Announcement Announcement Module
Collapse
No announcement yet.
Problem deploying a Spring 3.0 (RC3) MVC Web App to Weblogic 11gR1 Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Problem deploying a Spring 3.0 (RC3) MVC Web App to Weblogic 11gR1

    Hi there,

    I have a maven 2 based Spring 3 (RC3) web application which I am trying to deploy to my Weblogic 11gR1 server. When I do the deploy (using either the SpringsourceTool Suite IDE "Add and Remove ..." option or the maven weblogic plugin "weblogic:deploy" target) I get the following error:

    <Jan 6, 2010 5:22:15 PM GMT> <Error> <Deployer> <BEA-149265> <Failure occurred in the execution of deployment request with ID '1262798533895' for task '1'. Error is: 'weblogic.application.ModuleException: '
    weblogic.application.ModuleException:
    at weblogic.servlet.internal.WebAppModule.startContex ts(WebAppModule.java:1399)
    at weblogic.servlet.internal.WebAppModule.start(WebAp pModule.java:460)
    at weblogic.application.internal.flow.ModuleStateDriv er$3.next(ModuleStateDriver.java:425)
    at weblogic.application.utils.StateMachineDriver.next State(StateMachineDriver.java:83)
    at weblogic.application.internal.flow.ModuleStateDriv er.start(ModuleStateDriver.java:119)
    Truncated. see log file for complete stacktrace

    Caused By: java.lang.NoSuchMethodError: org.springframework.beans.factory.xml.BeanDefiniti onParserDelegate.getBeanDefinitionDefaults()Lorg/springframework/beans/factory/support/BeanDefinitionDefaults;
    at org.springframework.context.annotation.ComponentSc anBeanDefinitionParser.configureScanner(ComponentS canBeanDefinitionParser.java:101)
    at org.springframework.context.annotation.ComponentSc anBeanDefinitionParser.parse(ComponentScanBeanDefi nitionParser.java:83)
    at org.springframework.beans.factory.xml.NamespaceHan dlerSupport.parse(NamespaceHandlerSupport.java:69)
    at org.springframework.beans.factory.xml.BeanDefiniti onParserDelegate.parseCustomElement(BeanDefinition ParserDelegate.java:1114)
    at org.springframework.beans.factory.xml.BeanDefiniti onParserDelegate.parseCustomElement(BeanDefinition ParserDelegate.java:1104)
    Truncated. see log file for complete stacktrace
    >

    The dependencies we are using from Spring 3 (RC3) are shown below (cut from the maven pom.xml file):
    <dependencies>
    <dependency>
    <groupId>org.springframework</groupId>
    <artifactId>spring-core</artifactId>
    <version>3.0.0.RC3</version>
    </dependency>
    <dependency>
    <groupId>org.springframework</groupId>
    <artifactId>spring-expression</artifactId>
    <version>3.0.0.RC3</version>
    </dependency>
    <dependency>
    <groupId>org.springframework</groupId>
    <artifactId>spring-beans</artifactId>
    <version>3.0.0.RC3</version>
    </dependency>
    <dependency>
    <groupId>org.springframework</groupId>
    <artifactId>spring-aop</artifactId>
    <version>3.0.0.RC3</version>
    </dependency>
    <dependency>
    <groupId>org.springframework</groupId>
    <artifactId>spring-context</artifactId>
    <version>3.0.0.RC3</version>
    </dependency>
    <dependency>
    <groupId>org.springframework</groupId>
    <artifactId>spring-context-support</artifactId>
    <version>3.0.0.RC3</version>
    </dependency>
    <dependency>
    <groupId>org.springframework</groupId>
    <artifactId>spring-tx</artifactId>
    <version>3.0.0.RC3</version>
    </dependency>
    <dependency>
    <groupId>org.springframework</groupId>
    <artifactId>spring-jdbc</artifactId>
    <version>3.0.0.RC3</version>
    </dependency>
    <dependency>
    <groupId>org.springframework</groupId>
    <artifactId>spring-orm</artifactId>
    <version>3.0.0.RC3</version>
    </dependency>
    <dependency>
    <groupId>org.springframework</groupId>
    <artifactId>spring-oxm</artifactId>
    <version>3.0.0.RC3</version>
    </dependency>
    <dependency>
    <groupId>org.springframework</groupId>
    <artifactId>spring-web</artifactId>
    <version>3.0.0.RC3</version>
    </dependency>
    <dependency>
    <groupId>org.springframework</groupId>
    <artifactId>spring-webmvc</artifactId>
    <version>3.0.0.RC3</version>
    </dependency>
    <dependency>
    <groupId>org.springframework</groupId>
    <artifactId>spring-webmvc-portlet</artifactId>
    <version>3.0.0.RC3</version>
    </dependency>
    <dependency>
    <groupId>org.springframework</groupId>
    <artifactId>spring-webflow</artifactId>
    <version>2.0.8</version>
    </dependency>
    <dependency>
    <groupId>org.springframework</groupId>
    <artifactId>spring-js</artifactId>
    <version>2.0.8</version>
    </dependency>

    <dependency>
    <groupId>javax.servlet</groupId>
    <artifactId>servlet-api</artifactId>
    <version>2.5</version>
    </dependency>
    <dependency>
    <groupId>org.apache.tiles</groupId>
    <artifactId>tiles-api</artifactId>
    <version>2.1.2</version>
    </dependency>
    <dependency>
    <groupId>org.apache.tiles</groupId>
    <artifactId>tiles-compat</artifactId>
    <version>2.1.2</version>
    </dependency>
    <dependency>
    <groupId>org.apache.tiles</groupId>
    <artifactId>tiles-core</artifactId>
    <version>2.1.2</version>
    </dependency>
    <dependency>
    <groupId>org.apache.tiles</groupId>
    <artifactId>tiles-jsp</artifactId>
    <version>2.1.2</version>
    </dependency>
    <dependency>
    <groupId>org.apache.tiles</groupId>
    <artifactId>tiles-portlet</artifactId>
    <version>2.1.2</version>
    </dependency>
    <dependency>
    <groupId>org.apache.tiles</groupId>
    <artifactId>tiles-servlet</artifactId>
    <version>2.1.2</version>
    </dependency>
    <dependency>
    <groupId>org.apache.tomcat</groupId>
    <artifactId>jasper-el</artifactId>
    <version>6.0.20</version>
    </dependency>
    </dependencies>

    I had to add the jasper-el dependency as a lack of this threw a classnotfound error at deployment.

    I have googled for a solution to this problem but cannot seem to find any answer. I have also looked for tips on how to use Spring and Weblogic together but they do not seem to cover this area.

    Can anyone help me?

    Thanks in advance.

    Regs, Andrew

  • #2
    Have you tried analyzing your dependencies with the maven dependency plugin to see if an old version of spring is somehow getting pulled in (e.g. by spring-js or spring webflow) as a transitive dependency? Have you looked in your deployment artifact (WAR?) to see if this is the case?

    Comment


    • #3
      More information ...

      Further updates. I tried deploying my war archive manually to check that the deployment method wasn;t the root of the problem. I used the Admin Web UI, and deployed usnig all the default options. The deployment failed, and the same error was written in the AdminServer.log:

      ####<Jan 7, 2010 4:19:23 PM GMT> <Warning> <Deployer> <CMSR-XP-DTP10A> <AdminServer> <[STANDBY] ExecuteThread: '6' for queue: 'weblogic.kernel.Default (self-tuning)'> <<WLS Kernel>> <> <> <1262881163292> <BEA-149004> <Failures were detected while initiating deploy task for application 'cmsr-web-0'.>
      ####<Jan 7, 2010 4:19:23 PM GMT> <Warning> <Deployer> <CMSR-XP-DTP10A> <AdminServer> <[STANDBY] ExecuteThread: '6' for queue: 'weblogic.kernel.Default (self-tuning)'> <<WLS Kernel>> <> <> <1262881163292> <BEA-149078> <Stack trace for message 149004
      weblogic.application.ModuleException:
      at weblogic.servlet.internal.WebAppModule.startContex ts(WebAppModule.java:1399)
      at weblogic.servlet.internal.WebAppModule.start(WebAp pModule.java:460)
      at weblogic.application.internal.flow.ModuleStateDriv er$3.next(ModuleStateDriver.java:425)
      ...
      weblogic.deploy.service.internal.targetserver.Depl oymentReceiverCallbackDeliverer.doCommitCallback(D eploymentReceiverCallbackDeliverer.java:181)
      at weblogic.deploy.service.internal.targetserver.Depl oymentReceiverCallbackDeliverer.access$100(Deploym entReceiverCallbackDeliverer.java:12)
      at weblogic.deploy.service.internal.targetserver.Depl oymentReceiverCallbackDeliverer$2.run(DeploymentRe ceiverCallbackDeliverer.java:67)
      at weblogic.work.SelfTuningWorkManagerImpl$WorkAdapte rImpl.run(SelfTuningWorkManagerImpl.java:516)
      at weblogic.work.ExecuteThread.execute(ExecuteThread. java:201)
      at weblogic.work.ExecuteThread.run(ExecuteThread.java :173)

      Caused By: java.lang.NoSuchMethodError: org.springframework.beans.factory.xml.BeanDefiniti onParserDelegate.getBeanDefinitionDefaults()Lorg/springframework/beans/factory/support/BeanDefinitionDefaults;
      at org.springframework.context.annotation.ComponentSc anBeanDefinitionParser.configureScanner(ComponentS canBeanDefinitionParser.java:101)
      at org.springframework.context.annotation.ComponentSc anBeanDefinitionParser.parse(ComponentScanBeanDefi nitionParser.java:83)
      at org.springframework.beans.factory.xml.NamespaceHan dlerSupport.parse(NamespaceHandlerSupport.java:69)
      at org.springframework.beans.factory.xml.BeanDefiniti onParserDelegate.parseCustomElement(BeanDefinition ParserDelegate.java:1114)
      at org.springframework.beans.factory.xml.BeanDefiniti onParserDelegate.parseCustomElement(BeanDefinition ParserDelegate.java:1104)
      at org.springframework.beans.factory.xml.DefaultBeanD efinitionDocumentReader.parseBeanDefinitions(Defau ltBeanDefinitionDocumentReader.java:133)
      at org.springframework.beans.factory.xml.DefaultBeanD efinitionDocumentReader.registerBeanDefinitions(De faultBeanDefinitionDocumentReader.java:90)
      at org.springframework.beans.factory.xml.XmlBeanDefin itionReader.registerBeanDefinitions(XmlBeanDefinit ionReader.java:458)
      at org.springframework.beans.factory.xml.XmlBeanDefin itionReader.doLoadBeanDefinitions(XmlBeanDefinitio nReader.java:353)
      at org.springframework.beans.factory.xml.XmlBeanDefin itionReader.loadBeanDefinitions(XmlBeanDefinitionR eader.java:303)
      at org.springframework.beans.factory.xml.XmlBeanDefin itionReader.loadBeanDefinitions(XmlBeanDefinitionR eader.java:280)
      at org.springframework.beans.factory.support.Abstract BeanDefinitionReader.loadBeanDefinitions(AbstractB eanDefinitionReader.java:131)
      at org.springframework.beans.factory.support.Abstract BeanDefinitionReader.loadBeanDefinitions(AbstractB eanDefinitionReader.java:147)
      at org.springframework.web.context.support.XmlWebAppl icationContext.loadBeanDefinitions(XmlWebApplicati onContext.java:124)
      at org.springframework.web.context.support.XmlWebAppl icationContext.loadBeanDefinitions(XmlWebApplicati onContext.java:92)
      at org.springframework.context.support.AbstractRefres hableApplicationContext.refreshBeanFactory(Abstrac tRefreshableApplicationContext.java:101)
      at org.springframework.context.support.AbstractApplic ationContext.obtainFreshBeanFactory(AbstractApplic ationContext.java:389)
      at org.springframework.context.support.AbstractApplic ationContext.refresh(AbstractApplicationContext.ja va:324)
      at org.springframework.web.context.ContextLoader.crea teWebApplicationContext(ContextLoader.java:244)
      at org.springframework.web.context.ContextLoader.init WebApplicationContext(ContextLoader.java:187)
      at org.springframework.web.context.ContextLoaderListe ner.contextInitialized(ContextLoaderListener.java: 49)
      at weblogic.servlet.internal.EventsManager$FireContex tListenerAction.run(EventsManager.java:481)
      at weblogic.security.acl.internal.AuthenticatedSubjec t.doAs(AuthenticatedSubject.java:321)
      at weblogic.security.service.SecurityManager.runAs(Se curityManager.java:121)
      at weblogic.servlet.internal.EventsManager.notifyCont extCreatedEvent(EventsManager.java:181)
      at weblogic.servlet.internal.WebAppServletContext.pre loadResources(WebAppServletContext.java:1801)
      at weblogic.servlet.internal.WebAppServletContext.sta rt(WebAppServletContext.java:3045)
      at weblogic.servlet.internal.WebAppModule.startContex ts(WebAppModule.java:1397)
      at weblogic.servlet.internal.WebAppModule.start(WebAp pModule.java:460)
      at weblogic.application.internal.flow.ModuleStateDriv er$3.next(ModuleStateDriver.java:425)
      at weblogic.application.utils.StateMachineDriver.next State(StateMachineDriver.java:83)
      at weblogic.application.internal.flow.ModuleStateDriv er.start(ModuleStateDriver.java:119)
      at weblogic.application.internal.flow.ScopedModuleDri ver.start(ScopedModuleDriver.java:200)
      at weblogic.application.internal.flow.ModuleListenerI nvoker.start(ModuleListenerInvoker.java:247)
      at weblogic.application.internal.flow.ModuleStateDriv er$3.next(ModuleStateDriver.java:425)
      at weblogic.application.utils.StateMachineDriver.next State(StateMachineDriver.java:83)
      at weblogic.application.internal.flow.ModuleStateDriv er.start(ModuleStateDriver.java:119)
      at weblogic.application.internal.flow.StartModulesFlo w.activate(StartModulesFlow.java:27)
      at weblogic.application.internal.BaseDeployment$2.nex t(BaseDeployment.java:1267)
      at weblogic.application.utils.StateMachineDriver.next State(StateMachineDriver.java:83)
      at weblogic.application.internal.BaseDeployment.activ ate(BaseDeployment.java:409)
      at weblogic.application.internal.SingleModuleDeployme nt.activate(SingleModuleDeployment.java:39)
      at weblogic.application.internal.DeploymentStateCheck er.activate(DeploymentStateChecker.java:161)
      at weblogic.deploy.internal.targetserver.AppContainer Invoker.activate(AppContainerInvoker.java:79)
      at weblogic.deploy.internal.targetserver.operations.A bstractOperation.activate(AbstractOperation.java:5 69)
      at weblogic.deploy.internal.targetserver.operations.A ctivateOperation.activateDeployment(ActivateOperat ion.java:150)
      at weblogic.deploy.internal.targetserver.operations.A ctivateOperation.doCommit(ActivateOperation.java:1 16)
      at weblogic.deploy.internal.targetserver.operations.A bstractOperation.commit(AbstractOperation.java:323 )
      at weblogic.deploy.internal.targetserver.DeploymentMa nager.handleDeploymentCommit(DeploymentManager.jav a:844)
      at weblogic.deploy.internal.targetserver.DeploymentMa nager.activateDeploymentList(DeploymentManager.jav a:1253)
      at weblogic.deploy.internal.targetserver.DeploymentMa nager.handleCommit(DeploymentManager.java:440)
      at weblogic.deploy.internal.targetserver.DeploymentSe rviceDispatcher.commit(DeploymentServiceDispatcher .java:163)
      at weblogic.deploy.service.internal.targetserver.Depl oymentReceiverCallbackDeliverer.doCommitCallback(D eploymentReceiverCallbackDeliverer.java:181)
      at weblogic.deploy.service.internal.targetserver.Depl oymentReceiverCallbackDeliverer.access$100(Deploym entReceiverCallbackDeliverer.java:12)
      at weblogic.deploy.service.internal.targetserver.Depl oymentReceiverCallbackDeliverer$2.run(DeploymentRe ceiverCallbackDeliverer.java:67)
      at weblogic.work.SelfTuningWorkManagerImpl$WorkAdapte rImpl.run(SelfTuningWorkManagerImpl.java:516)
      at weblogic.work.ExecuteThread.execute(ExecuteThread. java:201)
      at weblogic.work.ExecuteThread.run(ExecuteThread.java :173)
      >

      I also checked that the spring-beans-3.0.0.RC3.jar file which is bundled in the war deployed. Contrary to the error, there is a method with the signature "public BeanDefinitionDefaults getBeanDefinitionDefaults()"

      Comment


      • #4
        Your error indicates that you have a conflicting jar in your classpath. That's why I asked the questions above.

        Comment


        • #5
          Hi @chudak. Thanks for the tip. I'll have a look and see. I'll post back with the results.

          Andrew

          Comment


          • #6
            Output from dependency:tree :

            uk.gov.gsi.copfs.cmsr:cmsr-web:war:0.1.0-SNAPSHOT
            +- org.springframework:spring-core:jar:3.0.0.RELEASE:compile
            | +- org.springframework:spring-asm:jar:3.0.0.RELEASE:compile
            | \- commons-logging:commons-logging:jar:1.1.1:compile
            +- org.springframework:spring-expression:jar:3.0.0.RELEASE:compile
            +- org.springframework:spring-beans:jar:3.0.0.RELEASE:compile
            +- org.springframework:spring-aop:jar:3.0.0.RELEASE:compile
            | \- aopalliance:aopalliance:jar:1.0:compile
            +- org.springframework:spring-context:jar:3.0.0.RELEASE:compile
            +- org.springframework:spring-context-support:jar:3.0.0.RELEASE:compile
            +- org.springframework:spring-tx:jar:3.0.0.RELEASE:compile
            +- org.springframework:spring-jdbc:jar:3.0.0.RELEASE:compile
            +- org.springframework:spring-orm:jar:3.0.0.RELEASE:compile
            +- org.springframework:spring-oxm:jar:3.0.0.RELEASE:compile
            +- org.springframework:spring-web:jar:3.0.0.RELEASE:compile
            +- org.springframework:spring-webmvc:jar:3.0.0.RELEASE:compile
            +- org.springframework:spring-webmvc-portlet:jar:3.0.0.RELEASE:compile
            +- org.springframework:spring-webflow:jar:2.0.8:compile
            +- org.springframework:spring-js:jar:2.0.8:compile
            +- javax.servlet:servlet-api:jar:2.5:compile
            +- org.apache.tiles:tiles-api:jar:2.1.2:compile
            | \- commons-logging:commons-logging-api:jar:1.1:compile
            +- org.apache.tiles:tiles-compat:jar:2.1.2:compile
            +- org.apache.tiles:tiles-core:jar:2.1.2:compile
            | \- commons-digester:commons-digester:jar:1.8.1:compile
            | \- commons-beanutils:commons-beanutils:jar:1.8.0:compile
            +- org.apache.tiles:tiles-jsp:jar:2.1.2:compile
            +- org.apache.tiles:tiles-portlet:jar:2.1.2:compile
            +- org.apache.tiles:tiles-servlet:jar:2.1.2:compile
            +- org.apache.tomcat:jasper-el:jar:6.0.20:compile
            | \- org.apache.tomcat:el-api:jar:6.0.20:compile
            \- junit:junit:jar:4.7:test

            It seems that the required class is in spring-beans-3.0.0.RC3. Looknig at this output there does not seem to be another version of this dependency...

            Comment


            • #7
              You might also want to look in your WAR WEB-INF/lib directory and verify what is actually in there.

              The next question: are there spring jars in the WL shared library? Do you have other applications deployed on this server running other versions of Spring?

              I haven't used WL in years (thankfully) so I don't know how well it still complies with the J2EE classloader spec but I can tell you that Jboss is awful in this regard; the default jboss classloader shares classloading among all applications so you can have your applications classloading space polluted by other applications that are codeployed.

              That would be the next thing I'd look at...

              Comment


              • #8
                Thanks @chudak. Thanks for the pointer. It was what I was beginning to wonder...

                The WAR WEB-INF/lib directory is clean (only 1 spring-beans jar file: spring-beans-3.0.0.RC.jar)

                I'm just upgrading to 3.0.0.RELEASE but I have no belief that this will fix the problem.

                I'll try and take a look at the Weblogic classpath which weblogic has. Perhaps it is using another version of this Spring library. I'll report back...

                Thanks again.

                Comment

                Working...
                X