2 Replies Latest reply on Aug 23, 2010 10:48 AM by Jessica Arnold

    class loader isolation in AS 6.0.0.M4 problem

    Jessica Arnold Newbie

      I am upgrading from JBoss 4.2.3 to 6.0.0.M4 and I am having issues getting my application to deploy.  I currently use Hibernate and Struts in my application and I am getting ClassCastException on the XML parsers that are included in my war file.  I have tried to isolate my war file by adding the following to jboss-web.xml:

       

      <class-loading>
          <loader-repository>
            net.idt:loader=IdtWebAppsLoader
            <loader-repository-config>java2ParentDelegation=false</loader-repository-config>
          </loader-repository>
        </class-loading>

       

      But I continue to get the folling exception:

       

      09:15:05,761 INFO  [STDOUT] Warning: Caught exception attempting to use SAX to load a SAX XMLReader
      09:15:05,762 INFO  [STDOUT] Warning: Exception was: java.lang.ClassCastException: org.apache.xerces.parsers.SAXParser cannot be cast to org.xml.sax.XMLReader
      09:15:05,762 INFO  [STDOUT] Warning: I will print the stack trace then carry on using the default SAX parser
      09:15:05,762 ERROR [STDERR] java.lang.ClassCastException: org.apache.xerces.parsers.SAXParser cannot be cast to org.xml.sax.XMLReader
      09:15:05,764 ERROR [STDERR]     at org.xml.sax.helpers.XMLReaderFactory.loadClass(Unknown Source)
      09:15:05,764 ERROR [STDERR]     at org.xml.sax.helpers.XMLReaderFactory.createXMLReader(Unknown Source)
      09:15:05,764 ERROR [STDERR]     at org.dom4j.io.SAXHelper.createXMLReader(SAXHelper.java:83)
      09:15:05,764 ERROR [STDERR]     at org.dom4j.io.SAXReader.createXMLReader(SAXReader.java:894)
      09:15:05,765 ERROR [STDERR]     at org.dom4j.io.SAXReader.getXMLReader(SAXReader.java:715)
      09:15:05,765 ERROR [STDERR]     at org.dom4j.io.SAXReader.read(SAXReader.java:435)
      09:15:05,765 ERROR [STDERR]     at org.hibernate.cfg.Configuration.doConfigure(Configuration.java:1484)
      09:15:05,765 ERROR [STDERR]     at org.hibernate.cfg.Configuration.configure(Configuration.java:1428)
      09:15:05,766 ERROR [STDERR]     at org.hibernate.cfg.Configuration.configure(Configuration.java:1414)
      09:15:05,766 ERROR [STDERR]     at net.idt.base.jutil.HibernateManager.<clinit>(HibernateManager.java:42)
      09:15:05,766 ERROR [STDERR]     at java.lang.Class.forName0(Native Method)
      09:15:05,766 ERROR [STDERR]     at java.lang.Class.forName(Class.java:186)
      09:15:05,767 ERROR [STDERR]     at net.idt.base.jutil.IdtInitServlet.init(IdtInitServlet.java:81)
      09:15:05,767 ERROR [STDERR]     at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1208)
      09:15:05,767 ERROR [STDERR]     at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:1108)
      09:15:05,768 ERROR [STDERR]     at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:3628)
      09:15:05,768 ERROR [STDERR]     at org.apache.catalina.core.StandardContext.start(StandardContext.java:3851)
      09:15:05,768 ERROR [STDERR]     at org.jboss.web.tomcat.service.deployers.TomcatDeployment.performDeployInternal(TomcatDeployment.java:310)
      09:15:05,768 ERROR [STDERR]     at org.jboss.web.tomcat.service.deployers.TomcatDeployment.performDeploy(TomcatDeployment.java:145)
      09:15:05,768 ERROR [STDERR]     at org.jboss.web.deployers.AbstractWarDeployment.start(AbstractWarDeployment.java:461)
      09:15:05,769 ERROR [STDERR]     at org.jboss.web.deployers.WebModule.startModule(WebModule.java:116)
      09:15:05,769 ERROR [STDERR]     at org.jboss.web.deployers.WebModule.start(WebModule.java:95)
      09:15:05,769 ERROR [STDERR]     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      09:15:05,769 ERROR [STDERR]     at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
      09:15:05,770 ERROR [STDERR]     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

      09:15:05,770 ERROR [STDERR]     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      09:15:05,770 ERROR [STDERR]     at java.lang.reflect.Method.invoke(Method.java:616)
      09:15:05,770 ERROR [STDERR]     at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:157)
      09:15:05,770 ERROR [STDERR]     at org.jboss.mx.server.Invocation.dispatch(Invocation.java:96)
      09:15:05,770 ERROR [STDERR]     at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
      09:15:05,771 ERROR [STDERR]     at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:271)
      09:15:05,771 ERROR [STDERR]     at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:670)
      09:15:05,771 ERROR [STDERR]     at org.jboss.system.microcontainer.ServiceProxy.invoke(ServiceProxy.java:206)
      09:15:05,771 ERROR [STDERR]     at $Proxy41.start(Unknown Source)
      09:15:05,772 ERROR [STDERR]     at org.jboss.system.microcontainer.StartStopLifecycleAction.installAction(StartStopLifecycleAction.java:53)
      09:15:05,772 ERROR [STDERR]     at org.jboss.system.microcontainer.StartStopLifecycleAction.installAction(StartStopLifecycleAction.java:41)
      09:15:05,772 ERROR [STDERR]     at org.jboss.dependency.plugins.action.SimpleControllerContextAction.simpleInstallAction(SimpleControllerContextAction.java:62)
      09:15:05,772 ERROR [STDERR]     at org.jboss.dependency.plugins.action.AccessControllerContextAction.install(AccessControllerContextAction.java:71)
      09:15:05,773 ERROR [STDERR]     at org.jboss.dependency.plugins.AbstractControllerContextActions.install(AbstractControllerContextActions.java:51)
      09:15:05,773 ERROR [STDERR]     at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:379)
      09:15:05,773 ERROR [STDERR]     at org.jboss.system.microcontainer.ServiceControllerContext.install(ServiceControllerContext.java:301)
      09:15:05,773 ERROR [STDERR]     at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:2044)
      09:15:05,773 ERROR [STDERR]     at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:1083)
      09:15:05,774 ERROR [STDERR]     at org.jboss.dependency.plugins.AbstractController.executeOrIncrementStateDirectly(AbstractController.java:1322)
      09:15:05,774 ERROR [STDERR]     at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1246)
      09:15:05,774 ERROR [STDERR]     at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1139)
      09:15:05,774 ERROR [STDERR]     at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:939)
      09:15:05,775 ERROR [STDERR]     at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:654)
      09:15:05,775 ERROR [STDERR]     at org.jboss.system.ServiceController.doChange(ServiceController.java:671)
      09:15:05,775 ERROR [STDERR]     at org.jboss.system.ServiceController.start(ServiceController.java:443)
      09:15:05,775 ERROR [STDERR]     at org.jboss.system.deployers.ServiceDeployer.start(ServiceDeployer.java:189)
      09:15:05,776 ERROR [STDERR]     at org.jboss.system.deployers.ServiceDeployer.deploy(ServiceDeployer.java:102)
      09:15:05,776 ERROR [STDERR]     at org.jboss.system.deployers.ServiceDeployer.deploy(ServiceDeployer.java:49)
      09:15:05,776 ERROR [STDERR]     at org.jboss.deployers.spi.deployer.helpers.AbstractSimpleRealDeployer.internalDeploy(AbstractSimpleRealDeployer.java:62)
      09:15:05,776 ERROR [STDERR]     at org.jboss.deployers.spi.deployer.helpers.AbstractRealDeployer.deploy(AbstractRealDeployer.java:55)
      09:15:05,777 ERROR [STDERR]     at org.jboss.deployers.plugins.deployers.DeployerWrapper.deploy(DeployerWrapper.java:179)
      09:15:05,777 ERROR [STDERR]     at org.jboss.deployers.plugins.deployers.DeployersImpl.doDeploy(DeployersImpl.java:1832)
      09:15:05,777 ERROR [STDERR]     at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:1550)
      09:15:05,777 ERROR [STDERR]     at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:1571)
      09:15:05,778 ERROR [STDERR]     at org.jboss.deployers.plugins.deployers.DeployersImpl.install(DeployersImpl.java:1491)
      09:15:05,778 ERROR [STDERR]     at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:379)
      09:15:05,778 ERROR [STDERR]     at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:2044)
      09:15:05,778 ERROR [STDERR]     at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:1083)
      09:15:05,779 ERROR [STDERR]     at org.jboss.dependency.plugins.AbstractController.executeOrIncrementStateDirectly(AbstractController.java:1322)
      09:15:05,779 ERROR [STDERR]     at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1246)
      09:15:05,779 ERROR [STDERR]     at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1139)
      09:15:05,779 ERROR [STDERR]     at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:939)

      09:15:05,779 ERROR [STDERR]     at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:939)
      09:15:05,779 ERROR [STDERR]     at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:654)
      09:15:05,780 ERROR [STDERR]     at org.jboss.deployers.plugins.deployers.DeployersImpl.change(DeployersImpl.java:1983)
      09:15:05,780 ERROR [STDERR]     at org.jboss.deployers.plugins.deployers.DeployersImpl.process(DeployersImpl.java:1076)
      09:15:05,780 ERROR [STDERR]     at org.jboss.deployers.plugins.main.MainDeployerImpl.process(MainDeployerImpl.java:679)
      09:15:05,780 ERROR [STDERR]     at org.jboss.system.server.profileservice.deployers.MainDeployerPlugin.process(MainDeployerPlugin.java:106)
      09:15:05,781 ERROR [STDERR]     at org.jboss.profileservice.dependency.ProfileControllerContext$DelegateDeployer.process(ProfileControllerContext.java:130)
      09:15:05,781 ERROR [STDERR]     at org.jboss.profileservice.deployment.hotdeploy.HDScanner$HDScanAction.deploy(HDScanner.java:240)
      09:15:05,781 ERROR [STDERR]     at org.jboss.profileservice.deployment.hotdeploy.HDScanner$HDScanAction.complete(HDScanner.java:192)
      09:15:05,781 ERROR [STDERR]     at org.jboss.profileservice.management.TwoPCActionWrapper.doComplete(TwoPCActionWrapper.java:59)
      09:15:05,782 ERROR [STDERR]     at org.jboss.profileservice.management.actions.AbstractTwoPhaseModificationAction.complete(AbstractTwoPhaseModificationAction.java:74)
      09:15:05,782 ERROR [STDERR]     at org.jboss.profileservice.management.actions.AbstractTwoPhaseModificationAction.prepare(AbstractTwoPhaseModificationAction.java:94)
      09:15:05,782 ERROR [STDERR]     at org.jboss.profileservice.management.ModificationSession.prepare(ModificationSession.java:87)
      09:15:05,782 ERROR [STDERR]     at org.jboss.profileservice.management.AbstractActionController.internalPerfom(AbstractActionController.java:234)
      09:15:05,783 ERROR [STDERR]     at org.jboss.profileservice.management.AbstractActionController.performWrite(AbstractActionController.java:213)
      09:15:05,783 ERROR [STDERR]     at org.jboss.profileservice.management.AbstractActionController.perform(AbstractActionController.java:150)
      09:15:05,783 ERROR [STDERR]     at org.jboss.profileservice.management.AbstractActionController.perform(AbstractActionController.java:135)
      09:15:05,783 ERROR [STDERR]     at org.jboss.profileservice.deployment.hotdeploy.HDScanner.scan(HDScanner.java:146)
      09:15:05,784 ERROR [STDERR]     at org.jboss.profileservice.deployment.hotdeploy.HDScanner.run(HDScanner.java:90)
      09:15:05,784 ERROR [STDERR]     at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
      09:15:05,784 ERROR [STDERR]     at java.util.concurrent.FutureTask$Sync.innerRunAndReset(FutureTask.java:351)
      09:15:05,784 ERROR [STDERR]     at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:178)
      09:15:05,785 ERROR [STDERR]     at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:165)
      09:15:05,785 ERROR [STDERR]     at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:267)
      09:15:05,785 ERROR [STDERR]     at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
      09:15:05,785 ERROR [STDERR]     at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
      09:15:05,785 ERROR [STDERR]     at java.lang.Thread.run(Thread.java:636)

       

      This particular error is occuring when we try to parse the hibernate.cfg.xml file.  Both Hibernate and Struts load xml-apis as transitive dependecies which seems to be conflicting with the JBoss XML parser.  If I remove Hibernate from my war then I get a similar error loading Struts.  Is there a way to get the class loader isloation to work so I don't have to remove the jar file dependencies from my war file?

       

      Thanks,

      Jessica