[jboss-user] [JCA/JBoss] - Re: Classloading and sharing classes between .ear and .rar

rupertlssmith do-not-reply at jboss.com
Thu Aug 3 15:13:44 EDT 2006


Presumably you mean in the scenario where the .rar is put inside the .ear file? I wasn't but I have now changed my MANIFEST to include references to them. It is stil not working.

To give a clearer picture, the relevant parts of my .ear file now looks like:

index-ra-test-0.1.ear:
|
|-index-ra-ds.xml               (the JBoss service descriptor for the ra)
|-index-ra-client-0.1.jar       (the client interface for the resource adapter)
|-index-ra-0.1.rar                (a resource adapter for the search engine)
|-META-INF/application.xml
|-META-INF/jboss-app.xml
|-common-0.1.jar                (my common lib)
|-index-0.1.jar                     (the index - a text search engine)
|...(more stuff, including EJB module that calls index-ra-0.1.rar using client interface in index-ra-client.jar).

The index-ra-0.1.rar file contains META-INF/MANIFEST.MF with class path:

Class-Path: index-0.1.jar common-0.1.jar index-ra-client-0.1.jar

refering to the shared jars.

The application.xml contains:

  
    index-ra-0.1.rar
  

and the jboss-app.xml contains:

  
    index-ra-ds.xml
  

The index-ra-ds.xml contains:

<!-- Non-transactional Index resource adaptor service configuration. -->
<connection-factories>
  <tx-connection-factory>
    <adapter-display-name>IndexResourceAdapter</adapter-display-name>
    <jndi-name>index_connection_factory</jndi-name>
    <local-transaction/>
    <rar-name>index-ra-0.1.rar</rar-name>
    <connection-definition>
      uk.co.thebadgerset.index.ra.IndexConnectionFactory
    </connection-definition>
  </tx-connection-factory>
</connection-factories>

Some highlights from the debug trace are:

DEBUG	org.jboss.deployment.EARDeployer	Extracted deployable content: index-ra-ds.xml
DEBUG	org.jboss.deployment.EARDeployer	Extracted deployable content: index-ra-0.1.rar

DEBUG	org.jboss.deployment.MainDeployer	Starting deployment (init step) of package at: file:/C:/projects/index-ra-test/target/jboss/myjboss/tmp/deploy/tmp50591index-ra-test-0.1.ear-contents/index-ra-0.1.rar
DEBUG	org.jboss.deployment.MainDeployer	using deployer org.jboss.resource.deployment.RARDeployer at 1649a55

DEBUG	org.jboss.deployment.MainDeployer	Starting deployment (init step) of package at: file:/C:/projects/index-ra-test/target/jboss/myjboss/tmp/deploy/tmp50591index-ra-test-0.1.ear-contents/index-ra-ds.xml
DEBUG	org.jboss.deployment.MainDeployer	using deployer org.jboss.deployment.XSLSubDeployer at 367013

DEBUG	uk.co.thebadgerset.index.ra.ResourceAdapterImpl	public void start(BootstrapContext context): called	

So I can see my resource adapters start method being called. It doesn't seem to bind the service to its JNDI name, as when I look it up from the session bean:

Context nc = new InitialContext();
            IndexConnectionFactory cf =
                (IndexConnectionFactory)nc.lookup("java:comp/env/ra/index/index_connection_factory");

I get a naming exception. Bear in mind that I have set up a resource reference (XDoclet tag from the source):

@jboss:resource-ref res-ref-name="ra/index/index_connection_factory"
                    jndi-name="java:/index_connection_factory"

So I would expect the connection factory to be at java:/index_connection_factory.

I'm wondering if there is something wrong with my -ds.xml file? Does the rar-name need to be:

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

as described in the Wiki? Or this only when the -ds.xml file is not in the .ear? I tried that too but it didn't work.


View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3962978#3962978

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3962978



More information about the jboss-user mailing list