2 Replies Latest reply on Sep 15, 2005 6:38 AM by Jim

    How do I specify order of deployment of my war/ear/jar files

    Jim Newbie

      Hi,

      I am using jboss-3.2.6 on winXP.

      I have a 'javax.naming.NameNotFoundException: ejb not bound' message occurring on jboss startup.

      This must be due to the fact that my war is loading data from an ejb before the ejb is deployed. (correct me if I'm wrong here but it seems pretty obvious that this is the case).

      So the question is how do I specify that my war file should deploy *after* the ejb jar file and not before it?

      Joe

        • 1. Re: How do I specify order of deployment of my war/ear/jar f
          Darran Lofthouse Master

          The default ordering should deploy the jar before the war anyway, can you post the full error (Exception, message and stack trace).

          • 2. Re: How do I specify order of deployment of my war/ear/jar f
            Jim Newbie

            The exception thrown is a custom exception but the lookup for the bean only failed since I configured a springbean method to be invoked on startup. This method is responsible for loading static data when the war is deployed.

            My stacktrace on jboss startup is as follows:
            ...

            10:23:54,775 INFO [UiApplicationContextUtils] No ThemeSource found for [Root WebApplicationContext]: using ResourceBundleThe
            meSource
            10:23:54,775 INFO [DefaultListableBeanFactory] Pre-instantiating singletons in factory [org.springframework.beans.factory.su
            pport.DefaultListableBeanFactory defining beans [mcmEnumBi,mcmAssetContainerBi,mcmContentProviderBi,mcmProductCategoryBi,stat
            icWebDataManager,comments_bmi,tape_bmi]; root of BeanFactory hierarchy]
            10:23:54,775 INFO [DefaultListableBeanFactory] Creating shared instance of singleton bean 'staticWebDataManager'
            10:23:54,963 INFO [STDOUT] uk.co.mycom.mcm.common.ServiceLocatorException: javax.naming.NameNotFoundException: ejb not bo
            und
            10:23:54,963 INFO [STDOUT] at uk.co.mycom.mcm.ejb.MCMEnumBI.lookupHome(MCMEnumBI.java:274)
            10:23:54,963 INFO [STDOUT] at uk.co.mycom.mcm.ejb.MCMEnumBI.getService(MCMEnumBI.java:241)
            10:23:54,963 INFO [STDOUT] at uk.co.mycom.mcm.ejb.MCMEnumBI.getAnimationFile(MCMEnumBI.java:24)
            10:23:54,963 INFO [STDOUT] at uk.co.mycom.mcmweb.common.MCMStaticWebDataManager.init(MCMStaticWebDataManager.java:38)
            
            10:23:54,963 INFO [STDOUT] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
            10:23:54,963 INFO [STDOUT] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
            10:23:54,963 INFO [STDOUT] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
            10:23:54,963 INFO [STDOUT] at java.lang.reflect.Method.invoke(Method.java:324)
            10:23:54,963 INFO [STDOUT] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeCustomI
            nitMethod(AbstractAutowireCapableBeanFactory.java:1037)
            10:23:54,963 INFO [STDOUT] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMet
            hods(AbstractAutowireCapableBeanFactory.java:1007)
            10:23:54,963 INFO [STDOUT] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(Ab
            stractAutowireCapableBeanFactory.java:348)
            10:23:54,963 INFO [STDOUT] at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.
            java:226)
            10:23:54,978 INFO [STDOUT] at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.
            java:147)
            10:23:54,978 INFO [STDOUT] at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSinglet
            ons(DefaultListableBeanFactory.java:275)
            10:23:54,978 INFO [STDOUT] at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplication
            Context.java:317)
            10:23:54,994 INFO [STDOUT] at org.springframework.web.context.support.AbstractRefreshableWebApplicationContext.refresh(A
            bstractRefreshableWebApplicationContext.java:134)
            10:23:54,994 INFO [STDOUT] at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.ja
            va:230)
            10:23:54,994 INFO [STDOUT] at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java
            :156)
            10:23:55,010 INFO [STDOUT] at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderList
            ener.java:48)
            10:23:55,010 INFO [STDOUT] at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3827)
            10:23:55,010 INFO [STDOUT] at org.apache.catalina.core.StandardContext.start(StandardContext.java:4343)
            10:23:55,010 INFO [STDOUT] at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:823)
            10:23:55,010 INFO [STDOUT] at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:807)
            10:23:55,025 INFO [STDOUT] at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:595)
            10:23:55,025 INFO [STDOUT] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
            10:23:55,025 INFO [STDOUT] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
            10:23:55,025 INFO [STDOUT] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
            10:23:55,025 INFO [STDOUT] at java.lang.reflect.Method.invoke(Method.java:324)
            10:23:55,025 INFO [STDOUT] at org.apache.commons.modeler.BaseModelMBean.invoke(BaseModelMBean.java:503)
            10:23:55,041 INFO [STDOUT] at org.jboss.mx.server.RawDynamicInvoker.invoke(RawDynamicInvoker.java:149)
            10:23:55,041 INFO [STDOUT] at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:473)
            10:23:55,041 INFO [STDOUT] at org.apache.catalina.core.StandardContext.init(StandardContext.java:5441)
            10:23:55,041 INFO [STDOUT] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
            10:23:55,041 INFO [STDOUT] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
            10:23:55,041 INFO [STDOUT] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
            10:23:55,056 INFO [STDOUT] at java.lang.reflect.Method.invoke(Method.java:324)
            10:23:55,056 INFO [STDOUT] at org.apache.commons.modeler.BaseModelMBean.invoke(BaseModelMBean.java:503)
            10:23:55,056 INFO [STDOUT] at org.jboss.mx.server.RawDynamicInvoker.invoke(RawDynamicInvoker.java:149)
            10:23:55,056 INFO [STDOUT] at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:473)
            10:23:55,056 INFO [STDOUT] at org.jboss.web.tomcat.tc5.TomcatDeployer.performDeployInternal(TomcatDeployer.java:316)
            10:23:55,056 INFO [STDOUT] at org.jboss.web.tomcat.tc5.TomcatDeployer.performDeploy(TomcatDeployer.java:76)
            10:23:55,072 INFO [STDOUT] at org.jboss.web.AbstractWebDeployer.start(AbstractWebDeployer.java:320)
            10:23:55,072 INFO [STDOUT] at org.jboss.web.WebModule.startModule(WebModule.java:62)
            10:23:55,072 INFO [STDOUT] at org.jboss.web.WebModule.startService(WebModule.java:40)
            10:23:55,072 INFO [STDOUT] at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanSupport.java:271)
            10:23:55,072 INFO [STDOUT] at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSupport.java:221)
            10:23:55,088 INFO [STDOUT] at sun.reflect.GeneratedMethodAccessor2.invoke(Unknown Source)
            10:23:55,088 INFO [STDOUT] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
            10:23:55,088 INFO [STDOUT] at java.lang.reflect.Method.invoke(Method.java:324)
            10:23:55,103 INFO [STDOUT] at org.jboss.mx.server.ReflectedDispatcher.dispatch(ReflectedDispatcher.java:60)
            10:23:55,103 INFO [STDOUT] at org.jboss.mx.server.Invocation.dispatch(Invocation.java:62)
            10:23:55,103 INFO [STDOUT] at org.jboss.mx.server.Invocation.dispatch(Invocation.java:54)
            10:23:55,103 INFO [STDOUT] at org.jboss.mx.server.Invocation.invoke(Invocation.java:82)
            10:23:55,119 INFO [STDOUT] at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:197)
            10:23:55,119 INFO [STDOUT] at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:473)
            10:23:55,119 INFO [STDOUT] at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:884)
            10:23:55,119 INFO [STDOUT] at $Proxy18.start(Unknown Source)
            10:23:55,119 INFO [STDOUT] at org.jboss.system.ServiceController.start(ServiceController.java:414)
            10:23:55,119 INFO [STDOUT] at sun.reflect.GeneratedMethodAccessor6.invoke(Unknown Source)
            10:23:55,135 INFO [STDOUT] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
            10:23:55,135 INFO [STDOUT] at java.lang.reflect.Method.invoke(Method.java:324)
            10:23:55,135 INFO [STDOUT] at org.jboss.mx.server.ReflectedDispatcher.dispatch(ReflectedDispatcher.java:60)
            10:23:55,135 INFO [STDOUT] at org.jboss.mx.server.Invocation.dispatch(Invocation.java:62)
            10:23:55,135 INFO [STDOUT] at org.jboss.mx.server.Invocation.dispatch(Invocation.java:54)
            10:23:55,135 INFO [STDOUT] at org.jboss.mx.server.Invocation.invoke(Invocation.java:82)
            10:23:55,150 INFO [STDOUT] at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:197)
            10:23:55,150 INFO [STDOUT] at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:473)
            10:23:55,150 INFO [STDOUT] at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:176)
            10:23:55,150 INFO [STDOUT] at $Proxy35.start(Unknown Source)
            10:23:55,150 INFO [STDOUT] at org.jboss.web.AbstractWebContainer.start(AbstractWebContainer.java:363)
            10:23:55,150 INFO [STDOUT] at org.jboss.deployment.MainDeployer.start(MainDeployer.java:829)
            10:23:55,166 INFO [STDOUT] at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:641)
            10:23:55,166 INFO [STDOUT] at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:604)
            10:23:55,166 INFO [STDOUT] at sun.reflect.GeneratedMethodAccessor15.invoke(Unknown Source)
            10:23:55,166 INFO [STDOUT] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
            10:23:55,166 INFO [STDOUT] at java.lang.reflect.Method.invoke(Method.java:324)
            10:23:55,166 INFO [STDOUT] at org.jboss.mx.server.ReflectedDispatcher.dispatch(ReflectedDispatcher.java:60)
            10:23:55,181 INFO [STDOUT] at org.jboss.mx.server.Invocation.dispatch(Invocation.java:62)
            10:23:55,181 INFO [STDOUT] at org.jboss.mx.server.Invocation.dispatch(Invocation.java:54)
            10:23:55,181 INFO [STDOUT] at org.jboss.mx.server.Invocation.invoke(Invocation.java:82)
            10:23:55,181 INFO [STDOUT] at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:197)
            10:23:55,181 INFO [STDOUT] at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:473)
            10:23:55,181 INFO [STDOUT] at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:176)
            10:23:55,181 INFO [STDOUT] at $Proxy8.deploy(Unknown Source)
            10:23:55,181 INFO [STDOUT] at org.jboss.deployment.scanner.URLDeploymentScanner.deploy(URLDeploymentScanner.java:304)
            10:23:55,197 INFO [STDOUT] at org.jboss.deployment.scanner.URLDeploymentScanner.scan(URLDeploymentScanner.java:478)
            10:23:55,197 INFO [STDOUT] at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.doScan(AbstractDeploy
            mentScanner.java:201)
            10:23:55,213 INFO [STDOUT] at org.jboss.deployment.scanner.AbstractDeploymentScanner.startService(AbstractDeploymentScan
            ner.java:274)
            10:23:55,213 INFO [STDOUT] at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanSupport.java:271)
            10:23:55,213 INFO [STDOUT] at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSupport.java:221)
            10:23:55,213 INFO [STDOUT] at sun.reflect.GeneratedMethodAccessor2.invoke(Unknown Source)
            10:23:55,228 INFO [STDOUT] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
            10:23:55,228 INFO [STDOUT] at java.lang.reflect.Method.invoke(Method.java:324)
            10:23:55,228 INFO [STDOUT] at org.jboss.mx.server.ReflectedDispatcher.dispatch(ReflectedDispatcher.java:60)
            10:23:55,228 INFO [STDOUT] at org.jboss.mx.server.Invocation.dispatch(Invocation.java:62)
            10:23:55,228 INFO [STDOUT] at org.jboss.mx.server.Invocation.dispatch(Invocation.java:54)
            10:23:55,228 INFO [STDOUT] at org.jboss.mx.server.Invocation.invoke(Invocation.java:82)
            10:23:55,228 INFO [STDOUT] at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:197)
            10:23:55,228 INFO [STDOUT] at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:473)
            10:23:55,244 INFO [STDOUT] at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:884)
            10:23:55,244 INFO [STDOUT] at $Proxy0.start(Unknown Source)
            10:23:55,260 INFO [STDOUT] at org.jboss.system.ServiceController.start(ServiceController.java:414)
            10:23:55,260 INFO [STDOUT] at sun.reflect.GeneratedMethodAccessor6.invoke(Unknown Source)
            10:23:55,260 INFO [STDOUT] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
            10:23:55,260 INFO [STDOUT] at java.lang.reflect.Method.invoke(Method.java:324)
            10:23:55,260 INFO [STDOUT] at org.jboss.mx.server.ReflectedDispatcher.dispatch(ReflectedDispatcher.java:60)
            10:23:55,260 INFO [STDOUT] at org.jboss.mx.server.Invocation.dispatch(Invocation.java:62)
            10:23:55,260 INFO [STDOUT] at org.jboss.mx.server.Invocation.dispatch(Invocation.java:54)
            10:23:55,260 INFO [STDOUT] at org.jboss.mx.server.Invocation.invoke(Invocation.java:82)
            10:23:55,260 INFO [STDOUT] at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:197)
            10:23:55,260 INFO [STDOUT] at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:473)
            10:23:55,275 INFO [STDOUT] at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:176)
            10:23:55,275 INFO [STDOUT] at $Proxy4.start(Unknown Source)
            10:23:55,275 INFO [STDOUT] at org.jboss.deployment.SARDeployer.start(SARDeployer.java:251)
            10:23:55,275 INFO [STDOUT] at org.jboss.deployment.MainDeployer.start(MainDeployer.java:829)
            10:23:55,275 INFO [STDOUT] at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:641)
            10:23:55,291 INFO [STDOUT] at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:604)
            10:23:55,291 INFO [STDOUT] at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:588)
            10:23:55,306 INFO [STDOUT] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
            10:23:55,306 INFO [STDOUT] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
            10:23:55,306 INFO [STDOUT] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
            10:23:55,306 INFO [STDOUT] at java.lang.reflect.Method.invoke(Method.java:324)
            10:23:55,306 INFO [STDOUT] at org.jboss.mx.server.ReflectedDispatcher.dispatch(ReflectedDispatcher.java:60)
            10:23:55,306 INFO [STDOUT] at org.jboss.mx.server.Invocation.dispatch(Invocation.java:62)
            10:23:55,306 INFO [STDOUT] at org.jboss.mx.server.Invocation.dispatch(Invocation.java:54)
            10:23:55,322 INFO [STDOUT] at org.jboss.mx.server.Invocation.invoke(Invocation.java:82)
            10:23:55,322 INFO [STDOUT] at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:197)
            10:23:55,322 INFO [STDOUT] at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:473)
            10:23:55,322 INFO [STDOUT] at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:176)
            10:23:55,322 INFO [STDOUT] at $Proxy5.deploy(Unknown Source)
            10:23:55,322 INFO [STDOUT] at org.jboss.system.server.ServerImpl.doStart(ServerImpl.java:407)
            10:23:55,338 INFO [STDOUT] at org.jboss.system.server.ServerImpl.start(ServerImpl.java:311)
            10:23:55,338 INFO [STDOUT] at org.jboss.Main.boot(Main.java:145)
            10:23:55,338 INFO [STDOUT] at org.jboss.Main$1.run(Main.java:399)
            10:23:55,338 INFO [STDOUT] at java.lang.Thread.run(Thread.java:534)
            10:23:55,338 INFO [STDOUT] Caused by: javax.naming.NameNotFoundException: ejb not bound
            10:23:55,338 INFO [STDOUT] at org.jnp.server.NamingServer.getBinding(NamingServer.java:490)
            10:23:55,338 INFO [STDOUT] at org.jnp.server.NamingServer.getBinding(NamingServer.java:498)
            10:23:55,338 INFO [STDOUT] at org.jnp.server.NamingServer.getObject(NamingServer.java:504)
            10:23:55,353 INFO [STDOUT] at org.jnp.server.NamingServer.lookup(NamingServer.java:248)
            10:23:55,353 INFO [STDOUT] at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:530)
            10:23:55,353 INFO [STDOUT] at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:509)
            10:23:55,353 INFO [STDOUT] at javax.naming.InitialContext.lookup(InitialContext.java:347)
            10:23:55,353 INFO [STDOUT] at uk.co.mycom.mcm.ejb.MCMEnumBI.lookupHome(MCMEnumBI.java:265)
            10:23:55,353 INFO [STDOUT] ... 134 more
            10:23:55,385 INFO [ContextLoader] Using context class [org.springframework.web.context.support.XmlWebApplicationContext] for
             root WebApplicationContext
            10:23:55,385 INFO [ContextLoader] Root WebApplicationContext: initialization completed in 985 ms
            


            The ejb that my war file depends on deploys successfully after this stacktrace. Let me know if you need any further details.

            Thanks
            Joe