6 Replies Latest reply on Oct 29, 2010 4:31 PM by Gnanasekaran Sakthivel

    Delpoyment exception on JBoss5.1, used to work fine on 4.0.3

    Gnanasekaran Sakthivel Newbie

      Hi

       

      JBoss5.1 AS, JDK 1.6.0_22

       

      Initially got this exception:

      org.apache.xerces.parsers.XML11Configuration cannot be cast to org.apache.xerces.xni.parser.XMLParserConfiguration

       

      On my classpath, here are the JARs where I could find these class files:

      Class - org.apache.xerces.parsers.XML11Configuration; Found at the following places
      C:/jboss-5.1.0.GA/server/default/deploy/MY_PROJECT.ear/MY_PROJECTWeb.war/WEB-INF/lib/xerces-2.4.0.jar
      C:/jboss-5.1.0.GA/server/default/deploy/MY_PROJECT.ear/MY_PROJECTWeb.war/WEB-INF/lib/xercesImpl.jar
      C:/jboss-5.1.0.GA/lib/endorsed/xercesImpl.jar

       

      Class - org.apache.xerces.xni.parser.XMLParserConfiguration; Found at the following places
      C:/jboss-5.1.0.GA/server/default/deploy/MY_PROJECT.ear/MY_PROJECTWeb.war/WEB-INF/lib/xerces-2.4.0.jar
      C:/jboss-5.1.0.GA/lib/endorsed/xercesImpl.jar
      C:/jboss-5.1.0.GA/server/default/deploy/MY_PROJECT.ear/MY_PROJECTWeb.war/WEB-INF/lib/xercesImpl.jar

       

      I thought I had to remove xerces-2.4.0.jar and xercesImpl.jar from my project web-inf lib. I did so.

       

      Then I ended up in the following error:

      Caused by: java.lang.ClassCastException: org.apache.xerces.jaxp.DocumentBuilderFactoryImpl cannot be cast to javax.xml.parsers.DocumentBuilderFactory

       

      Class - javax.xml.parsers.DocumentBuilderFactory; Found at:

      C:/jboss-5.1.0.GA/server/default/deploy/MY_PROJECT.ear/MY_PROJECTWeb.war/WEB-INF/lib/xml-apis.jar

      C:/jboss-5.1.0.GA/server/default/deploy/MY_PROJECT.ear/MY_PROJECTWeb.war/WEB-INF/lib/xml-apis-1.0.b2.jar

      C:/jboss-5.1.0.GA/server/default/deploy/MY_PROJECT.ear/MY_PROJECTWeb.war/WEB-INF/lib/xml-apis-1.3.04.jar

      C:/jboss-5.1.0.GA/server/default/deploy/MY_PROJECT.ear/MY_PROJECTWeb.war/WEB-INF/lib/xmlParserAPIs.jar

      C:/Program Files/Java/jdk1.6.0_22/jre/lib/rt.jar

       

      Class - org.apache.xerces.jaxp.DocumentBuilderFactoryImpl; Found at:

      C:/jboss-5.1.0.GA/lib/endorsed/xercesImpl.jar

      C:/Program Files/Java/jdk1.6.0_22/jre/lib/rt.jar

       

      I removed xml-apis*.jar and xmlParserAPIs.jar from my project web-inf lib. I am not sure if I have to do this. Please advise.

       

      Now I am having this error:

      java.lang.LinkageError: loader constraint violation: when resolving method
      "javax.xml.parsers.DocumentBuilder.setErrorHandler(Lorg/xml/sax/ErrorHandler;)V"
      the class loader (instance of org/jboss/classloader/spi/base/BaseClassLoader)
      of the current class, org/apache/log4j/xml/DOMConfigurator, and the
      class loader (instance of <bootloader>) for resolved class, javax/xml/parsers/DocumentBuilder,
      have different Class objects for the type org/xml/sax/ErrorHandler used in the signature

       

      Please let me know if there is any further information necessary. It looks like log4j refers some XML parsing class.

      Thanks for your help

       

      I am attaching my JBossServer Console Log as a text file.

        • 1. Re: Delpoyment exception on JBoss5.1, used to work fine on 4.0.3
          Wolf-Dieter Fink Master

          Looks like a version conflict between JBoss and your app.

           

          I see two options to solve the problem.

          Refactor the application and use the same version of xerces as JBoss.

          Or separate your application from the JBoss libraries with a special load-repository (element of the EAR deployment descriptor).

          But I'm not sure ATM whether this separate from endorsed libraries.

          1 of 1 people found this helpful
          • 2. Re: Delpoyment exception on JBoss5.1, used to work fine on 4.0.3
            Gnanasekaran Sakthivel Newbie

            Thanks Wolf-Dieter

            I do not know if I understood what you meant by refactor... however, this is what I did. Let me know if I am on the wrong direction.

             

            I removed xerces*.jar from my project webinf lib. Then I added C:/jboss-5.1.0.GA/lib/endorsed/xercesImpl.jar to the build path and recompiled the EAR.

            So I do not have xercesImpl.jar anywhere else in my project folder. As a matter of fact, C:/jboss-5.1.0.GA/lib/endorsed is the only location I have xercesImpl.jar.

             

            I have included my server.log extract and boot.log.

             

            Still I am getting this error again (could indicate something else). This is my server.log extract:

            ------------------------------------------------

            2010-10-27 12:06:20,163 ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[localhost].[/MY_PROJECT]] (main) Error configuring application listener of class com.sa.v4.application.ContextListener
            java.lang.ExceptionInInitializerError
                at org.apache.log4j.Category.getInstance(Category.java:514)
                at com.sa.v4.application.ContextListener.<init>(ContextListener.java:26)
                at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
                at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
                at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
                at java.lang.reflect.Constructor.newInstance(Constructor.java:501)
                at java.lang.Class.newInstance0(Class.java:350)
                at java.lang.Class.newInstance(Class.java:303)
                at org.jboss.web.tomcat.service.TomcatInjectionContainer.newInstance(TomcatInjectionContainer.java:264)
                at org.jboss.web.tomcat.service.TomcatInjectionContainer.newInstance(TomcatInjectionContainer.java:256)
                at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3859)
                at org.apache.catalina.core.StandardContext.start(StandardContext.java:4393)
                at org.jboss.web.tomcat.service.deployers.TomcatDeployment.performDeployInternal(TomcatDeployment.java:310)
                at org.jboss.web.tomcat.service.deployers.TomcatDeployment.performDeploy(TomcatDeployment.java:142)
                at org.jboss.web.deployers.AbstractWarDeployment.start(AbstractWarDeployment.java:461)
                at org.jboss.web.deployers.WebModule.startModule(WebModule.java:118)
                at org.jboss.web.deployers.WebModule.start(WebModule.java:97)
                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:592)
                at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:157)
                at org.jboss.mx.server.Invocation.dispatch(Invocation.java:96)
                at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
                at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
                at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:668)
                at org.jboss.system.microcontainer.ServiceProxy.invoke(ServiceProxy.java:206)
                at $Proxy38.start(Unknown Source)
                at org.jboss.system.microcontainer.StartStopLifecycleAction.installAction(StartStopLifecycleAction.java:42)
                at org.jboss.system.microcontainer.StartStopLifecycleAction.installAction(StartStopLifecycleAction.java:37)
                at org.jboss.dependency.plugins.action.SimpleControllerContextAction.simpleInstallAction(SimpleControllerContextAction.java:62)
                at org.jboss.dependency.plugins.action.AccessControllerContextAction.install(AccessControllerContextAction.java:71)
                at org.jboss.dependency.plugins.AbstractControllerContextActions.install(AbstractControllerContextActions.java:51)
                at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:348)
                at org.jboss.system.microcontainer.ServiceControllerContext.install(ServiceControllerContext.java:286)
                at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:1631)
                at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:934)
                at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1082)
                at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:984)
                at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:822)
                at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:553)
                at org.jboss.system.ServiceController.doChange(ServiceController.java:688)
                at org.jboss.system.ServiceController.start(ServiceController.java:460)
                at org.jboss.system.deployers.ServiceDeployer.start(ServiceDeployer.java:163)
                at org.jboss.system.deployers.ServiceDeployer.deploy(ServiceDeployer.java:99)
                at org.jboss.system.deployers.ServiceDeployer.deploy(ServiceDeployer.java:46)
                at org.jboss.deployers.spi.deployer.helpers.AbstractSimpleRealDeployer.internalDeploy(AbstractSimpleRealDeployer.java:62)
                at org.jboss.deployers.spi.deployer.helpers.AbstractRealDeployer.deploy(AbstractRealDeployer.java:50)
                at org.jboss.deployers.plugins.deployers.DeployerWrapper.deploy(DeployerWrapper.java:171)
                at org.jboss.deployers.plugins.deployers.DeployersImpl.doDeploy(DeployersImpl.java:1439)
                at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:1157)
                at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:1178)
                at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:1210)
                at org.jboss.deployers.plugins.deployers.DeployersImpl.install(DeployersImpl.java:1098)
                at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:348)
                at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:1631)
                at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:934)
                at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1082)
                at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:984)
                at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:822)
                at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:553)
                at org.jboss.deployers.plugins.deployers.DeployersImpl.process(DeployersImpl.java:781)
                at org.jboss.deployers.plugins.main.MainDeployerImpl.process(MainDeployerImpl.java:702)
                at org.jboss.system.server.profileservice.repository.MainDeployerAdapter.process(MainDeployerAdapter.java:117)
                at org.jboss.system.server.profileservice.repository.ProfileDeployAction.install(ProfileDeployAction.java:70)
                at org.jboss.system.server.profileservice.repository.AbstractProfileAction.install(AbstractProfileAction.java:53)
                at org.jboss.system.server.profileservice.repository.AbstractProfileService.install(AbstractProfileService.java:361)
                at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:348)
                at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:1631)
                at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:934)
                at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1082)
                at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:984)
                at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:822)
                at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:553)
                at org.jboss.system.server.profileservice.repository.AbstractProfileService.activateProfile(AbstractProfileService.java:306)
                at org.jboss.system.server.profileservice.ProfileServiceBootstrap.start(ProfileServiceBootstrap.java:271)
                at org.jboss.bootstrap.AbstractServerImpl.start(AbstractServerImpl.java:461)
                at org.jboss.Main.boot(Main.java:221)
                at org.jboss.Main$1.run(Main.java:556)
                at java.lang.Thread.run(Thread.java:595)
            Caused by: java.lang.ClassCastException: org.apache.xerces.jaxp.DocumentBuilderFactoryImpl
                at javax.xml.parsers.DocumentBuilderFactory.newInstance(Unknown Source)
                at org.apache.log4j.xml.DOMConfigurator.doConfigure(DOMConfigurator.java:644)
                at org.apache.log4j.xml.DOMConfigurator.doConfigure(DOMConfigurator.java:616)
                at org.apache.log4j.xml.DOMConfigurator.doConfigure(DOMConfigurator.java:602)
                at org.apache.log4j.helpers.OptionConverter.selectAndConfigure(OptionConverter.java:460)
                at org.apache.log4j.LogManager.<clinit>(LogManager.java:113)
                ... 80 more
            2010-10-27 12:06:20,226 ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[localhost].[/MY_PROJECT]] (main) Skipped installing application listeners due to previous error(s)
            2010-10-27 12:06:20,241 ERROR [org.apache.catalina.core.StandardContext] (main) Error listenerStart
            2010-10-27 12:06:20,241 ERROR [org.apache.catalina.core.StandardContext] (main) Context [/MY_PROJECT] startup failed due to previous errors
            2010-10-27 12:06:20,241 ERROR [org.jboss.kernel.plugins.dependency.AbstractKernelController] (main) Error installing to Start: name=jboss.web.deployment:war=/MY_PROJECT state=Create mode=Manual requiredState=Installed

             

             

            Following is JBoss AS boot.log (I see some smoke)

             

             

            ------------------------------------------------------------------

            12:00:09,534 INFO  [ServerImpl] Starting JBoss (Microcontainer)...

            12:00:09,596 INFO  [ServerImpl] Release ID: JBoss [The Oracle] 5.1.0.GA (build: SVNTag=JBoss_5_1_0_GA date=200905221053)

            12:00:09,596 DEBUG [ServerImpl] Using config: org.jboss.bootstrap.BaseServerConfig@6f7ce9

            12:00:09,596 DEBUG [ServerImpl] Server type: class org.jboss.bootstrap.microcontainer.ServerImpl

            12:00:09,596 DEBUG [ServerImpl] Server loaded through: org.jboss.bootstrap.NoAnnotationURLClassLoader

            [org.jboss.aop.microcontainer.beans.metadata.AOPDeployment]}


            12:00:50,456 DEBUG [DeployersImpl] Added deployer org.jboss.aop.asintegration.jboss5.AOPClassLoaderDeployer@1a01e8a for stage ClassLoader

            org.jboss.aop.asintegration.jboss5.AOPClassLoaderDeployer@1a01e8a{inputs=[java.lang.ClassLoader] outputs=[]}


            12:00:50,550 DEBUG [DeployersImpl] Added deployer org.jboss.aop.asintegration.jboss5.AOPDeploymentAopMetaDataDeployer@11b50a1 for stage PostClassLoader

            org.jboss.aop.asintegration.jboss5.AOPDeploymentAopMetaDataDeployer@11b50a1{inputs=[org.jboss.aop.microcontainer.beans.metadata.AOPDeployment] outputs=[org.jboss.aop.asintegration.jboss5.AopMetaDataDeployerOutput]}


            12:00:50,643 DEBUG [DeployersImpl] Added deployer org.jboss.aop.asintegration.jboss5.BeansDeploymentAopMetaDataDeployer@1ebf4ff for stage PostClassLoader

            org.jboss.aop.asintegration.jboss5.AOPDeploymentAopMetaDataDeployer@11b50a1{inputs=[org.jboss.aop.microcontainer.beans.metadata.AOPDeployment] outputs=[org.jboss.aop.asintegration.jboss5.AopMetaDataDeployerOutput]}

            org.jboss.aop.asintegration.jboss5.BeansDeploymentAopMetaDataDeployer@1ebf4ff{inputs=[org.jboss.kernel.spi.deployment.KernelDeployment] outputs=[org.jboss.aop.asintegration.jboss5.AopMetaDataDeployerOutput]}


            12:00:55,925 DEBUG [ProfileServiceBootstrap] Created ManagedComponent(jboss.system:type=ServerInfo) of type: ComponentType{type=MCBean, subtype=ServerInfo} for MO: jboss.system:type=ServerInfo, componentName: jboss.system:type=ServerInfo

            12:00:55,925 DEBUG [ProfileServiceBootstrap] Created ManagedComponent(AspectManagerJMXRegistrar) of type: ComponentType{type=MCBean, subtype=*} for MO: AspectManagerJMXRegistrar, componentName: AspectManagerJMXRegistrar

            12:00:55,925 DEBUG [ProfileServiceBootstrap] Created ManagedComponent(JMXCreateDestroyAdvice) of type: ComponentType{type=MCBean, subtype=*} for MO: JMXCreateDestroyAdvice, componentName: JMXCreateDestroyAdvice

            12:00:55,925 DEBUG [ProfileServiceBootstrap] Created ManagedComponent(jmx-classloader:0.0.0) of type: ComponentType{type=MCBean, subtype=*} for MO: jmx-classloader:0.0.0, componentName: jmx-classloader:0.0.0

            12:00:55,925 DEBUG [ProfileServiceBootstrap] Created ManagedComponent(JMXCreateDestroyAdvice$AspectBinding) of type: ComponentType{type=MCBean, subtype=*} for MO: JMXCreateDestroyAdvice$AspectBinding, componentName: JMXCreateDestroyAdvice$AspectBinding

            12:00:55,925 DEBUG [ProfileServiceBootstrap] Created ManagedComponent(JMXRegistrationAdvice) of type: ComponentType{type=MCBean, subtype=*} for MO: JMXRegistrationAdvice, componentName: JMXRegistrationAdvice

            12:00:55,925 DEBUG [AbstractDeploymentContext] Added component LogBridgeHandler to file:/C:/jboss-5.1.0.GA/server/default/conf/bootstrap/logging.xml

            12:00:55,925 DEBUG [ProfileServiceBootstrap] Failed to build ManagedDeployment for: AbstractKernelDeployment@4218cb{name=file:/C:/jboss-5.1.0.GA/server/default/conf/bootstrap/logging.xml installed=true beanFactories=[AbstractBeanMetaData@169c6f2{name=LogBridgeHandler bean=org.jboss.logbridge.LogBridgeHandler properties= constructor=null autowireCandidate=true}]}

            org.jboss.deployers.spi.DeploymentException: Error deploying: file:/C:/jboss-5.1.0.GA/server/default/conf/bootstrap/logging.xml

                at org.jboss.deployers.spi.DeploymentException.rethrowAsDeploymentException(DeploymentException.java:49)

                at org.jboss.deployers.vfs.deployer.kernel.BeanMetaDataFactoryVisitor.deploy(BeanMetaDataFactoryVisitor.java:136)

                at org.jboss.system.server.profileservice.ProfileServiceBootstrap.initBootstrapMDs(ProfileServiceBootstrap.java:433)

                at org.jboss.system.server.profileservice.ProfileServiceBootstrap.start(ProfileServiceBootstrap.java:250)

                at org.jboss.bootstrap.AbstractServerImpl.start(AbstractServerImpl.java:461)

                at org.jboss.Main.boot(Main.java:221)

                at org.jboss.Main$1.run(Main.java:556)

                at java.lang.Thread.run(Thread.java:595)

            Caused by: java.lang.IllegalStateException: ClassLoader has not been set

                at org.jboss.deployers.structure.spi.helpers.AbstractDeploymentUnit.getClassLoader(AbstractDeploymentUnit.java:154)

                at org.jboss.deployers.vfs.deployer.kernel.BeanMetaDataFactoryVisitor.addBeanComponent(BeanMetaDataFactoryVisitor.java:60)

                at org.jboss.deployers.vfs.deployer.kernel.BeanMetaDataFactoryVisitor.deploy(BeanMetaDataFactoryVisitor.java:126)

                ... 6 more

            12:00:55,925 DEBUG [AbstractDeploymentContext] Added component VFSCache$realCache#1 to file:/C:/jboss-5.1.0.GA/server/default/conf/bootstrap/vfs.xml

            12:00:55,925 DEBUG [ProfileServiceBootstrap] Failed to build ManagedDeployment for: AbstractKernelDeployment@c791f4{name=file:/C:/jboss-5.1.0.GA/server/default/conf/bootstrap/vfs.xml installed=true beanFactories=[AbstractBeanMetaData@3f58bb{name=VFSCache bean=null properties=[realCache, permanentRoots] constructor=AbstractConstructorMetaData@167e3a5{parameters=[null] factoryClass=org.jboss.virtual.spi.cache.VFSCacheFactory factoryMethod=getInstance} autowireCandidate=true start=AbstractLifecycleMetaData@1926e90{ whenRequired=ControllerState@da9067{Start} parameters= }}, AbstractBeanMetaData@13e9934{name=VfsNamesExceptionHandler bean=org.jboss.virtual.plugins.context.helpers.NamesExceptionHandler properties= constructor=AbstractConstructorMetaData@bc36ff{parameters=[java.lang.String]} autowireCandidate=true}]}

            org.jboss.deployers.spi.DeploymentException: Error deploying: file:/C:/jboss-5.1.0.GA/server/default/conf/bootstrap/vfs.xml

                at org.jboss.deployers.spi.DeploymentException.rethrowAsDeploymentException(DeploymentException.java:49)

                at org.jboss.deployers.vfs.deployer.kernel.BeanMetaDataFactoryVisitor.deploy(BeanMetaDataFactoryVisitor.java:136)

                at org.jboss.system.server.profileservice.ProfileServiceBootstrap.initBootstrapMDs(ProfileServiceBootstrap.java:433)

                at org.jboss.system.server.profileservice.ProfileServiceBootstrap.start(ProfileServiceBootstrap.java:250)

                at org.jboss.bootstrap.AbstractServerImpl.start(AbstractServerImpl.java:461)

                at org.jboss.Main.boot(Main.java:221)

                at org.jboss.Main$1.run(Main.java:556)

                at java.lang.Thread.run(Thread.java:595)

            Caused by: java.lang.IllegalStateException: ClassLoader has not been set

                at org.jboss.deployers.structure.spi.helpers.AbstractDeploymentUnit.getClassLoader(AbstractDeploymentUnit.java:154)

                at org.jboss.deployers.vfs.deployer.kernel.BeanMetaDataFactoryVisitor.addBeanComponent(BeanMetaDataFactoryVisitor.java:60)

                at org.jboss.deployers.vfs.deployer.kernel.BeanMetaDataFactoryVisitor.deploy(BeanMetaDataFactoryVisitor.java:126)

                ... 6 more

            12:00:55,925 DEBUG [AbstractDeploymentContext] Added component aop-classloader:0.0.0 to file:/C:/jboss-5.1.0.GA/server/default/conf/bootstrap/aop.xml

            12:00:55,925 DEBUG [AbstractDeploymentContext] Added component aop-classloader:0.0.0$MODULE to file:/C:/jboss-5.1.0.GA/server/default/conf/bootstrap/aop.xml

            12:00:55,925 DEBUG [AbstractDeploymentContext] Added component AOPClassLoaderScopingPolicy to file:/C:/jboss-5.1.0.GA/server/default/conf/bootstrap/aop.xml

            12:00:55,925 DEBUG [AbstractDeploymentContext] Added component AOPClassPoolFactory to file:/C:/jboss-5.1.0.GA/server/default/conf/bootstrap/aop.xml

            12:00:55,925 DEBUG [AbstractDeploymentContext] Added component AOPJBossIntegration to file:/C:/jboss-5.1.0.GA/server/default/conf/bootstrap/aop.xml

            12:00:55,925 DEBUG [AbstractDeploymentContext] Added component LogBridgeHandler to file:/C:/jboss-5.1.0.GA/server/default/conf/bootstrap/logging.xml
            12:00:55,925 DEBUG [ProfileServiceBootstrap] Failed to build ManagedDeployment for: AbstractKernelDeployment@4218cb{name=file:/C:/jboss-5.1.0.GA/server/default/conf/bootstrap/logging.xml installed=true beanFactories=[AbstractBeanMetaData@169c6f2{name=LogBridgeHandler bean=org.jboss.logbridge.LogBridgeHandler properties= constructor=null autowireCandidate=true}]}
            org.jboss.deployers.spi.DeploymentException: Error deploying: file:/C:/jboss-5.1.0.GA/server/default/conf/bootstrap/logging.xml
                at org.jboss.deployers.spi.DeploymentException.rethrowAsDeploymentException(DeploymentException.java:49)
                at org.jboss.deployers.vfs.deployer.kernel.BeanMetaDataFactoryVisitor.deploy(BeanMetaDataFactoryVisitor.java:136)
                at org.jboss.system.server.profileservice.ProfileServiceBootstrap.initBootstrapMDs(ProfileServiceBootstrap.java:433)
                at org.jboss.system.server.profileservice.ProfileServiceBootstrap.start(ProfileServiceBootstrap.java:250)
                at org.jboss.bootstrap.AbstractServerImpl.start(AbstractServerImpl.java:461)
                at org.jboss.Main.boot(Main.java:221)
                at org.jboss.Main$1.run(Main.java:556)
                at java.lang.Thread.run(Thread.java:595)
            Caused by: java.lang.IllegalStateException: ClassLoader has not been set
                at org.jboss.deployers.structure.spi.helpers.AbstractDeploymentUnit.getClassLoader(AbstractDeploymentUnit.java:154)
                at org.jboss.deployers.vfs.deployer.kernel.BeanMetaDataFactoryVisitor.addBeanComponent(BeanMetaDataFactoryVisitor.java:60)
                at org.jboss.deployers.vfs.deployer.kernel.BeanMetaDataFactoryVisitor.deploy(BeanMetaDataFactoryVisitor.java:126)
                ... 6 more
            12:00:55,925 DEBUG [AbstractDeploymentContext] Added component VFSCache$realCache#1 to file:/C:/jboss-5.1.0.GA/server/default/conf/bootstrap/vfs.xml
            12:00:55,925 DEBUG [ProfileServiceBootstrap] Failed to build ManagedDeployment for: AbstractKernelDeployment@c791f4{name=file:/C:/jboss-5

             

            -----------------------------------------------------------------------------------------------------

            • 3. Re: Delpoyment exception on JBoss5.1, used to work fine on 4.0.3
              Gnanasekaran Sakthivel Newbie

              Hi,

               

              To revisit what has happened so far, my Project EAR had the following JARS packaged:

              xerces-2.4.0.jar, xercesImpl.jar, xml-apis-1.0.b2.jar, xml-apis-1.3.04.jar, xml-apis.jar, xmlParserAPIs.jar, log4j-1.2.8.jar, log4j.jar, sax2.jar, pullparser.jar.

               

              The reason I am listing these out is - I ended up removing all these because of ClassCastExceptions.

               

              Now, I am glad JBoss 5 AS, on startup, stepped more forward after all these "removals".

              We had not upgraded since JBoss 4.0.3 which could be 5 years or I do not know if JBoss 5 had gone through huge huge changes.

               

              I think I am still not completely clear on interpreting the link between  removal of JARs to the classes mentioned in the ClassCastException.  Because, when I removed sax2.jar and pullparser.jar, the Exception that I  had, had some Class names that are not in these packages. Can anyone  explain this? I might be on a similar situation below... please you may  want to read on further before answering...

               

              However, my project is still NOT deployed successfully. I am including this exception and details:

               

              10:04:22,920 INFO  [ServiceLocator]  Entering ServiceLocator

              10:04:23,076 SEVERE [ServiceLocator]  Error while initializing ServiceLocator :javax.naming.NoInitialContextException:

              Cannot instantiate class:  org.jnp.interfaces.NamingContextFactory

              [Root exception is  java.lang.ClassCastException: org.jnp.interfaces.NamingContextFactory cannot be  cast to javax.naming.spi.InitialContextFactory]

              10:04:23,076 INFO  [ServiceLocator]  Exiting ServiceLocator

              10:04:23,076 INFO  [ServiceLocator]  Entering ServiceLocator.getDataSource()

               

              Ok, this seems to happen when JBoss AS is trying to lookup for datasource through JNDI.

              On this exception I have two classes mentioned: org.jnp.interfaces.NamingContextFactory CANNOT BE CAST TO javax.naming.spi.InitialContextFactory.

               

              With this information, assuming we have some more JARS packaged in our EAR, how am I going to locate the JAR in question. Please advice.

               

              However, I did search for these class files on all the JARs (of my JBossAS and JDK together)... Here is the results.

              The Class org.jnp.interfaces.NamingContextFactory is available in the following JARs:

              C:/jboss-5.1.0.GA/server/all/deploy/management/console-mgr.sar/web-console.war/applet.jar

              C:/jboss-5.1.0.GA/common/lib/jnpserver.jar

              C:/jboss-5.1.0.GA/server/default/deploy/management/console-mgr.sar/web-console.war/applet.jar

              C:/jboss-5.1.0.GA/server/minimal/lib/jnpserver.jar

              C:/jboss-5.1.0.GA/client/jnp-client.jar

              C:/jboss-5.1.0.GA/client/jbossjmx-ant.jar

               

              Similarly, the Class javax.naming.spi.InitialContextFactory is available in the following JARs:

              C:/jboss-5.1.0.GA/server/default/deploy/mlo.ear/mloWeb.war/WEB-INF/lib/easj2ee.jar

              C:/Program  Files/Java/jdk1.5.0_22/jre/lib/rt.jar

               

              This does not seem to give me any location in my project folder. Can someone help me please in getting past this Exception?

              Please ask me if you need to see the whole log file. Can I use jmx-console or some admin tool to track this down?

              • 4. Re: Delpoyment exception on JBoss5.1, used to work fine on 4.0.3
                Wolf-Dieter Fink Master

                Do you compile your application with some JBoss4.0 libs?

                I suppose that you use the InitialContextx in your code.

                • 5. Re: Delpoyment exception on JBoss5.1, used to work fine on 4.0.3
                  Gnanasekaran Sakthivel Newbie

                  Thanks Wolf-Dieter,

                   

                  I believe I recompiled/built my EAR in JBossAS 5 environment.  My build path does not contain any reference to JBoss 4 environment, because on this machine I do not have JBoss 4.x. I checked out the project fresh and clean/build using Eclipse. So we rule out this possibility.

                   

                  About InitialContext

                   

                  Yeah, in my project, I have reference to InitialContext in quiet a number of places.. For example..

                   

                  We use Ibatis for most of our database transactions. On Ibatis, SqlMapConfig.xml is used to mention about the connection.

                   

                  <transactionManager type="JDBC">

                      <dataSource type="JNDI">

                        <property name="DataSource" value="java:comp/env/MYPROJECT_DS"/>    

                      </dataSource>

                  </transactionManager>

                  So IBatis would do a JNDI lookup.

                   

                  We have a servlet that, I think, for displaying JNDI tree and test Database connectivity for our application. It has some references to initialcontext (as mentioned below)

                  context = new InitialContext();

                  dataSource = (DataSource) context.lookup("java:comp/env/"+dataSourceName);

                   

                  I will think over, how this matters.


                  Do you think I need to get a newer IBatis library?

                   

                  Or do you think, I should remove the JAR, thats in my project, that has InitialContext?

                   

                  Which is - C:/jboss-5.1.0.GA/server/default/deploy/MYPROJECT.ear/MYPROJECTWeb.war/WEB-INF/lib/easj2ee.jar

                   

                   

                  Whichever the answer is, could you please give me a little bit of explanation, why we are doing that?

                   

                  Thank you

                  • 6. Re: Delpoyment exception on JBoss5.1, used to work fine on 4.0.3
                    Gnanasekaran Sakthivel Newbie

                    I think, this InitialContext.class is also packaged with JDK 1.5 itself. Is this the reason?

                    However, they were also part of j2sdk1.4.2_11 which we were using in our JBoss 4.0.x.

                    Did JBoss AS 5 changed its classloading strategy compared to JBoss 4.0?