Skip to main content

IncompatibleClassChangeError

10 replies [Last post]
jxf6483
Offline
Joined: 2005-07-14

Hi,

I updated the jax-ws source and my code can be compiled. But when I run the junit tests in the eclipse UI, all tests are broken due to the java.lang.IncompatibleClassChangeError error. One error is as follows,

java.lang.IncompatibleClassChangeError
at com.sun.xml.ws.wsdl.writer.WSDLGenerator.doGeneration(WSDLGenerator.java:127)
at com.sun.xml.ws.server.RuntimeEndpointInfo.generateWSDL(RuntimeEndpointInfo.java:381)
at com.sun.xml.ws.transport.http.servlet.WSServletContextListener.createModelAndMetadata(WSServletContextListener.java:209)
at com.sun.xml.ws.transport.http.servlet.WSServletContextListener.contextInitialized(WSServletContextListener.java:123)
at com.jtv.core.ws.endpoint.EndpointTestCase.setUp(EndpointTestCase.java:65)
at com.jtv.core.ws.endpoint.EndpointTestCase.setUp(EndpointTestCase.java:50)
at com.jtv.core.ws.endpoint.example.handlerresult.SignatureEndpoint_UT.setUp(SignatureEndpoint_UT.java:9)
at junit.framework.TestCase.runBare(TestCase.java:125)
at junit.framework.TestResult$1.protect(TestResult.java:106)
at junit.framework.TestResult.runProtected(TestResult.java:124)
at junit.framework.TestResult.run(TestResult.java:109)
at junit.framework.TestCase.run(TestCase.java:118)
at junit.framework.TestSuite.runTest(TestSuite.java:208)
at junit.framework.TestSuite.run(TestSuite.java:203)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:478)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:344)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196)

Does anyone know how to get around this?

Thanks in advance,

Jian

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
jxf6483
Offline
Joined: 2005-07-14

Yes, I put jaxws jars in eclipse by configuring the project build path. Eclipse should have no problem to find the classes. I don't how the classloader in eclipse is implemented. From my debuging, it seems to call the classloader whenever it cannot find a class.

Thanks,

Jian

jxf6483
Offline
Joined: 2005-07-14

Yes, it is included in a jar file under /WEB-INF/lib/. But if it is a classpath problem, why other classes in the same package do not throw out any error message?

Thanks,

Jian

kohsuke
Offline
Joined: 2003-06-09

This is apparently happening inside the JAXB RI.
I think I know what's going on, but to make sure, let me ask one question.

I see that you are testing your code from within Eclipse. Do you know how ClassLoaders are set up in this environment?

Does JAX-WS jars live in an Eclipse plugin?

jxf6483
Offline
Joined: 2005-07-14

Is it possible for you to fix the JAXB RI source? I tried to go back to the previous CVS source, but have problems for annotation processing.

Thanks.

jxf6483
Offline
Joined: 2005-07-14

I have fixed this problem. Thanks.

kohlert
Offline
Joined: 2003-06-16

Would you mind posting the fix in case others have a similar problem?

jxf6483
Offline
Joined: 2005-07-14

It is a classpath problem. In eclipse, I set project A is dependent on project B. But Project B uses a different verision of Jaxb jars. I reset the project build path so that eclipse UI will first find the jars in the current project. This time it works fine.

I didn't see such errors before, perhaps the latest Jaxb jars conflict with the previous version while generating
WSDLs.

jxf6483
Offline
Joined: 2005-07-14

I deployed the war file to tomcat and got the following messages:

