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.

Bug 141205 - loader constraints violation during testing some ws op
Summary: loader constraints violation during testing some ws op
Status: VERIFIED FIXED
Alias: None
Product: webservices
Classification: Unclassified
Component: Manager (show other bugs)
Version: 6.x
Hardware: All All
: P2 blocker (vote)
Assignee: Peter Liu
URL:
Keywords:
: 141919 (view as bug list)
Depends on:
Blocks:
 
Reported: 2008-07-22 17:39 UTC by Lukas Jungmann
Modified: 2008-08-18 16:49 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Lukas Jungmann 2008-07-22 17:39:29 UTC
-invoke Test method ie on stikeiron -> emailverify -> ... -> getremaining hits

=>

loader constraint violation in interface itable initialization: when resolving method
"com.sun.xml.ws.handler.SOAPMessageContextImpl.getHeaders(Ljavax/xml/namespace/QName;Ljavax/xml/bind/JAXBContext;Z)[Ljava/lang/Object;"
the class loader (instance of java/net/URLClassLoader) of the current class,
com/sun/xml/ws/handler/SOAPMessageContextImpl, and the class loader (instance of  ) for interface
javax/xml/ws/handler/soap/SOAPMessageContext have different Class objects for the type javax/xml/bind/JAXBContext used
in the signature com.sun.xml.ws.handler.ClientSOAPHandlerTube.getContext(ClientSOAPHandlerTube.java:119)
 ...
java.lang.reflect.Method.invoke(Method.java:597)
org.netbeans.modules.websvc.saas.ui.wizards.ReflectionHelper.callMethodWithParams(ReflectionHelper.java:735)
org.netbeans.modules.websvc.saas.ui.wizards.TestWebServiceMethodDlg$MethodTask.run(TestWebServiceMethodDlg.java:697)
Comment 1 Peter Liu 2008-07-22 20:38:48 UTC
Lukas, does this happen for both jdk 1.5 and 1.6?
Comment 2 Lukas Jungmann 2008-07-22 20:42:52 UTC
I'm now on JDK1.6.0_10-rc-b26 where I would not expect this to happen but let me try... I'll let you know soon...

Comment 3 Lukas Jungmann 2008-07-22 21:32:45 UTC
same happens on jdk1.6.0_03

but on jdk1.5.0_15 there's another exception:

Class javax/xml/bind/attachment/AttachmentMarshaller violates loader constraints
java.lang.ClassLoader.defineClass1(Native Method) java.lang.ClassLoader.defineClass(ClassLoader.java:620)
org.netbeans.JarClassLoader.doLoadClass(JarClassLoader.java:225)
org.netbeans.ProxyClassLoader.selfLoadClass(ProxyClassLoader.java:262)
org.netbeans.ProxyClassLoader.loadClass(ProxyClassLoader.java:226) java.lang.ClassLoader.loadClass(ClassLoader.java:251)
java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
com.sun.xml.bind.v2.runtime.XMLSerializer.startDocument(XMLSerializer.java:819) 
...
java.lang.reflect.Method.invoke(Method.java:585)
org.netbeans.modules.websvc.saas.ui.wizards.ReflectionHelper.callMethodWithParams(ReflectionHelper.java:735)
org.netbeans.modules.websvc.saas.ui.wizards.TestWebServiceMethodDlg$MethodTask.run(TestWebServiceMethodDlg.java:697)
java.lang.Thread.run(Thread.java:595)

and IDE suddenly becomes a bit more verbose (not sure if this is related):

WARNING [org.netbeans.ProxyClassLoader]: Will not load class com.sun.org.apache.xml.internal.resolver.CatalogManager
arbitrarily from one of org.netbeans.StandardModule$OneModuleClassLoader@3f265b[org.netbeans.libs.jaxb] and
org.netbeans.StandardModule$OneModuleClassLoader@2264da[org.netbeans.modules.websvc.jaxws21]; see
http://wiki.netbeans.org/DevFaqModuleCCE
Comment 4 Peter Liu 2008-07-22 22:14:43 UTC
Lukas, does this happen for both jdk 1.5 and 1.6?
Comment 5 Lukas Jungmann 2008-07-22 22:20:01 UTC
see desc4
Comment 6 Peter Liu 2008-07-22 22:38:39 UTC
The issue here is the websvc.saas.ui module does not have a dependency on the jaxws21 library module which is required
to test the soap services. Therefore, for jdk1.6, the tester is using the jaxws library in the jdk for testing which
loaded its own version of JAXBContext which conflicts with the JAXBContext loaded by websvc.saas.ui module classloader.
 Similarly, for jdk1.5, since jaxws21 library doesn't exists, we get a different type of exception.

