This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
I would like to develop a NetBeans extension. I'm using a "third party" jar wrapper for JAX-WS web service calls. I create a library wrapper around that jar. Then I try to use the wrapped library from my module. I have two possible outcomes. If I don't add Library Dependency on JAX-WS and JAXB on the Library wrapper module I get: Linkage Error from JAX-WS If I add the JAX-WS and JAXB dependencies I get: java.lang.ClassNotFoundException: com.sun.istack.logging.Logger Before NetBeans moved to JAXWS-2.2 this way using web services was OK. I'm going to attach a sample NetBeans Suite. It consists of four NB projects. The one called dictionary shall be built first then the suite.
Created attachment 93977 [details] A testcase that demonstrates this issue
The suite is not compilable for me. First it complains that NB68SOAP/dictionary/dist does not exist. I try to build NB68SOAP/dictionary manually (see FAQ, this ought to be done as part of dictionary-wrapper/build.xml, which should _not_ use the release dir but rather directly copy to ${cluster}), but this fails with /tmp/NB68SOAP/dictionary/build/generated-sources/jax-ws/com/aonaware/services/webservices/DictService.java:48: cannot find symbol symbol : constructor Service(java.net.URL,javax.xml.namespace.QName,javax.xml.ws.WebServiceFeature[]) location: class javax.xml.ws.Service super(__getWsdlLocation(), DICTSERVICE_QNAME, features); /tmp/NB68SOAP/dictionary/build/generated-sources/jax-ws/com/aonaware/services/webservices/DictService.java:56: cannot find symbol symbol : constructor Service(java.net.URL,javax.xml.namespace.QName,javax.xml.ws.WebServiceFeature[]) location: class javax.xml.ws.Service super(wsdlLocation, DICTSERVICE_QNAME, features); /tmp/NB68SOAP/dictionary/build/generated-sources/jax-ws/com/aonaware/services/webservices/DictService.java:64: cannot find symbol symbol : constructor Service(java.net.URL,javax.xml.namespace.QName,javax.xml.ws.WebServiceFeature[]) location: class javax.xml.ws.Service super(wsdlLocation, serviceName, features); and anyway it says JAX-WS-ENDORSED does not exist. A reproducible test case must include all required libraries. Whatever the CNFE you get is from (there is no stack trace to inspect), it is likely this is a bug either in the JAX-* libraries or in the way the suite is packaging them, not a module system issue. Assigning to Milan for diagnosis since he generally works on these scenarios.
However it is strange that the dictionary project is not buildable, here is one stacktrace: java.lang.ClassNotFoundException: com.sun.istack.logging.Logger at java.net.URLClassLoader$1.run(URLClassLoader.java:202) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:190) at java.lang.ClassLoader.loadClass(ClassLoader.java:307) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301) at java.lang.ClassLoader.loadClass(ClassLoader.java:248) at org.netbeans.ProxyClassLoader.loadClass(ProxyClassLoader.java:259) Caused: java.lang.ClassNotFoundException: com.sun.istack.logging.Logger starting from ModuleCL@13d86a73[org.netbeans.modules.websvc.jaxws21] with possible defining loaders [ModuleCL@48423606[org.netbeans.libs.jaxb]] and declared parents [ModuleCL@48423606[org.netbeans.libs.jaxb], ModuleCL@39d7af3[org.netbeans.modules.websvc.jaxws21api], ModuleCL@77b9e7fc[org.netbeans.modules.xml.jaxb.api]] at org.netbeans.ProxyClassLoader.loadClass(ProxyClassLoader.java:261) at java.lang.ClassLoader.loadClass(ClassLoader.java:248) Caused: java.lang.NoClassDefFoundError: com/sun/istack/logging/Logger at java.lang.ClassLoader.defineClass1(Native Method) at java.lang.ClassLoader.defineClassCond(ClassLoader.java:632) at java.lang.ClassLoader.defineClass(ClassLoader.java:616) at org.netbeans.JarClassLoader.doLoadClass(JarClassLoader.java:246) at org.netbeans.ProxyClassLoader.selfLoadClass(ProxyClassLoader.java:297) Caused: java.lang.NoClassDefFoundError: com/sun/istack/logging/Logger while loading com.sun.xml.ws.policy.privateutilcom.sun.xml.ws.policy.privateutil.PolicyLogger; see http://wiki.netbeans.org/DevFaqTroubleshootClassNotFound at org.netbeans.ProxyClassLoader.selfLoadClass(ProxyClassLoader.java:301) at org.netbeans.ProxyClassLoader.loadClass(ProxyClassLoader.java:224) at java.lang.ClassLoader.loadClass(ClassLoader.java:248) at com.sun.xml.ws.policy.PolicyWSDLParserExtension.<clinit>(PolicyWSDLParserExtension.java:104) at com.sun.xml.ws.wsdl.parser.RuntimeWSDLParser.<init>(RuntimeWSDLParser.java:274) at com.sun.xml.ws.wsdl.parser.RuntimeWSDLParser.parse(RuntimeWSDLParser.java:148) at com.sun.xml.ws.wsdl.parser.RuntimeWSDLParser.parse(RuntimeWSDLParser.java:131) at com.sun.xml.ws.client.WSServiceDelegate.parseWSDL(WSServiceDelegate.java:267) at com.sun.xml.ws.client.WSServiceDelegate.<init>(WSServiceDelegate.java:230) at com.sun.xml.ws.client.WSServiceDelegate.<init>(WSServiceDelegate.java:178) at com.sun.xml.ws.spi.ProviderImpl.createServiceDelegate(ProviderImpl.java:106) at javax.xml.ws.Service.<init>(Service.java:57) at com.aonaware.services.webservices.DictService.<init>(DictService.java:44) at com.netbeans86.soap.Dictionary.define(Dictionary.java:21) at com.netbeans68.soap.test.Installer.restored(Installer.java:21) at org.netbeans.core.startup.NbInstaller.loadCode(NbInstaller.java:440) at org.netbeans.core.startup.NbInstaller.load(NbInstaller.java:361) at org.netbeans.ModuleManager.enable(ModuleManager.java:928) at org.netbeans.core.startup.ModuleList.installNew(ModuleList.java:289) at org.netbeans.core.startup.ModuleList.trigger(ModuleList.java:225) at org.netbeans.core.startup.ModuleSystem.restore(ModuleSystem.java:276) at org.netbeans.core.startup.Main.getModuleSystem(Main.java:168) at org.netbeans.core.startup.Main.start(Main.java:309) at org.netbeans.core.startup.TopThreadGroup.run(TopThreadGroup.java:111) [catch] at java.lang.Thread.run(Thread.java:619)
It seems JAX-WS-ENDORSED was included in 6.8 Patch1. So my test projects requires NetBeans 6.8 Patch 1 to compile. I've tried to downgrade it to base NetBeans 6.8 but the result is the same: CNFE
Other findings: It seems this issue does not effect the Platform itself. The CNFE is thrown only when I set the JAX-WS and JAXB module dependency. Well I don't really need JAX-WS 2.2 so I assume not depending on the modules above is jut fine. Now the interesting part will be what could cause the Linkage Error. java.lang.LinkageError: ClassCastException: attempting to castjar:file:/home/nbtest/netbeans-6.8/java3/modules/ext/jaxws22/api/jaxws-api.jar!/javax/xml/ws/spi/Provider.classtojar:file:/usr/lib/jvm/java-6-sun-1.6.0.16/jre/lib/rt.jar!/javax/xml/ws/spi/Provider.class at javax.xml.ws.spi.Provider.provider(Provider.java:94) at javax.xml.ws.Service.<init>(Service.java:56) at com.aonaware.services.webservices.DictService.<init>(DictService.java:44) at com.netbeans86.soap.Dictionary.define(Dictionary.java:21) at com.netbeans68.soap.test.Installer.restored(Installer.java:21) at org.netbeans.core.startup.NbInstaller.loadCode(NbInstaller.java:440) at org.netbeans.core.startup.NbInstaller.load(NbInstaller.java:361) at org.netbeans.ModuleManager.enable(ModuleManager.java:928) at org.netbeans.core.startup.ModuleList.installNew(ModuleList.java:289) at org.netbeans.core.startup.ModuleList.trigger(ModuleList.java:225) at org.netbeans.core.startup.ModuleSystem.restore(ModuleSystem.java:276) at org.netbeans.core.startup.Main.getModuleSystem(Main.java:168) at org.netbeans.core.startup.Main.start(Main.java:309) at org.netbeans.core.startup.TopThreadGroup.run(TopThreadGroup.java:111)
Reporter, please, attach the reproducible test case. Jesse, is that possible to set up endorsed classpath in NBProjects ? like for example : endorsed.classpath=\ ${libs.JAX-WS-ENDORSED.classpath}
The testcase is compilable _only with NetBeans 6.8 Patch 1_. Anyway I'm going to attach a version where the "third party" dictionary jar is precompiled into the wrapper module, so you can reproduce the testcase just by running the suite.
Created attachment 94032 [details] Testcase with precompiled dictionary.jar
Note: the error: Caused: java.lang.NoClassDefFoundError: com/sun/istack/logging/Logger was fixed recently (for 6.9) in http://hg.netbeans.org/main/rev/9553144c4069 Reporter, please, test the added jaxws-rt.jar file (replace jar in NB_Home/java3/modules/ext/jaxws22)
Created attachment 94033 [details] jaxws-rt.jar
I got it finally, though I had to create a dist directory under dictionary. So if I correctly understand : - You've created a JAX-WS client in some project (e.g. J2SE Project) - you wrapped the project's jar file to library wrapper module - you've created another (test module) that depends on library wrapper and tests the service. I am going to test this scenario. Thanks
I've replaced the jaxws-rt.jar. I still get CNFE, but there is a difference. Previously when I did't include the JAX-WS JAXB modules I got java.lang.LinkageError, now I have the same CNFE on this scenario as well. java.lang.ClassNotFoundException: com.sun.istack.logging.Logger at java.net.URLClassLoader$1.run(URLClassLoader.java:202) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:190) at java.lang.ClassLoader.loadClass(ClassLoader.java:307) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301) at java.lang.ClassLoader.loadClass(ClassLoader.java:248) at org.netbeans.ProxyClassLoader.loadClass(ProxyClassLoader.java:259) Caused: java.lang.ClassNotFoundException: com.sun.istack.logging.Logger starting from ModuleCL@69f4b0dc[org.netbeans.modules.websvc.jaxws21] with possible defining loaders [ModuleCL@1f6b69d7[org.netbeans.libs.jaxb]] and declared parents [ModuleCL@1f6b69d7[org.netbeans.libs.jaxb], ModuleCL@9f6f3dc[org.netbeans.modules.websvc.jaxws21api], ModuleCL@1e646bfb[org.netbeans.modules.xml.jaxb.api]] at org.netbeans.ProxyClassLoader.loadClass(ProxyClassLoader.java:261) at java.lang.ClassLoader.loadClass(ClassLoader.java:248) Caused: java.lang.NoClassDefFoundError: com/sun/istack/logging/Logger at java.lang.ClassLoader.defineClass1(Native Method) at java.lang.ClassLoader.defineClassCond(ClassLoader.java:632) at java.lang.ClassLoader.defineClass(ClassLoader.java:616) at org.netbeans.JarClassLoader.doLoadClass(JarClassLoader.java:246) at org.netbeans.ProxyClassLoader.selfLoadClass(ProxyClassLoader.java:297) Caused: java.lang.NoClassDefFoundError: com/sun/istack/logging/Logger while loading com.sun.xml.ws.policy.privateutilcom.sun.xml.ws.policy.privateutil.PolicyLogger; see http://wiki.netbeans.org/DevFaqTroubleshootClassNotFound at org.netbeans.ProxyClassLoader.selfLoadClass(ProxyClassLoader.java:301) at org.netbeans.ProxyClassLoader.loadClass(ProxyClassLoader.java:224) at java.lang.ClassLoader.loadClass(ClassLoader.java:248) at com.sun.xml.ws.policy.PolicyWSDLParserExtension.<clinit>(PolicyWSDLParserExtension.java:104) at com.sun.xml.ws.wsdl.parser.RuntimeWSDLParser.<init>(RuntimeWSDLParser.java:274) at com.sun.xml.ws.wsdl.parser.RuntimeWSDLParser.parse(RuntimeWSDLParser.java:148) at com.sun.xml.ws.wsdl.parser.RuntimeWSDLParser.parse(RuntimeWSDLParser.java:131) at com.sun.xml.ws.client.WSServiceDelegate.parseWSDL(WSServiceDelegate.java:268) at com.sun.xml.ws.client.WSServiceDelegate.<init>(WSServiceDelegate.java:231) at com.sun.xml.ws.client.WSServiceDelegate.<init>(WSServiceDelegate.java:179) at com.sun.xml.ws.spi.ProviderImpl.createServiceDelegate(ProviderImpl.java:106) at javax.xml.ws.Service.<init>(Service.java:57) at com.aonaware.services.webservices.DictService.<init>(DictService.java:44) at com.netbeans86.soap.Dictionary.define(Dictionary.java:21) at com.netbeans68.soap.test.Installer.restored(Installer.java:21) at org.netbeans.core.startup.NbInstaller.loadCode(NbInstaller.java:440) at org.netbeans.core.startup.NbInstaller.load(NbInstaller.java:361) at org.netbeans.ModuleManager.enable(ModuleManager.java:928) at org.netbeans.core.startup.ModuleList.installNew(ModuleList.java:289) at org.netbeans.core.startup.ModuleList.trigger(ModuleList.java:225) at org.netbeans.core.startup.ModuleSystem.restore(ModuleSystem.java:276) at org.netbeans.core.startup.Main.getModuleSystem(Main.java:168) at org.netbeans.core.startup.Main.start(Main.java:309) at org.netbeans.core.startup.TopThreadGroup.run(TopThreadGroup.java:111) [catch] at java.lang.Thread.run(Thread.java:619)
Are you able to re-compile JAX-WS client stub again? What version of IDE you used to create JAX-WS client classes (dictionary.jar) ? So you have JAXB-API and JAX-WS-API dependencies in both library wrapper module and test module right?
Hi. I was able to make it work when I removed JAXB and JAX-WS dependencies from dictionary-test module. Can you check if this works for you ?
Right now removing JAX-WS and JAXB dependencies from dictionary-test does not help. I guess there are a plenty of conditions I need to test this issue: - NetBeans 6.8 vs. NetBeans 6.8 Patch 1 (endorsing JAX-WS 2.2) - NetBeans 6.8 Patch 1 + (JAX-WS 2.2 vs. JAX-WS 2.2 build with 2.1 compatibility) - Dependency on JAX-WS and/or JAXB or not adding dependency on them for dictionary-wrapper - Dependency on JAX-WS and/or JAXB or not adding dependency on them for dictionary-test I assume I can skpi testind at least the last one and I don't need to set the dependency on JAX-WS and JAXB. Unfortunatelly I have other work to do, so I'll come up with te results by tomorrow.
Thanks, sorry for taking your time. I think, I found a fix for : java.lang.ClassNotFoundException: com.sun.istack.logging.Logger (there was missing runtime dependency on JAXB in JAX-WS-API) Fix: http://hg.netbeans.org/main/rev/7b57e979feb1 Note also: http://hg.netbeans.org/main/rev/9553144c4069 To test the fix please copy the org-netbeans-modules-websvc-jaxws21api.jar to netbeans_home/java/modules and jaxws-rt.jar to java/modules/ext/jaxws22 This should help.
Integrated into 'main-golden', will be available in build *201002110200* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main/rev/7b57e979feb1 User: mkuchtiak@netbeans.org Log: #180455: JAX-WS should depend on JAXB in runtime
I've tested it in the nightly build from trunk. I can confirm that this issue is fixed there. Both JAX-WS and JAXB modules are needed to be added as dependency on the library wrapper module. Unfortunately I was not able to patch my NetBeans 6.8 Patch1 in a way to get it working, so this issue must depend on other (unfortunately unknown) changes as well.
Created attachment 94066 [details] org-netbeans-modules-websvc-jaxws21api.jar
Have you tried to copy : jaxws-rt.jar and org-netbeans-modules-websvc-jaxws21api.jar (both attached) to the folders I mentioned sooner (in Nb6.8 patch) ?
Yes I've replaced the mentioned jars. (Yesterday, I just patched the MANIFEST.MF of org-netbeans-modules-websvc-jaxws21api.jar as it vas not uploaded) Still no success on NB 6.8. $ ls -l /opt/netbeans-6.8/java3/modules/org-netbeans-modules-websvc-jaxws21api.jar -rw-rw-r-- 1 root root 4509 2010-02-11 10:02 /opt/netbeans-6.8/java3/modules/org-netbeans-modules-websvc-jaxws21api.jar $ ls -l /opt/netbeans-6.8/java3/modules/ext/jaxws22/jaxws-rt.jar -rw-rw-r-- 1 root root 1482168 2010-02-11 09:59 /opt/netbeans-6.8/java3/modules/ext/jaxws22/jaxws-rt.jar
Yes, I realized, meanwhile there were also changes related to JAXB, JAX-WS library definitions (issue 178735): http://hg.netbeans.org/main/rev/3b3d1c4272a5 So I zipped all the modules that were changed. Try this. It works on my computer when I replace jars from NB6.8.
Created attachment 94070 [details] 68_patch
For sure archive all 4 jars that you will replace by the patch.
I confirm that the attached set of jars fixes this issue on NB 6.8! I knew, from the first time, that Jesse Glick has to have a hand resolving this issue! :D
v.