Skip to main content

Apache Felix GoGo Shell Commands in Liferay 7

As you might be aware now, non of the portlets, services, etc.. are getting deployed under webapps.

So how do I manage my deployed artefacts on Liferay 7!!!

For this we need to use TelNet commands or you can say GOGO Shell commands.

Prerequisite
  1. Open up "Command Prompt"
  2. Click on "Program & Features"
  3. Click on "Turn Windows features on or off"
  4. Check "Telnet Client", if not already checked, click ok
    This would install Telnet components-1
Lets see how to use GOGO Shell
  • Open Command Prompt
  • Execute the following command
    telnet localhost 11311
    ____________________________
    Welcome to Apache Felix Gogo
  • Get help on any command like: lb (lists all of the bundles installed in Liferay’s module framework)

    g! help lb
    lb - list all installed bundles
     scope: felix
      flags:
     -l, --location   show location
     -s, --symbolicname   show symbolic name
     -u, --updatelocation   show update location
    lb - list installed bundles matching a substring
      scope: felix
      flags:
     -l, --location   show location
     -s, --symbolicname   show symbolic name
     -u, --updatelocation   show update location
      parameters:
     String   subtring matched against name or symbolic name
  • Lists all of the bundles installed in Liferay’s module framework.

    g! lb
    ......................................................................
    <<<<< List only the required ones I created >>>>>
    ......................................................................
    513|Active     |   10|lfg-portlet (1.0.0) 
    514|Active     |   10|lfg-service-api (1.0.0)
    515|Active     |   10|lfg-service-service (1.0.0)
    523|Active     |   10|lfg-theme-1.0.0-SNAPSHOT (1.0.0)
  • Looking at the OSGi Lifecycle:
    Seeing our bundles installed on Liferay. All are in Active state.

  • Now Lets stop the "lfg-portlet", the Bundle ID is 513

    g! stop 513

    Note:
    - If you have added the portlet on any page, the portlet would display a message that it has been undeployed.
    - A Stopped status would also be printed on Liferay console about the portlet.

    We can check our bundles again.

    g! lb
    ......................................................................
    <<<<< List only the required ones I created >>>>>
    ......................................................................
    513|Resolved   |   10|lfg-portlet (1.0.0) 
    514|Active     |   10|lfg-service-api (1.0.0)
    515|Active     |   10|lfg-service-service (1.0.0)
    523|Active     |   10|lfg-theme-1.0.0-SNAPSHOT (1.0.0)
  • Let Start the "lfg-portlet", the Bundle ID is 513

    g! start 513

    We will check our bundles again.

    g! lb
    ......................................................................
    <<<<< List only the required ones I created >>>>>
    ......................................................................
    513|Active     |   10|lfg-portlet (1.0.0)\\\\t\\\\t
    514|Active     |   10|lfg-service-api (1.0.0)
    515|Active     |   10|lfg-service-service (1.0.0)
    523|Active     |   10|lfg-theme-1.0.0-SNAPSHOT (1.0.0
  • To remove or undeploy the portlet.

    g! uninstall 513

  • To end the console connection

    g! disconnect


    Disconnect from console? (y/n; default=y) y
    Connection to host lost.
Warning: Commands shutdown, close, and exit stop the OSGi framework.(Would stop the Liferay instance)
So make sure to use the disconnect command to end the telnet Gogo Shell session.

Some Useful Commands
- help: lists all the available Gogo shell commands. Notice that each command has two parts to its name, separated by a colon. For example, the full name of the help command is felix:help. The first part is the command scope while the second part is the command function. The scope allows commands with the same name to be disambiguated. E.g., scope allows the felix:refresh command to be distinguished from the equinox:refresh command.

- help : lists information about a specific command including a description of the command, the scope of the command, and information about any flags or parameters that can be supplied when invoking the command.

- lb: lists all of the bundles installed in Liferay’s module framework. Use the -s flag to list the bundles using the bundles’ symbolic names.

-b : lists information about a specific bundle including the bundle’s symbolic name, bundle ID, data root, registered (provided) and used services, imported and exported packages, and more
- headers : lists metadata about the bundle from the bundle’s MANIFEST.MF file

- diag : lists information about why the specified bundle is not working (e.g., unresolved dependencies, etc.)

- packages : lists all of the named package’s dependencies

- scr:list: lists all of the components registered in the module framework (scr stands for service component runtime)

- services: lists all of the services that have been registered in Liferay’s module framework

- inspect capability service : lists services exposed by a bundle

- install : installs the specified bundle into Liferay’s module framework

- start : starts the specified bundle

- stop : stops the specified bundle

- uninstall : uninstalls the specified bundle from Liferay’s module framework

- system:getproperties: lists all of the system properties

For more information about the Gogo shell, please visit http://felix.apache.org/documentation/subprojects/apache-felix-gogo.html.

Comments

Post a Comment

Popular posts from this blog

Everything about Java 8

The following post is a comprehensive summary of the developer-facing changes coming in Java 8. This next iteration of the JDK is currently scheduled for general availability in  September 2013 . Read More

Hands-on with Mozilla’s Web-based “Firefox OS” for smartphones

Launching a new mobile OS is a difficult project since the market leaders, Android and iOS, have such  a big lead. Even Microsoft, with its near-infinite financial resources and vast ecosystem of complementary products, has struggled to gain traction. And new entrants face a chicken-and-egg problem: developers don't want to write apps for a platform without many users, while users don't want to buy a phone without many apps. Mozilla, the non-profit foundation behind Firefox, believes it can tackle this dilemma. In 2011, it announced a new project  called Boot2Gecko to build an operating system around its browser. Last year the project was  re-branded Firefox OS, and Mozilla began preparations for a major push into the mobile phone market. In February, Mozilla  unveiled an impressive initial list  of hardware and network partners. If all goes according to plan, Firefox OS phones will be available in a number of countries, mostly in the developing world, la...

Three reasons Microsoft wants to kill the Windows Desktop

Microsoft's Windows Blue update to Windows 8  makes it increasingly clear that Microsoft wants to kill the Desktop.  That may seem self-defeating, but there's method in Microsoft's madness. Here are three reasons I think it wants to eventually kill the Desktop. Help Windows Phone and Windows tablets gain market share Unify the operating system Lock enterprises into future versions of Windows Read More