2 Replies Latest reply on Apr 19, 2011 10:01 AM by pi4630

    JBoss-5.1.0.GA: Unable to inject jndi dependency

    pi4630

      Hi,

       

      I've a SLSB on which I try to inject a reference to the default topic (test/testTopic) destination.

       

      {code}

      public class AnaUniEJB implements AURemoteBusiness, AnaUniWebService {

       

       

                @PersistenceContext(

                                    unitName = "AnaUniDb")

                private EntityManager manager;

                @EJB

                private GVCCLocalBusiness gvcc;

       

       

                @Resource(

                                    mappedName = "ConnectionFactory")

                ConnectionFactory factory;

       

       

                @Resource(

                                    mappedName = "topic/testTopic")

                Topic topic;

      {code}

      When I run the client, I get the following error:

       

      {quote}javax.ejb.EJBException: java.lang.RuntimeException: Unable to inject jndi dependency: env/it.bz.prov.anauni.blogic.AnaUniEJB/topic into property it.bz.prov.anauni.blogic.AnaUniEJB.topic: testTopic not bound

      {quote}

       

       

       

      I'm studying with a book that is based on EJB3.0 and uses JBoss-AS 4.0.4GA.

      Has something changed in the AS versions concering default message destintations or what am I doing wrong?

       

      Thanks for caring!

        • 1. JBoss-5.1.0.GA: Unable to inject jndi dependency
          wdfink

          Looks like that the JMS Topic (topic/testTopic) is not deployed.

          I suppose if you use a default 5.1 community the testTopic is not configured.

          You have to add it to the server/.../deploy/messaging/destinations-service.xml, or deploy your own ...-service.xml

          • 2. Re: JBoss-5.1.0.GA: Unable to inject jndi dependency
            pi4630

            Thanks, Wolf-Dieter.

             

            The following mbean destination was not included:

             

            {code}

            <mbean code="org.jboss.mq.server.jmx.Topic"

                       name="jboss.mq.destination:service=Topic,name=testTopic">

                <depends optional-attribute-name="DestinationManager">jboss.mq:service=DestinationManager</depends>

                <depends optional-attribute-name="SecurityManager">jboss.mq:service=SecurityManager</depends>

                <attribute name="SecurityConf">

                  <security>

                    <role name="guest" read="true" write="true"/>

                    <role name="publisher" read="true" write="true" create="false"/>

                    <role name="durpublisher" read="true" write="true" create="true"/>

                  </security>

                </attribute>

              </mbean> 

            {code}

            which is the "default" Topic destination as of JBoss 4. These lines are to be added in the destinations-service.xml, as you mentioned.

             

            Thanks