0 Replies Latest reply: Dec 23, 2009 6:01 PM by Luiz Abrahao RSS

    JNDI Exception on Glassfish

    Luiz Abrahao Newbie

      Hi,


      I'm running on Glassfish, trying to inject a Seam component into another Seam component and getting the follow exception:


      Caused by javax.naming.NameNotFoundException with message: "No object bound to name java:comp/env/elf/CompanyDAOBean/local"
      
      com.sun.enterprise.naming.NamingManagerImpl.lookup(NamingManagerImpl.java:856)
      com.sun.enterprise.naming.java.javaURLContext.lookup(javaURLContext.java:173)
      com.sun.enterprise.naming.SerialContext.lookup(SerialContext.java:407)
      javax.naming.InitialContext.lookup(InitialContext.java:392)
      org.jboss.seam.Component.instantiateSessionBean(Component.java:1400)
      org.jboss.seam.Component.instantiate(Component.java:1364)
      org.jboss.seam.Component.newInstance(Component.java:2122)
      org.jboss.seam.Component.getInstance(Component.java:2021)
      org.jboss.seam.Component.getInstance(Component.java:1983)
      org.jboss.seam.Component.getInstance(Component.java:1977)
      org.jboss.seam.Component.getInstanceInAllNamespaces(Component.java:2349)
      org.jboss.seam.Component.getValueToInject(Component.java:2301)
      org.jboss.seam.Component.injectAttributes(Component.java:1736)
      org.jboss.seam.Component.inject(Component.java:1554)
      org.jboss.seam.core.BijectionInterceptor.aroundInvoke(BijectionInterceptor.java:61)
      org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
      org.jboss.seam.core.MethodContextInterceptor.aroundInvoke(MethodContextInterceptor.java:44)
      org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
      org.jboss.seam.persistence.EntityManagerProxyInterceptor.aroundInvoke(EntityManagerProxyInterceptor.java:29)
      org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
      org.jboss.seam.persistence.HibernateSessionProxyInterceptor.aroundInvoke(HibernateSessionProxyInterceptor.java:30)
      org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
      org.jboss.seam.intercept.RootInterceptor.invoke(RootInterceptor.java:107)
      org.jboss.seam.intercept.SessionBeanInterceptor.aroundInvoke(SessionBeanInterceptor.java:50)
      sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      java.lang.reflect.Method.invoke(Method.java:597)
      com.sun.ejb.containers.interceptors.AroundInvokeInterceptor.intercept(InterceptorManager.java:579)
      com.sun.ejb.containers.interceptors.AroundInvokeChainImpl.invokeNext(InterceptorManager.java:483)
      com.sun.ejb.containers.interceptors.InterceptorManager.intercept(InterceptorManager.java:205)
      com.sun.ejb.containers.BaseContainer.intercept(BaseContainer.java:4003)
      com.sun.ejb.containers.EJBLocalObjectInvocationHandler.invoke(EJBLocalObjectInvocationHandler.java:197)
      com.sun.ejb.containers.EJBLocalObjectInvocationHandlerDelegate.invoke(EJBLocalObjectInvocationHandlerDelegate.java:127)
      $Proxy318.saveCompany(Unknown Source)
      sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      java.lang.reflect.Method.invoke(Method.java:597)
      org.jboss.seam.util.Reflections.invoke(Reflections.java:22)
      org.jboss.seam.intercept.RootInvocationContext.proceed(RootInvocationContext.java:32)
      org.jboss.seam.intercept.ClientSideInterceptor$1.proceed(ClientSideInterceptor.java:76)
      org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:56)
      org.jboss.seam.intercept.RootInterceptor.invoke(RootInterceptor.java:107)
      org.jboss.seam.intercept.ClientSideInterceptor.invoke(ClientSideInterceptor.java:54)
      org.javassist.tmp.java.lang.Object_$$_javassist_seam_3.saveCompany(Object_$$_javassist_seam_3.java)
      sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      java.lang.reflect.Method.invoke(Method.java:597)
      org.jboss.el.util.ReflectionUtil.invokeMethod(ReflectionUtil.java:335)
      org.jboss.el.util.ReflectionUtil.invokeMethod(ReflectionUtil.java:348)
      org.jboss.el.parser.AstPropertySuffix.invoke(AstPropertySuffix.java:58)
      org.jboss.el.parser.AstValue.invoke(AstValue.java:96)
      org.jboss.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:276)
      com.sun.facelets.el.TagMethodExpression.invoke(TagMethodExpression.java:68)
      javax.faces.component.MethodBindingMethodExpressionAdapter.invoke(MethodBindingMethodExpressionAdapter.java:77)
      com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:91)
      javax.faces.component.UICommand.broadcast(UICommand.java:383)
      javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:447)
      javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:752)
      com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:97)
      com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:251)
      com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:117)
      com.icesoft.faces.webapp.http.core.JsfLifecycleExecutor.apply(JsfLifecycleExecutor.java:18)
      com.icesoft.faces.webapp.http.core.ReceiveSendUpdates.renderCycle(ReceiveSendUpdates.java:132)
      com.icesoft.faces.webapp.http.core.ReceiveSendUpdates.service(ReceiveSendUpdates.java:74)
      com.icesoft.faces.webapp.http.core.RequestVerifier.service(RequestVerifier.java:31)
      com.icesoft.faces.webapp.http.common.standard.PathDispatcherServer.service(PathDispatcherServer.java:24)
      com.icesoft.faces.webapp.http.servlet.BasicAdaptingServlet.service(BasicAdaptingServlet.java:16)
      com.icesoft.faces.webapp.http.servlet.PathDispatcher.service(PathDispatcher.java:23)
      com.icesoft.faces.webapp.http.servlet.SessionDispatcher.service(SessionDispatcher.java:53)
      com.icesoft.faces.webapp.http.servlet.SessionVerifier.service(SessionVerifier.java:26)
      com.icesoft.faces.webapp.http.servlet.PathDispatcher.service(PathDispatcher.java:23)
      com.icesoft.faces.webapp.http.servlet.MainServlet.service(MainServlet.java:131)
      javax.servlet.http.HttpServlet.service(HttpServlet.java:847)
      com.icesoft.faces.webapp.xmlhttp.BlockingServlet.service(BlockingServlet.java:56)
      org.apache.catalina.core.ApplicationFilterChain.servletService(ApplicationFilterChain.java:427)
      org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:333)
      org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:214)
      org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:83)
      org.jboss.seam.web.LoggingFilter.doFilter(LoggingFilter.java:60)
      org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
      org.jboss.seam.web.ExceptionFilter.doFilter(ExceptionFilter.java:64)
      org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
      org.jboss.seam.web.RedirectFilter.doFilter(RedirectFilter.java:45)
      org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
      org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:73)
      org.jboss.seam.web.IdentityFilter.doFilter(IdentityFilter.java:40)
      org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
      org.jboss.seam.servlet.SeamFilter.doFilter(SeamFilter.java:158)
      org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:246)
      org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:214)
      org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:313)
      org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:287)
      org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:218)
      org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:648)
      org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:593)
      com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:94)
      com.sun.enterprise.web.PESessionLockingStandardPipeline.invoke(PESessionLockingStandardPipeline.java:98)
      org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:222)
      org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:648)
      org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:593)
      org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:587)
      org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:1096)
      org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:166)
      org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:648)
      org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:593)
      org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:587)
      org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:1096)
      org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:288)
      com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.invokeAdapter(DefaultProcessorTask.java:647)
      com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.doProcess(DefaultProcessorTask.java:579)
      com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.process(DefaultProcessorTask.java:831)
      com.sun.enterprise.web.connector.grizzly.DefaultReadTask.executeProcessorTask(DefaultReadTask.java:341)
      com.sun.enterprise.web.connector.grizzly.DefaultReadTask.doTask(DefaultReadTask.java:263)
      com.sun.enterprise.web.connector.grizzly.DefaultReadTask.doTask(DefaultReadTask.java:214)
      com.sun.enterprise.web.connector.grizzly.TaskBase.run(TaskBase.java:265)
      com.sun.enterprise.web.connector.grizzly.ssl.SSLWorkerThread.run(SSLWorkerThread.java:106)



      The configuration files:


      components.xml


      <core:init debug="true" jndi-pattern="java:comp/env/elf/#{ejbName}/local" />



      web.xml:


      <ejb-local-ref>
          <ejb-ref-name>elf/CompanyDAOBean/local</ejb-ref-name>
          <ejb-ref-type>Session</ejb-ref-type>
          <local>com.eukleia.model.dao.common.declaration.CompanyDAO</local>
      </ejb-local-ref>




      ejb-jar.xml:


          <enterprise-beans>
               <session>
                    <ejb-name>CompanyDAOBean</ejb-name>
                    <ejb-local-ref>
                       <ejb-ref-name>elf/CompanyDAOBean/local</ejb-ref-name>
                       <ejb-ref-type>Session</ejb-ref-type>
                       <local>com.eukleia.model.dao.common.declaration.CompanyDAO</local>
                    </ejb-local-ref>
               </session>
          </enterprise-beans>
      



      Am I missing something?


      Thank you!