Hi, everyone!
I'm having grave difficulties with generated JAR bundles from Maven OSGI plugin in Netbeans. When running the bundle from Netbeans, all works fine. But when I'm taking the generated JAR file from Maven and I'm using it outside Netbeans from command prompt and with Felix (java -jar bin\felix.jar, start file:/...), I'm having a NoClassDefFoundError on any com.sun.* class that is used.
I think I have tried everything: importing the package, exporting the package, setting the classpath to rt.jar (where com.sun.*
classes) are defined, trying to know how Maven from Netbeans launches Felix (but I haven't found it). I still don't know how to remove the NoClassDefFoundErrors I'm having.
If you have ANY advice that can help me, please say it to me. This problem has wasted A LOT of my very limited time.
g! start file:/C:/Users/Pierre-Alexandre/Documents/NetBeansProjects/Prototype1ClientOSGIBundle/target/Prototype1ClientOS
GIBundle-1.0-SNAPSHOT.jar
WSDL location is: [url]http://132.210.47.44:9595/prototype1Service?WSDL[/url]
Service name is: {http://common.prototype1/}ILocalisationService
org.osgi.framework.BundleException: Activator start error in bundle domus.usherbrooke.ca.Prototype1ClientOSGIBundle [41]
.
at org.apache.felix.framework.Felix.activateBundle(Felix.java:1869)
at org.apache.felix.framework.Felix.startBundle(Felix.java:1739)
at org.apache.felix.framework.BundleImpl.start(BundleImpl.java:919)
at org.apache.felix.gogo.command.Basic.start(Basic.java:758)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.apache.felix.gogo.runtime.Reflective.method(Reflective.java:136)
at org.apache.felix.gogo.runtime.CommandProxy.execute(CommandProxy.java:82)
at org.apache.felix.gogo.runtime.Closure.executeCmd(Closure.java:458)
at org.apache.felix.gogo.runtime.Closure.executeStatement(Closure.java:384)
at org.apache.felix.gogo.runtime.Pipe.run(Pipe.java:108)
at org.apache.felix.gogo.runtime.Closure.execute(Closure.java:183)
at org.apache.felix.gogo.runtime.Closure.execute(Closure.java:120)
at org.apache.felix.gogo.runtime.CommandSessionImpl.execute(CommandSessionImpl.java:79)
at org.apache.felix.gogo.shell.Console.run(Console.java:62)
at org.apache.felix.gogo.shell.Shell.console(Shell.java:198)
at org.apache.felix.gogo.shell.Shell.gosh(Shell.java:124)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.apache.felix.gogo.runtime.Reflective.method(Reflective.java:136)
at org.apache.felix.gogo.runtime.CommandProxy.execute(CommandProxy.java:82)
at org.apache.felix.gogo.runtime.Closure.executeCmd(Closure.java:458)
at org.apache.felix.gogo.runtime.Closure.executeStatement(Closure.java:384)
at org.apache.felix.gogo.runtime.Pipe.run(Pipe.java:108)
at org.apache.felix.gogo.runtime.Closure.execute(Closure.java:183)
at org.apache.felix.gogo.runtime.Closure.execute(Closure.java:120)
at org.apache.felix.gogo.runtime.CommandSessionImpl.execute(CommandSessionImpl.java:79)
at org.apache.felix.gogo.shell.Activator.run(Activator.java:75)
at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.NoClassDefFoundError: com.sun.xml.internal.ws.api.message.Header not found by domus.usherbrooke.ca.
Prototype1ClientOSGIBundle [41]
at $Proxy31.<clinit>(Unknown Source)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
at java.lang.reflect.Constructor.newInstance(Unknown Source)
at java.lang.reflect.Proxy.newProxyInstance(Unknown Source)
at com.sun.xml.internal.ws.client.WSServiceDelegate.createEndpointIFBaseProxy(Unknown Source)
at com.sun.xml.internal.ws.client.WSServiceDelegate.getPort(Unknown Source)
at com.sun.xml.internal.ws.client.WSServiceDelegate.getPort(Unknown Source)
at com.sun.xml.internal.ws.client.WSServiceDelegate.getPort(Unknown Source)
at javax.xml.ws.Service.getPort(Unknown Source)
at prototype1.common.ILocalisationService.getILocalisationServicePort(ILocalisationService.java:62)
at prototype1.common.Prototype1ClientActivator.start(Prototype1ClientActivator.java:21)
at org.apache.felix.framework.util.SecureAction.startActivator(SecureAction.java:633)
at org.apache.felix.framework.Felix.activateBundle(Felix.java:1822)
... 32 more
java.lang.NoClassDefFoundError: com.sun.xml.internal.ws.api.message.Header not found by domus.usherbrooke.ca.Prototype1C
lientOSGIBundle [41]