5 Replies Latest reply on Apr 4, 2002 4:52 AM by blackbluegl

    External EJB reference

    patxi

      Hi!

      I'm trying to reference a bean from another application (in the same jboss server), but it keeps sendding the same error during deploying:

      ---
      [ERROR,ContainerFactory] DeploymentError
      org.jboss.deployment.DeploymentException: ejb-ref ejb/Teste, expected either ejb-link in ejb-jar.xml
      or jndi-name in jboss.xml
      ----

      This is what I did:
      - in ejb-jar.xml I provided the <ejb-ref-name> tag
      - in jboss.xml I provided the same <ejb-ref-name> tag and the <jndi-name> tag with the full JNDI name of the ean to be called.

      What is the problem?

        • 1. Re: External EJB reference

          You might want to check for typing errors in
          ejb-name, ejb-ref-name or the tag names.

          Can you post the relevant parts of the deployment
          descriptors?

          Regards,
          Adrian

          • 2. Re: External EJB reference
            patxi

            Here it goes...

            ---- ejb-jar.xml ----
            <ejb-jar>
            <display-name>mediator</display-name>
            <enterprise-beans>

            Caller Session Bean
            <display-name>Caller</display-name>
            <ejb-name>Caller</ejb-name>
            company.caller.CallerHome
            company.caller.Caller
            <ejb-class>company.caller.CallerEJB</ejb-class>
            <session-type>Stateless</session-type>
            <transaction-type>Bean</transaction-type>
            <ejb-ref>
            <ejb-ref-name>ejb/Teste</ejb-ref-name>
            <ejb-ref-type>Session</ejb-ref-type>
            company.ejb.teste.TesteHome
            company.ejb.teste.Teste
            </ejb-ref>

            </enterprise-beans>
            <assembly-descriptor />
            </ejb-jar>
            -------
            --- jboss.xml ---


            <enterprise-beans>

            <ejb-name>Caller</ejb-name>
            <ejb-ref>
            <ejb-ref-name>ejb/Teste</ejb-ref-name>
            <jndi-name>company/ejb/teste/Teste</jndi-name>
            </ejb-ref>

            </enterprise-beans>


            Bean 'Caller' is in company/caller/ package and the bean 'Teste' is in company/ejb/teste/ package.


            It looks ok, doesn´t it?

            • 3. Re: External EJB reference

              I can't see an obvious error.

              Are you certain these are the deployment descriptors
              deployed?

              Regards,
              Adrian

              • 4. Re: External EJB reference
                patxi

                Yes, I'm sure. I've even extracted them from the Caller.jar file in the deploy directory, after deployment...

                I really can´t see the problem :(

                Thank you, anyway.

                • 5. Re: External EJB reference
                  blackbluegl


                  <enterprise-beans>

                  <ejb-name>Caller</ejb-name>
                  <ejb-ref>
                  <ejb-ref-name>ejb/Teste</ejb-ref-name>
                  <jndi-name>company/ejb/teste/Teste</jndi-name>
                  </ejb-ref>

                  </enterprise-beans>


                  in this line
                  <jndi-name>company/ejb/teste/Teste</jndi-name>
                  typing in the JNDI-Name of the bean that you call
                  not the package/classes
                  see the chapter 7 'Declaring an EJB reference' abs 'External EJB reference' of jboss-documentation for an exsample