Share application and subscription among a set of specific groups or roles WSO2 APIM Correlating analytics event with correlationID APIM analytics distinguish production and sandbox traffic APIM 2.x.x analytics internal and analytics tuneup Configure APIM 3.0.0 Key Manager User stores APIM V3 working with key manager DAS 3.x Parse system variables to Spark Context Revoke OAuth application In APIM 2.1.0 Next WSO2 APIM (3.0.0) powered by WSO2 Ballerina Configure WSO2 APIM Analytics on Cluster environment Configure WSO2 DAS 3.1.0 for WSO2 APIM 2.0.0 Analytics WSO2 APIM publishing custom statistics WSO2 APIM Error codes Working with WSO2 message tracer Use DAS admin service to query using Spark SQL Configure WSO2 APIM Analytics using XML WSO2 APIM Generating and Retrieving Custom Statistics Understanding WSO2 APIM Statistics Model Publishing WSO2 APIM 1.10.x Runtime Statistics to DAS with RDBMS Publishing_APIM_1100_Runtime_Statistics_to_DAS Aggregate functions with WSO2 DAS REST API Create a cApp for WSO2 DAS Debugging WSO2 Products using OSGI console. Publishing APIM Runtime Statistics to DAS Deploy cApp on WSO2 DAS How to configure and start the Accumulo minicluster How to setup DNS server on Ubuntu and Ubuntu server How to use Java Reflection how to install apache web server on ubuntu and ubuntu server How to install Mail server on Ubuntu and Ubuntu server How to install squirrelmail webmail client on Ubuntu and Ubuntu Server Pass and return String value to JNI method Pass and return numeric value to JNI method Calling a C Function from the Java Programming Language using JNI AXIS 2 Sample web service Client with maven and eclipse How to setup AXIS 2 with Apache Tomcat AXIS 2 Sample web service with maven and eclipse Robot framework Sample with Selenium Robot framework Custom Library Sample Behaviour-Driven Development with JBehave and Eclipse Play Audio with Netbeans and linking with LibVLC Implement LibVLC based player with QT-part2 Simple Audio playing sample with LibVLC How to install LibVLC on Ubuntu Implement LibVLC based player with QT-part1
Debugging WSO2 Products using OSGI console.

Wso2 products are built collecting several osgi components. It has increased the modularity and extensibility of the WSO2 Carbon based products. But These components get to register on the JVM at runtime and could raise a problem when you develop or testing with products. Thus OSGI console provides a way to debug and monitor the component and related service of the product. Here I will demonstrate several commands and it’s usage.

  • Start the product with enabling osgi console
  • here i used the APIM 1.10.x version
