8 Replies Latest reply on Apr 14, 2009 7:31 AM by alesj

    Exception while integrating spring and jboss 5.01 AS

    seleshmaster

      I read and followed the instruction outlined by Ales Justin to integrate Jboss and spring. I am using Jboss 5.01 and Spring 2.5.

      Here is what I did.

      1) I copied jboss-spring-jdk5.deployer into JBOSS_HOME/server/deploy directory and the directory contains the follwoing:

      jboss-spring-jdk5.deployer/
      
      jboss-spring-jdk5.jar
      META-INF/
       jboss-service.xml
      spring-aop.jar
      spring-beans.jar
      spring-context.jar
      spring-core.jar
      

      2) I edited the ejb3-interceptors-aop.xml in my JBOSS_HOME/server/default/deploy directory:


      I added the follwoing


      <interceptor class="org.jboss.spring.interceptor.SpringInjectionInterceptor" scope="PER_VM"/>



      I could not locate the follwing entry in the ejb3-interceptors-aop.xml so I just ingnored it (Anyway, I don't think I need to do anything here)

      <typedef name="ejb3intercepted" expr="class(@javax.ejb.Interceptors) OR class(@javax.ejb.Interceptor) OR has(* *->@javax.ejb.AroundInvoke(..))"/>



      I added the pointcut entry for every domain name expression.

      <domain name="Stateless Bean">
      
       <bind pointcut="execution(*->new(..))">
      
       <interceptor-ref name="org.jboss.spring.interceptor.SpringInjectionInterceptor"/>
      
       </bind>



      3) finally I started Jboss 5.01 server and deployed JBoss-Spring.ear file by coping it in the default/deploy directory

      the ear file contains the following:

      0 Mon Jun 05 15:43:24 EDT 2006 META-INF/
       103 Mon Jun 05 15:43:22 EDT 2006 META-INF/MANIFEST.MF
       695 Tue Aug 09 10:46:56 EDT 2005 META-INF/application.xml
       3562 Mon Jun 05 15:43:24 EDT 2006 business.ejb3
       5978 Mon Jun 05 15:43:22 EDT 2006 spring-pojo.spring
       4821 Mon Jun 05 15:43:24 EDT 2006 web.war
      


      but I am getting the following exception


      07:57:09,694 WARN [HDScanner] Scan failed
      org.jboss.deployers.spi.DeploymentException: Exception determining structure: AbstractVFSDeployment(JBoss-Spring.ear)
      at org.jboss.deployers.spi.DeploymentException.rethrowAsDeploymentException(DeploymentException.java:49)
      at org.jboss.deployers.structure.spi.helpers.AbstractStructuralDeployers.determineStructure(AbstractStructuralDeployers.java:85)
      at org.jboss.deployers.plugins.main.MainDeployerImpl.determineStructure(MainDeployerImpl.java:1000)
      at org.jboss.deployers.plugins.main.MainDeployerImpl.determineDeploymentContext(MainDeployerImpl.java:440)
      at org.jboss.deployers.plugins.main.MainDeployerImpl.addDeployment(MainDeployerImpl.java:390)
      at org.jboss.deployers.plugins.main.MainDeployerImpl.addDeployment(MainDeployerImpl.java:300)
      at org.jboss.system.server.profileservice.hotdeploy.HDScanner.scan(HDScanner.java:267)
      at org.jboss.system.server.profileservice.hotdeploy.HDScanner.run(HDScanner.java:221)
      at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
      at java.util.concurrent.FutureTask$Sync.innerRunAndReset(FutureTask.java:317)
      at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:150)
      at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$101(ScheduledThreadPoolExecutor.java:98)
      at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.runPeriodic(ScheduledThreadPoolExecutor.java:181)
      at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:205)
      at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:885)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907)
      at java.lang.Thread.run(Thread.java:637)
      Caused by: java.lang.RuntimeException: Error determining structure: JBoss-Spring.ear
      at org.jboss.deployment.EARStructure.determineStructure(EARStructure.java:293)
      at org.jboss.deployers.vfs.plugins.structure.StructureDeployerWrapper.determineStructure(StructureDeployerWrapper.java:73)
      at org.jboss.deployers.vfs.plugins.structure.VFSStructuralDeployersImpl.doDetermineStructure(VFSStructuralDeployersImpl.java:196)
      at org.jboss.deployers.vfs.plugins.structure.VFSStructuralDeployersImpl.determineStructure(VFSStructuralDeployersImpl.java:221)
      at org.jboss.deployers.structure.spi.helpers.AbstractStructuralDeployers.determineStructure(AbstractStructuralDeployers.java:77)
      ... 15 more
      Caused by: org.jboss.xb.binding.JBossXBException: Failed to parse source: Element {http://java.sun.com/xml/ns/j2ee}application is not bound as a global element.
      at org.jboss.xb.binding.parser.sax.SaxJBossXBParser.parse(SaxJBossXBParser.java:203)
      at org.jboss.xb.binding.parser.sax.SaxJBossXBParser.parse(SaxJBossXBParser.java:183)
      at org.jboss.xb.binding.UnmarshallerImpl.unmarshal(UnmarshallerImpl.java:161)
      at org.jboss.deployment.EARStructure.determineStructure(EARStructure.java:160)
      ... 19 more
      Caused by: org.jboss.xb.binding.JBossXBRuntimeException: Element {http://java.sun.com/xml/ns/j2ee}application is not bound as a global element.
      at org.jboss.xb.binding.sunday.unmarshalling.SundayContentHandler.startElement(SundayContentHandler.java:667)
      at org.jboss.xb.binding.parser.sax.SaxJBossXBParser$DelegatingContentHandler.startElement(SaxJBossXBParser.java:401)
      at org.apache.xerces.parsers.AbstractSAXParser.startElement(Unknown Source)
      at org.apache.xerces.xinclude.XIncludeHandler.startElement(Unknown Source)
      at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanStartElement(Unknown Source)
      at org.apache.xerces.impl.XMLNSDocumentScannerImpl$NSContentDispatcher.scanRootElementHook(Unknown Source)
      at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source)
      at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
      at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
      at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
      at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
      at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
      at org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source)
      at org.jboss.xb.binding.parser.sax.SaxJBossXBParser.parse(SaxJBossXBParser.java:199)
      ... 22 more




      can someone help please? am I missing something?



        • 1. Re: Exception while integrating spring and jboss 5.01 AS
          alesj

          I think first you should update SpringDeployer (SD) to use version 3.1.
          Follow simple instructions from here:
          - http://www.jboss.org/index.html?module=bb&op=viewtopic&t=126475

          If that doesn't work against AS_5.0.1 let me know
          and I'll do a new release.

          Your exception actually looks like it's not SD related,
          but it's some issue with application.xml.
          Once you update SD and you still get this exception
          I think it's better if you post it to JBoss5 forum.

          • 2. Re: Exception while integrating spring and jboss 5.01 AS
            seleshmaster

            Thax Ales;

            Ok, I updated SD to use 3.1 version. JBoss starts up fine, but when I deploy the JBoss-Spring.ear file, I still get the same error.

            One thing I did, I changed the spring-pojo.spring to spring-pojo.jar. I should do that correct? I can deploy .war files with no problem. the application.xml file looks ok. I am just using the example from sourceforge.net 'Fixed Example'

            • 3. Re: Exception while integrating spring and jboss 5.01 AS
              seleshmaster

              oh one thing, I am not sure the 3.1 SD is added to the main deployer, i do not see it on the JMX view. Earlier when i had the jdk5.deployer, I was able to see it on JMX view.

              but I see the following in the server log file

              2009-04-13 19:39:47,923 DEBUG [org.jboss.deployers.plugins.main.MainDeployerImpl] (main) Add deployment: vfsfile:/Applications/jboss-5.0.1.GA/server/default/deploy/jboss-spring-3.1.deployer/
              2009-04-13 19:39:48,005 DEBUG [org.jboss.deployers.plugins.main.MainDeployerImpl] (main) Scheduling deployment: vfsfile:/Applications/jboss-5.0.1.GA/server/default/deploy/jboss-spring-3.1.deployer/ parent=null


              so I am asuming it is added successfully.


              • 4. Re: Exception while integrating spring and jboss 5.01 AS
                alesj

                 

                "seleshmaster" wrote:

                Ok, I updated SD to use 3.1 version. JBoss starts up fine, but when I deploy the JBoss-Spring.ear file, I still get the same error.


                What about if you somehow update that xml namespace in application.xml?
                Since it's been a while since I wrote that example.

                If even that doesn't work, post this error issue on JBoss5 forum,
                and link it with this current thread.

                • 5. Re: Exception while integrating spring and jboss 5.01 AS
                  alesj

                   

                  "seleshmaster" wrote:
                  oh one thing, I am not sure the 3.1 SD is added to the main deployer, i do not see it on the JMX view. Earlier when i had the jdk5.deployer, I was able to see it on JMX view.

                  The deployers are not JMX based any more - they are not MBeans by default.
                  Since you didn't see any errors after that log we can assume that it was installed OK.

                  • 6. Re: Exception while integrating spring and jboss 5.01 AS
                    seleshmaster

                    ok, thx alesj

                    I will post it on Jboss forum

                    • 7. Re: Exception while integrating spring and jboss 5.01 AS
                      seleshmaster

                      Ok, as you suggested the problem was with the application.xml .. well, I did 2 things.

                      I replaced the namespace with this

                      <?xml version="1.0" encoding="UTF-8"?>
                      <application xmlns="http://java.sun.com/xml/ns/javaee"
                       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                       xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
                       http://java.sun.com/xml/ns/javaee/application_5.xsd"
                       version="5">



                      second, I re-named business.ejb3 to business.jar .

                      these two changes seem to fix the intial exception that I was getting. But now I am getting a different kind of exception.

                      6:23:35,186 INFO [DefaultListableBeanFactory] Destroying singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@5b11d7a6: defining beans [randomizer,horoscope]; root of factory hierarchy
                      06:23:35,186 ERROR [ContextLoader] Context initialization failed
                      org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'randomizer' defined in ServletContext resource [/WEB-INF/applicationContext.xml]: Invocation of init method failed; nested exception is javax.naming.NameNotFoundException: org.jboss.tutorial.ee.service.Randomizer not bound
                       at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1337)
                       at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:473)
                       at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.java:409)
                       at java.security.AccessController.doPrivileged(Native Method)
                       at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:380)
                       at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:264)
                       at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:221)
                       at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:261)
                       at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:185)
                       at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:164)
                       at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:423)
                       at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:729)
                       at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:381)
                       at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:255)
                       at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:199)
                       at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:45)
                       at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3910)
                       at org.apache.catalina.core.StandardContext.start(StandardContext.java:4393)
                       at org.jboss.web.tomcat.service.deployers.TomcatDeployment.performDeployInternal(TomcatDeployment.java:312)
                       at org.jboss.web.tomcat.service.deployers.TomcatDeployment.performDeploy(TomcatDeployment.java:144)
                       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:597)
                       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 $Proxy36.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:1598)
                       at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:934)
                       at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1062)
                       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:1598)
                       at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:934)
                       at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1062)
                       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:698)
                       at org.jboss.system.server.profileservice.hotdeploy.HDScanner.scan(HDScanner.java:290)
                       at org.jboss.system.server.profileservice.hotdeploy.HDScanner.run(HDScanner.java:221)
                       at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
                       at java.util.concurrent.FutureTask$Sync.innerRunAndReset(FutureTask.java:317)
                       at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:150)
                       at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$101(ScheduledThreadPoolExecutor.java:98)
                       at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.runPeriodic(ScheduledThreadPoolExecutor.java:181)
                       at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:205)
                       at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:885)
                       at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907)
                       at java.lang.Thread.run(Thread.java:637)
                      Caused by: javax.naming.NameNotFoundException: org.jboss.tutorial.ee.service.Randomizer not bound
                       at org.jnp.server.NamingServer.getBinding(NamingServer.java:771)
                       at org.jnp.server.NamingServer.getBinding(NamingServer.java:779)
                       at org.jnp.server.NamingServer.getObject(NamingServer.java:785)
                       at org.jnp.server.NamingServer.lookup(NamingServer.java:443)
                       at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:722)
                       at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:682)
                       at javax.naming.InitialContext.lookup(InitialContext.java:392)
                       at org.springframework.jndi.JndiTemplate$1.doInContext(JndiTemplate.java:155)
                       at org.springframework.jndi.JndiTemplate.execute(JndiTemplate.java:88)
                       at org.springframework.jndi.JndiTemplate.lookup(JndiTemplate.java:153)
                       at org.springframework.jndi.JndiTemplate.lookup(JndiTemplate.java:178)
                       at org.springframework.jndi.JndiLocatorSupport.lookup(JndiLocatorSupport.java:95)
                       at org.springframework.jndi.JndiObjectLocator.lookup(JndiObjectLocator.java:105)
                       at org.springframework.jndi.JndiObjectFactoryBean.lookupWithFallback(JndiObjectFactoryBean.java:200)
                       at org.springframework.jndi.JndiObjectFactoryBean.afterPropertiesSet(JndiObjectFactoryBean.java:186)
                       at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1368)
                       at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1334)
                       ... 79 more
                      06:23:35,189 ERROR [[/jboss-spring]] Exception sending context initialized event to listener instance of class org.springframework.web.context.ContextLoaderListener
                      org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'randomizer' defined in ServletContext resource [/WEB-INF/applicationContext.xml]: Invocation of init method failed; nested exception is javax.naming.NameNotFoundException: org.jboss.tutorial.ee.service.Randomizer not bound
                       at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1337)
                       at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:473)
                       at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.java:409)
                       at java.security.AccessController.doPrivileged(Native Method)
                       at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:380)
                       at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:264)
                       at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:221)
                       at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:261)
                       at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:185)
                       at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:164)
                       at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:423)
                       at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:729)
                       at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:381)
                       at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:255)
                       at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:199)
                       at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:45)
                       at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3910)
                       at org.apache.catalina.core.StandardContext.start(StandardContext.java:4393)
                       at org.jboss.web.tomcat.service.deployers.TomcatDeployment.performDeployInternal(TomcatDeployment.java:312)
                       at org.jboss.web.tomcat.service.deployers.TomcatDeployment.performDeploy(TomcatDeployment.java:144)
                       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:597)
                       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 $Proxy36.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:1598)
                       at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:934)
                       at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1062)
                       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:1598)
                       at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:934)
                       at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1062)
                       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:698)
                       at org.jboss.system.server.profileservice.hotdeploy.HDScanner.scan(HDScanner.java:290)
                       at org.jboss.system.server.profileservice.hotdeploy.HDScanner.run(HDScanner.java:221)
                       at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
                       at java.util.concurrent.FutureTask$Sync.innerRunAndReset(FutureTask.java:317)
                       at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:150)
                       at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$101(ScheduledThreadPoolExecutor.java:98)
                       at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.runPeriodic(ScheduledThreadPoolExecutor.java:181)
                       at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:205)
                       at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:885)
                       at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907)
                       at java.lang.Thread.run(Thread.java:637)
                      Caused by: javax.naming.NameNotFoundException: org.jboss.tutorial.ee.service.Randomizer not bound
                       at org.jnp.server.NamingServer.getBinding(NamingServer.java:771)
                       at org.jnp.server.NamingServer.getBinding(NamingServer.java:779)
                       at org.jnp.server.NamingServer.getObject(NamingServer.java:785)
                       at org.jnp.server.NamingServer.lookup(NamingServer.java:443)
                       at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:722)
                       at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:682)
                       at javax.naming.InitialContext.lookup(InitialContext.java:392)
                       at org.springframework.jndi.JndiTemplate$1.doInContext(JndiTemplate.java:155)
                       at org.springframework.jndi.JndiTemplate.execute(JndiTemplate.java:88)
                       at org.springframework.jndi.JndiTemplate.lookup(JndiTemplate.java:153)
                       at org.springframework.jndi.JndiTemplate.lookup(JndiTemplate.java:178)
                       at org.springframework.jndi.JndiLocatorSupport.lookup(JndiLocatorSupport.java:95)
                       at org.springframework.jndi.JndiObjectLocator.lookup(JndiObjectLocator.java:105)
                       at org.springframework.jndi.JndiObjectFactoryBean.lookupWithFallback(JndiObjectFactoryBean.java:200)
                       at org.springframework.jndi.JndiObjectFactoryBean.afterPropertiesSet(JndiObjectFactoryBean.java:186)
                       at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1368)
                       at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1334)
                       ... 79 more



                      It seems like spring is unable to inject the randomize bean may be due to a name mismatch in the applicationContext.xml and what it is declared in the code. Since I do not have the source code, I couldn't verify that. Do you have any idea?

                      thx
                      seleshmaster

                      • 8. Re: Exception while integrating spring and jboss 5.01 AS
                        alesj

                        The source is here:
                        - http://anonsvn.jboss.org/repos/jbossas/trunk/spring-int/src/test/

                        It might be that my example code is a bit outdated,
                        as I think EJB3 naming convention has changed since.