6 Replies Latest reply on Aug 16, 2010 2:51 PM by sara0804

    got javax.naming.NameNotFoundException error about the jndi name configured in the jboss-spring.xml for BeanFactory

    sara0804

      I try the example sportsclub with snowdrop1.1.0.GA on JBoss5.1.0.GA, but I keep getting NameNotFoundException for SpringDao the jndi name. I googled around for the posting regarding to the same problem, but I found few. I would like to see the annotation @Spring working for integration of Spring and EJB 3.0. I am wondering if anyone of you have the same problem. Any input is welcomed.

      Thank you very much in advance.

        • 1. Re: got javax.naming.NameNotFoundException error about the jndi name configured in the jboss-spring.xml for BeanFactory
          marius.bogoevici

          Hi Sara,

           

          Looks like something is missing in the deployment.

           

          I'll try get you a more comprehensive answer tomorrow, but can you post the:

           

          - class in which you inject the EJB

          - EJB definition

          - the application context definition that you use to  boostrap the application context.

           

          Also, if you have time, you can take a look at the Sportsclub example here:

           

          http://jboss.org/snowdrop/examples.html

           

          It contains a working EJB + Spring integration using Snowdrop.

           

          Hope this helps,

          Marius

          • 2. Re: got javax.naming.NameNotFoundException error about the jndi name configured in the jboss-spring.xml for BeanFactory
            marius.bogoevici

            Ah, I see that you are using the sportsclub example, sorry

             

            Have you installed the jboss deployer in JBoss AS?

             

            The instructions are here: http://docs.jboss.org/snowdrop/1.1/html/ch02.html#d0e150

            • 3. Re: got javax.naming.NameNotFoundException error about the jndi name configured in the jboss-spring.xml for BeanFactory
              sara0804

              Thank you Marius for the information and response.

              What I did to deploy jboss snowdrop is I dropped the snowdrop-deployers-1.1.0.GA.jar, snowdrop-vfs-1.1.0.GA.jar, and snowdrop-weaving-1.1.0.GA.jar at jbossAs_home/server/default/lib. I use jdk1.6.

               

              At \server\default\depooy\sportsclub.ear

                  + lib

                     sportsclub-domain.jar

                     sportsclub-jpa-dao-1.0.jar

                     sportsclub-reservations-spring-1.0.jar

                  + META-INF

                     application.xml

                     jboss-spring.xml

                  sportsclub-invoicing-ejb-1.0.jar

                  sportsclub-invoicing-webmvc.war

                  sportsclub-reservations-web-1.0.war

                  sportsclub-subscriptions-ejb-1.0.jar

                  sportsclub-subscriptions-web-1.0.war

               

              start database

              start JBossAS (no errors)

              go to http://localhost:8080/sportsclub/invoicing

              enter anything in the search text box, the request failed.

              The error log is below.

              I cannot find "SpringDao" jndi name from jmx console.

              I tried to move jboss-spring.xml to meta-info in sportsclub-invoicing-webmvc.war, I got same error.

              Am I miss something else?

               

               

              22:27:38,781 INFO  [DispatcherServlet] FrameworkServlet 'spring-mvc-servlet': initialization completed in 1094 ms
              22:27:48,953 ERROR [[spring-mvc-servlet]] Servlet.service() for servlet spring-mvc-servlet threw exception
              javax.naming.NameNotFoundException: SpringDao 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:726)
                      at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:686)
                      at javax.naming.InitialContext.lookup(InitialContext.java:392)
                      at org.jboss.util.naming.Util.lookup(Util.java:222)
                      at org.jboss.util.naming.Util.lookup(Util.java:182)
                      at org.jboss.spring.support.SpringInjectionSupport.getObjectFromBeanFactory(SpringInjectionSupport.java:130)
                      at org.jboss.spring.support.SpringInjectionSupport.injectToField(SpringInjectionSupport.java:189)
                      at org.jboss.spring.support.SpringInjectionSupport.inject(SpringInjectionSupport.java:76)
                      at org.jboss.spring.callback.SpringLifecycleInterceptor.postConstruct(SpringLifecycleInterceptor.java:44)
                      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.ejb3.interceptors.aop.LifecycleCallbackInterceptorMethodInterceptor.invoke(LifecycleCallbackInterce
              ptorMethodInterceptor.java:80)
                      at org.jboss.aop.joinpoint.ConstructionInvocation.invokeNext(ConstructionInvocation.java:79)
                      at org.jboss.ejb3.interceptors.aop.InvocationContextInterceptor.setup(InvocationContextInterceptor.java:88)
                      at org.jboss.aop.advice.org.jboss.ejb3.interceptors.aop.InvocationContextInterceptor_z_setup_11773393.invoke(Inv
              ocationContextInterceptor_z_setup_11773393.java)
                      at org.jboss.aop.joinpoint.ConstructionInvocation.invokeNext(ConstructionInvocation.java:79)
                      at org.jboss.aspects.currentinvocation.CurrentInvocationInterceptor.invoke(CurrentInvocationInterceptor.java:67)

               

                      at org.jboss.aop.joinpoint.ConstructionInvocation.invokeNext(ConstructionInvocation.java:79)
                      at org.jboss.ejb3.EJBContainer.invokeCallback(EJBContainer.java:1119)
                      at org.jboss.ejb3.EJBContainer.invokePostConstruct(EJBContainer.java:1133)
                      at org.jboss.ejb3.EJBContainer.invokePostConstruct(EJBContainer.java:1144)
                      at org.jboss.ejb3.pool.AbstractPool.create(AbstractPool.java:93)
                      at org.jboss.ejb3.InfinitePool.get(InfinitePool.java:56)
                      at org.jboss.ejb3.InfinitePool.get(InfinitePool.java:51)
                      at org.jboss.ejb3.pool.ThreadlocalPool.create(ThreadlocalPool.java:53)
                      at org.jboss.ejb3.pool.ThreadlocalPool.get(ThreadlocalPool.java:93)
                      at org.jboss.ejb3.stateless.StatelessInstanceInterceptor.invoke(StatelessInstanceInterceptor.java:58)
                      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
                      at org.jboss.aspects.tx.TxPolicy.invokeInOurTx(TxPolicy.java:79)
                      at org.jboss.aspects.tx.TxInterceptor$Required.invoke(TxInterceptor.java:190)
                      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
                      at org.jboss.aspects.tx.TxPropagationInterceptor.invoke(TxPropagationInterceptor.java:76)
                      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
                      at org.jboss.ejb3.tx.NullInterceptor.invoke(NullInterceptor.java:42)
                      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
                      at org.jboss.ejb3.security.Ejb3AuthenticationInterceptorv2.invoke(Ejb3AuthenticationInterceptorv2.java:186)
                      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
                      at org.jboss.ejb3.ENCPropagationInterceptor.invoke(ENCPropagationInterceptor.java:41)
                      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
                      at org.jboss.ejb3.BlockContainerShutdownInterceptor.invoke(BlockContainerShutdownInterceptor.java:67)
                      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
                      at org.jboss.aspects.currentinvocation.CurrentInvocationInterceptor.invoke(CurrentInvocationInterceptor.java:67)

               

                      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
                      at org.jboss.ejb3.session.SessionSpecContainer.invoke(SessionSpecContainer.java:176)
                      at org.jboss.ejb3.session.SessionSpecContainer.invoke(SessionSpecContainer.java:216)
                      at org.jboss.ejb3.proxy.impl.handler.session.SessionProxyInvocationHandlerBase.invoke(SessionProxyInvocationHand
              lerBase.java:207)
                      at org.jboss.ejb3.proxy.impl.handler.session.SessionProxyInvocationHandlerBase.invoke(SessionProxyInvocationHand
              lerBase.java:164)
                      at $Proxy335.findAccountsBySubscriberName(Unknown Source)
                      at org.jboss.snowdrop.samples.sportsclub.springmvc.AccountController.updateAccount(AccountController.java:59)
                      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.springframework.web.bind.annotation.support.HandlerMethodInvoker.invokeHandlerMethod(HandlerMethodInvoker
              .java:174)
                      at org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter.invokeHandlerMethod(AnnotationM
              ethodHandlerAdapter.java:421)
                      at org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter.handle(AnnotationMethodHandlerA
              dapter.java:409)
                      at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:771)
                      at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:716)
                      at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:644)
                      at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:560)
                      at javax.servlet.http.HttpServlet.service(HttpServlet.java:637)
                      at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
                      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
                      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
                      at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
                      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
                      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
                      at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:235)
                      at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
                      at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:190)
                      at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:92)
                      at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.process(SecurityContextEstablishmentValve.jav
              a:126)
                      at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.invoke(SecurityContextEstablishmentValve.java
              :70)
                      at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
                      at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
                      at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:158)
                      at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
                      at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:330)
                      at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:829)
                      at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:598)
                      at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
                      at java.lang.Thread.run(Thread.java:619)

              • 4. Re: got javax.naming.NameNotFoundException error about the jndi name configured in the jboss-spring.xml for BeanFactory
                alesj
                What I did to deploy jboss snowdrop is I dropped the snowdrop-deployers-1.1.0.GA.jar, snowdrop-vfs-1.1.0.GA.jar, and snowdrop-weaving-1.1.0.GA.jar at jbossAs_home/server/default/lib. I use jdk1.6.

                The snowdrop-deployers-1.1.0.GA.jar needs to go into deployers/ directory.

                As we need to pick up the deployer beans defined in its META-INF/*-jboss-beans.xml,

                which doesn't happen if you simply put it into lib dir.

                1 of 1 people found this helpful
                • 5. Re: got javax.naming.NameNotFoundException error about the jndi name configured in the jboss-spring.xml for BeanFactory
                  marius.bogoevici

                  Hi Sara,

                   

                  What you need to do is to

                  1) dowload the deployer from here: http://downloads.jboss.org/snowdrop/1.1.0.GA/jboss-spring-deployer-3.3.zip

                      (the main download page is at http://jboss.org/snowdrop/downloads.html)

                   

                  2) extract it into $JBOSS_HOME/server/default/deployers

                      (the whole procedure is described here: http://docs.jboss.org/snowdrop/1.1/html_single/index.html#d0e150)

                   

                  Hope this helps,

                  Marius

                  1 of 1 people found this helpful
                  • 6. Re: got javax.naming.NameNotFoundException error about the jndi name configured in the jboss-spring.xml for BeanFactory
                    sara0804

                    Thank you very much Marius and Ales for your help. It works! Great work.