1 2 Previous Next 19 Replies Latest reply on Jan 8, 2008 4:56 PM by Andrew Rubinger

    Ejb 3 in Jboss 5 Beta 3

    Ragav Gomatam Novice

      Hi,

      I have ejb3 deployed & working in jboss 4.2.1. The same EAR when dropped into jboss 5 Beta 3\default\deploy has problems. Let me elaborate.
      I have ejb's . (1) SayHelloBean & (2) Calculator Bean. BOTH WORK IN jboss 4.2.1 and BOTH ARE EJB 3's.

      Code

      package com.ejb3.interfaces;
      
      import java.sql.SQLException;
      import javax.ejb.Local;
      @Local
      public interface SayHello {
       public String sayHelloWithEjb3DI() throws SQLException;
      

      }

      Bean

      package com.ejb3.beans;
      
      import static javax.ejb.TransactionAttributeType.REQUIRED;
      import javax.ejb.Stateful;
      import javax.ejb.TransactionAttribute;
      import javax.ejb.EJB;
      import javax.annotation.PostConstruct;
      import javax.annotation.Resource;
      import javax.interceptor.ExcludeDefaultInterceptors;
      import javax.sql.DataSource;
      import javax.annotation.PreDestroy;
      
      import org.springframework.jdbc.core.simple.SimpleJdbcDaoSupport;
      import org.jboss.annotation.spring.Spring;
      
      import com.ejb3.domain.IPerson;
      import com.ejb3.interfaces.Calculator;
      import com.ejb3.interfaces.SayHello;
      
      @Stateful
      @TransactionAttribute(REQUIRED)
      @ExcludeDefaultInterceptors
      public class SayHelloBean extends SimpleJdbcDaoSupport implements SayHello {
      
       @Resource(name = "jdbc/TestDs", type = DataSource.class, shareable = true, mappedName = "java:jdbc/OracleDS")
       private DataSource ds;
      
       @EJB(beanName = "CalculatorBean")
       private Calculator calculator;
      
       @Resource(name = "sqlForEjb")
       private String sql;
      
       public String sayHelloWithEjb3DI() {
       return "Testing ejb3 DI & your age is "
       + getSimpleJdbcTemplate().queryForInt(sql);
       }
      
       public double calulate() {
       return calculator.calculate(2, 3);
       }
      
       @PostConstruct
       public void init() {
       setDataSource(ds);
       }
      
       @PreDestroy
       public void callThis() {
       System.out.println("Invoking method: preDestroy()");
       }
      
      }
      


      BEAN 2
      package com.ejb3.interfaces;
      
      import javax.ejb.Local;
      
      @Local
      public interface Calculator {
       public double calculate(int i, int j);
      }



      package com.ejb3.beans;
      
      import static javax.ejb.TransactionAttributeType.REQUIRED;
      import javax.ejb.Stateless;
      import javax.ejb.TransactionAttribute;
      import javax.interceptor.ExcludeDefaultInterceptors;
      import com.ejb3.interfaces.Calculator;
      
      @Stateless
      @TransactionAttribute(REQUIRED)
      @ExcludeDefaultInterceptors
      public class CalculatorBean implements Calculator {
      
       public double calculate(int i, int j) {
       return i + j;
       }
      
      }
      
      


      This was deployed in an EAR file with spring looking up the ejb as follows :-

      <bean name="/home" class="com.ejb3.action.SpringEjb3Action"
       autowire="byName">
       <property name="sayhello" ref="ejbLocalIntf"></property>
       </bean>
       <!-- Jboss 4.2 look up of ejb3 -->
       <jee:jndi-lookup id="ejbLocalIntf" jndi-name="Ejb3/SayHelloBean/local" />
      </beans>


      This works perfectly in jboss 4.2.1 but in jboss 5 beta 3 I get the following deployment error :-


      org.jboss.deployers.spi.DeploymentException: Error deploying Ejb3.jar: Error creating ejb container CalculatorBean: java.lang.RuntimeException: Unable to load class for annotation org.jboss.annotation.ejb.PoolClass using class loader org.jboss.mx.loading.UnifiedClassLoader3@b8ec9b{ url=vfsfile:/C:/jboss-5.0.0.Beta3/server/default/deploy/Ejb3.ear ,addedOrder=21}

      Also in the jmx-console under jndiView, I see the ejb's not bound.

      java:comp namespace of the component jboss.j2ee:ear=Ejb3.ear,jar=Ejb3.jar,name=CalculatorBean,service=EJB3 :
      
       +- ORB[link -> java:/JBossCorbaORB] (class: javax.naming.LinkRef)
       +- EJBContext (class: javax.ejb.EJBContext)
       +- env (class: org.jnp.interfaces.NamingContext)


      I don't see the ejb's bound under GLOBAL JNDI Namespace either.

      Any suggestions/ideas ?

        • 1. Re: Ejb 3 in Jboss 5 Beta 3
          Andrew Rubinger Master

          Have you used any portion of the ejb3-interceptors-aop.xml from your 4.2.1 installation in Beta3?

          If not, please send me a zip/tar.gz of your source, along with the JARs, EARs you're trying to deploy?

          Email address in my profile.

          S,
          ALR

          • 2. Re: Ejb 3 in Jboss 5 Beta 3
            Andrew Rubinger Master

            For some more contextual information:

            org.jboss.annotation.ejb.PoolClass in the 4.2.x series has been renamed/refactored as org.jboss.ejb3.annotation.Pool. (See http://wiki.jboss.org/wiki/Wiki.jsp?page=ToAS5.0.0.Beta3).

            For your installation, the following command (on *nix-based Systems) should return clean:

            shell> grep -R 'PoolClass' $JBOSS_HOME


            If this is not the case, your Beta3 install has some old configs copied into it, and is not clean.

            Assuming there are no references to PoolClass in your installation, I'd like to look further for you.

            S,
            ALR

            • 3. Re: Ejb 3 in Jboss 5 Beta 3
              Ragav Gomatam Novice

              I am sending my entire source code in a Zip file to your email address...I have also enclosed a seperate zip file of my jboss 5 beta 3 install..Yes I copied over my ejb3-interceptors-aop.xml from my 4.2.1 and pasted it to 5.00 Beta 3. Is that correct ?

              I am using spring + ejb 3 & doing POJO DI into ejb3 with spring deployer. Worked like a charm in 4.2.1. PLease let me know.

              • 4. Re: Ejb 3 in Jboss 5 Beta 3
                Andrew Rubinger Master

                 

                "ragavgomatam" wrote:
                Yes I copied over my ejb3-interceptors-aop.xml from my 4.2.1 and pasted it to 5.00 Beta 3. Is that correct ?


                Nope, and is the source of your problem. :)

                ejb3-interceptors-aop.xml is the configuration for EJB3, and when we refactored the changes to the annotations, these needed to be reflected here.

                If you've got custom logic added in there to support your application, you've gotta merge it into the new version, or declare it in a separate *-aop.xml file to be placed alongside.

                Keep in mind the 5.x series is a major version increase and a bit of a departure from the 4.x series. Some migration may have to take place, but when 5.x goes GA it'll continue to be supported for some time.

                For now I'll leave it to you to merge up ejb3-interceptors-aop.xml as we've found the source of your errors. Take a look at the migration Wiki, and repost to this Thread with specifics if you're still stuck.

                Good luck.

                S,
                ALR

                • 5. Re: Ejb 3 in Jboss 5 Beta 3
                  Ragav Gomatam Novice

                  Hi Andy,

                  Still having no luck. I merged the xml's as you suggesed & I get the following errors :-

                  spring.jar/org/springframework/jmx/export/annotation/ManagedAttribute.class context=file:/C:/jboss-5.0.0.Beta3/server/default/deploy/ real=jar:file:/C:/DOCUME~1/Ragav/LOCALS~1
                  13:59:27,734 INFO [SpringInjectionInterceptor] Instantiating SpringInjectionInterceptor
                  13:59:32,141 INFO [MCKernelAbstraction] installing bean: jboss.j2ee:ear=Ejb3.ear,jar=Ejb3.jar,name=CalculatorBean,service=EJB3 with dependencies:
                  13:59:32,141 INFO [MCKernelAbstraction] and supplies:
                  13:59:32,141 INFO [MCKernelAbstraction] Class:com.ejb3.interfaces.Calculator
                  13:59:34,328 INFO [EJBContainer] STARTED EJB: com.ejb3.beans.CalculatorBean ejbName: CalculatorBean
                  13:59:34,859 INFO [EJBContainer] STOPPED EJB: com.ejb3.beans.CalculatorBean ejbName: CalculatorBean
                  13:59:34,859 ERROR [AbstractKernelController] Error installing to Start: name=jboss.j2ee:ear=Ejb3.ear,jar=Ejb3.jar,name=CalculatorBean,service=EJB3 state=Create
                  java.lang.NullPointerException
                  at org.jboss.ejb.txtimer.EJBTimerServiceImpl.restoreTimers(EJBTimerServiceImpl.java:452)
                  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.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
                  at $Proxy74.restoreTimers(Unknown Source)
                  at org.jboss.ejb3.timerservice.jboss.JBossTimerServiceFactory.restoreTimerService(JBossTimerServiceFactory.java:121)
                  at org.jboss.ejb3.stateless.StatelessContainer.start(StatelessContainer.java:128)
                  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.reflect.plugins.introspection.ReflectionUtils.invoke(ReflectionUtils.java:56)
                  at org.jboss.reflect.plugins.introspection.ReflectMethodInfoImpl.invoke(ReflectMethodInfoImpl.java:110)
                  at org.jboss.joinpoint.plugins.BasicMethodJoinPoint.dispatch(BasicMethodJoinPoint.java:66)
                  at org.jboss.kernel.plugins.dependency.KernelControllerContextAction$JoinpointDispatchWrapper.execute(KernelControllerContextAction.java:214)
                  at org.jboss.kernel.plugins.dependency.ExecutionWrapper.execute(ExecutionWrapper.java:45)
                  at org.jboss.kernel.plugins.dependency.KernelControllerContextAction.dispatchExecutionWrapper(KernelControllerContextAction.java:108)
                  at org.jboss.kernel.plugins.dependency.KernelControllerContextAction.dispatchJoinPoint(KernelControllerContextAction.java:69)
                  at org.jboss.kernel.plugins.dependency.LifecycleAction.installActionInternal(LifecycleAction.java:221)
                  at org.jboss.kernel.plugins.dependency.KernelControllerContextAction.installAction(KernelControllerContextAction.java:135)
                  at org.jboss.kernel.plugins.dependency.KernelControllerContextAction.installAction(KernelControllerContextAction.java:46)
                  13:59:34,891 INFO [MCKernelAbstraction] installing bean: jboss.j2ee:ear=Ejb3.ear,jar=Ejb3.jar,name=SayHelloBean,service=EJB3 with dependencies:
                  13:59:34,891 INFO [MCKernelAbstraction] installing bean: jboss.j2ee:ear=Ejb3.ear,jar=Ejb3.jar,name=SayHelloBean,service=EJB3 with dependencies:
                  13:59:34,891 INFO [MCKernelAbstraction] and supplies:
                  13:59:34,891 INFO [MCKernelAbstraction] Class:com.ejb3.interfaces.SayHello
                  13:59:37,438 INFO [NamedXmlApplicationContext] Refreshing org.jboss.spring.factory.NamedXmlApplicationContext@1c8c4c9: display name [org.jboss.spring.factory.NamedXmlApplicationContext@1c8c4c9]; startup date [Sun Dec 23 13:59:35 EST 2007]; root of context hierarchy
                  13:59:37,969 INFO [NamedXmlBeanDefinitionReader] Loading XML bean definitions from URL [vfsfile:/C:/jboss-5.0.0.Beta3/server/default/deploy/Ejb3.ear/spring-inject.jar/META-INF/jboss-spring.xml]
                  13:59:39,250 INFO [NamedXmlApplicationContext] Bean factory for application context [org.jboss.spring.factory.NamedXmlApplicationContext@1c8c4c9]: org.springframework.beans.factory.support.DefaultListableBeanFactory@ceb741
                  13:59:39,281 INFO [DefaultListableBeanFactory] Pre-instantiating singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@ceb741: defining beans [person]; root of factory hierarchy
                  13:59:40,266 INFO [TomcatDeployment] deploy, ctxPath=/ejb3, vfsUrl=Ejb3.ear/Ejb3.war
                  13:59:47,562 INFO [ContextLoaderPlugIn] ContextLoaderPlugIn for Struts ActionServlet 'action, module '': initialization started
                  13:59:47,562 INFO [[/ejb3]] Initializing WebApplicationContext for Struts ActionServlet 'action', module ''
                  13:59:47,562 INFO [XmlWebApplicationContext] Refreshing org.springframework.web.context.support.XmlWebApplicationContext@1b03a8a: display name [WebApplicationContext for namespace 'action-servlet']; startup date [Sun Dec 23 13:59:47 EST 2007]; root of context hierarchy
                  13:59:47,875 INFO [XmlBeanDefinitionReader] Loading XML bean definitions from ServletContext resource [/WEB-INF/spring-ejb3.xml]
                  13:59:48,031 INFO [XmlWebApplicationContext] Bean factory for application context [org.springframework.web.context.support.XmlWebApplicationContext@1b03a8a]: org.springframework.beans.factory.support.DefaultListableBeanFactory@1bfb995
                  13:59:48,047 INFO [DefaultListableBeanFactory] Pre-instantiating singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@1bfb995: defining beans [/home,ejbLocalIntf]; root of factory hierarchy
                  13:59:48,250 INFO [DefaultListableBeanFactory] Destroying singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@1bfb995: defining beans [/home,ejbLocalIntf]; root of factory hierarchy
                  13:59:48,250 ERROR [ContextLoaderPlugIn] Context initialization failed
                  org.springframework.beans.factory.BeanCreationException: Error creating bean with name '/home' defined in ServletContext resource [/WEB-INF/spring-ejb3.xml]: Cannot resolve reference to bean 'ejbLocalIntf' while setting bean property 'sayhello'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'ejbLocalIntf': Invocation of init method failed; nested exception is javax.naming.NameNotFoundException: Ejb3 not bound
                  Caused by:
                  org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'ejbLocalIntf': Invocation of init method failed; nested exception is javax.naming.NameNotFoundException: Ejb3 not bound
                  Caused by:
                  javax.naming.NameNotFoundException: Ejb3 not bound
                  at org.jnp.server.NamingServer.getBinding(NamingServer.java:542)
                  at org.jnp.server.NamingServer.getBinding(NamingServer.java:550)
                  at org.jnp.server.NamingServer.getObject(NamingServer.java:556)
                  at org.jnp.server.NamingServer.lookup(NamingServer.java:267)
                  at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:669)
                  at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:629)
                  at javax.naming.InitialContext.lookup(InitialContext.java:392)
                  at org.springframework.jndi.JndiTemplate$1.doInContext(JndiTemplate.java:123)
                  at org.springframework.jndi.JndiTemplate.execute(JndiTemplate.java:85)
                  at org.springframework.jndi.JndiTemplate.lookup(JndiTemplate.java:121)
                  at org.springframework.jndi.JndiTemplate.lookup(JndiTemplate.java:146)
                  at org.springframework.jndi.JndiLocatorSupport.lookup(JndiLocatorSupport.java:93)
                  at org.springframework.jndi.JndiObjectLocator.lookup(JndiObjectLocator.java:105)
                  at org.springframework.jndi.JndiObjectFactoryBean.lookupWithFallback(JndiObjectFactoryBean.java:197)
                  at org.springframework.jndi.JndiObjectFactoryBean.afterPropertiesSet(JndiObjectFactoryBean.java:184)
                  at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1202)
                  at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1172)

                  • 6. Re: Ejb 3 in Jboss 5 Beta 3
                    Ragav Gomatam Novice

                    Hi Andrew,

                    As advised I have sent the merged ejb3-interceptors-aop.xml.

                    Thanks & Merry Christmas

                    • 7. Re: Ejb 3 in Jboss 5 Beta 3
                      Andrew Rubinger Master

                      Great; when back from holiday travels I'll take a look for you.

                      S,
                      ALR

                      • 8. Re: Ejb 3 in Jboss 5 Beta 3
                        N Sampat Newbie

                        I am having the same problem too. I downloaded the jboss beta3. wrote a sample HelloWorld Stateless session bean and I found the same problem.

                        14:29:56,178 INFO [EJBContainer] STARTED EJB: com.ns.learn.ejb3.beans.helloworld.HelloUserBean ejbName: HelloUserBean
                        14:29:57,304 INFO [EJBContainer] STOPPED EJB: com.ns.learn.ejb3.beans.helloworld.HelloUserBean ejbName: HelloUserBean
                        14:29:57,304 ERROR [AbstractKernelController] Error installing to Start: name=jboss.j2ee:jar=helloworld.jar,name=HelloUserBean,service=EJB3 state=Create
                        java.lang.NullPointerException
                        at org.jboss.ejb.txtimer.EJBTimerServiceImpl.restoreTimers(EJBTimerServiceImpl.java:452)
                        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:585)
                        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.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
                        at $Proxy61.restoreTimers(Unknown Source)
                        at org.jboss.ejb3.timerservice.jboss.JBossTimerServiceFactory.restoreTimerService(JBossTimerServiceFactory.java:121)
                        at org.jboss.ejb3.stateless.StatelessContainer.start(StatelessContainer.java:128)
                        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:585)
                        at org.jboss.reflect.plugins.introspection.ReflectionUtils.invoke(ReflectionUtils.java:56)
                        at org.jboss.reflect.plugins.introspection.ReflectMethodInfoImpl.invoke(ReflectMethodInfoImpl.java:110)
                        at org.jboss.joinpoint.plugins.BasicMethodJoinPoint.dispatch(BasicMethodJoinPoint.java:66)
                        at org.jboss.kernel.plugins.dependency.KernelControllerContextAction$JoinpointDispatchWrapper.execute(KernelControllerContextAction.java:214)
                        at org.jboss.kernel.plugins.dependency.ExecutionWrapper.execute(ExecutionWrapper.java:45)
                        at org.jboss.kernel.plugins.dependency.KernelControllerContextAction.dispatchExecutionWrapper(KernelControllerContextAction.java:108)
                        at org.jboss.kernel.plugins.dependency.KernelControllerContextAction.dispatchJoinPoint(KernelControllerContextAction.java:69)
                        at org.jboss.kernel.plugins.dependency.LifecycleAction.installActionInternal(LifecycleAction.java:221)
                        at org.jboss.kernel.plugins.dependency.KernelControllerContextAction.installAction(KernelControllerContextAction.java:135)
                        at org.jboss.kernel.plugins.dependency.KernelControllerContextAction.installAction(KernelControllerContextAction.java:46)
                        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:327)
                        at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:1309)
                        at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:734)
                        at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:862)
                        at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:784)
                        at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:574)
                        at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:398)
                        at org.jboss.kernel.plugins.dependency.AbstractKernelController.install(AbstractKernelController.java:96)
                        at org.jboss.kernel.plugins.dependency.AbstractKernelController.install(AbstractKernelController.java:90)
                        at org.jboss.ejb3.MCKernelAbstraction.install(MCKernelAbstraction.java:151)
                        at org.jboss.ejb3.Ejb3Deployment.registerEJBContainer(Ejb3Deployment.java:350)
                        at org.jboss.ejb3.Ejb3Deployment.start(Ejb3Deployment.java:411)
                        at org.jboss.ejb3.deployers.EJBStage2Deployer.deploy(EJBStage2Deployer.java:53)
                        at org.jboss.ejb3.deployers.EJBStage2Deployer.deploy(EJBStage2Deployer.java:37)
                        at org.jboss.deployers.spi.deployer.helpers.AbstractSimpleRealDeployer.internalDeploy(AbstractSimpleRealDeployer.java:65)
                        at org.jboss.deployers.spi.deployer.helpers.AbstractRealDeployer.deploy(AbstractRealDeployer.java:50)
                        at org.jboss.deployers.plugins.deployers.DeployerWrapper.deploy(DeployerWrapper.java:169)
                        at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:853)
                        at org.jboss.deployers.plugins.deployers.DeployersImpl.install(DeployersImpl.java:794)
                        at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:327)
                        at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:1309)
                        at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:734)
                        at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:862)
                        at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:784)
                        at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:622)
                        at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:411)
                        at org.jboss.deployers.plugins.deployers.DeployersImpl.process(DeployersImpl.java:498)
                        at org.jboss.deployers.plugins.main.MainDeployerImpl.process(MainDeployerImpl.java:506)
                        at org.jboss.system.server.profileservice.ProfileServiceBootstrap.loadProfile(ProfileServiceBootstrap.java:245)
                        at org.jboss.system.server.profileservice.ProfileServiceBootstrap.start(ProfileServiceBootstrap.java:131)
                        at org.jboss.bootstrap.AbstractServerImpl.start(AbstractServerImpl.java:408)
                        at org.jboss.Main.boot(Main.java:208)
                        at org.jboss.Main$1.run(Main.java:534)



                        "ALRubinger" wrote:
                        Great; when back from holiday travels I'll take a look for you.

                        S,
                        ALR


                        • 9. Re: Ejb 3 in Jboss 5 Beta 3
                          N Sampat Newbie

                          However, no null pointer exception was thrown if jar did not exist in deploy directory and copied later on after server was started.

                          Is this a problem with the deploy/initialise order?

                          Nilesh

                          ###### successful start only if jar did not exist in deploy directory but later on deployed after started successfully.


                          15:28:51,557 INFO [Http11Protocol] Starting Coyote HTTP/1.1 on http-127.0.0.1-8080
                          15:28:51,823 INFO [AjpProtocol] Starting Coyote AJP/1.3 on ajp-127.0.0.1-8009
                          15:28:51,823 INFO [ServerImpl] JBoss (Microcontainer) [5.0.0.Beta3 (build: SVNTag=JBoss_5_0_0_Beta3 date=200712210026)] Started in 3m:48s:288ms
                          15:28:59,463 INFO [MCKernelAbstraction] installing bean: jboss.j2ee:jar=helloworld.jar,name=HelloUserBean,service=EJB3 with dependencies:
                          15:28:59,463 INFO [MCKernelAbstraction] and supplies:
                          15:28:59,479 INFO [MCKernelAbstraction] Class:com.ns.learn.ejb3.beans.helloworld.HelloUser
                          15:29:03,370 INFO [EJBContainer] STARTED EJB: com.ns.learn.ejb3.beans.helloworld.HelloUserBean ejbName: HelloUserBean
                          15:29:04,667 INFO [MCKernelAbstraction] installing bean: jboss.j2ee:jar=helloworld.jar,name=SearchFacade,service=EJB3 with dependencies:
                          15:29:04,667 INFO [MCKernelAbstraction] and supplies:
                          15:29:04,667 INFO [MCKernelAbstraction] Class:com.ns.learn.ejb3.beans.searchfacade.SearchFacadeLocal
                          15:29:04,667 INFO [MCKernelAbstraction] Class:com.ns.learn.ejb3.beans.searchfacade.SearchFacade
                          15:29:06,823 INFO [EJBContainer] STARTED EJB: com.ns.learn.ejb3.beans.searchfacade.SearchFacadeBean ejbName: SearchFacade

                          "ALRubinger" wrote:
                          Great; when back from holiday travels I'll take a look for you.

                          S,
                          ALR


                          • 10. Re: Ejb 3 in Jboss 5 Beta 3
                            N Sampat Newbie

                            sorry However, no null pointer exception was NOT thrown ......and deployed later on i.e. after server was started.

                            "sampatn" wrote:
                            However, no null pointer exception was thrown if jar did not exist in deploy directory and copied later on after server was started.

                            Is this a problem with the deploy/initialise order?

                            Nilesh

                            ###### successful start only if jar did not exist in deploy directory but later on deployed after started successfully.


                            15:28:51,557 INFO [Http11Protocol] Starting Coyote HTTP/1.1 on http-127.0.0.1-8080
                            15:28:51,823 INFO [AjpProtocol] Starting Coyote AJP/1.3 on ajp-127.0.0.1-8009
                            15:28:51,823 INFO [ServerImpl] JBoss (Microcontainer) [5.0.0.Beta3 (build: SVNTag=JBoss_5_0_0_Beta3 date=200712210026)] Started in 3m:48s:288ms
                            15:28:59,463 INFO [MCKernelAbstraction] installing bean: jboss.j2ee:jar=helloworld.jar,name=HelloUserBean,service=EJB3 with dependencies:
                            15:28:59,463 INFO [MCKernelAbstraction] and supplies:
                            15:28:59,479 INFO [MCKernelAbstraction] Class:com.ns.learn.ejb3.beans.helloworld.HelloUser
                            15:29:03,370 INFO [EJBContainer] STARTED EJB: com.ns.learn.ejb3.beans.helloworld.HelloUserBean ejbName: HelloUserBean
                            15:29:04,667 INFO [MCKernelAbstraction] installing bean: jboss.j2ee:jar=helloworld.jar,name=SearchFacade,service=EJB3 with dependencies:
                            15:29:04,667 INFO [MCKernelAbstraction] and supplies:
                            15:29:04,667 INFO [MCKernelAbstraction] Class:com.ns.learn.ejb3.beans.searchfacade.SearchFacadeLocal
                            15:29:04,667 INFO [MCKernelAbstraction] Class:com.ns.learn.ejb3.beans.searchfacade.SearchFacade
                            15:29:06,823 INFO [EJBContainer] STARTED EJB: com.ns.learn.ejb3.beans.searchfacade.SearchFacadeBean ejbName: SearchFacade

                            "ALRubinger" wrote:
                            Great; when back from holiday travels I'll take a look for you.

                            S,
                            ALR


                            • 11. Re: Ejb 3 in Jboss 5 Beta 3
                              Ragav Gomatam Novice

                              Really....I will try this & let you know...But I have Spring 2.0 Injecting POJO's into Ejb 3....I am also using the spring deployer in conjunction with ejb 3. I had no problems with jboss 4.2.1 GA...It worked beautifully....Again, let me test it out as you suggested. I will remove my EAR & then drop it in & let you know

                              • 12. Re: Ejb 3 in Jboss 5 Beta 3
                                Ragav Gomatam Novice

                                Yes....Correct....When you deploy after the server is started, I get no ejb 3 errors....I still get errors but these are related to spring deployer being bound to jndi...I have shown the errors belo.w..I will post it at spring-ejb3 forums...

                                08:41,938 INFO [SpringInjectionInterceptor] Instantiating SpringInjectionInterceptor
                                08:45,375 INFO [MCKernelAbstraction] installing bean: jboss.j2ee:ear=Ejb3.ear,jar=Ejb3.jar,name=CalculatorBean,service=EJB3 with dependencies:
                                08:45,375 INFO [MCKernelAbstraction] and supplies:
                                08:45,375 INFO [MCKernelAbstraction] Class:com.ejb3.interfaces.Calculator
                                08:47,719 INFO [EJBContainer] STARTED EJB: com.ejb3.beans.CalculatorBean ejbName: CalculatorBean
                                08:48,203 INFO [MCKernelAbstraction] installing bean: jboss.j2ee:ear=Ejb3.ear,jar=Ejb3.jar,name=SayHelloBean,service=EJB3 with dependencies:
                                08:48,203 INFO [MCKernelAbstraction] and supplies:
                                08:48,203 INFO [MCKernelAbstraction] Class:com.ejb3.interfaces.SayHello
                                08:50,062 INFO [EJBContainer] STARTED EJB: com.ejb3.beans.SayHelloBean ejbName: SayHelloBean
                                08:50,828 INFO [NamedXmlApplicationContext] Refreshing org.jboss.spring.factory.NamedXmlApplicationContext@142781b: display name [org.jboss.spring.factory.NamedXmlApplicationContext@142781b]; startup date [Tue Jan 01 10:08:50 EST 2008]; root of context hierarchy
                                08:51,203 INFO [NamedXmlBeanDefinitionReader] Loading XML bean definitions from URL [vfsfile:/C:/jboss-5.0.0.Beta3/server/default/deploy/Ejb3.ear/spring-inject.jar/META-INF/jboss-spring.xml]
                                08:52,547 INFO [NamedXmlApplicationContext] Bean factory for application context [org.jboss.spring.factory.NamedXmlApplicationContext@142781b]: org.springframework.beans.factory.support.DefaultListableBeanFactory@1eb1b28
                                08:52,578 INFO [DefaultListableBeanFactory] Pre-instantiating singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@1eb1b28: defining beans [person]; root of factory hierarchy
                                08:52,891 INFO [TomcatDeployment] deploy, ctxPath=/ejb3, vfsUrl=Ejb3.ear/Ejb3.war
                                08:53,500 INFO [ContextLoaderPlugIn] ContextLoaderPlugIn for Struts ActionServlet 'action, module '': initialization started
                                08:53,516 INFO [[/ejb3]] Initializing WebApplicationContext for Struts ActionServlet 'action', module ''
                                08:53,516 INFO [XmlWebApplicationContext] Refreshing org.springframework.web.context.support.XmlWebApplicationContext@1578c50: display name [WebApplicationContext for namespace 'action-servlet']; startup date [Tue Jan 01 10:08:53 EST 2008]; root of context hierarchy
                                08:53,828 INFO [XmlBeanDefinitionReader] Loading XML bean definitions from ServletContext resource [/WEB-INF/spring-ejb3.xml]
                                08:54,000 INFO [XmlWebApplicationContext] Bean factory for application context [org.springframework.web.context.support.XmlWebApplicationContext@1578c50]: org.springframework.beans.factory.support.DefaultListableBeanFactory@15d7a6a
                                08:54,016 INFO [DefaultListableBeanFactory] Pre-instantiating singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@15d7a6a: defining beans [/home,ejbLocalIntf]; root of factory hierarchy
                                08:54,266 ERROR [STDERR] java.lang.RuntimeException: javax.naming.NameNotFoundException: spring-inject not bound
                                08:54,266 ERROR [STDERR] at org.jboss.ejb3.EJBContainer.construct(EJBContainer.java:727)
                                08:54,266 ERROR [STDERR] at org.jboss.ejb3.stateful.StatefulContainer.createBeanContext(StatefulContainer.java:103)
                                08:54,266 ERROR [STDERR] at org.jboss.ejb3.pool.AbstractPool.createBeanContext(AbstractPool.java:130)
                                08:54,266 ERROR [STDERR] at org.jboss.ejb3.pool.AbstractPool.create(AbstractPool.java:79)
                                08:54,266 ERROR [STDERR] at org.jboss.ejb3.InfinitePool.get(InfinitePool.java:56)
                                08:54,266 ERROR [STDERR] at org.jboss.ejb3.pool.ThreadlocalPool.create(ThreadlocalPool.java:58)
                                08:54,266 ERROR [STDERR] at org.jboss.ejb3.pool.ThreadlocalPool.get(ThreadlocalPool.java:113)
                                08:54,266 ERROR [STDERR] at org.jboss.ejb3.cache.simple.SimpleStatefulCache.create(SimpleStatefulCache.java:351)
                                08:54,266 ERROR [STDERR] at org.jboss.ejb3.stateful.StatefulContainer.createSession(StatefulContainer.java:296)
                                08:54,266 ERROR [STDERR] at org.jboss.ejb3.session.SessionContainer.createSession(SessionContainer.java:457)
                                08:54,266 ERROR [STDERR] at org.jboss.ejb3.stateful.StatefulLocalProxyFactory.createProxy(StatefulLocalProxyFactory.java:148)
                                08:54,266 ERROR [STDERR] at org.jboss.ejb3.JndiProxyFactory.getObjectInstance(JndiProxyFactory.java:55)
                                08:54,266 ERROR [STDERR] at javax.naming.spi.NamingManager.getObjectInstance(NamingManager.java:304)
                                08:54,266 ERROR [STDERR] at org.jnp.interfaces.NamingContext.getObjectInstance(NamingContext.java:1312)
                                08:54,266 ERROR [STDERR] at org.jnp.interfaces.NamingContext.getObjectInstanceWrapFailure(NamingContext.java:1329)
                                08:54,266 ERROR [STDERR] at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:765)
                                08:54,266 ERROR [STDERR] at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:629)
                                08:54,266 ERROR [STDERR] at javax.naming.InitialContext.lookup(InitialContext.java:392)
                                08:54,266 ERROR [STDERR] at org.springframework.jndi.JndiTemplate$1.doInContext(JndiTemplate.java:123)
                                08:54,266 ERROR [STDERR] at org.springframework.jndi.JndiTemplate.execute(JndiTemplate.java:85)
                                08:54,266 ERROR [STDERR] at org.springframework.jndi.JndiTemplate.lookup(JndiTemplate.java:121)
                                08:54,266 ERROR [STDERR] at org.springframework.jndi.JndiTemplate.lookup(JndiTemplate.java:146)
                                08:54,266 ERROR [STDERR] at org.springframework.jndi.JndiLocatorSupport.lookup(JndiLocatorSupport.java:93)





                                Alright Andy do we have any clues here ?

                                • 13. Re: Ejb 3 in Jboss 5 Beta 3
                                  Andrew Rubinger Master

                                   

                                  "ragavgomatam" wrote:
                                  Alright Andy do we have any clues here ?


                                  I'm best able to determine bugs if provided with a slimmed-down use case exhibiting the error in question. Would like to know how to duplicate:

                                  java.lang.NullPointerException
                                  at org.jboss.ejb.txtimer.EJBTimerServiceImpl.restoreTimers(EJBTimerServiceImpl.java:452)


                                  I can't speak to the Spring Injection binding errors....

                                  This thread has gotten a bit convoluted from its initial intent. :) Let's separate out each individual error in its own topic? And if someone could provide easily-reproducible sample code for the NPE in the Timer Service, would be appreciated.

                                  S,
                                  ALR

                                  • 14. Re: Ejb 3 in Jboss 5 Beta 3
                                    N Sampat Newbie

                                    Hello Andrew,

                                    In order to reproduce this error follow the following steps.

                                    - create a simple Hello World stateless session bean
                                    - copy helloworld.jar into server/default/deploy directory
                                    - start the server using run.bat
                                    - error is reproducible
                                    - EJB3 are not successfully redeployed.

                                    However, in order to successfully deploy follow these steps.
                                    - delete helloworld.jar from server/default/deploy directory i.e.
                                    make sure helloworld.jar does not exists in server/default/deploy directory
                                    - start the server using run.bat
                                    - server starts successfully
                                    - Now copy the same helloworld.jar into server/default/deploy directory
                                    - EJB is successfully deployed
                                    - client can now access the EJB

                                    If you want me to send you helloworld.jar for you to test at your end then please drop me an email. I will send you the same.

                                    Nilesh


                                    "ALRubinger" wrote:
                                    "ragavgomatam" wrote:
                                    Alright Andy do we have any clues here ?


                                    I'm best able to determine bugs if provided with a slimmed-down use case exhibiting the error in question. Would like to know how to duplicate:

                                    java.lang.NullPointerException
                                    at org.jboss.ejb.txtimer.EJBTimerServiceImpl.restoreTimers(EJBTimerServiceImpl.java:452)


                                    I can't speak to the Spring Injection binding errors....

                                    This thread has gotten a bit convoluted from its initial intent. :) Let's separate out each individual error in its own topic? And if someone could provide easily-reproducible sample code for the NPE in the Timer Service, would be appreciated.

                                    S,
                                    ALR


                                    1 2 Previous Next