2 Replies Latest reply on May 29, 2007 3:52 AM by Martin Isheim

    JNDI Entry for EJB3 Session Bean in JBossAS 5.0.0Beta2 not a

    Martin Isheim Newbie

      Deploying on JBossAS 5.0.0Beta2 succeeded, following one (correct) JNDI entry available:
      jcoffee/components/jcoffee/UserManagement3: class $Proxy10
      But the second JNDI Entry for Home Interface for EJB3 Session Bean (due to EJB2.1 Compatibility) is missing.
      As subsequent fault, my EJB2.1 Session Bean can't find the EJB3 Session Bean.

      Deploying on JBossAS 4.0.4GA with EJB3.0 package yields both JNDI Entries:
      jcoffee/components/jcoffee/UserManagement3: $Proxy448
      jcoffee/components/jcoffee/UserManagement3Home: class javax.naming.Reference
      And my application works fine.

      Is my lookup of the JNDI entry within my EJB2.1 bean wrong
      or is there something broken in JBossAS 5.0.0Beta2?

      Thanks,
      Martin

      Here the ejb-jar.xml with the tags for EJB2.1 compatibility:

      <?xml version='1.0' encoding='ISO-8859-1'?>
      <ejb-jar xmlns="http://java.sun.com/xml/ns/javaee"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
       http://java.sun.com/xml/ns/javaee/ejb-jar_3_0.xsd"
       version="3.0">
       <enterprise-beans>
       <session>
       <ejb-name>UserManagement3Component</ejb-name>
       <home>com.jcoffee.base.comp.server.ServiceProviderRemoteHome</home>
       <remote>com.jcoffee.base.comp.server.ServiceProviderRemote</remote>
       <local-home>com.jcoffee.base.comp.server.ServiceProviderLocalHome</local-home>
       <local>com.jcoffee.base.comp.server.ServiceProviderLocal</local>
       <ejb-class>com.jcoffee.components.um3.UserManagement3Component</ejb-class>
       <session-type>Stateless</session-type>
       <transaction-type>Container</transaction-type>
       </session>
       </enterprise-beans>
      </ejb-jar>
      


      Here the exception,
      14:44:30,390 INFO [STDOUT] 2007-05-25 14:44:30,390 INFO exceptions.ServiceProviderNotFoundException - ServiceProviderNotFoundExc
      eption The serviceprovider: 'Serviceprovider: (Home: jcoffee.UserManagement3)' could not be located!: Cannot lookup object 'jcoffe
      e.components.jcoffee.UserManagement3Home'.: UserManagement3Home not bound called at com.jcoffee.base.server.EJBUtilities.createSer
      viceProvider(EJBUtilities.java:209)
      com.jcoffee.base.comp.global.exceptions.ServiceProviderNotFoundException: The serviceprovider: 'Serviceprovider: (Home: jcoffee.Us
      erManagement3)' could not be located!;
      ---> nested com.jcoffee.base.global.JCoffeeNamingException: Cannot lookup object 'jcoffee.components.jcoffee.UserManagemen
      t3Home'.;
      ---> nested javax.naming.NameNotFoundException: UserManagement3Home not bound
      at com.jcoffee.base.server.EJBUtilities.createServiceProvider(EJBUtilities.java:209)
      at com.jcoffee.base.comp.server.ServiceProvider.localExecute(ServiceProvider.java:633)
      at com.jcoffee.base.comp.UserSessionBean.localExecute(UserSessionBean.java:452)
      at com.jcoffee.base.comp.server.ServiceProvider.execute(ServiceProvider.java:375)
      at sun.reflect.GeneratedMethodAccessor149.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:585)
      at org.jboss.invocation.Invocation.performCall(Invocation.java:359)
      at org.jboss.ejb.StatefulSessionContainer$ContainerInterceptor.invoke(StatefulSessionContainer.java:597)
      at org.jboss.ejb.plugins.StatefulSessionSecurityInterceptor.invoke(StatefulSessionSecurityInterceptor.java:85)
      at org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInterceptor.java:206)
      at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invoke(CachedConnectionInterceptor.java:158)
      at org.jboss.ejb.plugins.StatefulSessionInstanceInterceptor.invoke(StatefulSessionInstanceInterceptor.java:336)
      at org.jboss.ejb.plugins.CallValidationInterceptor.invoke(CallValidationInterceptor.java:63)
      at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:121)
      at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:350)
      at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:181)
      at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:205)
      at org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor.invoke(ProxyFactoryFinderInterceptor.java:138)
      at org.jboss.ejb.SessionContainer.internalInvoke(SessionContainer.java:650)
      at org.jboss.ejb.Container.invoke(Container.java:978)
      at sun.reflect.GeneratedMethodAccessor154.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:585)
      at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:157)
      at org.jboss.mx.server.Invocation.dispatch(Invocation.java:96)
      at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
      at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:668)
      at org.jboss.invocation.unified.server.UnifiedInvoker.invoke(UnifiedInvoker.java:230)
      at sun.reflect.GeneratedMethodAccessor167.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:585)
      at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:157)
      at org.jboss.mx.server.Invocation.dispatch(Invocation.java:96)
      at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
      at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:668)
      at javax.management.MBeanServerInvocationHandler.invoke(MBeanServerInvocationHandler.java:201)
      at $Proxy10.invoke(Unknown Source)
      at org.jboss.remoting.ServerInvoker.invoke(ServerInvoker.java:734)
      at org.jboss.remoting.transport.socket.ServerThread.processInvocation(ServerThread.java:553)
      at org.jboss.remoting.transport.socket.ServerThread.dorun(ServerThread.java:377)
      at org.jboss.remoting.transport.socket.ServerThread.run(ServerThread.java:159)
      Caused by: com.jcoffee.base.global.JCoffeeNamingException: Cannot lookup object 'jcoffee.components.jcoffee.UserManagement3Home'.;

      ---> nested javax.naming.NameNotFoundException: UserManagement3Home not bound
      at com.jcoffee.base.global.naming.JNDIUtilities.lookup(JNDIUtilities.java:219)
      at com.jcoffee.base.server.EJBUtilities.lookup(EJBUtilities.java:152)
      at com.jcoffee.base.server.EJBUtilities.lookupServiceProvider(EJBUtilities.java:176)
      at com.jcoffee.base.server.EJBUtilities.createServiceProvider(EJBUtilities.java:197)
      ... 43 more
      Caused by: javax.naming.NameNotFoundException: UserManagement3Home not bound
      at org.jnp.server.NamingServer.getBinding(NamingServer.java:542)
      at org.jnp.server.NamingServer.getBinding(NamingServer.java:550)
      at org.jnp.server.NamingServer.getObject(NamingServer.java:556)
      at org.jnp.server.NamingServer.lookup(NamingServer.java:296)
      at org.jnp.server.NamingServer.lookup(NamingServer.java:270)
      at org.jnp.server.NamingServer.lookup(NamingServer.java:270)
      at org.jnp.server.NamingServer.lookup(NamingServer.java:270)
      at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:628)
      at javax.naming.InitialContext.lookup(InitialContext.java:355)
      at com.jcoffee.base.global.naming.JNDIUtilities.lookup(JNDIUtilities.java:217)
      ... 46 more



        • 1. Re: JNDI Entry for EJB3 Session Bean in JBossAS 5.0.0Beta2 n
          Carlo de Wolf Master

          There are still some issues with EJB 2.1 beans:
          http://jira.jboss.com/jira/browse/EJBTHREE-959
          http://jira.jboss.com/jira/browse/EJBTHREE-966

          What does the deployer say during deployment of the UserManagement3Component?

          • 2. Re: JNDI Entry for EJB3 Session Bean in JBossAS 5.0.0Beta2 n
            Martin Isheim Newbie

            Here is the console output when deploying UserManagement3Component,
            there is no exception, but two warnings, i don't understand:

            09:46:46,375 INFO [MCKernelAbstraction] installing bean: persistence.units:jar=um3.jar,unitName=UserManagement3Component with dependencies:
            09:46:51,578 INFO [MCKernelAbstraction] jboss.jca:name=jcoffee/jdbc/datasources/jcoffee_db_tx,service=DataSourceBinding
            09:46:51,765 INFO [PersistenceUnitDeployment] Starting persistence unit persistence.units:jar=um3.jar,unitName=UserManagement3Component
            09:46:52,156 INFO [Version] Hibernate EntityManager 3.2.0.GA
            09:46:53,140 INFO [Version] Hibernate Annotations 3.2.0.GA
            09:46:53,171 INFO [Environment] Hibernate 3.2.1
            09:46:53,203 INFO [Environment] hibernate.properties not found
            09:46:53,203 INFO [Environment] Bytecode provider name : javassist
            09:46:53,234 INFO [Environment] using JDK 1.4 java.sql.Timestamp handling
            09:46:53,921 INFO [Ejb3Configuration] found EJB3 Entity bean: com.jcoffee.components.um3.AddressEntity
            09:46:53,953 INFO [Ejb3Configuration] found EJB3 Entity bean: com.jcoffee.components.um3.EmailAddressEntity
            09:46:53,968 INFO [Ejb3Configuration] found EJB3 Entity bean: com.jcoffee.components.um3.FailedLogonHistoryEntity
            09:46:53,968 INFO [Ejb3Configuration] found EJB3 Entity bean: com.jcoffee.components.um3.PasswordEntity
            09:46:53,968 INFO [Ejb3Configuration] found EJB3 Entity bean: com.jcoffee.components.um3.PasswordHistoryEntity
            09:46:53,968 INFO [Ejb3Configuration] found EJB3 Entity bean: com.jcoffee.components.um3.PasswordNotAllowedEntity
            09:46:53,984 INFO [Ejb3Configuration] found EJB3 Entity bean: com.jcoffee.components.um3.PersonEntity
            09:46:54,000 INFO [Ejb3Configuration] found EJB3 Entity bean: com.jcoffee.components.um3.TelephoneNoEntity
            09:46:54,015 INFO [Ejb3Configuration] found EJB3 Entity bean: com.jcoffee.components.um3.UserEntity
            09:46:54,015 INFO [Ejb3Configuration] found EJB3 Entity bean: com.jcoffee.components.um3.UserGroupEntity
            09:46:54,031 INFO [Ejb3Configuration] found EJB3 Entity bean: com.jcoffee.components.um3.UserUserGroupsUserGroupUsersRelation
            09:46:54,031 WARN [Ejb3Configuration] Persistence provider caller does not implements the EJB3 spec correctly. PersistenceUnitInfo.getNewTempClassLoader() is null.
            09:46:54,859 INFO [Configuration] Reading mappings from resource : META-INF/orm.xml
            09:46:54,875 INFO [Ejb3Configuration] [PersistenceUnit: UserManagement3Component] no META-INF/orm.xml found
            09:46:55,218 INFO [AnnotationBinder] Binding entity from annotated class: com.jcoffee.components.um3.AddressEntity
            09:46:55,500 INFO [EntityBinder] Bind entity com.jcoffee.components.um3.AddressEntity on table ADDRESS
            09:46:55,781 INFO [AnnotationBinder] Binding entity from annotated class: com.jcoffee.components.um3.EmailAddressEntity
            09:46:55,781 INFO [EntityBinder] Bind entity com.jcoffee.components.um3.EmailAddressEntity on table EMAILADDRESS
            09:46:55,796 INFO [AnnotationBinder] Binding entity from annotated class: com.jcoffee.components.um3.FailedLogonHistoryEntity
            09:46:55,796 INFO [EntityBinder] Bind entity com.jcoffee.components.um3.FailedLogonHistoryEntity on table FAILEDLOGONHISTORY
            09:46:55,796 INFO [AnnotationBinder] Binding entity from annotated class: com.jcoffee.components.um3.PasswordEntity
            09:46:55,796 INFO [EntityBinder] Bind entity com.jcoffee.components.um3.PasswordEntity on table PASSWORD
            09:46:55,812 INFO [AnnotationBinder] Binding entity from annotated class: com.jcoffee.components.um3.PasswordHistoryEntity
            09:46:55,812 INFO [EntityBinder] Bind entity com.jcoffee.components.um3.PasswordHistoryEntity on table PASSWORDHISTORY
            09:46:55,843 INFO [AnnotationBinder] Binding entity from annotated class: com.jcoffee.components.um3.PasswordNotAllowedEntity
            09:46:55,843 INFO [EntityBinder] Bind entity com.jcoffee.components.um3.PasswordNotAllowedEntity on table PASSWORDSNOTALLOWED
            09:46:55,843 INFO [AnnotationBinder] Binding entity from annotated class: com.jcoffee.components.um3.PersonEntity
            09:46:55,843 INFO [EntityBinder] Bind entity com.jcoffee.components.um3.PersonEntity on table PERSON
            09:46:55,843 INFO [AnnotationBinder] Binding entity from annotated class: com.jcoffee.components.um3.TelephoneNoEntity
            09:46:55,843 INFO [EntityBinder] Bind entity com.jcoffee.components.um3.TelephoneNoEntity on table TELEPHONENO
            09:46:55,859 INFO [AnnotationBinder] Binding entity from annotated class: com.jcoffee.components.um3.UserEntity
            09:46:55,859 INFO [EntityBinder] Bind entity com.jcoffee.components.um3.UserEntity on table USERS
            09:46:55,953 INFO [AnnotationBinder] Binding entity from annotated class: com.jcoffee.components.um3.UserGroupEntity
            09:46:55,953 INFO [EntityBinder] Bind entity com.jcoffee.components.um3.UserGroupEntity on table USERGROUP
            09:46:56,109 INFO [AnnotationBinder] Binding entity from annotated class: com.jcoffee.components.um3.UserUserGroupsUserGroupUsersRelation
            09:46:56,109 INFO [EntityBinder] Bind entity com.jcoffee.components.um3.UserUserGroupsUserGroupUsersRelation on table USERGROUPUSER
            09:46:58,640 INFO [ConnectionProviderFactory] Initializing connection provider: org.hibernate.ejb.connection.InjectedDataSourceConnectionProvider
            09:46:58,656 INFO [InjectedDataSourceConnectionProvider] Using provided datasource
            09:46:58,656 INFO [SettingsFactory] RDBMS: Oracle, version: Oracle Database 10g Enterprise Edition Release 10.1.0.4.0 - Production
            With the OLAP and Data Mining options
            09:46:58,656 INFO [SettingsFactory] JDBC driver: Oracle JDBC driver, version: 10.1.0.2.0
            09:46:58,796 INFO [Dialect] Using dialect: org.hibernate.dialect.Oracle9Dialect
            09:46:59,062 INFO [TransactionFactoryFactory] Transaction strategy: org.hibernate.ejb.transaction.JoinableCMTTransactionFactory
            09:46:59,078 INFO [TransactionManagerLookupFactory] instantiating TransactionManagerLookup: org.hibernate.transaction.JBossTransactionManagerLookup
            09:46:59,093 INFO [TransactionManagerLookupFactory] instantiated TransactionManagerLookup
            09:46:59,093 INFO [SettingsFactory] Automatic flush during beforeCompletion(): disabled
            09:46:59,093 INFO [SettingsFactory] Automatic session close at end of transaction: disabled
            09:46:59,093 INFO [SettingsFactory] JDBC batch size: 15
            09:46:59,093 INFO [SettingsFactory] JDBC batch updates for versioned data: disabled
            09:46:59,109 INFO [SettingsFactory] Scrollable result sets: enabled
            09:46:59,109 INFO [SettingsFactory] JDBC3 getGeneratedKeys(): disabled
            09:46:59,109 INFO [SettingsFactory] Connection release mode: auto
            09:46:59,109 INFO [SettingsFactory] Default batch fetch size: 1
            09:46:59,109 INFO [SettingsFactory] Generate SQL with comments: disabled
            09:46:59,109 INFO [SettingsFactory] Order SQL updates by primary key: disabled
            09:46:59,109 INFO [SettingsFactory] Query translator: org.hibernate.hql.ast.ASTQueryTranslatorFactory
            09:46:59,125 INFO [ASTQueryTranslatorFactory] Using ASTQueryTranslatorFactory
            09:46:59,125 INFO [SettingsFactory] Query language substitutions: {}
            09:46:59,125 INFO [SettingsFactory] JPA-QL strict compliance: enabled
            09:46:59,125 INFO [SettingsFactory] Second-level cache: enabled
            09:46:59,125 INFO [SettingsFactory] Query cache: disabled
            09:46:59,125 INFO [SettingsFactory] Cache provider: org.hibernate.cache.HashtableCacheProvider
            09:46:59,140 INFO [SettingsFactory] Optimize cache for minimal puts: disabled
            09:46:59,140 INFO [SettingsFactory] Structured second-level cache entries: disabled
            09:46:59,187 INFO [SettingsFactory] Statistics: disabled
            09:46:59,187 INFO [SettingsFactory] Deleted entity synthetic identifier rollback: disabled
            09:46:59,187 INFO [SettingsFactory] Default entity-mode: pojo
            09:46:59,484 INFO [SessionFactoryImpl] building session factory
            09:47:01,437 INFO [SessionFactoryObjectFactory] Factory name: persistence.units:jar=um3.jar,unitName=UserManagement3Component
            09:47:01,437 INFO [NamingHelper] JNDI InitialContext properties:{java.naming.factory.initial=org.jnp.interfaces.NamingContextFact
            ory, java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces}
            09:47:01,625 INFO [SessionFactoryObjectFactory] Bound factory to JNDI name: persistence.units:jar=um3.jar,unitName=UserManagement3Component
            09:47:01,625 WARN [SessionFactoryObjectFactory] InitialContext did not implement EventContext
            09:47:01,625 INFO [NamingHelper] JNDI InitialContext properties:{java.naming.factory.initial=org.jnp.interfaces.NamingContextFact
            ory, java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces}
            09:47:02,328 INFO [MCKernelAbstraction] installing bean: jboss.j2ee:jar=um3.jar,name=UserManagement3Component,service=EJB3 with dependencies:
            09:47:02,328 INFO [MCKernelAbstraction] persistence.units:jar=um3.jar,unitName=UserManagement3Component
            09:47:10,453 INFO [EJBContainer] STARTED EJB: com.jcoffee.components.um3.UserManagement3Component ejbName: UserManagement3Component