5 Replies Latest reply on Dec 22, 2006 4:17 PM by mr662

    JBoss JAXB class loading problem

    Johannes Mueller Newbie

      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 [org.jboss.mx.loading.UnifiedClassLoader3@1c0a077{ 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 [org.jboss.system.server.NoAnnotationURLClassLoader@ab95e6].
      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

        • 1. Re: JBoss JAXB class loading problem
          Weston M. Price Master

          I am assuminig that you have the JAXB classes at the root of your EAR archive (or some other accesible location). Do you have the JAR files listed in the relevant MANIFEST.MF entries in your application components (ie WAR, EJB)?


          • 2. Re: JBoss JAXB class loading problem
            Johannes Mueller Newbie

             

            "weston.price@jboss.com" wrote:
            I am assuminig that you have the JAXB classes at the root of your EAR archive (or some other accesible location). Do you have the JAR files listed in the relevant MANIFEST.MF entries in your application components (ie WAR, EJB)?


            Thank you for your reply.

            Yes, the JAXB jars are at the root of the EAR archive.

            foobar_integration.jar contains the java code using JAXB.
            foobar_presentation.war contains the web application.
            Both jars are in the root folder of foobar.ear ("EAR-ARCHIVE").

            The JAXB (2.0) jars are listed in

            EAR-ARCHIVE/foobar_integration.jar/META-INF/MANIFEST.MF...
            Manifest-Version: 1.0
            Ant-Version: Apache Ant 1.6.5
            Created-By: 1.5.0_07-b03 (Sun Microsystems Inc.)
            Class-Path: junit-4.1.jar activation.jar dtd-parser-1.0.jar isorelax.jar jaxb-api-doc.zip jaxb-api.jar jaxb-impl.jar jaxb-xjc.jar jsr173_1.0_api.jar msv.jar relaxngDatatype.jar resolver.jar rngom.jar txw2.jar xsdlib.jar xsom-src.zip xsom.jar framework_access.jar axis-ant.jar axis.jar commons-discovery-0.2.jar commons-logging-1.0.4.jar jaxrpc.jar log4j-1.2.8.jar saaj.jar wsdl4j-1.5.1.jar jboss-ejb3x.jar j2ee.jar
            


            ...and in EAR-ARCHIVE/foobar_presentation.war/META-INF/MANIFEST.MF:
            Manifest-Version: 1.0
            Ant-Version: Apache Ant 1.6.5
            Created-By: 1.5.0_07-b03 (Sun Microsystems Inc.)
            Class-Path: commons-codec-1.3.jar commons-validator-1.3.0.jar foobar_l
             ogic.jar j2ee.jar commons-collections-3.1.jar commons-digester-1.6.ja
             r jstl.jar standard.jar myfaces-api-1.1.3.jar myfaces-impl-1.1.3.jar
             commons-logging-1.0.4.jar jboss-ejb3x.jar junit-4.1.jar axis-ant.jar
             axis.jar commons-discovery-0.2.jar commons-logging-1.0.4.jar jaxrpc.j
             ar log4j-1.2.8.jar saaj.jar wsdl4j-1.5.1.jar activation.jar dtd-parse
             r-1.0.jar isorelax.jar jaxb-api-doc.zip jaxb-api.jar
             jaxb-impl.jar jaxb-xjc.jar jsr173_1.0_api.jar msv.jar relaxngDatatype.jar resolver.jar rngom.jar txw2.jar xsdlib.jar xsom-src.zip xsom.jar commons-el-1.0.jar tomahawk-1.1.3.jar common_presentation.jar commons-lang-2.1.jar foobar_integration.jar commons-fileupload-1.1.1.jar commons-beanutils-1.7.0.jar
            


            I think these are all the relevant MANIFEST.MF files where the JAXB jars have to be listed. Am I right?

            Why does JBoss prefer the old JAXB classes in jboss-j2ee.jar from the \jboss-4.0.4.GA\server\default\lib folder?




            • 3. Re: JBoss JAXB class loading problem
              Johannes Mueller Newbie

              Can anyone give me a hint how to force JBoss to use the JAXB (2.0) classes from the jars I deploy instead of using the outdated ones in

              jboss4.0.4/server/default/lib/jboss-j2ee.jar ?


              Thank you in advance for your help.

              • 4. Re: JBoss JAXB class loading problem
                Weston M. Price Master

                I assume you have the the <use-jboss-web-loader> set to true in your jboss-service.xml file of your Tomcat configuration correct? Also, do you really require a scoped log4j and commons-logging configuration? I would start with simply overriding the JAXB stuff and then add things you need as you go along.

                • 5. Re: JBoss JAXB class loading problem
                  mr662 Newbie

                  DerJohannes, were you able to get it working?If so, can you post your solution here.

                  I am in a silimiar situation where I need to use JAXB 2.0 with jboss 4.0.5, but in my case I am getting a classCastException

                  15:59:10,469 ERROR [STDERR] java.lang.ClassCastException: javax.xml.bind.JAXBElement
                  15:59:10,469 ERROR [STDERR] at com.covergence.enms.servlets.TemplateManagerServlet.updateTemplateConfig(TemplateManagerServlet.java:518)
                  15:59:10,469 ERROR [STDERR] at com.covergence.enms.servlets.TemplateManagerServlet.doPost(TemplateManagerServlet.java:183)
                  15:59:10,469 ERROR [STDERR] at com.covergence.enms.servlets.TemplateManagerServlet.doGet(TemplateManagerServlet.java:146)
                  15:59:10,469 ERROR [STDERR] at javax.servlet.http.HttpServlet.service(HttpServlet.java:697)
                  15:59:10,469 ERROR [STDERR] at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
                  15:59:10,484 ERROR [STDERR] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
                  15:59:10,500 ERROR [STDERR] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
                  15:59:10,500 ERROR [STDERR] at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
                  15:59:10,500 ERROR [STDERR] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
                  15:59:10,500 ERROR [STDERR] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
                  15:59:10,500 ERROR [STDERR] at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
                  15:59:10,500 ERROR [STDERR] at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
                  15:59:10,500 ERROR [STDERR] at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:175)
                  15:59:10,500 ERROR [STDERR] at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:524)
                  15:59:10,500 ERROR [STDERR] at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:74)
                  15:59:10,500 ERROR [STDERR] at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
                  15:59:10,500 ERROR [STDERR] at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
                  15:59:10,500 ERROR [STDERR] at org.jboss.web.tomcat.tc5.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:156)
                  15:59:10,500 ERROR [STDERR] at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
                  15:59:10,500 ERROR [STDERR] at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
                  15:59:10,500 ERROR [STDERR] at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
                  15:59:10,500 ERROR [STDERR] at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
                  15:59:10,500 ERROR [STDERR] at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
                  15:59:10,500 ERROR [STDERR] at org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorkerThread.java:112)
                  15:59:10,500 ERROR [STDERR] at java.lang.Thread.run(Thread.java:595)


                  This is what I have done so far

                  Included following JAXB jars with my EAR

                  jaxb-api.jar
                  jaxb-impl.jar



                  Added following to jboss-app.xml
                  <loader-repository> javax.xml.bind:loader=ENMSApp.ear
                   <loader-repository-config> java2ParentDelegation=false
                   </loader-repository-config>
                   </loader-repository>



                  Changed META-INF/MANIFEST.MF for my EJB JAR and WAR to include classpath. MANIFEST.MF now looks like the following for both:

                  Manifest-Version: 1.0
                  Ant-Version: Apache Ant 1.6.2
                  Created-By: 1.5.0_08-b03 (Sun Microsystems Inc.)
                  Class-Path: jaxb-api.jar jaxb-impl.jar



                  What am I missing? Why am I still getting classCastException?

                  I am sure many people have already solved this problem. Would really appreciate if somebody could post their solution here. Thanks.