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

Google leaps language barrier with translator phone

GOOGLE is developing software for the first phone capable of translating foreign languages almost instantly — like the Babel Fish in The Hitchhiker’s Guide to the Galaxy. By building on existing technologies in voice recognition and automatic translation, Google hopes to have a basic system ready within a couple of years. If it works, it could eventually transform communication among speakers of the world’s 6,000-plus languages. The company has already created an automatic system for translating text on computers, which is being honed by scanning millions of multi-lingual websites and documents. So far it covers 52 languages, adding Haitian Creole last week. Google also has a voice recognition system that enables phone users to conduct web searches by speaking commands into their phones rather than typing them in. Now it is working on combining the two technologies to produce software capable of understanding a caller’s voice and translating it into a synthetic equivalent in a foreign

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

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