1 2 Previous Next 20 Replies Latest reply on Nov 22, 2006 10:46 AM by weston.price Go to original post
      • 15. Re: Classloading and sharing classes between .ear and .rar
        rupertlssmith

        The good news is that I now have everything working. Thankyou Weston for your quick and helpfull replies.

        To recap: I have the -ds.xml and RAR inside the EAR. I am using isolated class loaders. IT doesn't seem to matter whether or not i turn on call by value in the naming service and ear deployer configs. The all in one EAR approach should mean its all call-by-reference anyway. What seems to be making or breaking it is the RAR reference in the -ds.xml:

        I am using:

        <rar-name>index-ra-test-0.1.ear#index-ra-0.1.rar</rar-name>

        and it is working with that.

        Using:

        <rar-name>index-ra-0.1.rar</rar-name>

        it will silently fail without binding the service to its JNDI name. I'm a little surprised by that, i thought the -ds.xml deployer would fail if it can't find the connection factory interface. Perahps all the ear# syntax is doing is prompting it to use the right clasloader? I've no idea.

        Any enlightenment on how to get the RAR working as a seperate modular deployment would still be appreciated and of general interest I think. For example, suppose I had EARs needing isolated loaders but want to share a single resource adapter between them?

        Rupert Smith

        • 16. Re: Classloading and sharing classes between .ear and .rar
          technobrat

          I'm experiencing a similar problem when my RAR is inside the EAR.
          See post : http://www.jboss.com/index.html?module=bb&op=viewtopic&t=88990



          • 17. Re: Classloading and sharing classes between .ear and .rar
            amazon

            Is there anything new on this topic? I did it in the same way as described in the original posting, with the same negative result. The .rar is not found if it is inside the .ear, no matter if the .rar name in the -ds.xml is qualified or not. However, with the -ds.xml inside the .ear and the .rar deployed separately, it is working again. Is there no way to deploy a .rar inside an .ear?

            • 18. Re: Classloading and sharing classes between .ear and .rar
              rupertlssmith

               

              "amazon" wrote:
              Is there anything new on this topic? I did it in the same way as described in the original posting, with the same negative result. The .rar is not found if it is inside the .ear, no matter if the .rar name in the -ds.xml is qualified or not. However, with the -ds.xml inside the .ear and the .rar deployed separately, it is working again. Is there no way to deploy a .rar inside an .ear?


              I have the -ds.xml and the .rar file in my .ear:

              myapp.ear
              |
              |-META-INF/application.xml
              |-index-ra-ds.xml
              |-index-ra-0.2.rar

              In the -ds.xml file I have the fully qualified name of the .rar file:

              <rar-name>myapp.ear#index-ra-0.2.rar</rar-name>

              In my application.xml I have the .rar named as a connector module:

              module
              connector index-ra-0.2.rar /connector
              /module

              (Please excuse the lack of angle brackets in the above XML, I can't get them to appear correctly and I'm not gonna spend all day finding out how to!!!)

              Its been a while since I played around with getting this to work, but I think that is everything that is needed. I'm running JBoss version 4.0.4 GA and using the 'default' server setup to base my setup on.

              I'm not 100% happy with this way of doing it because really I want to share my resource adapter between many .ears. Deploying it in the .ear as described above was the only way I ever managed to get it working.

              Hope this helps?

              • 19. Re: Classloading and sharing classes between .ear and .rar
                rupertlssmith

                I should add, that that was the only way I could get it to work whilst using isolated classloaders for my .ear to solve the JAXB 2.0 problem. I think I managed to get around that one a differnt way and am not having to use the isolated class loaders now. So I should be able to deploy my .rar outside of the .ear too and not get class loader conflicts between the two.

                I suspect JBoss needs to add a call-by-value mode switch for calling resource adapters? like it already has for making calls to EJB's that are not in the same .ear. This would be needed to call one that is deployed outside of the .ear when using isolated class loaders. I wonder if there is anything about this in the JCA specs? Haven't the time or inclination right now to go through them again.

                My advice: Keep trying, this can be figured out. If you can't get it then post more specific details of your problem.

                • 20. Re: Classloading and sharing classes between .ear and .rar
                  weston.price

                  Note, just so it is clear to everyone:

                  Using isolated classloader scoping will require you to add your *-ds.xml file to the EAR file for your deployment. The reason is that when the *-ds.xml file is deployed outside of the EAR the classes cannot be loaded due to the isolation policy. So, using an isolated classloader will force a particular deployment solution in this case.

                  If you want to deploy the *-ds.xml file in the scoped scenario, include a reference to it in your jboss-app.xml file as


                  *-ds.xml


                  Note, to use this type of setup in your *-ds.xml you will also have to specify the RAR name as

                  <rar-name>ear-name.ear#rar-name.rar</rar-name>

                  I am working on writing up all the usage scenarios and options as they pertain to RARs...stay tuned.



                  1 2 Previous Next