users@glassfish.java.net

Re: where to put an RA's connection factory interface in an EAR file

From: Jagadish Prasath Ramu <Jagadish.Ramu_at_Sun.COM>
Date: Tue, 02 Mar 2010 09:22:16 +0530

Hi Dies,

By default, a RAR is available to applications that has references
specified in the deployment descriptors of the applications.

Please refer :
http://docs.sun.com/app/docs/doc/820-7695/gjjyy?l=en&a=view

By default, the class-loading-policy is "derived" ie., availability of
RAR is based on application's references.

In order to switch to v2's behavior, you can set the
class-loading-policy to "global" as specified in the above documentation
and restart the server. All applications will have access to all
standalone RARs.

Thanks,
-Jagadish




On Tue, 2010-03-02 at 13:20 +1100, Dies Koper wrote:
> Hi,
>
> While trying to run an app that worked on GFv2.1 and not in GFv3 I got
> confused about where to put what classes.
> Could you shed some light on it?
>
> I have a resource adapter packaged in a RAR file. I use it from an EJB,
> which is packaged in an ejb-jar. The EJB is accessed from a Java
> application client, packaged in a jar file.
>
> On GFv2.1, I deploy the RAR first, then deploy an EAR file which
> contains the ejb-jar and client jars. Even though the ejb-jar and the
> EAR file do not contain the RA's interfaces, this works fine.
>
> On GFv3, I can also successfully deploy the applications, but when I
> access the EJB a ClassNotFoundException occurs.
>
> Next, on GFv3, I tried adding the RAR to the EAR, but then I got a
> ClassCastException (of the connection factory implementation class) in
> the statement where I do the JNDI lookup of the connection factory in
> the EJB.
>
> How should I package and deploy this?
>
> Thanks,
> Dies
>
>