Oct 31, 2005 1:46:43 PM com.sun.xml.ws.transport.http.servlet.WSServletContextListener contextInitialized
INFO: WSSERVLET12: JAX-WS context listener initializing
Oct 31, 2005 1:46:44 PM com.sun.xml.ws.transport.http.servlet.WSServletContextListener contextInitialized
SEVERE: WSSERVLET11: failed to parse runtime descriptor: java.lang.IllegalArgumentException: interface com.jtv.core.validator.annotation.StringFieldValidation is not visible from class loader
java.lang.IllegalArgumentException: interface com.jtv.core.validator.annotation.StringFieldValidation is not visible from class loader
at java.lang.reflect.Proxy.getProxyClass(Proxy.java:345)
at java.lang.reflect.Proxy.newProxyInstance(Proxy.java:564)
at com.sun.xml.bind.v2.model.annotation.LocatableAnnotation.create(LocatableAnnotation.java:37)
at com.sun.xml.bind.v2.model.annotation.RuntimeInlineAnnotationReader.getAllFieldAnnotations(RuntimeInlineAnnotationReader.java:31)
at com.sun.xml.bind.v2.model.annotation.RuntimeInlineAnnotationReader.getAllFieldAnnotations(RuntimeInlineAnnotationReader.java:17)
at com.sun.xml.bind.v2.model.impl.ClassInfoImpl.getProperties(ClassInfoImpl.java:230)
at com.sun.xml.bind.v2.model.impl.RuntimeClassInfoImpl.getProperties(RuntimeClassInfoImpl.java:87)
at com.sun.xml.bind.v2.model.impl.ModelBuilder.getClassInfo(ModelBuilder.java:127)
at com.sun.xml.bind.v2.model.impl.RuntimeModelBuilder.getClassInfo(RuntimeModelBuilder.java:49)
at com.sun.xml.bind.v2.model.impl.RuntimeModelBuilder.getClassInfo(RuntimeModelBuilder.java:41)
at com.sun.xml.bind.v2.model.impl.ModelBuilder.getTypeInfo(ModelBuilder.java:189)
at com.sun.xml.bind.v2.model.impl.TypeRefImpl.calcRef(TypeRefImpl.java:56)
at com.sun.xml.bind.v2.model.impl.TypeRefImpl.getTarget(TypeRefImpl.java:33)
at com.sun.xml.bind.v2.model.impl.RuntimeTypeRefImpl.getTarget(RuntimeTypeRefImpl.java:22)
at com.sun.xml.bind.v2.model.impl.RuntimeTypeRefImpl.getTarget(RuntimeTypeRefImpl.java:15)
at com.sun.xml.bind.v2.model.impl.ElementPropertyInfoImpl$1.get(ElementPropertyInfoImpl.java:39)
at com.sun.xml.bind.v2.model.impl.ElementPropertyInfoImpl$1.get(ElementPropertyInfoImpl.java:42)
at java.util.AbstractList$Itr.next(AbstractList.java:422)
at com.sun.xml.bind.v2.model.impl.ModelBuilder.getClassInfo(ModelBuilder.java:139)
at com.sun.xml.bind.v2.model.impl.RuntimeModelBuilder.getClassInfo(RuntimeModelBuilder.java:49)
at com.sun.xml.bind.v2.model.impl.RuntimeModelBuilder.getClassInfo(RuntimeModelBuilder.java:41)
at com.sun.xml.bind.v2.model.impl.ModelBuilder.getTypeInfo(ModelBuilder.java:189)
at com.sun.xml.bind.v2.model.impl.ModelBuilder.getTypeInfo(ModelBuilder.java:204)
at com.sun.xml.bind.v2.runtime.JAXBContextImpl.getTypeInfoSet(JAXBContextImpl.java:327)
at com.sun.xml.bind.v2.runtime.JAXBContextImpl.(JAXBContextImpl.java:198)
at com.sun.xml.bind.v2.ContextFactory.createContext(ContextFactory.java:76)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at com.sun.xml.bind.api.JAXBRIContext.newInstance(JAXBRIContext.java:72) at com.sun.xml.ws.model.RuntimeModel$1.run(RuntimeModel.java:179)
at java.security.AccessController.doPrivileged(Native Method)
at com.sun.xml.ws.model.RuntimeModel.createJAXBContext(RuntimeModel.java:176)
at com.sun.xml.ws.model.RuntimeModel.postProcess(RuntimeModel.java:69)
at com.sun.xml.ws.modeler.RuntimeModeler.buildRuntimeModel(RuntimeModeler.java:256)
at com.sun.xml.ws.server.RuntimeEndpointInfo.createModel(RuntimeEndpointInfo.java:177)
at com.sun.xml.ws.server.RuntimeEndpointInfo.init(RuntimeEndpointInfo.java:314)
at com.sun.xml.ws.transport.http.servlet.WSServletContextListener.createModelAndMetadata(WSServletContextListener.java:207)
at com.sun.xml.ws.transport.http.servlet.WSServletContextListener.contextInitialized(WSServletContextListener.java:123)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3669)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4104)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:759)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:739)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:524) at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:788) at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:498)
at org.apache.catalina.startup.HostConfig.check(HostConfig.java:1179)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.apache.commons.modeler.BaseModelMBean.invoke(BaseModelMBean.java:503)
at com.sun.jmx.mbeanserver.DynamicMetaDataImpl.invoke(DynamicMetaDataImpl.java:213)
at com.sun.jmx.mbeanserver.MetaDataImpl.invoke(MetaDataImpl.java:220)
at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:815)
at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:784)
at org.apache.catalina.manager.ManagerServlet.check(ManagerServlet.java:1377)
at org.apache.catalina.manager.ManagerServlet.deploy(ManagerServlet.java:636)
at org.apache.catalina.manager.ManagerServlet.doPut(ManagerServlet.java:423)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:712)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:482)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:856)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:744)
at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
at java.lang.Thread.run(Thread.java:595)

