13 Replies Latest reply on Feb 20, 2008 10:34 AM by adrian.brock

    deployment of RAR inside of EAR

    pecks1976

      My resource adapter works fine as standalone, but I want to add it to an EAR. So I did two things:
      1. Had Eclipse add it to my ear
      2. changed my *-ds.xml file from

      <connection-factories>
      <no-tx-connection-factory>
      <jndi-name>eis/MySample</jndi-name>
      <rar-name>GDFResourceAdapter.rar</rar-name>
      <connection-definition>
      gdfra.host.GDFConnectionFactory
      </connection-definition>
      </no-tx-connection-factory>
      </connection-factories>
      to
      <connection-factories>
      <no-tx-connection-factory>
      <jndi-name>eis/MySample</jndi-name>
      <rar-name>IWMDT_EAR.ear#GDFResourceAdapter.rar</rar-name>
      <connection-definition>
      gdfra.host.GDFConnectionFactory
      </connection-definition>
      </no-tx-connection-factory>
      </connection-factories>

      It doesn't work: I get this:

      14:03:40,920 ERROR [RARDeployment] Could not find ManagedConnectionFactory class: gdfra.spi.GDFManagedConnectionFactory
      java.lang.ClassNotFoundException: No ClassLoaders found for: gdfra.spi.GDFManagedConnectionFactory
      at org.jboss.mx.loading.LoadMgr3.beginLoadTask(LoadMgr3.java:198)
      at org.jboss.mx.loading.RepositoryClassLoader.loadClassImpl(RepositoryClassLoader.java:463)
      at org.jboss.mx.loading.RepositoryClassLoader.loadClass(RepositoryClassLoader.java:374)
      at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
      at org.jboss.resource.connectionmanager.RARDeployment.startService(RARDeployment.java:543)
      at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanSupport.java:271)
      at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSupport.java:221)

      .....
      .....
      .....
      .....
      MBEANS THAT ARE THE ROOT CAUSE OF THE PROBLEM:
      ObjectName: jboss.jca:service=ManagedConnectionFactory,name=eis/MySample
      state: FAILED
      I Depend On: jboss.jca:service=RARDeployment,name='IWMDT_EAR.ear#GDFResourceAdapter.rar'

      Depends On Me: jboss.jca:service=ManagedConnectionPool,name=eis/MySample
      org.jboss.deployment.DeploymentException: Could not find ManagedConnectionFactory class: gdfra.spi.GDFManagedConnectionFactory

      Can anyone tell me where I've gone wrong?

        • 1. Re: deployment of RAR inside of EAR
          pecks1976

          No one knows the answer... :(
          Maybe I didn't include enough information?
          Perhaps I can re-phrase the question as "what are the differences, in terms of deployment, between a standalone RAR file and one that is included in an EAR?".

          • 2. Re: deployment of RAR inside of EAR
            vickyk

             

            "pecks1976" wrote:
            14:03:40,920 ERROR [RARDeployment] Could not find ManagedConnectionFactory class: gdfra.spi.GDFManagedConnectionFactory

            Where is this class packaged , I wanted to know the location of the jar which contains this class?


            • 3. Re: deployment of RAR inside of EAR
              vickyk

              The EAR/META-INF/application.xml should contain the RAR reference like this

              <module>
               <connector>GDFResourceAdapter.rar</connector>
               </module>

              I just wanted to confirm you have this entry .


              No one knows the answer... :(

              We need free time to reply to your queries :)

              • 4. Re: deployment of RAR inside of EAR
                pecks1976

                Sorry for seeming impatient. I'm finding it really hard to find the information I need on resource adapters.

                Yes, I've got that entry in the application.xml. I've also had a look in the deployed EAR, and the RAR file is definitely there. So there must be something else I'm missing.

                • 5. Re: deployment of RAR inside of EAR
                  vickyk

                  -ds.xml files are deployed before the EAR .
                  The -ds.xml file basically gets converted to the xml services during XSLSubDeployer , these converted services are deployed before the EAR .
                  Check this
                  http://wiki.jboss.org/wiki/Wiki.jsp?page=DeploymentScanner
                  The ordering of suffixes is: "sar", "service.xml", "rar", "jar", "war", "wsr", "ear", "zip"

                  Can you make the -ds.xml file dependent on the EAR , this looks to me the dependency issue ?
                  I need to see the entire server.log file to verify this .
                  You can verify this from the server.log , you might notice that the EAR might be getting deployed after you see this error .

                  Before making -ds.xml dependent on EAR you can do simple test , you can try this
                  1) Start JBoss Server
                  2) After it is started , deploy the EAR which contains your RAR .
                  3) After the EAR is deployed you deploy the -ds.xml , this should work as the dependent EAR is already available .


                  If you still don't get it working send the -ds.xml+EAR at my email address .


                  • 6. Re: deployment of RAR inside of EAR
                    shelly.mcgowan

                    Look in the server.log to see what the ConnectionFactoryBinding shows; i.e., INFO [org.jboss.resource.connectionmanager.ConnectionFactoryBindingService:160] Bound ConnectionManager 'jboss.jca:service=ConnectionFactoryBinding,name=IWMDT_EAR_GDFResourceAdapter.rar to JNDI name 'eis/??'

                    • 7. Re: deployment of RAR inside of EAR
                      pecks1976

                      To answer vickyk, I tried deploying in the manner you suggested, and it still didn't work. So I'll mail the files to you, thanks for your help.

                      To anwer smcgowan, I looked in the server logs, tried comparing a "working" log and a "broken" one, but I'm afraid I just got lost. I don't think I'm experienced enough to determine the cause of the error from the log file.

                      Thanks to both of you for answering.

                      • 8. Re: deployment of RAR inside of EAR
                        shelly.mcgowan

                        if you want to compress the log and email it to me I can take a quick look.

                        • 9. Re: deployment of RAR inside of EAR
                          vickyk

                           

                          "pecks1976" wrote:
                          To answer vickyk, I tried deploying in the manner you suggested, and it still didn't work. So I'll mail the files to you, thanks for your help.

                          You can mail the details at vicky.kak@gmail.com .

                          • 10. Re: deployment of RAR inside of EAR

                             

                            "pecks1976" wrote:
                            No one knows the answer... :(


                            No, you're just expecting an SLA that is not a feature of this forum.

                            Read this:
                            http://wiki.jboss.org/wiki/Wiki.jsp?page=JBossHelp

                            e.g. typically I only visit these forums once every week or two.


                            Maybe I didn't include enough information?


                            The log for a start.


                            Perhaps I can re-phrase the question as "what are the differences, in terms of deployment, between a standalone RAR file and one that is included in an EAR?".


                            Guess 1:
                            A -ds.xml is deployed before an ear so it wouldn't be suprising if it couldn't find
                            the classes - see Vicky's comment

                            Guess 2:
                            If the ear is scoped and the -ds.xml is outside the ear
                            then you also have to tell the -ds.xml what classloader repository to use.

                            If you don't it will use the default repository which won't know about any classes
                            from the ear.

                            This is the same as for a -service.xml that depends upon a scoped ear:
                            http://wiki.jboss.org/wiki/Wiki.jsp?page=ClassLoadingConfiguration

                            e.g.
                            <connection-factories>
                             <loader-repository>jboss.j2ee:service=EARDeployment,url=myapp.ear</loader-repository>
                            
                            <etc/>
                            


                            Or whatever you called the scoped repository in jboss-app.xml

                            • 11. Re: deployment of RAR inside of EAR
                              pecks1976

                              I found the problem. I feel a little silly...
                              I remembered that a colleague had pointed out that I was running a rather old version of JBoss. So I updated to 4.2.2.GA, and guess what...
                              Thanks for your help guys. I guess I leant a lesson there.

                              • 12. Re: deployment of RAR inside of EAR
                                pecks1976

                                BTW the "No one knows the answer... :( " was supposed to be humorous, I guess it didn't come across well.

                                • 13. Re: deployment of RAR inside of EAR

                                   

                                  "pecks1976" wrote:
                                  BTW the "No one knows the answer... :( " was supposed to be humorous, I guess it didn't come across well.


                                  You should use a smily rather than a frown. There's sarcasm and then there's netiquette. :-)