3 Replies Latest reply on Oct 21, 2005 12:24 PM by rke21

    Any good adivce for ejb not bound

    urswag

      It is hard, perhaps You have a good hint for me.
      In my ear file I always get a ejb not bound error.
      The call
      PartnerAgencyUtil.getLocalHome().create();
      in the war file creates this exception.

      javax.naming.NameNotFoundException: ejb not bound
      at org.jnp.server.NamingServer.getBinding(NamingServer.java:491)
      at org.jnp.server.NamingServer.getBinding(NamingServer.java:499)
      at org.jnp.server.NamingServer.getObject(NamingServer.java:505)
      at org.jnp.server.NamingServer.lookup(NamingServer.java:249)
      at org.jnp.server.NamingServer.lookup(NamingServer.java:252)
      at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:610)
      at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:701)
      at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:572)
      at javax.naming.InitialContext.lookup(InitialContext.java:351)
      at org.partneragency.util.PartnerUtil.getLocalHome(PartnerUtil.java:35)
      at org.partneragency.ejb.PartnerAgencyBean.getPartnerLocalHome(PartnerAgencyBean.java:63)


      I think I have all necessary entries in the configuration files

      ejb-jar.xml
      <!-- Session Beans -->

      [CDATA[]]

      <ejb-name>PartnerAgency</ejb-name>

      <local-home>org.partneragency.interfaces.PartnerAgencyLocalHome</local-home>
      org.partneragency.interfaces.PartnerAgencyLocal
      <ejb-class>org.partneragency.ejb.PartnerAgencySession</ejb-class>
      <session-type>Stateless</session-type>
      <transaction-type>Container</transaction-type>



      jboss.xml

      <ejb-name>PartnerAgency</ejb-name>
      <local-jndi-name>PartnerAgencyLocal</local-jndi-name>


      web.xml

      <ejb-local-ref>
      <ejb-ref-name>ejb/PartnerAgencyLocal</ejb-ref-name>
      <ejb-ref-type>Session</ejb-ref-type>
      <local-home>org.partneragency.interfaces.PartnerAgencyLocalHome</local-home>
      org.partneragency.interfaces.PartnerAgencyLocal
      <ejb-link>PartnerAgency</ejb-link>
      </ejb-local-ref>

      What can I else check?

        • 1. Re: Any good adivce for ejb not bound
          darranl

          Wrap your XML using [ code ][ /code ] tags without the spaces and use the preview button to make sure it displays correctly.

          Where is your lookup code that is being executed? Is it part of a session bean or is it code in the web application? Can you show the code.

          What type of component is 'PartnerAgencyBean'?

          • 2. Re: Any good adivce for ejb not bound
            urswag

            Thanks You help me.
            I use xdoclet. I thought the PartnerAgency bean lookup does not work. Correctly the Partner bean lookup fails.
            I had to add

             * @ejb.ejb-ref
             * ejb-name="Partner"
             * view-type="local"
             * ref-name="ejb/PartnerLocal"
            


            to generate the necessary ejb-local-ref entry in ejb-jar.xml.
            The next error I think has the reason that I have no entry in the database table.

            Thanks

            Caused by: javax.ejb.EJBException: Could not instantiate bean; CausedByException is:
             createBeanClassInstanceCommand == null
             at org.jboss.ejb.plugins.AbstractInstancePool.get(AbstractInstancePool.java:191)
             at org.jboss.ejb.plugins.EntityInstanceInterceptor.invokeHome(EntityInstanceInterceptor.java:98)
             at org.jboss.ejb.plugins.EntityLockInterceptor.invokeHome(EntityLockInterceptor.java:61)
             at org.jboss.ejb.plugins.EntityCreationInterceptor.invokeHome(EntityCreationInterceptor.java:28)
             at org.jboss.ejb.plugins.CallValidationInterceptor.invokeHome(CallValidationInterceptor.java:41)
             at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:109)
             at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:335)
             at org.jboss.ejb.plugins.TxInterceptorCMT.invokeHome(TxInterceptorCMT.java:146)
             at org.jboss.ejb.plugins.SecurityInterceptor.invokeHome(SecurityInterceptor.java:116)
             at org.jboss.ejb.plugins.LogInterceptor.invokeHome(LogInterceptor.java:121)
             at org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor.invokeHome(ProxyFactoryFinderInterceptor.java:93)
             at org.jboss.ejb.EntityContainer.internalInvokeHome(EntityContainer.java:508)
             at org.jboss.ejb.Container.invoke(Container.java:894)
             at org.jboss.ejb.plugins.local.BaseLocalProxyFactory.invokeHome(BaseLocalProxyFactory.java:344)
             at org.jboss.ejb.plugins.local.LocalHomeProxy.invoke(LocalHomeProxy.java:118)
             at $Proxy169.findByNickName(Unknown Source)
             at org.partneragency.ejb.PartnerAgencyBean.login(PartnerAgencyBean.java:56)
            


            • 3. Re: Any good adivce for ejb not bound
              rke21

              what are you looking up? Are you using the ENC? From the outside, you won't be able to lookup java:/comp. There will be nothing there. you'll have to look up in the global namespace.