4 Replies Latest reply on Jul 6, 2006 11:20 AM by weston.price

    Link between RAR Administered Object and <resource(-env)-ref

    mgruebsch

      On one side it is possible to declared administered objects in a ResourceAdapter deployment descriptor. On the other side you can use an administered object in an EJB.

      However, I miss the link between both sides. I tried <resource(-env)-ref> in the bean's deployment descriptor as well as the @Resource annotation on a bean's member field. In both cases an exception occured telling me that the referenced resource is not bound to JNDI.

      As far as I understand I could bind the administered objects to JNDI in my application code (not preferable) or could deploy a JBoss *-service.xml file which configures and binds my administered objects using MBeans. However, in both cases I have to do additional work. I could do this work with any object/service, not only with administered objects of a resource adapter.

      If explicit binding to the JNDI is required what is the in the ra.xml good for at all? If I have to care about binding it to JNDI who needs the information in ra.xml? What changes if the is left out?

      Thank you very much
      Michael

        • 1. Re: Link between RAR Administered Object and <resource(-env)
          mgruebsch

           

          If explicit binding to the JNDI is required what is the in the ra.xml good for at all? If I have to care about binding it to JNDI who needs the information in ra.xml? What changes if the is left out?


          This should read:

          If explicit binding to the JNDI is required what is the < adminobject> in the ra.xml good for at all? If I have to care about binding it to JNDI who needs the information in ra.xml? What changes if the < adminobject> is left out from the ra.xml?

          Sorry, Michael


          • 2. Re: Link between RAR Administered Object and <resource(-env)
            weston.price

            How are you creating, deploying the admin object? Typically, more than the ra.xml is required.

            http://wiki.jboss.org/wiki/Wiki.jsp?page=ConfigAdminObject

            Everything changes if you leave out the entry in the ra.xml file, being that when you deploy an admin object, the RAR is required.

            What you are seeing is typical in our deployment model. We generally do not use ra.xml values to configure an adapter (beyond the ResourceAdapter bean) but rather, use a *-ds.xml file to dynamically configure deployments in JCA.

            However, you have a point. The adapter should probably honor AdminObject deployments from the ra.xml file. There is an existing JIRA task:

            http://jira.jboss.org/jira/browse/JBAS-3343

            that has to do with RA properties at deployment time. I will create another issue and link it to this one.

            • 3. Re: Link between RAR Administered Object and <resource(-env)
              mgruebsch

               

              How are you creating, deploying the admin object? Typically, more than the ra.xml is required.

              http://wiki.jboss.org/wiki/Wiki.jsp?page=ConfigAdminObject


              Yes, I did it that way, and it worked. Thanks, Weston!

              I suspect that the Java EE 5.0 specification has a leak in this area. It allows an adapter to declare an AdminObject and it defines how EJBs can reference them. However, it leaves out how an AdminObject is instantiated and provided by the container!?

              Did I miss something?

              Michael


              • 4. Re: Link between RAR Administered Object and <resource(-env)
                weston.price

                No, you didn't miss anything. It is purposely vague being that every app server has different operational requirements for a target environment. In some ways, you are seeing a bi-product of JBoss's deployment process in handling something like this.

                Deployment of a ResourceAdapter in JBoss is a bit confusing.

                1) RAR is deployed to deploy directory
                2) RAR properties are applied and the ResourceAdapter created.
                3) *After* this you use a *-service.xml file to populate and bind the AdminObject into JNDI, set values etc, etc.

                Not something I am thrilled with actually and I am debating ways to make this more accesible, or at the very least, more intuitve to understand.