bin/wso2server.sh -DosgiConsole

  1. listadminservices

    As you know WSO2 Products are composed set of components and which are exposed as a SOAP service, we need to find out what are the available services and its endpoints. This command will list down available services like this.

    1. ProvisioningAdminService, ProvisioningAdminService, https://rukshan-ThinkPad-T540p:8243/services/ProvisioningAdminService
    2. MediationSecurityAdminService, MediationSecurityAdminService, https://rukshan-ThinkPad-T540p:8243/services/MediationSecurityAdminService
    3. CarbonAppUploader, CarbonAppUploader, https://rukshan-ThinkPad-T540p:8243/services/CarbonAppUploader
    4. OperationAdmin, OperationAdmin, https://rukshan-ThinkPad-T540p:8243/services/OperationAdmin
    5. JaggeryAppAdmin, JaggeryAppAdmin, https://rukshan-ThinkPad-T540p:8243/services/JaggeryAppAdmin
    
  2. ss

    This will list down the all the bundle or components that are registered with JVM runtime

    ex:
    id	State       Bundle
    0	ACTIVE      org.eclipse.osgi_3.9.1.v20130814-1242
    	            Fragments=1
    1	RESOLVED    org.wso2.carbon.framework.exporter_4.4.1
    	            Master=0
    2	ACTIVE      org.eclipse.equinox.simpleconfigurator_1.0.400.v20130327-2119
    
  3. ss <name>

    This command is used to search the component from the above list. it will list all the components which contain the <name> substring.

    osgi> ss stub
    "Framework is launched."
    
    
    id	State       Bundle
    152	ACTIVE      org.jaggeryjs.jaggery.app.mgt.stub_0.12.0.M1
    172	ACTIVE      org.wso2.carbon.apimgt.authenticator.oidc.stub_4.3.0.SNAPSHOT
    176	ACTIVE      org.wso2.carbon.apimgt.gateway.stub_4.3.0.SNAPSHOT
    177	ACTIVE      org.wso2.carbon.apimgt.handlers.security.stub_4.3.0.SNAPSHOT
    183	ACTIVE      org.wso2.carbon.apimgt.keymgt.stub_4.3.0.SNAPSHOT
    
  4. b <component-id>

    It is used to find the metadata information of the given bundle. a component id can be find out with ss command.

    osgi> b 198
    org.wso2.carbon.bam.service.data.publisher.stub_4.5.3 [198]
      Id=198, Status=ACTIVE      Data Root=/home/rukshan/apim/1.10.x/wso2am-1.10.0-SNAPSHOT/repository/components/default/configuration/org.eclipse.osgi/bundles/198/data
      "No registered services."
      No services in use.
      Exported packages
        org.wso2.carbon.bam.service.data.publisher.stub.axis2; version="4.5.3"[exported]
        org.wso2.carbon.bam.service.data.publisher.stub.conf; version="4.5.3"[exported]
        org.wso2.carbon.bam.service.data.publisher.stub; version="4.5.3"[exported]
      Imported packages
        javax.xml.namespace; version="0.0.0"<org.eclipse.osgi_3.9.1.v20130814-1242 [0]>
        javax.xml.stream; version="1.0.1"<org.eclipse.osgi_3.9.1.v20130814-1242 [0]>
        org.apache.axiom.om; version="1.2.11.wso2v6"<axiom_1.2.11.wso2v6 [13]>
        org.apache.axiom.soap; version="1.2.11.wso2v6"<axiom_1.2.11.wso2v6 [13]>
        org.apache.axis2; version="1.6.1.wso2v14"<axis2_1.6.1.wso2v14 [14]>
        org.apache.axis2.addressing; version="1.6.1.wso2v14"<axis2_1.6.1.wso2v14 [14]>
        org.apache.axis2.client; version="1.6.1.wso2v14"<axis2_1.6.1.wso2v14 [14]>
        org.apache.axis2.client.async; version="1.6.1.wso2v14"<axis2_1.6.1.wso2v14 [14]>
        org.apache.axis2.context; version="1.6.1.wso2v14"<axis2_1.6.1.wso2v14 [14]>
        org.apache.axis2.databinding; version="1.6.1.wso2v14"<axis2_1.6.1.wso2v14 [14]>
        org.apache.axis2.databinding.utils; version="1.6.1.wso2v14"<axis2_1.6.1.wso2v14 [14]>
        org.apache.axis2.databinding.utils.reader; version="1.6.1.wso2v14"<axis2_1.6.1.wso2v14 [14]>
        org.apache.axis2.description; version="1.6.1.wso2v14"<axis2_1.6.1.wso2v14 [14]>
        org.apache.axis2.engine; version="1.6.1.wso2v14"<axis2_1.6.1.wso2v14 [14]>
        org.apache.axis2.transport; version="1.6.1.wso2v14"<axis2_1.6.1.wso2v14 [14]>
        org.apache.axis2.util; version="1.6.1.wso2v14"<axis2_1.6.1.wso2v14 [14]>
      No fragment bundles
      Named class space
        org.wso2.carbon.bam.service.data.publisher.stub; bundle-version="4.5.3"[provided]
      No required bundles
    
  5. diag <component-id>

    This will show the list of missing imported packages

    osgi> diag 190
    reference:file:../plugins/org.wso2.carbon.application.mgt_4.4.7.jar [190]
      Direct constraints which are unresolved:
        Missing optionally imported package javax.activation_[1.1.0,2.0.0).
    
  6. packages <package-name>

    This will return all the bundles which use the above package.

    osgi> packages org.wso2.carbon.ui
    org.wso2.carbon.ui; version="4.4.1"<org.wso2.carbon.ui_4.4.1 [452]>
      org.jaggeryjs.jaggery.app.mgt.ui_0.12.0.M1 [153] imports
      org.wso2.carbon.apimgt.authenticator.oidc.ui_4.3.0.SNAPSHOT [173] imports
      org.wso2.carbon.application.mgt.ui_4.4.7 [193] imports
    
  7. install file:<file-path>

    this is used to install new bundle to the classpath.

    osgi> install file:/home/rukshan/Downloads/mysql-connector-java-5.1.35-bin.jar
    Bundle id is 515
    RegisteredServices   null
    ServicesInUse        null
    Fragments            null
    LoaderProxy          com.mysql.jdbc; bundle-version="5.1.35"
    ClassLoader          null
    Version              5.1.35
    LastModified         1443364020182
    Headers               Ant-Version = Apache Ant 1.8.2
     Built-By = pb2user
     Bundle-Classpath = .
     Bundle-ManifestVersion = 2
     Bundle-Name = Oracle Corporation's JDBC Driver for MySQL
     Bundle-SymbolicName = com.mysql.jdbc
     Bundle-Vendor = Oracle Corporation
     Bundle-Version = 5.1.35
     Created-By = 1.5.0_22-b03 (Sun Microsystems Inc.)
     Export-Package = com.mysql.jdbc;version="5.1.35";uses:="com.mysql.jdbc.log,javax.naming,javax.net.ssl,javax.xml.transform,org.xml.sax",com.mysql.jdbc.jdbc2.optional;version="5.1.35";uses:="com.mysql.jdbc,com.mysql.jdbc.log,javax.naming,javax.sql,javax.transaction.xa",com.mysql.jdbc.log;version="5.1.35",com.mysql.jdbc.profiler;version="5.1.35";uses:="com.mysql.jdbc",com.mysql.jdbc.util;version="5.1.35";uses:="com.mysql.jdbc.log",com.mysql.jdbc.exceptions;version="5.1.35",com.mysql.jdbc.exceptions.jdbc4;version="5.1.35";uses:="com.mysql.jdbc",com.mysql.jdbc.interceptors;version="5.1.35";uses:="com.mysql.jdbc",com.mysql.jdbc.integration.c3p0;version="5.1.35",com.mysql.jdbc.integration.jboss;version="5.1.35",com.mysql.jdbc.configs;version="5.1.35",org.gjt.mm.mysql;version="5.1.35"
     Implementation-Title = MySQL Connector Java
     Implementation-Vendor = Oracle
     Implementation-Vendor-Id = com.mysql
     Implementation-Version = 5.1.35
     Import-Package = javax.net,javax.net.ssl;version="[1.0.1, 2.0.0)";resolution:=optional,javax.xml.parsers, javax.xml.stream,javax.xml.transform,javax.xml.transform.dom,javax.xml.transform.sax,javax.xml.transform.stax,javax.xml.transform.stream,org.w3c.dom,org.xml.sax,org.xml.sax.helpers;resolution:=optional,javax.naming,javax.naming.spi,javax.sql,javax.transaction.xa;version="[1.0.1, 2.0.0)";resolution:=optional,com.mchange.v2.c3p0;version="[0.9.1.2, 1.0.0)";resolution:=optional,org.jboss.resource.adapter.jdbc;resolution:=optional,org.jboss.resource.adapter.jdbc.vendor;resolution:=optional
     Manifest-Version = 1.0
     Specification-Title = JDBC
     Specification-Vendor = Oracle Corporation
     Specification-Version = 4.0
    
    
    StartLevel           1
    BundleData           com.mysql.jdbc_5.1.35
    BundleContext        null
    BundleId             515
    SymbolicName         com.mysql.jdbc
    KeyHashCode          515
    StateChanging        null
    BundleDescription    com.mysql.jdbc_5.1.35
    Framework            org.eclipse.osgi.framework.internal.core.Framework@225d5c92
    ResolutionFailureException org.osgi.framework.BundleException: The bundle "com.mysql.jdbc_5.1.35 [515]" could not be resolved
    Revisions            [com.mysql.jdbc_5.1.35]
    Key                  515
    ProtectionDomain     null
    Location             file:/home/rukshan/Downloads/mysql-connector-java-5.1.35-bin.jar
    State                2
    Bundle                 515|Installed  |    1|com.mysql.jdbc (5.1.35)
    
    osgi> ss sql
    "Framework is launched."
    
    
    id	State       Bundle
    515	INSTALLED   com.mysql.jdbc_5.1.35
    osgi>
    
  8. uninstall <bundle-id>
    osgi> uninstall 514
    osgi> ss sql
    "Framework is launched."
    
    
    id	State       Bundle
    osgi>
    
  9. refresh

    refresh command will refresh the system components.

    osgi> refresh
    
    

Add Comment

* Required information
1000
Powered by Commentics

Comments (0)

No comments yet. Be the first!