5 Replies Latest reply on Dec 26, 2008 12:49 PM by onur.aktas

    Migration problem to JBoss 5 GA (EJBs does not bind to JNDI

      Sorry for cross-post but i think this is the right place for the subject i created at JBoss installation & deployments forum.

      My Message is:
      EJB's work with JBoss 4.2.3 GA and does not work with JBoss 5.0 GA

      package com.test.model.ejb.system;
      
      import com.test.model.entity.system.Usr;
      import javax.ejb.Stateless;
      
      @Stateless(name = "UsrEJB")
      public class UsrEJBBean implements UsrEJB, UsrEJBLocal {
       @PersistenceContext(name = "testPU")
       EntityManager em;
      
       public UsrEJBBean() {
       }
      
       public Usr persist(Usr usrEntity) {
       em.persist(usrEntity);
       return usrEntity;
       }
      }


      It does not give any error, just warnings but it does not bind EJB to JNDI Tree like JBoss 4.2.3 GA.

      Related Console logs when i deploy:

      19:59:20,145 INFO [NamingHelper] JNDI InitialContext properties:{java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory, java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces}
      19:59:20,145 INFO [UpdateTimestampsCache] starting update timestamps cache at region: persistence.unit:unitName=test.ear/testEjb.jar#testPU.org.hibernate.cache.UpdateTimestampsCache
      19:59:20,145 INFO [StandardQueryCache] starting query cache at region: persistence.unit:unitName=test.ear/testEjb.jar#testPU.org.hibernate.cache.StandardQueryCache
      
      19:59:20,285 INFO [SessionSpecContainer] Starting jboss.j2ee:ear=test.ear,jar=testEjb.jar,name=UsrEJB,service=EJB3
      19:59:20,286 INFO [EJBContainer] STARTED EJB: com.test.model.ejb.system.UsrEJBBean ejbName: UsrEJB
      19:59:20,286 INFO [JndiSessionRegistrarBase] Binding the following Entries in Global JNDI:
      
      
      19:59:20,339 WARN [WebServiceDeployerEJB] Ingore ejb deployment with null classname: org.jboss.metadata.ejb.jboss.JBossSessionBeanMetaData@97955a49{UsrEJB}
      19:59:20,768 INFO [TomcatDeployment] deploy, ctxPath=/, vfsUrl=test.ear/testWeb.war
      19:59:21,381 INFO [JBossSerializationProvider] Using JBoss Serialization for JavaServer Faces.
      19:59:21,398 INFO [JBossSerializationProvider] Using JBoss Serialization for JavaServer Faces.


      Jndi Tree:

      Other components with java:comp namespace
      
      java:comp namespace of the component jboss.j2ee:ear=test.ear,jar=testEjb.jar,name=UsrEJB,service=EJB3 :
      
       +- EJBContext (class: javax.ejb.EJBContext)
       +- TransactionSynchronizationRegistry[link -> java:TransactionSynchronizationRegistry] (class: javax.naming.LinkRef)
       +- UserTransaction (class: org.jboss.ejb3.tx.UserTransactionImpl)
       +- env (class: org.jnp.interfaces.NamingContext)
       | +- testPU (class: org.jboss.jpa.tx.TransactionScopedEntityManager)
       +- ORB[link -> java:/JBossCorbaORB] (class: javax.naming.LinkRef)
      
      
      java: Namespace
      
       +- securityManagement (class: org.jboss.security.integration.JNDIBasedSecurityManagement)
       +- comp (class: javax.namingMain.Context)
       +- testds (class: org.jboss.resource.adapter.jdbc.WrapperDataSource)
       +- XAConnectionFactory (class: org.jboss.jms.client.JBossConnectionFactory)
       +- JmsXA (class: org.jboss.resource.adapter.jms.JmsConnectionFactoryImpl)
       +- TransactionPropagationContextImporter (class: com.arjuna.ats.internal.jbossatx.jta.PropagationContextManager)
       +- policyRegistration (class: org.jboss.security.plugins.JBossPolicyRegistration)
       +- ClusteredConnectionFactory (class: org.jboss.jms.client.JBossConnectionFactory)
       +- Mail (class: javax.mail.Session)
       +- TransactionPropagationContextExporter (class: com.arjuna.ats.internal.jbossatx.jta.PropagationContextManager)
       +- DefaultDS (class: org.jboss.resource.adapter.jdbc.WrapperDataSource)
       +- jaas (class: javax.naming.Context)
       | +- HsqlDbRealm (class: org.jboss.security.plugins.SecurityDomainContext)
       | +- profileservice (class: org.jboss.security.plugins.SecurityDomainContext)
       +- ClusteredXAConnectionFactory (class: org.jboss.jms.client.JBossConnectionFactory)
       +- TransactionSynchronizationRegistry (class: com.arjuna.ats.internal.jta.transaction.arjunacore.TransactionSynchronizationRegistryImple)
       +- SecurityProxyFactory (class: org.jboss.security.SubjectSecurityProxyFactory)
       +- ConnectionFactory (class: org.jboss.jms.client.JBossConnectionFactory)
       +- DefaultJMSProvider (class: org.jboss.jms.jndi.JNDIProviderAdapter)
       +- TransactionManager (class: com.arjuna.ats.jbossatx.jta.TransactionManagerDelegate)
       +- timedCacheFactory (class: javax.naming.Context)
      Failed to lookup: timedCacheFactory, errmsg=org.jboss.util.TimedCachePolicy cannot be cast to javax.naming.NamingEnumeration
      
      
      Global JNDI Namespace
      
       +- UserTransactionSessionFactory (proxy: $Proxy104 implements interface org.jboss.tm.usertx.interfaces.UserTransactionSessionFactory)
       +- UUIDKeyGeneratorFactory (class: org.jboss.ejb.plugins.keygenerator.uuid.UUIDKeyGeneratorFactory)
       +- HiLoKeyGeneratorFactory (class: org.jboss.ejb.plugins.keygenerator.hilo.HiLoKeyGeneratorFactory)
       +- XAConnectionFactory (class: org.jboss.jms.client.JBossConnectionFactory)
       +- topic (class: org.jnp.interfaces.NamingContext)
       +- ClusteredConnectionFactory (class: org.jboss.jms.client.JBossConnectionFactory)
       +- ProfileService (class: AOPProxy$0)
       +- queue (class: org.jnp.interfaces.NamingContext)
       | +- DLQ (class: org.jboss.jms.destination.JBossQueue)
       | +- ExpiryQueue (class: org.jboss.jms.destination.JBossQueue)
       +- ClusteredXAConnectionFactory (class: org.jboss.jms.client.JBossConnectionFactory)
       +- UserTransaction (class: org.jboss.tm.usertx.client.ClientUserTransaction)
       +- ConnectionFactory (class: org.jboss.jms.client.JBossConnectionFactory)
       +- jmx (class: org.jnp.interfaces.NamingContext)
       | +- invoker (class: org.jnp.interfaces.NamingContext)
       | | +- RMIAdaptor (proxy: $Proxy100 implements interface org.jboss.jmx.adaptor.rmi.RMIAdaptor,interface org.jboss.jmx.adaptor.rmi.RMIAdaptorExt)
       | +- rmi (class: org.jnp.interfaces.NamingContext)
       | | +- RMIAdaptor[link -> jmx/invoker/RMIAdaptor] (class: javax.naming.LinkRef)
       +- TomcatAuthenticators (class: java.util.Properties)
       +- persistence.unit:unitName=test.ear (class: org.jnp.interfaces.NamingContext)
       | +- testEjb.jar#testPU (class: org.hibernate.impl.SessionFactoryImpl)
       +- console (class: org.jnp.interfaces.NamingContext)
       | +- PluginManager (proxy: $Proxy101 implements interface org.jboss.console.manager.PluginManagerMBean)


      Thank you very much.

        • 1. Re: Migration problem to JBoss 5 GA (EJBs does not bind to J
          alesj

          I'm having hard time figuring out from your post what exactly is the problem?

          • 2. Re: Migration problem to JBoss 5 GA (EJBs does not bind to J

             

            "alesj" wrote:
            I'm having hard time figuring out from your post what exactly is the problem?


            Thank you for your reply, the problem is if you check code EJB is correct but it is not being binded like previous releases.

            For example: UsrEJB, in MyEJB.jar in MyEAR.ear was being binded like:

            MyEAR/MyEJB/UsrEJB/local
            MyEAR/MyEJB/UsrEJB/remote

            But now, console says EJB is STARTED, but i do not see it under Global JNDI View, if you check the JNDI you will see this at first lines:
            java:comp namespace of the component jboss.j2ee:ear=test.ear,jar=testEjb.jar,name=UsrEJB,service=EJB
            3 :
            
             +- EJBContext (class: javax.ejb.EJBContext)
             +- TransactionSynchronizationRegistry[link -> java:TransactionSynchronizationRegistry] (class: javax.naming.LinkRef)
             +- UserTransaction (class: org.jboss.ejb3.tx.UserTransactionImpl)
             +- env (class: org.jnp.interfaces.NamingContext)
             | +- testPU (class: org.jboss.jpa.tx.TransactionScopedEntityManager)
             +- ORB[link -> java:/JBossCorbaORB] (class: javax.naming.LinkRef)
            


            So i can not Lookup EJB's..

            • 3. Re: Migration problem to JBoss 5 GA (EJBs does not bind to J

              Solved

              The problem is that SessionBean implements 2 interfaces. Local and Remote. Since Remote interfaces has no methods inside while Local one has all methods that SessionBean implements.

              Removing Remote interface has solved the issue, however it looks like a bug or any unacceptable design pattern that previous release does not show any warnings neither new release does..

              Thanks.

              • 4. Re: Migration problem to JBoss 5 GA (EJBs does not bind to J
                alrubinger

                Could you please detail exactly the interfaces involved? I'd like to know what's triggering:

                19:59:20,339 WARN [WebServiceDeployerEJB] Ingore ejb deployment with null classname: org.jboss.meta
                data.ejb.jboss.JBossSessionBeanMetaData@97955a49{UsrEJB}


                If you could provide a JIRA with sample source that'd also be very helpful in ensuring we can report deployment errors as intelligently as possible.

                S,
                ALR

                • 5. Re: Migration problem to JBoss 5 GA (EJBs does not bind to J

                  Hi, i had 1 Session bean, implementing 2 interfaces (Local and Remote).
                  Remote interface has note method inside while Local one has all methods, and UsrEJBBean implements both of them. In previous release, having no method declaration inside did not cause any problem, but in JBoss 5 GA, it causes, and EJB can not be deployed.

                  UsrEJBBean:

                  package com.test.model.ejb.system;
                  
                  import com.test.model.entity.system.Usr;
                  import javax.ejb.Stateless;
                  import javax.persistence.EntityManager;
                  import javax.persistence.PersistenceContext;
                  import javax.persistence.Query;
                  
                  
                  @Stateless(name = "UsrEJB")
                  public class UsrEJBBean implements UsrEJB, UsrEJBLocal {
                   @PersistenceContext(unitName="testPU")
                   EntityManager em;
                  
                   public UsrEJBBean() {
                   }
                  
                   public Usr merge(Usr usrEntity) {
                   return em.merge(usrEntity);
                   }
                  
                   public void remove(Usr usrEntity) {
                   usrEntity = em.find(Usr.class, usrEntity.getId());
                   em.remove(usrEntity);
                   }
                  
                  
                   public Usr persist(Usr usrEntity) {
                   em.persist(usrEntity);
                   return usrEntity;
                   }
                  }



                  UsrEJBLocal:
                  package com.test.model.ejb.system;
                  
                  import com.test.model.entity.system.Usr;
                  
                  import javax.ejb.Local;
                  
                  @Local
                  public interface UsrEJBLocal {
                   public Usr persist(Usr usrEntity);
                   public Usr merge(Usr usrEntity);
                   public void remove(Usr usrEntity);
                  }



                  UsrEJB:
                  package com.test.model.ejb.system;
                  
                  import javax.ejb.Remote;
                  
                  @Remote
                  public interface UsrEJB {
                  }