Java Component throws ClassNotFoundException for the javax.* class at runtime, but this class is included in the JDK library RT.jar

Java Component throws ClassNotFoundException for the javax.* class at runtime, but this class is included in the JDK library RT.jar

book

Article ID: KB0090673

calendar_today

Updated On:

Products Versions
TIBCO ActiveMatrix Service Grid -
Not Applicable -

Description

Description:
Java Component throws ClassNotFoundException for the javax.* class at runtime, but this class is included in the JDK library RT.jar. Is this an expected behavior?


Symptoms:
Java Component throw the ClassNotFoundException for the javax.* class at runtime.
Cause:
The OSGI specification mandates that a bundle declare all package dependencies using either Import-Package or Require-Bundle. The one exception to this rule is the part of java.* packages from the JDK library which is always delegated to the boot class path. All other packages dependencies must be declared in the bundle's manifest file.

Boot delegation for TIBCO ActiveMatrix Service Grid 3.2.x and TIBCO ActiveMatrix Service Grid 3.3.x define in the <Config_Home>\data\tibcohost\Admin-amxadmin-instanceOne\data_3.2.x\nodes\DevNode\configuration\node.xml.

Boot delegation for TIBCO ActiveMatrix Service Grid 3.1.x define in the <Config_Home>\tibco\data\tibcohost\Admin-amxadmin-instanceOne\tools\machinemodel.xmi, it has a list define for the Boot delegation in this file as follows.

<kv-pair name="org.osgi.framework.bootdelegation" value="com.ibm.*,com.sun.activation.*,com.sun.awt,com.sun.beans,com.sun.codemodel.*,com.sun.corba.*,com.sun.crypto.*,com.sun.demo.*,com.sun.image.*,com.sun.imageio.*,com.sun.istack.*,com.sun.jarsigner,com.sun.java.*,com.sun.java_cup.*,com.sun.javadoc.*,com.sun.jdi,com.sun.jdi.*,com.sun.jmx.*,com.sun.jndi.*,com.sun.management,com.sun.management.*,com.sun.media.*,com.sun.mirror.*,com.sun.naming.*,com.sun.net.*,com.sun.org.omg.*,com.sun.rmi.*,com.sun.rowset,com.sun.rowset.*,com.sun.script.*,com.sun.security.*,com.sun.servicetag,com.sun.servicetag.*,com.sun.source.*,com.sun.swing.*,com.sun.tools.*,javax.accessibility,javax.activity,javax.crypto,javax.crypto.*,javax.imageio,javax.imageio.*,javax.management,javax.management.*,javax.naming,javax.naming.*,javax.net,javax.net.*,javax.print,javax.print.*,javax.rmi,javax.rmi.*,javax.script,javax.security,javax.security.*,javax.sound,javax.sound.*,javax.sql,javax.sql.*,javax.swing,javax.swing.*,javax.transaction,javax.transaction.*,javax.xml,javax.xml.namespace,org.omg.*,org.w3c.dom,org.w3c.dom.css,org.w3c.dom.events,org.w3c.dom.html,org.w3c.dom.ls,org.w3c.dom.ranges,org.w3c.dom.stylesheets,org.w3c.dom.traversal,org.w3c.dom.views ,org.xml.*,sun.*"/>

For example, javax.xml.bind is from the JDK library, but not part of the boot delegation from the Node configuration.

Issue/Introduction

Java Component throws ClassNotFoundException for the javax.* class at runtime, but this class is included in the JDK library RT.jar

Resolution

1), Open the Java Plug-in project in TIBCO Business Studio.
2). Expand the META-INF directory of the plug-in project containing the component implementation.
3), Double-click MANIFEST.MF. The manifest will open in the manifest editor.
4), Click on the Dependencies tab.
5), Click Add... to the right of the Imported Packages table.
6), Add the reference package (require by the Java plugin project, which is from JDK library but not include in boot delegation), and then click OK.

Additional Information

http://wiki.eclipse.org/Equinox_Boot_Delegation