7 Replies Latest reply: Mar 4, 2010 2:20 AM by Jay SenSharma MiddlewareMagic RSS

    Weblogic 10.3.0.0 deployment problem

    755133
      Hi All,

      Im trying to deploy a hibernate application i.e app1.war file on Weblogic 10.3.0.0 and it shows following error on console while deploying(Please have a look at the bottom section which contains exception details captured from log file) :

      Error An error occurred during activation of changes, please see the log for details.
      Error Failed to load webapp: 'app1.war'
      Error org.apache.xerces.jaxp.DocumentBuilderFactoryImpl

      The org.apache.xerces.jaxp.DocumentBuilderFactoryImpl problem, i.e it point is to the DocumentBuilder file --

      org.apache.xerces.jaxp.DocumentBuilderFactoryImpl cannot be cast to javax.xml.parsers.DocumentBuilderFactory

      The jar file i have in my app is 'xerces-2.6.2' & the jar present in the weblogic is of version 2.8.1 i guess..
      When i remove the xerces-2.6.2.jar from my application the war gets deployed but webapp wasnt working properly as the jar required was removed.
      Later i tried adding the weblogic versioned xercesImpl.jar file but still couldnt crack the issue.
      I also tried adding the following in the weblogic-application.xml file of META-INF folder :

      <weblogic-application xmlns="http://www.bea.com/ns/weblogic/90" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
      <prefer-application-packages>
      <package-name>org.apache.xerces.*</package-name>
      <package-name>org.apache.oro.*</package-name>
      <package-name>org.apache.commons.*</package-name>
      <package-name>org.apache.log4j.*</package-name>
      <package-name>org.apache.axis.transport.http.*</package-name>
      <package-name>org.jdom.xpath.*</package-name>
      </prefer-application-packages>
      </weblogic-application>


      Before this exception i was getting the antlr.jar file problems(i.e queries werent executing.. stopped @ first query itself)... so i added the following in the weblogic.xml file located under WEB-INF folder to make it work :

      <weblogic-web-app>
      <container-descriptor>
      <prefer-web-inf-classes>true</prefer-web-inf-classes>
      </container-descriptor>
      </weblogic-web-app>

      Error occurring due to antlr.jar file :
      {"message":"system failure: SQL: 'select currencyCode from OprationalLocation where code = ? and domainCode=?'","success":false}


      Exception details :

      <Feb 20, 2010 12:00:51 PM IST> <Error> <HTTP> <BEA-101371> <There was a failure when processing annotations for application /root/bea/user_projects/domains/papa_domain/servers/AdminServer/upload/app1.war. Please make sure that the annotations are valid. The error is >
      <Feb 20, 2010 12:00:51 PM IST> <Error> <Deployer> <BEA-149265> <Failure occurred in the execution of deployment request with ID '1266474648751' for task '7'. Error is: 'weblogic.application.ModuleException: Failed to load webapp: 'app1.war''
      weblogic.application.ModuleException: Failed to load webapp: 'app1.war'

      at weblogic.servlet.internal.WebAppModule.prepare(WebAppModule.java:387)
      at weblogic.application.internal.flow.ScopedModuleDriver.prepare(ScopedModuleDriver.java:176)
      at weblogic.application.internal.flow.ModuleListenerInvoker.prepare(ModuleListenerInvoker.java:93)
      at weblogic.application.internal.flow.DeploymentCallbackFlow$1.next(DeploymentCallbackFlow.java:387)
      at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:37)
      Truncated. see log file for complete stacktrace
      java.lang.ClassCastException: org.apache.xerces.jaxp.DocumentBuilderFactoryImpl
      at javax.xml.parsers.DocumentBuilderFactory.newInstance(DocumentBuilderFactory.java:123)
      at com.bea.core.repackaged.springframework.beans.factory.xml.DefaultDocumentLoader.createDocumentBuilderFactory(DefaultDocumentLoader.java:88)
      at com.bea.core.repackaged.springframework.beans.factory.xml.DefaultDocumentLoader.loadDocument(DefaultDocumentLoader.java:70)
      at com.bea.core.repackaged.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:388)
      at com.bea.core.repackaged.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:340)
      Truncated. see log file for complete stacktrace
      >
      <Feb 20, 2010 12:00:51 PM IST> <Warning> <Deployer> <BEA-149004> <Failures were detected while initiating distribute task for application 'asset'.>
      <Feb 20, 2010 12:00:51 PM IST> <Warning> <Deployer> <BEA-149078> <Stack trace for message 149004
      weblogic.application.ModuleException: Failed to load webapp: 'app1.war'

      at weblogic.servlet.internal.WebAppModule.prepare(WebAppModule.java:387)
      at weblogic.application.internal.flow.ScopedModuleDriver.prepare(ScopedModuleDriver.java:176)
      at weblogic.application.internal.flow.ModuleListenerInvoker.prepare(ModuleListenerInvoker.java:93)
      at weblogic.application.internal.flow.DeploymentCallbackFlow$1.next(DeploymentCallbackFlow.java:387)
      at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:37)
      Truncated. see log file for complete stacktrace
      java.lang.ClassCastException: org.apache.xerces.jaxp.DocumentBuilderFactoryImpl
      at javax.xml.parsers.DocumentBuilderFactory.newInstance(DocumentBuilderFactory.java:123)
      at com.bea.core.repackaged.springframework.beans.factory.xml.DefaultDocumentLoader.createDocumentBuilderFactory(DefaultDocumentLoader.java:88)
      at com.bea.core.repackaged.springframework.beans.factory.xml.DefaultDocumentLoader.loadDocument(DefaultDocumentLoader.java:70)
      at com.bea.core.repackaged.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:388)
      at com.bea.core.repackaged.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:340)
      Truncated. see log file for complete stacktrace
      >
      <Feb 20, 2010 12:00:51 PM IST> <Error> <Console> <BEA-240003> <Console encountered the following error weblogic.application.ModuleException: Failed to load webapp: 'app1.war'

      at weblogic.servlet.internal.WebAppModule.prepare(WebAppModule.java:387)
      at weblogic.application.internal.flow.ScopedModuleDriver.prepare(ScopedModuleDriver.java:176)
      at weblogic.application.internal.flow.ModuleListenerInvoker.prepare(ModuleListenerInvoker.java:93)
      at weblogic.application.internal.flow.DeploymentCallbackFlow$1.next(DeploymentCallbackFlow.java:387)
      at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:37)
      at weblogic.application.internal.flow.DeploymentCallbackFlow.prepare(DeploymentCallbackFlow.java:58)
      at weblogic.application.internal.flow.DeploymentCallbackFlow.prepare(DeploymentCallbackFlow.java:42)
      at weblogic.application.internal.BaseDeployment$1.next(BaseDeployment.java:615)

      at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:37)
      at weblogic.application.internal.BaseDeployment.prepare(BaseDeployment.java:191)
      at weblogic.application.internal.SingleModuleDeployment.prepare(SingleModuleDeployment.java:16)
      at weblogic.application.internal.DeploymentStateChecker.prepare(DeploymentStateChecker.java:155)
      at weblogic.deploy.internal.targetserver.AppContainerInvoker.prepare(AppContainerInvoker.java:60)
      at weblogic.deploy.internal.targetserver.operations.ActivateOperation.createAndPrepareContainer(ActivateOperation.java:197)
      at weblogic.deploy.internal.targetserver.operations.ActivateOperation.doPrepare(ActivateOperation.java:89)
      at weblogic.deploy.internal.targetserver.operations.AbstractOperation.prepare(AbstractOperation.java:217)
      at weblogic.deploy.internal.targetserver.DeploymentManager.handleDeploymentPrepare(DeploymentManager.java:723)
      at weblogic.deploy.internal.targetserver.DeploymentManager.prepareDeploymentList(DeploymentManager.java:1190)
      at weblogic.deploy.internal.targetserver.DeploymentManager.handlePrepare(DeploymentManager.java:248)
      at weblogic.deploy.internal.targetserver.DeploymentServiceDispatcher.prepare(DeploymentServiceDispatcher.java:159)
      at weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer.doPrepareCallback(DeploymentReceiverCallbackDeliverer.java:157)
      at weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer.access$000(DeploymentReceiverCallbackDeliverer.java:12)
      at weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer$1.run(DeploymentReceiverCallbackDeliverer.java:45)
      at weblogic.work.SelfTuningWorkManagerImpl$WorkAdapterImpl.run(SelfTuningWorkManagerImpl.java:516)

      at weblogic.work.ExecuteThread.execute(ExecuteThread.java:201)
      at weblogic.work.ExecuteThread.run(ExecuteThread.java:173)
      Caused by: java.lang.ClassCastException: org.apache.xerces.jaxp.DocumentBuilderFactoryImpl

      at javax.xml.parsers.DocumentBuilderFactory.newInstance(DocumentBuilderFactory.java:123)
      at com.bea.core.repackaged.springframework.beans.factory.xml.DefaultDocumentLoader.createDocumentBuilderFactory(DefaultDocumentLoader.java:88)
      at com.bea.core.repackaged.springframework.beans.factory.xml.DefaultDocumentLoader.loadDocument(DefaultDocumentLoader.java:70)
      at com.bea.core.repackaged.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:388)
      at com.bea.core.repackaged.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:340)
      at com.bea.core.repackaged.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:317)
      at com.bea.core.repackaged.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:125)
      at com.bea.core.repackaged.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:141)
      at com.bea.core.repackaged.springframework.jee.server.Bootstrap.<init>(Bootstrap.java:81)
      at com.bea.core.repackaged.springframework.jee.server.Bootstrap.<init>(Bootstrap.java:94)
      at com.bea.core.repackaged.springframework.jee.spi.WLSBootstrap.<init>(WLSBootstrap.java:51)
      at com.bea.core.repackaged.springframework.jee.spi.WebComponentContributorBrokerImpl.initialize(WebComponentContributorBrokerImpl.java:21)



      Can anyone guide me this issue, how should i deploy my app with the required changes so that my app works seamlessly with the libraries provided in the /lib folder?
      Any kind of help would be priceless!
        • 1. Re: Weblogic 10.3.0.0 deployment problem
          753582
          The issue is that the weblogic classpath is contradicting with your classpath. Essentially one of the jars in weblogic classpath has the same package structure but a different version. The easiest way to solve this problem is to have weblogic.xml file included in you war next to web.xml and set the tag <prefer-web-inf-classes> to true in it

          - Priya Madhok
          Systems Architect
          http://www.interalliancegroup.com
          • 2. Re: Weblogic 10.3.0.0 deployment problem
            755133
            Hi Priya,

            Thanks for the reply, I have already added the weblogic.xml in the WEB-INF folder containing web.xml coz i was getting the ANTLR.jar library conflict prior to xerces.jar problem, also mentioned the same in the pilot thread.

            Weblogic.xml fix works for latest weblogic server version i.e 10.3.2.0 but not for 10.3.0.0 version & i need to deploy it on 10.3.0.0.

            Please guide me through this!
            • 3. Re: Weblogic 10.3.0.0 deployment problem
              MohtashimShaikh
              Hi,

              try setting

              -Djavax.xml.parsers.DocumentBuilderFactory=weblogic.xml.jaxp.WebLogicDocumentBuilderFactory

              as JVM parameter in Server startup script.

              If that does not help try

              -Djavax.xml.soap.SOAPFactory=weblogic.xml.saaj.SOAPFactoryImpl

              Regards,

              Mohtashim Shaikh
              • 4. Re: Weblogic 10.3.0.0 deployment problem
                755133
                Thanks Mohtashim,

                The change suggested will affect the whole environment, cant we config some stuff which is only specific to the application itself?
                • 5. Re: Weblogic 10.3.0.0 deployment problem
                  Jay SenSharma MiddlewareMagic
                  Hi,

                  Inside your application you can define it in "YourEAR/META-INF/weblogic-application.xml"


                  <?xml version = '1.0' encoding = 'UTF-8'?>
                  <weblogic-application xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.bea.com/ns/weblogic/weblogic-application http://www.bea.com/ns/weblogic/weblogic-application/1.0/weblogic-application.xsd" xmlns="http://www.bea.com/ns/weblogic/weblogic-application">
                  <xml>
                  <parser-factory>
                  <saxparser-factory>YourParserFactory</saxparser-factory>
                  <document-builder-factory>weblogic.xml.jaxp.WebLogicDocumentBuilderFactory</document-builder-factory>
                  <transformer-factory>YourTransformerFactory</transformer-factory>
                  </parser-factory>
                  </xml>
                  </weblogic-application>


                  Thanks
                  Jay SenSharma
                  http://jaysensharma.wordpress.com/ (WebLogic Wonders Are Here)
                  • 6. Re: Weblogic 10.3.0.0 deployment problem
                    MohtashimShaikh
                    Hi,

                    I believe we can write this in the application code.

                    System.setProperty("javax.xml.parsers.DocumentBuilderFactory","new-factory");

                    Not sure if it would affect the application or the whole server/domain.

                    Regards,

                    Mohtashim
                    • 7. Re: Weblogic 10.3.0.0 deployment problem
                      Jay SenSharma MiddlewareMagic
                      Hi Mohtashim,

                      System.setProperty("javax.xml.parsers.DocumentBuilderFactory","new-factory");
                      In this case The Property will be set at the System level ...means the JVM level where this code get executed will be effected...and if any other application is running on that JVM ..then that application also will be affected by this property.

                      So For Application specific setting please use:
                      <?xml version = '1.0' encoding = 'UTF-8'?>
                      <weblogic-application xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.bea.com/ns/weblogic/weblogic-application http://www.bea.com/ns/weblogic/weblogic-application/1.0/weblogic-application.xsd" xmlns="http://www.bea.com/ns/weblogic/weblogic-application">
                      <xml>
                      <parser-factory>
                      <saxparser-factory>YourParserFactory</saxparser-factory>
                      <document-builder-factory>weblogic.xml.jaxp.WebLogicDocumentBuilderFactory</document-builder-factory>
                      <transformer-factory>YourTransformerFactory</transformer-factory>
                      </parser-factory>
                      </xml>
                      </weblogic-application>


                      .
                      .
                      .
                      Thanks
                      Jay SenSharma
                      http://jaysensharma.wordpress.com (WebLogic wonders Are Here)