4 Replies Latest reply on Dec 3, 2008 5:19 PM by Andreas Eriksson

    NameNotFoundException on deploy when adding Seam Remoting

    Andreas Eriksson Newbie

      Hi,


      I'm trying to use Seam Remoting but get the same exception over and over again:



      Caused by: java.lang.IllegalArgumentException: EntityManagerFactory not found in JNDI : java:/testEntityManagerFactory
           at org.jboss.seam.persistence.ManagedPersistenceContext.getEntityManagerFactoryFromJndiOrValueBinding(ManagedPersistenceContext.java:231)
           at org.jboss.seam.persistence.ManagedPersistenceContext.initEntityManager(ManagedPersistenceContext.java:78)
           at org.jboss.seam.persistence.ManagedPersistenceContext.getEntityManager(ManagedPersistenceContext.java:107)
           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.seam.util.Reflections.invoke(Reflections.java:22)
           at org.jboss.seam.util.Reflections.invokeAndWrap(Reflections.java:144)
           at org.jboss.seam.Component.callComponentMethod(Component.java:2210)
           at org.jboss.seam.Component.unwrap(Component.java:2236)
           at org.jboss.seam.Component.getInstance(Component.java:2003)
           at org.jboss.seam.Component.getInstance(Component.java:1949)
           at org.jboss.seam.Component.getInstance(Component.java:1943)
           at org.jboss.seam.Component.getInstanceInAllNamespaces(Component.java:2310)
           at org.jboss.seam.Component.getValueToInject(Component.java:2262)
           at org.jboss.seam.Component.injectAttributes(Component.java:1702)
           at org.jboss.seam.Component.inject(Component.java:1520)
           at org.jboss.seam.core.BijectionInterceptor.aroundInvoke(BijectionInterceptor.java:61)
           at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
           at org.jboss.seam.core.MethodContextInterceptor.aroundInvoke(MethodContextInterceptor.java:44)
           at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
           at org.jboss.seam.intercept.RootInterceptor.invoke(RootInterceptor.java:107)
           at org.jboss.seam.intercept.JavaBeanInterceptor.interceptInvocation(JavaBeanInterceptor.java:166)
           at org.jboss.seam.intercept.JavaBeanInterceptor.invoke(JavaBeanInterceptor.java:102)
           at com.cambobo.core.services.common.IndexerService_$$_javassist_0.index(IndexerService_$$_javassist_0.java)
           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.seam.util.Reflections.invoke(Reflections.java:22)
           at org.jboss.seam.util.Reflections.invokeAndWrap(Reflections.java:144)
           at org.jboss.seam.Component.callComponentMethod(Component.java:2210)
           at org.jboss.seam.Component.callCreateMethod(Component.java:2133)
           at org.jboss.seam.Component.newInstance(Component.java:2093)
           ... 95 more
      Caused by: javax.naming.NameNotFoundException: testEntityManagerFactory not bound
           at org.jnp.server.NamingServer.getBinding(NamingServer.java:529)
           at org.jnp.server.NamingServer.getBinding(NamingServer.java:537)
           at org.jnp.server.NamingServer.getObject(NamingServer.java:543)
           at org.jnp.server.NamingServer.lookup(NamingServer.java:296)
           at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:667)
           at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:627)
           at javax.naming.InitialContext.lookup(InitialContext.java:351)
           at org.jboss.seam.persistence.ManagedPersistenceContext.getEntityManagerFactoryFromJndiOrValueBinding(ManagedPersistenceContext.java:227)
           ... 129 more
      
      



      This is on a clean JBoss AS 4.2.3.GA using Seam 2.1.1.CR1.


      But(!), if I remove Seam Remoting and deploy the EAR and then add the Seam Remoting dependency and hot deploy - everything is fine!


      I put my jboss-seam-remoting.jar in my EAR/lib directory.


      I'm using SMPC.


      Any tips?!


      Cheers!

        • 1. Re: NameNotFoundException on deploy when adding Seam Remoting
          Andreas Eriksson Newbie

          I'd like to clearify that I'm only adding the Seam Remoting JAR - I'm NOT USING any Seam Remoting functionality yet!


          If I remove the Seam Remoting JAR from my EAR my application works as expected.


          Cheers!

          • 2. Re: NameNotFoundException on deploy when adding Seam Remoting
            Andreas Eriksson Newbie

            So, what I found out this morning is the following...


            If I remove the orm.xml from my EJB-JAR - everything works!


            I tried to add the orm.xml to the Seam HelloWorld Remoting example to reproduce the exception but it didn't.


            I will try to setup a new project using SMPC and Seam Remoting with the orm.xml and see if the exception occurs again.


            Here's my orm.xml:



            <?xml version="1.0" encoding="UTF-8"?>
            <entity-mappings xmlns="http://java.sun.com/xml/ns/persistence/orm"
                             xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                             xsi:schemaLocation="http://java.sun.com/xml/ns/persistence/orm http://java.sun.com/xml/ns/persistence/orm_1_0.xsd"
                             version="1.0">
                             
                <persistence-unit-metadata>
                    <persistence-unit-defaults>
                        <entity-listeners>
                            <entity-listener class="org.jboss.seam.security.EntitySecurityListener"/>
                        </entity-listeners>
                    </persistence-unit-defaults>
                </persistence-unit-metadata>
                
            </entity-mappings>



            Tips is still appreciatet :-)


            Cheers!

            • 3. Re: NameNotFoundException on deploy when adding Seam Remoting
              Andreas Eriksson Newbie

              Created a sample project re-producing the exception and filed it to JIRA.


              JBSEAM-3779


              Cheers!

              • 4. Re: NameNotFoundException on deploy when adding Seam Remoting
                Andreas Eriksson Newbie

                This is apparently not a bug according to Pete Muir, hmm....


                Okay, so I modified the JBoss Seam Hello World remoting example shipped with the JBoss Seam 2.1.1.CR1 release and it complains on not being able to parse the components.xml.


                What did I do?



                1. Added the entity manager factory configuration to the components.xml

                2. Added a persistence.xml (copied from the contactlist example)

                3. Injected the entity manager to the HelloAction





                Still not a bug?