Hello! I am using JAXB 2.0 on a JBoss 4.0.4GA server. The problem is, that JBoss is choosing the wrong (v1.x) JAXB classes that are part of "jboss-j2ee.jar".
How can I get JBoss to load the JAXB classes ("javax.xml.bind...") from the jars in the .ear-archive (jaxb-api.jar, jaxb-impl.jar and so on) INSTEAD of loading them from jboss-j2ee.jar? I read "JBossClassLoadingUseCases" (http://wiki.jboss.org/wiki/Wiki.jsp?page=JBossClassLoadingUseCases) and "ClassLoadingConfiguration" (http://www.jboss.org/wiki/Wiki.jsp?page=ClassLoadingConfiguration) in the JBoss Wiki, but don't get the application run correctly. As soon as I add the following code in META-INF/jboss-app.xml: | <jboss-app> | <loader-repository> | javax.xml.bind:loader=foobar.ear | <loader-repository-config> | java2ParentDelegation=false | </loader-repository-config> | </loader-repository> | </jboss-app> | I get errors like | 14:02:34,148 ERROR [STDERR] log4j:ERROR A "org.jboss.logging.util.OnlyOnceErrorHandler" object is not assignable to a "org.apache.log4j.spi.ErrorHandler" variable. | 14:02:34,148 ERROR [STDERR] log4j:ERROR The class "org.apache.log4j.spi.ErrorHandler" was loaded by | 14:02:34,148 ERROR [STDERR] log4j:ERROR [EMAIL PROTECTED] url=file:/D:/jboss-4.0.4.GA/server/default/tmp/deploy/tmp746foobar.ear ,addedOrder=39}] whereas object of type | 14:02:34,148 ERROR [STDERR] log4j:ERROR "org.jboss.logging.util.OnlyOnceErrorHandler" was loaded by [EMAIL PROTECTED] | 14:02:34,198 ERROR [STDERR] log4j:ERROR Could not create an Appender. Reported error follows. | 14:02:34,198 ERROR [STDERR] java.lang.ClassCastException: org.jboss.logging.appender.DailyRollingFileAppender | 14:02:34,198 ERROR [STDERR] at org.apache.log4j.xml.DOMConfigurator.parseAppender(DOMConfigurator.java:165) | 14:02:34,198 ERROR [STDERR] at org.apache.log4j.xml.DOMConfigurator.findAppenderByName(DOMConfigurator.java:140) | 14:02:34,198 ERROR [STDERR] at org.apache.log4j.xml.DOMConfigurator.findAppenderByReference(DOMConfigurator.java:153) | 14:02:34,198 ERROR [STDERR] at org.apache.log4j.xml.DOMConfigurator.parseChildrenOfLoggerElement(DOMConfigurator.java:415) | 14:02:34,198 ERROR [STDERR] at org.apache.log4j.xml.DOMConfigurator.parseRoot(DOMConfigurator.java:384) | 14:02:34,198 ERROR [STDERR] at org.apache.log4j.xml.DOMConfigurator.parse(DOMConfigurator.java:783) | 14:02:34,198 ERROR [STDERR] at org.apache.log4j.xml.DOMConfigurator.doConfigure(DOMConfigurator.java:666) | 14:02:34,198 ERROR [STDERR] at org.apache.log4j.xml.DOMConfigurator.doConfigure(DOMConfigurator.java:616) | 14:02:34,198 ERROR [STDERR] at org.apache.log4j.xml.DOMConfigurator.doConfigure(DOMConfigurator.java:602) | 14:02:34,198 ERROR [STDERR] at org.apache.log4j.helpers.OptionConverter.selectAndConfigure(OptionConverter.java:460) | 14:02:34,198 ERROR [STDERR] at org.apache.log4j.LogManager.<clinit>(LogManager.java:113) | 14:02:34,198 ERROR [STDERR] at org.apache.log4j.Logger.getLogger(Logger.java:85) | 14:02:34,198 ERROR [STDERR] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) | 14:02:34,198 ERROR [STDERR] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) | 14:02:34,198 ERROR [STDERR] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) | 14:02:34,198 ERROR [STDERR] at java.lang.reflect.Method.invoke(Method.java:585) | 14:02:34,198 ERROR [STDERR] at org.apache.commons.logging.impl.Log4jProxy.<init>(Log4jProxy.java:132) | 14:02:34,198 ERROR [STDERR] at org.apache.commons.logging.impl.Log4JLogger.<init>(Log4JLogger.java:39) | 14:02:34,198 ERROR [STDERR] at sun.reflect.GeneratedConstructorAccessor19.newInstance(Unknown Source) | 14:02:34,198 ERROR [STDERR] at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27) | 14:02:34,198 ERROR [STDERR] at java.lang.reflect.Constructor.newInstance(Constructor.java:494) | 14:02:34,198 ERROR [STDERR] at org.apache.commons.logging.impl.LogFactoryImpl.newInstance(LogFactoryImpl.java:529) | 14:02:34,198 ERROR [STDERR] at org.apache.commons.logging.impl.LogFactoryImpl.getInstance(LogFactoryImpl.java:235) | 14:02:34,198 ERROR [STDERR] at org.apache.commons.logging.LogFactory.getLog(LogFactory.java:372) | 14:02:34,198 ERROR [STDERR] at org.apache.tomcat.util.digester.Digester.configure(Digester.java:2557) | 14:02:34,198 ERROR [STDERR] at org.apache.tomcat.util.digester.Digester.parse(Digester.java:1560) | 14:02:34,198 ERROR [STDERR] at org.apache.catalina.startup.ContextConfig.processContextConfig(ContextConfig.java:781) | 14:02:34,198 ERROR [STDERR] at org.apache.catalina.startup.ContextConfig.contextConfig(ContextConfig.java:717) | 14:02:34,198 ERROR [STDERR] at org.apache.catalina.startup.ContextConfig.init(ContextConfig.java:977) | 14:02:34,198 ERROR [STDERR] at org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:278) | 14:02:34,198 ERROR [STDERR] at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119) | 14:02:34,198 ERROR [STDERR] at org.apache.catalina.core.StandardContext.init(StandardContext.java:5130) | 14:02:34,198 ERROR [STDERR] at org.apache.catalina.core.StandardContext.start(StandardContext.java:3945) | 14:02:34,198 ERROR [STDERR] at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:759) | 14:02:34,198 ERROR [STDERR] at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:739) | 14:02:34,198 ERROR [STDERR] at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:524) | 14:02:34,198 ERROR [STDERR] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) | 14:02:34,198 ERROR [STDERR] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) | 14:02:34,198 ERROR [STDERR] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) | 14:02:34,198 ERROR [STDERR] at java.lang.reflect.Method.invoke(Method.java:585) | 14:02:34,198 ERROR [STDERR] at org.apache.commons.modeler.BaseModelMBean.invoke(BaseModelMBean.java:503) | 14:02:34,198 ERROR [STDERR] at org.jboss.mx.server.RawDynamicInvoker.invoke(RawDynamicInvoker.java:164) | 14:02:34,198 ERROR [STDERR] at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659) | 14:02:34,198 ERROR [STDERR] at org.apache.catalina.core.StandardContext.init(StandardContext.java:5116) | 14:02:34,198 ERROR [STDERR] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) | 14:02:34,198 ERROR [STDERR] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) | 14:02:34,198 ERROR [STDERR] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) | 14:02:34,198 ERROR [STDERR] at java.lang.reflect.Method.invoke(Method.java:585) | 14:02:34,198 ERROR [STDERR] at org.apache.commons.modeler.BaseModelMBean.invoke(BaseModelMBean.java:503) | 14:02:34,198 ERROR [STDERR] at org.jboss.mx.server.RawDynamicInvoker.invoke(RawDynamicInvoker.java:164) | 14:02:34,198 ERROR [STDERR] at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659) | 14:02:34,198 ERROR [STDERR] at org.jboss.web.tomcat.tc5.TomcatDeployer.performDeployInternal(TomcatDeployer.java:297) | 14:02:34,198 ERROR [STDERR] at org.jboss.web.tomcat.tc5.TomcatDeployer.performDeploy(TomcatDeployer.java:103) | 14:02:34,198 ERROR [STDERR] at org.jboss.web.AbstractWebDeployer.start(AbstractWebDeployer.java:371) | 14:02:34,198 ERROR [STDERR] at org.jboss.web.WebModule.startModule(WebModule.java:83) | 14:02:34,198 ERROR [STDERR] at org.jboss.web.WebModule.startService(WebModule.java:61) | 14:02:34,198 ERROR [STDERR] at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanSupport.java:289) | 14:02:34,198 ERROR [STDERR] at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSupport.java:245) | 14:02:34,198 ERROR [STDERR] at sun.reflect.GeneratedMethodAccessor3.invoke(Unknown Source) | 14:02:34,198 ERROR [STDERR] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) | 14:02:34,198 ERROR [STDERR] at java.lang.reflect.Method.invoke(Method.java:585) | 14:02:34,198 ERROR [STDERR] at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155) | 14:02:34,198 ERROR [STDERR] at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94) | 14:02:34,198 ERROR [STDERR] at org.jboss.mx.server.Invocation.invoke(Invocation.java:86) | 14:02:34,198 ERROR [STDERR] at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264) | 14:02:34,198 ERROR [STDERR] at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659) | 14:02:34,198 ERROR [STDERR] at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:978) | 14:02:34,198 ERROR [STDERR] at $Proxy0.start(Unknown Source) | 14:02:34,198 ERROR [STDERR] at org.jboss.system.ServiceController.start(ServiceController.java:417) | 14:02:34,198 ERROR [STDERR] at sun.reflect.GeneratedMethodAccessor6.invoke(Unknown Source) | 14:02:34,198 ERROR [STDERR] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) | 14:02:34,198 ERROR [STDERR] at java.lang.reflect.Method.invoke(Method.java:585) | 14:02:34,198 ERROR [STDERR] at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155) | 14:02:34,198 ERROR [STDERR] at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94) | 14:02:34,198 ERROR [STDERR] at org.jboss.mx.server.Invocation.invoke(Invocation.java:86) | 14:02:34,198 ERROR [STDERR] at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264) | 14:02:34,198 ERROR [STDERR] at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659) | 14:02:34,198 ERROR [STDERR] at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210) | 14:02:34,198 ERROR [STDERR] at $Proxy39.start(Unknown Source) | 14:02:34,198 ERROR [STDERR] at org.jboss.web.AbstractWebContainer.start(AbstractWebContainer.java:466) | 14:02:34,198 ERROR [STDERR] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) | 14:02:34,198 ERROR [STDERR] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) | 14:02:34,198 ERROR [STDERR] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) | 14:02:34,198 ERROR [STDERR] at java.lang.reflect.Method.invoke(Method.java:585) | 14:02:34,198 ERROR [STDERR] at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155) | 14:02:34,198 ERROR [STDERR] at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94) | 14:02:34,198 ERROR [STDERR] at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:133) | 14:02:34,198 ERROR [STDERR] at org.jboss.mx.server.Invocation.invoke(Invocation.java:88) | 14:02:34,198 ERROR [STDERR] at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:142) | 14:02:34,198 ERROR [STDERR] at org.jboss.mx.interceptor.DynamicInterceptor.invoke(DynamicInterceptor.java:97) | 14:02:34,198 ERROR [STDERR] at org.jboss.system.InterceptorServiceMBeanSupport.invokeNext(InterceptorServiceMBeanSupport.java:238) | 14:02:34,198 ERROR [STDERR] at org.jboss.ws.server.WebServiceDeployer.start(WebServiceDeployer.java:117) | 14:02:34,198 ERROR [STDERR] at org.jboss.deployment.SubDeployerInterceptorSupport$XMBeanInterceptor.start(SubDeployerInterceptorSupport.java:188) | 14:02:34,198 ERROR [STDERR] at org.jboss.deployment.SubDeployerInterceptor.invoke(SubDeployerInterceptor.java:95) | 14:02:34,198 ERROR [STDERR] at org.jboss.mx.server.Invocation.invoke(Invocation.java:88) | 14:02:34,198 ERROR [STDERR] at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264) | 14:02:34,198 ERROR [STDERR] at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659) | 14:02:34,198 ERROR [STDERR] at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210) | 14:02:34,198 ERROR [STDERR] at $Proxy40.start(Unknown Source) | 14:02:34,198 ERROR [STDERR] at org.jboss.deployment.MainDeployer.start(MainDeployer.java:1007) | 14:02:34,198 ERROR [STDERR] at org.jboss.deployment.MainDeployer.start(MainDeployer.java:997) | 14:02:34,198 ERROR [STDERR] at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:808) | 14:02:34,198 ERROR [STDERR] at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:771) | 14:02:34,198 ERROR [STDERR] at sun.reflect.GeneratedMethodAccessor14.invoke(Unknown Source) | 14:02:34,198 ERROR [STDERR] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) | 14:02:34,198 ERROR [STDERR] at java.lang.reflect.Method.invoke(Method.java:585) | 14:02:34,198 ERROR [STDERR] at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155) | 14:02:34,198 ERROR [STDERR] at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94) | 14:02:34,198 ERROR [STDERR] at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:133) | 14:02:34,198 ERROR [STDERR] at org.jboss.mx.server.Invocation.invoke(Invocation.java:88) | 14:02:34,198 ERROR [STDERR] at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:142) | 14:02:34,198 ERROR [STDERR] at org.jboss.mx.server.Invocation.invoke(Invocation.java:88) | 14:02:34,198 ERROR [STDERR] at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264) | 14:02:34,198 ERROR [STDERR] at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659) | 14:02:34,198 ERROR [STDERR] at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210) | 14:02:34,198 ERROR [STDERR] at $Proxy6.deploy(Unknown Source) | 14:02:34,198 ERROR [STDERR] at org.jboss.deployment.scanner.URLDeploymentScanner.deploy(URLDeploymentScanner.java:421) | 14:02:34,198 ERROR [STDERR] at org.jboss.deployment.scanner.URLDeploymentScanner.scan(URLDeploymentScanner.java:610) | 14:02:34,198 ERROR [STDERR] at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.doScan(AbstractDeploymentScanner.java:263) | 14:02:34,198 ERROR [STDERR] at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.loop(AbstractDeploymentScanner.java:274) | 14:02:34,198 ERROR [STDERR] at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.run(AbstractDeploymentScanner.java:225) | How can I simply tell JBoss to load all javax.xml.bind.* classes from the JAXB2.0-jars in the ear, not from the old jboss4.0.4/server/default/lib/jboss-j2ee.jar AND to leave other class loading mechanisms untouched (like for log4j and so on)? Any help would be appreciated. Johannes View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3988396#3988396 Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3988396 _______________________________________________ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user