users@glassfish.java.net

Unable to access JCA connector deployed in same ear

From: <glassfish_at_javadesktop.org>
Date: Thu, 24 Jul 2008 16:16:41 PDT

I'm trying to deploy an ear which has

- a custom JCA connector and
- a war using that JCA connector

as sub modules. The connector's api classes - Connection and ConnectionFactory - live inside its own jar, connector-api.jar. This jar resides in the ear's META-INF/lib directory, declared via

<library-directory>META-INF/lib</library-directory>

in the ear's application.xml. Overall, we have

application.ear
         |
         - META-INF/lib
         | |
         | - connector-api.jar
         |
         |---------- connector.rar
         | |
         | --- connector-impl.jar
         |
         |---------- client.war
                            |
                            - WEB-INF/classes/consume.connector.Client.class

In my web.xml, I reference a ConnectionFactory like so:

           <resource-ref>
                <res-ref-name>
                        local/osgi/JeeServiceLookupConnectionFactory
                </res-ref-name>
                <res-type>
                        de.saxsys.osgira.shared.connectorapi.factory.JeeServiceLookupConnectionFactory
                </res-type>
                <res-auth>Container</res-auth>
                <res-sharing-scope>Shareable</res-sharing-scope>
        </resource-ref>

(I tried Unshareable, alas to no avail).
Upon deployment into GlassFish v2, I get, however,

[#|2008-07-25T00:59:16.088+0200|SEVERE|sun-appserver9.1|javax.enterprise.system.container.web|_ThreadID=16;_ThreadName=Thread-76;_RequestID=e7a1650b-7a69-4457-a4c6-0daeef4258d5;|WEB0123: WebModule [/ws] failed to deploy and has been disabled
java.lang.IllegalArgumentException: [de.saxsys.osgira.shared.connectorapi.factory.JeeServiceLookupConnectionFactory] is not an allowed property value type
        at com.sun.enterprise.deployment.ResourceReferenceDescriptor.checkType(ResourceReferenceDescriptor.java:492)
        at com.sun.enterprise.naming.NamingManagerImpl.bindObjects(NamingManagerImpl.java:530)
        at com.sun.enterprise.web.WebModuleContextConfig.configureResource(WebModuleContextConfig.java:220)
        at com.sun.enterprise.web.WebModuleContextConfig.lifecycleEvent(WebModuleContextConfig.java:161)
        at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:143)
        at org.apache.catalina.core.StandardContext.init(StandardContext.java:6350)
        at org.apache.catalina.core.StandardContext.start(StandardContext.java:4848)
        at com.sun.enterprise.web.WebModule.start(WebModule.java:326)

which, according to ResourceReferenceDescriptor's sources, means that the current Thread's context classloader cannot see

de.saxsys.osgira.shared.connectorapi.factory.JeeServiceLookupConnectionFactory

which happily lives inside my connector-api.jar.

What did I do wrong, and how can I fix it?

Cheers,
Olaf
[Message sent by forum member 'obergner' (obergner)]

http://forums.java.net/jive/thread.jspa?messageID=289204