3 Replies Latest reply on Aug 1, 2007 10:19 PM by Samuel Doyle

    Seam messes up JNDI lookups from webtier in GlassFish

    Samuel Doyle Apprentice

      Gah, I thougth Seam was going to make things easy to integrate not harder?

      Since Seam Remoting doesn't appear to work on GlassFish I am attempting to switchback to DWR which works fine as usual. But when I hit my server side object that does a JNDI lookup I get a no object bound to name exception. The exact same code works fine without using Seam.

      Very basic lookup in GlassFish that works without Seam:

       private GarageEntityBeanFacadeLocal lookupGarageEntityBeanFacade() {
       try {
       Context c = new InitialContext();
       return (GarageEntityBeanFacadeLocal) c.lookup("java:comp/env/ejb/GarageEntityBeanFacade");
       } catch(NamingException ne) {
       Logger.getLogger(getClass().getName()).log(Level.SEVERE,"exception caught" ,ne);
       throw new RuntimeException(ne);
       }
       }
      


      With Seam I constantly get the exception

      javax.naming.NameNotFoundException: No object bound to name exceptions.


      I really think Seam has potential but perhaps it is not ready for use with GlassFish. I'm really encountering several snags that really bogs me down and is preventing me from getting stuff done.

        • 1. Re: Seam messes up JNDI lookups from webtier in GlassFish
          Samuel Doyle Apprentice

          Here is the stack trace. You can see it is passing through the Seam Filter which I suspect is doing something whacky.

          javax.naming.NameNotFoundException: No object bound to name java:comp/env/ejb/GarageEntityBeanFacade
           at com.sun.enterprise.naming.NamingManagerImpl.lookup(NamingManagerImpl.java:834)
           at com.sun.enterprise.naming.java.javaURLContext.lookup(javaURLContext.java:173)
           at com.sun.enterprise.naming.SerialContext.lookup(SerialContext.java:337)
           at javax.naming.InitialContext.lookup(InitialContext.java:392)
           at com.covaluate.projects.fishermanswharf.web.client.ClientHandler.lookupGarageEntityBeanFacade(ClientHandler.java:61)
           at com.covaluate.projects.fishermanswharf.web.client.ClientHandler.getGarages(ClientHandler.java:38)
           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.directwebremoting.impl.ExecuteAjaxFilter.doFilter(ExecuteAjaxFilter.java:34)
           at org.directwebremoting.impl.DefaultRemoter$1.doFilter(DefaultRemoter.java:428)
           at org.directwebremoting.impl.DefaultRemoter.execute(DefaultRemoter.java:431)
           at org.directwebremoting.impl.DefaultRemoter.execute(DefaultRemoter.java:283)
           at org.directwebremoting.servlet.PlainCallHandler.handle(PlainCallHandler.java:52)
           at org.directwebremoting.servlet.UrlProcessor.handle(UrlProcessor.java:101)
           at org.directwebremoting.servlet.DwrServlet.doPost(DwrServlet.java:146)
           at javax.servlet.http.HttpServlet.service(HttpServlet.java:738)
           at javax.servlet.http.HttpServlet.service(HttpServlet.java:831)
           at org.apache.catalina.core.ApplicationFilterChain.servletService(ApplicationFilterChain.java:411)
           at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:317)
           at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:198)
           at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:82)
           at org.jboss.seam.web.MultipartFilter.doFilter(MultipartFilter.java:85)
           at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:68)
           at org.jboss.seam.web.ExceptionFilter.doFilter(ExceptionFilter.java:64)
           at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:68)
           at org.jboss.seam.web.RedirectFilter.doFilter(RedirectFilter.java:44)
           at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:68)
           at org.ajax4jsf.framework.ajax.xmlfilter.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:127)
           at org.ajax4jsf.framework.ajax.xmlfilter.BaseFilter.doFilter(BaseFilter.java:277)
           at org.jboss.seam.web.Ajax4jsfFilter.doFilter(Ajax4jsfFilter.java:60)
           at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:68)
           at org.jboss.seam.web.LoggingFilter.doFilter(LoggingFilter.java:58)
           at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:68)
           at org.jboss.seam.debug.hot.HotDeployFilter.doFilter(HotDeployFilter.java:68)
           at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:68)
           at org.jboss.seam.servlet.SeamFilter.doFilter(SeamFilter.java:149)
           at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:230)
           at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:198)
           at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:288)
           at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:271)
           at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:202)
           at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:632)
           at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:577)
           at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:94)
           at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:206)
           at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:632)
           at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:577)
           at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:571)
           at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:1080)
           at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:150)
           at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:632)
           at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:577)
           at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:571)
           at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:1080)
           at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:268)
           at com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.invokeAdapter(DefaultProcessorTask.java:637)
           at com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.doProcess(DefaultProcessorTask.java:568)
           at com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.process(DefaultProcessorTask.java:813)
           at com.sun.enterprise.web.connector.grizzly.DefaultReadTask.executeProcessorTask(DefaultReadTask.java:339)
           at com.sun.enterprise.web.connector.grizzly.DefaultReadTask.doTask(DefaultReadTask.java:261)
           at com.sun.enterprise.web.connector.grizzly.DefaultReadTask.doTask(DefaultReadTask.java:212)
           at com.sun.enterprise.web.connector.grizzly.TaskBase.run(TaskBase.java:265)
           at com.sun.enterprise.web.connector.grizzly.ssl.SSLWorkerThread.run(SSLWorkerThread.java:106)
          |#]
          


          • 2. Re: Seam messes up JNDI lookups from webtier in GlassFish
            Michael Yuan Novice

            Can you produce a repeatable test case? Seam does not handle JNDI registration for EJBs. My suspicion is that your EJBs are somehow not deployed correctly in the Seam app?

            • 3. Re: Seam messes up JNDI lookups from webtier in GlassFish
              Samuel Doyle Apprentice

              Looking at my previous version of the web.xml and comparing it to the seam-gen one I had and changed based on tutorials the format of the ejb-local-ref was different for this session bean.

              <ejb-local-ref>
               <ejb-ref-name>ejb/GarageEntityBeanFacade</ejb-ref-name>
               <ejb-ref-type>Session</ejb-ref-type>
               <local-home/>
               <local>com.myproject.ejb.entity.GarageEntityBeanFacadeLocal</local>
               <ejb-link>FishermansWharf-ejb.jar#GarageEntityBeanFacade</ejb-link>
               </ejb-local-ref>


              In addition the seam-gen web-app version tag for web.xml was set to 2.4 not 2.5 which is what I had previously had. I'm not sure if this made a difference or not but I was able to get it finally working after these changes.

              Thanks.