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

OnePlus 3T in 2017

Hi there, I just bought OnePlus 3T, why? Even when OnePlus 5 is out and OnePlus 5T looming around the corner. Top five reasons why the 3T might just be a very sound investment if you are in the market for a new phone. 3T is going for a relatively cheap price. Its wickedly fast. Its 1080p display. Its software. OnePlus 5 isnt a huge update. Key Specs Display - 5.50-inch Processor - 1.6GHz quad-core Front Camera - 16-megapixel Resolution - 1080x1920 pixels RAM - 6GB OS - Android 7.1.1 Storage - 64GB Rear Camera - 16-megapixel Battery Capacity - 3400mAh Overall Rating 9/10 - Design 9/10 - Display 9/10 - Software 9/10 - Performance 9/10 - Battery life 9/10 - Camera 9/10 - Value for money Important - No other phone with all round 9's. Good Solid system and app performance Very good battery life Competent set of cameras Amazing premium build quality Good value for money Bad Nothing as yet

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

Google tablet to give Apple a touch of its own medicine

Google is trying to one-up Apple, showing off designs for a new tablet computer based on its Chrome operating system that would be a direct rival to the iPad. Just weeks after launching its own iPhone competitor in the US, the Nexus One, Google might soon extend its competition with Apple further as it seeks to push its search and other products on to as many devices as possible. Google's user interface designer, Glen Murphy, published mock-ups of a Google tablet on the search giant's Chromium.org website, along with a video of how users would interact with the device. Late last year Google announced Chrome OS, an operating system predominantly for small netbooks that would be based around the web browser, providing quick boot times and easy access to Google's array of online services. The first Chrome OS netbooks are due to arrive this year, but Google is now considering extending the platform to other devices including tablets, desktops and even big screen TVs. Chrome OS ...