2005-10-31 13:46:44,063 ERROR
org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/core-ws]: Exception sending context initialized event to listener instance of class com.sun.xml.ws.transport.http.servlet.WSServletContextListener
WSSERVLET11: failed to parse runtime descriptor: java.lang.IllegalArgumentException: interface com.jtv.core.validator.annotation.StringFieldValidation is not visible from class loader
at com.sun.xml.ws.transport.http.servlet.WSServletContextListener.contextInitialized(WSServletContextListener.java:134)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3669)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4104)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:759)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:739)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:524) at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:788) at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:498)
at org.apache.catalina.startup.HostConfig.check(HostConfig.java:1179)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.apache.commons.modeler.BaseModelMBean.invoke(BaseModelMBean.java:503)
at com.sun.jmx.mbeanserver.DynamicMetaDataImpl.invoke(DynamicMetaDataImpl.java:213)
at com.sun.jmx.mbeanserver.MetaDataImpl.invoke(MetaDataImpl.java:220)
at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:815)
at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:784)
at org.apache.catalina.manager.ManagerServlet.check(ManagerServlet.java:1377)
at org.apache.catalina.manager.ManagerServlet.deploy(ManagerServlet.java:636)
at org.apache.catalina.manager.ManagerServlet.doPut(ManagerServlet.java:423)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:712)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:482)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:856)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:744)
at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
at java.lang.Thread.run(Thread.java:595)
Caused by: java.lang.IllegalArgumentException: interface com.jtv.core.validator.annotation.StringFieldValidation is not visible from class loader
at java.lang.reflect.Proxy.getProxyClass(Proxy.java:345)
at java.lang.reflect.Proxy.newProxyInstance(Proxy.java:564)
at com.sun.xml.bind.v2.model.annotation.LocatableAnnotation.create(LocatableAnnotation.java:37)
at com.sun.xml.bind.v2.model.annotation.RuntimeInlineAnnotationReader.getAllFieldAnnotations(RuntimeInlineAnnotationReader.java:31)
at com.sun.xml.bind.v2.model.annotation.RuntimeInlineAnnotationReader.getAllFieldAnnotations(RuntimeInlineAnnotationReader.java:17)
at com.sun.xml.bind.v2.model.impl.ClassInfoImpl.getProperties(ClassInfoImpl.java:230)
at com.sun.xml.bind.v2.model.impl.RuntimeClassInfoImpl.getProperties(RuntimeClassInfoImpl.java:87)
at com.sun.xml.bind.v2.model.impl.ModelBuilder.getClassInfo(ModelBuilder.java:127)
at com.sun.xml.bind.v2.model.impl.RuntimeModelBuilder.getClassInfo(RuntimeModelBuilder.java:49)
at com.sun.xml.bind.v2.model.impl.RuntimeModelBuilder.getClassInfo(RuntimeModelBuilder.java:41)
at com.sun.xml.bind.v2.model.impl.ModelBuilder.getTypeInfo(ModelBuilder.java:189)
at com.sun.xml.bind.v2.model.impl.TypeRefImpl.calcRef(TypeRefImpl.java:56)
at com.sun.xml.bind.v2.model.impl.TypeRefImpl.getTarget(TypeRefImpl.java:33)
at com.sun.xml.bind.v2.model.impl.RuntimeTypeRefImpl.getTarget(RuntimeTypeRefImpl.java:22)
at com.sun.xml.bind.v2.model.impl.RuntimeTypeRefImpl.getTarget(RuntimeTypeRefImpl.java:15)
at com.sun.xml.bind.v2.model.impl.ElementPropertyInfoImpl$1.get(ElementPropertyInfoImpl.java:39)
at com.sun.xml.bind.v2.model.impl.ElementPropertyInfoImpl$1.get(ElementPropertyInfoImpl.java:42)
at java.util.AbstractList$Itr.next(AbstractList.java:422)
at com.sun.xml.bind.v2.model.impl.ModelBuilder.getClassInfo(ModelBuilder.java:139)
at com.sun.xml.bind.v2.model.impl.RuntimeModelBuilder.getClassInfo(RuntimeModelBuilder.java:49)
at com.sun.xml.bind.v2.model.impl.RuntimeModelBuilder.getClassInfo(RuntimeModelBuilder.java:41)
at com.sun.xml.bind.v2.model.impl.ModelBuilder.getTypeInfo(ModelBuilder.java:189)
at com.sun.xml.bind.v2.model.impl.ModelBuilder.getTypeInfo(ModelBuilder.java:204)
at com.sun.xml.bind.v2.runtime.JAXBContextImpl.getTypeInfoSet(JAXBContextImpl.java:327)
at com.sun.xml.bind.v2.runtime.JAXBContextImpl.(JAXBContextImpl.java:198)
at com.sun.xml.bind.v2.ContextFactory.createContext(ContextFactory.java:76)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at com.sun.xml.bind.api.JAXBRIContext.newInstance(JAXBRIContext.java:72) at com.sun.xml.ws.model.RuntimeModel$1.run(RuntimeModel.java:179)
at java.security.AccessController.doPrivileged(Native Method)
at com.sun.xml.ws.model.RuntimeModel.createJAXBContext(RuntimeModel.java:176)
at com.sun.xml.ws.model.RuntimeModel.postProcess(RuntimeModel.java:69)
at com.sun.xml.ws.modeler.RuntimeModeler.buildRuntimeModel(RuntimeModeler.java:256)
at com.sun.xml.ws.server.RuntimeEndpointInfo.createModel(RuntimeEndpointInfo.java:177)
at com.sun.xml.ws.server.RuntimeEndpointInfo.init(RuntimeEndpointInfo.java:314)
at com.sun.xml.ws.transport.http.servlet.WSServletContextListener.createModelAndMetadata(WSServletContextListener.java:207)
at com.sun.xml.ws.transport.http.servlet.WSServletContextListener.contextInitialized(WSServletContextListener.java:123)
... 37 more
Oct 31, 2005 1:46:44 PM org.apache.catalina.core.StandardContext start
SEVERE: Error listenerStart
Oct 31, 2005 1:46:44 PM org.apache.catalina.core.StandardContext start
SEVERE: Context [/core-ws] startup failed due to previous errors
Oct 31, 2005 1:46:44 PM com.sun.xml.ws.transport.http.servlet.WSServletContextListener contextDestroyed
INFO: WSSERVLET13: JAX-WS context listener destroyed
2005-10-31 13:46:44,066 INFO
org.springframework.web.context.support.XmlWebApplicationContext: Closing application context [Root WebApplicationContext]
2005-10-31 13:46:44,067 INFO
org.springframework.beans.factory.support.DefaultListableBeanFactory: Destroying singletons in factory {org.springframework.beans.factory.support.DefaultListableBeanFactory defining beans [requestContextService]; root of BeanFactory hierarchy}

