[jboss-user] [Installation, Configuration & DEPLOYMENT] How to make the EAR classloader override JRE library?
William
zhou_william at yahoo.cn
Fri May 15 01:43:30 EDT 2009
Hi,
Previously I posted the question at Beginners Corner, nobody answered it. Could anybody in this group help me on this question?
In my project's EAR package, I am using the latest JAXB jars by packaging them in APP-INF/lib/jaxb*.jar. The environment I am using is JBoss4 + JDK6. However, the JBOSS and JRE has old versions of JAXB.
I wish to configure the JBOSS ClassLoader to make it load my packaged JAXB jars precedence over the old versions either in JBOSS_HOME/lib/ or JAVA_HOME/jre/lib.
I set the jboss-app.xml as:
<jboss-app>
<loader-repository>
my.example:loader=my-example.ear
<loader-repository-config>
java2ParentDelegation=false
</loader-repository-config>
</loader-repository>
<library-directory>
APP-INF/lib
</library-directory>
</jboss-app>
My EAR structure for "my-example.ear" is:
- EAR my.example.impl.ear
- APP-INF/class
- APP-INF/lib
- META-INF
- WAR my-example.war
- WEB-INF
- META-INF
However, the deployment failed when verifying JAXBContext class:
...
[Loaded com.sun.jersey.core.spi.component.ProviderFactory$SingletonComponentProvider from file:/C:/jboss-4.2.3.GA-jdk6/server/default/tmp/deploy/tmp3081340691940707694my-example.ear-contents/APP-INF/lib/jersey-core-1.0.2.jar]
[Loaded com.sun.jersey.core.spi.component.ComponentDestructor from file:/C:/jboss-4.2.3.GA-jdk6/server/default/tmp/deploy/tmp3081340691940707694my-example.ear-contents/APP-INF/lib/jersey-core-1.0.2.jar]
[Loaded javax.annotation.PreDestroy from C:\Java\jdk1.6.0_13\jre\lib\rt.jar]
[Loaded javax.xml.bind.JAXBContext from C:\jboss-4.2.3.GA-jdk6\lib\endorsed\jaxb-api.jar]
[Loaded com.sun.jersey.api.json.JSONConfigurated from file:/C:/jboss-4.2.3.GA-jdk6/server/default/tmp/deploy/tmp3081340691940707694my-example.ear-contents/APP-INF/lib/jersey-json-1.0.2.jar]
[Loaded java.lang.Package$1 from C:\Java\jdk1.6.0_13\jre\lib\rt.jar]
[Loaded javax.xml.bind.JAXBContext from file:/C:/jboss-4.2.3.GA-jdk6/server/default/tmp/deploy/tmp3081340691940707694my-example.ear-contents/APP-INF/lib/jaxb-api.jar]
[Loaded com.sun.jersey.api.json.JSONJAXBContext from file:/C:/jboss-4.2.3.GA-jdk6/server/default/tmp/deploy/tmp3081340691940707694my-example.ear-contents/APP-INF/lib/jersey-json-1.0.2.jar]
[Loaded java.lang.VerifyError from C:\Java\jdk1.6.0_13\jre\lib\rt.jar]
02:24:23,953 ERROR [[/resources]] StandardWrapper.Throwable
java.lang.VerifyError: (class: my/example/impl/provider/JAXBContextResolver, method: <init> signature: ()V) Bad type in putfield/putstatic
at java.lang.Class.getDeclaredMethods0(Native Method)
at java.lang.Class.privateGetDeclaredMethods(Unknown Source)
at java.lang.Class.privateGetPublicMethods(Unknown Source)
at java.lang.Class.getMethods(Unknown Source)
at com.sun.jersey.core.reflection.MethodList.<init>(MethodList.java:57)
at com.sun.jersey.core.spi.component.ComponentConstructor.getPostConstructMethod(ComponentConstructor.java:124)
at com.sun.jersey.core.spi.component.ComponentConstructor.<init>(ComponentConstructor.java:118)
at com.sun.jersey.core.spi.component.ProviderFactory.getInstance(ProviderFactory.java:205)
at com.sun.jersey.core.spi.component.ProviderFactory._getComponentProvider(ProviderFactory.java:133)
at com.sun.jersey.core.spi.component.ProviderFactory.getComponentProvider(ProviderFactory.java:126)
at com.sun.jersey.core.spi.component.ProviderServices.getComponent(ProviderServices.java:168)
at com.sun.jersey.core.spi.component.ProviderServices.getProviders(ProviderServices.java:95)
at com.sun.jersey.core.spi.factory.ContextResolverFactory.<init>(ContextResolverFactory.java:90)
at com.sun.jersey.server.impl.application.WebApplicationImpl.initiate(WebApplicationImpl.java:410)
at com.sun.jersey.server.impl.application.WebApplicationImpl.initiate(WebApplicationImpl.java:317)
at com.sun.jersey.spi.container.servlet.WebComponent.initiate(WebComponent.java:422)
at com.sun.jersey.spi.container.servlet.WebComponent.load(WebComponent.java:433)
at com.sun.jersey.spi.container.servlet.WebComponent.init(WebComponent.java:167)
at com.sun.jersey.spi.container.servlet.ServletContainer.init(ServletContainer.java:197)
at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1161)
at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:981)
at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:4071)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4375)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:790)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:770)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:553)
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.tomcat.util.modeler.BaseModelMBean.invoke(BaseModelMBean.java:296)
at org.jboss.mx.server.RawDynamicInvoker.invoke(RawDynamicInvoker.java:164)
at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
at org.apache.catalina.core.StandardContext.init(StandardContext.java:5312)
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.tomcat.util.modeler.BaseModelMBean.invoke(BaseModelMBean.java:296)
at org.jboss.mx.server.RawDynamicInvoker.invoke(RawDynamicInvoker.java:164)
at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
at org.jboss.web.tomcat.service.TomcatDeployer.performDeployInternal(TomcatDeployer.java:301)
at org.jboss.web.tomcat.service.TomcatDeployer.performDeploy(TomcatDeployer.java:104)
at org.jboss.web.AbstractWebDeployer.start(AbstractWebDeployer.java:375)
at org.jboss.web.WebModule.startModule(WebModule.java:83)
at org.jboss.web.WebModule.startService(WebModule.java:61)
at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanSupport.java:289)
at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSupport.java:245)
at sun.reflect.GeneratedMethodAccessor3.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
Thanks a lot,
William
___________________________________________________________
好玩贺卡等你发,邮箱贺卡全新上线!
http://card.mail.cn.yahoo.com/
More information about the jboss-user
mailing list