2 Replies Latest reply on Feb 22, 2012 5:21 PM by chandraprabha rajput

    java.lang.NoClassDefFoundError: javax/xml/rpc/handler/Handler

    Peter Chandler Master

      I am trying to resolve/use javax.xml.rpc.* in one of my OSGi bundles.

       

      Can't figure-out the correct maven dependency / import / feature to start?

       

      Has anyone used  javax.xml.rpc.* inside an OSGi Bundle?

       

      If so, what's the required run-time bundle configuration?

       

      Or the General Question: how do I make all the javax.* available to my bundle?

       

      Here is what I tried (brute force):

         Import-Package: javax.xml.rpc.handler

         Bundle-ClassPath: .,lib/j2ee-1.4.jar,lib/jmxri-1.2.jar,lib/mail-1.3.3.jar,lib/activation-1.0.2.jar

       

      Interesting note is that this package ends up in Private-Package of the manifest

         Private-Package: javax.xml.rpc.handler

      I am not specifying any <Private-Package> in my maven-bundle-plugin? Why/how does it end up there?

       

      In the stacktrace (below) I was hoping to see searching "Bundle-Classpath"?

       

      Thanks,

       

      Peter.

       

      java.lang.NoClassDefFoundError: javax/xml/rpc/handler/Handler

              at java.lang.ClassLoader.defineClass1(Native Method)

              at java.lang.ClassLoader.defineClass(ClassLoader.java:621)

              at org.apache.felix.framework.searchpolicy.ModuleImpl$ModuleClassLoader.findClass(ModuleImpl.java:1537)

              at org.apache.felix.framework.searchpolicy.ModuleImpl.findClassOrResourceByDelegation(ModuleImpl.java:502)

              at org.apache.felix.framework.searchpolicy.ModuleImpl.access$100(ModuleImpl.java:59)

              at org.apache.felix.framework.searchpolicy.ModuleImpl$ModuleClassLoader.loadClass(ModuleImpl.java:1427)

              at java.lang.ClassLoader.loadClass(ClassLoader.java:252)

              at org.apache.felix.framework.searchpolicy.ModuleImpl.getClassByDelegation(ModuleImpl.java:421)

              at org.apache.felix.framework.searchpolicy.R4Wire.getClass(R4Wire.java:108)

              at org.apache.felix.framework.searchpolicy.ModuleImpl.searchImports(ModuleImpl.java:1124)

              at org.apache.felix.framework.searchpolicy.ModuleImpl.findClassOrResourceByDelegation(ModuleImpl.java:497)

              at org.apache.felix.framework.searchpolicy.ModuleImpl.access$100(ModuleImpl.java:59)

              at org.apache.felix.framework.searchpolicy.ModuleImpl$ModuleClassLoader.loadClass(ModuleImpl.java:1427)

              at java.lang.ClassLoader.loadClass(ClassLoader.java:252)

              at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)

       

      Edited by: pchandler on Jul 8, 2009 1:48 PM