The class

com.jtv.core.validator.annotation.StringFieldValidation

is as follows,
package com.jtv.core.validator.annotation;

import java.lang.annotation.Retention;
import java.lang.annotation.Target;

import static java.lang.annotation.ElementType.*;
import static java.lang.annotation.RetentionPolicy.*;

@Retention(RUNTIME) @Target({FIELD})
public @interface StringFieldValidation {
String key();
boolean allowNull() default true;
int minLength() default 0;
int maxLength() default -1;
String mask() default "[\\p{Zs}\\p{L}\\p{N}]*";
}

Actually, we have couple similar classes as the interfaces. But only this class causes errors. For example, the following interface does not cause any error:

package com.jtv.core.validator.annotation;

import static java.lang.annotation.ElementType.FIELD;
import static java.lang.annotation.RetentionPolicy.RUNTIME;

import java.lang.annotation.Retention;
import java.lang.annotation.Target;

@Retention(RUNTIME) @Target({FIELD})
public @interface LongFieldValidation {
String key();
long minValue() default Long.MIN_VALUE;
long maxValue() default Long.MAX_VALUE;
}

The error occurred only when we use the latest JAXWS source. The code works fine for the source that is two to three weeks ago. I don't know if this is the same error as the junit tests.

Thanks,

Jian

kohlert
Offline
Joined: 2003-06-16

This looks like a potential classpath issue, is the StringFieldValidation packaged in your war file?

kohlert
Offline
Joined: 2003-06-16

Is there more to this stack trace? Can you send me the code you are trying use?