I tried adding the jaxws21 library to websvc.saas.ui module and was able to get past both exceptions for both jdk 1.5
and 1.6. However, I got the following exception:

java.lang.NoClassDefFoundError: javax/xml/bind/JAXBException
        at java.lang.Class.getDeclaredConstructors0(Native Method)
        at java.lang.Class.privateGetDeclaredConstructors(Class.java:2357)
        at java.lang.Class.getConstructor0(Class.java:2671)
        at java.lang.Class.getDeclaredConstructor(Class.java:1953)
        at com.sun.xml.bind.v2.model.nav.ReflectionNavigator.hasDefaultConstructor(ReflectionNavigat
or.java:464)
        at com.sun.xml.bind.v2.model.nav.ReflectionNavigator.hasDefaultConstructor(ReflectionNavigat
or.java:58)
        ......
        at com.sun.xml.bind.v2.runtime.JAXBContextImpl.<init>(JAXBContextImpl.java:286)
        at com.sun.xml.bind.v2.ContextFactory.createContext(ContextFactory.java:139)
        at com.sun.xml.bind.v2.ContextFactory.createContext(ContextFactory.java:117)
        ....
       
        at javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:522)
        at com.sun.xml.ws.spi.ProviderImpl$2.run(ProviderImpl.java:220)
        at com.sun.xml.ws.spi.ProviderImpl$2.run(ProviderImpl.java:218)
        .....
        at javax.xml.ws.spi.Provider.provider(Provider.java:83)
        at javax.xml.ws.Service.<init>(Service.java:56)
        at com.strikeiron.EmailVerification.<init>(EmailVerification.java:44)
Caused: java.lang.reflect.InvocationTargetException
        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:
39)
        at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorIm
pl.java:27)
        at java.lang.reflect.Constructor.newInstance(Constructor.java:494)
        at org.netbeans.modules.websvc.saas.ui.wizards.ReflectionHelper.callMethodWithParams(Reflect
ionHelper.java:667)


Which is very very strange because looking at the stack trace, javax.xml.bind.JAXBContext is already loaded which means
JAXBException should be, too.

Anyway, the first thing we need to do is to abstract out all the actions on the web services manager and move the
implementation for the test service action to the websvc.manager module.

Comment 7 Ayub Khan 2008-07-24 16:45:58 UTC
Above mentioned refactoring is done. Now I see the exception Peter reported ie.,

java.lang.NoClassDefFoundError: javax/xml/bind/JAXBException
        at java.lang.Class.getDeclaredConstructors0(Native Method)
Comment 8 Ayub Khan 2008-07-28 22:31:44 UTC
*** Issue 141919 has been marked as a duplicate of this issue. ***
Comment 9 Jeffrey Rubinoff 2008-07-29 10:37:08 UTC
FYI, when testing StrikeIron method, I got javax/xml/bind/attachment/AttachmentMarshaller showing up in red (assume
exception but there were no details) in my output window. This under 1.6.0_u6. See my attachment to bug
http://www.netbeans.org/issues/show_bug.cgi?id=141936. 
Comment 10 Ayub Khan 2008-08-04 19:24:18 UTC
Since Rico is debugging this issue, assigning to rico.
Comment 11 Peter Liu 2008-08-05 21:30:49 UTC
So by adding a dependency on the jaxb module to the jaxws21api module and adding
javax.xml.bind.** to OpenIDE-Module-Hide-Classpath-Packages entry in the manifest file
for jaxws21api module as suggested by Milan solves the problem for both jdk 1.5 and 1.6. 

Fix checked into trunk: http://hg.netbeans.org/main/rev/22bd1349aa67
Comment 12 Quality Engineering 2008-08-06 04:28:20 UTC
Integrated into 'main-golden', available in build *200808060201* on http://bits.netbeans.org/dev/nightly/
Changeset: http://hg.netbeans.org/main/rev/22bd1349aa67
User: PeterTLiu@netbeans.org
Log: Fix for IZ #141205
Comment 13 Lukas Jungmann 2008-08-18 16:49:15 UTC
v.