GFv2 does not make a difference between RARs deployed standalone and RARs deployed as part of an EAR. In fact it is a bit odd: You first must deploy your EAR, and in this turn GF will say that it cannot find the RA used by the EJB. Then, create the RA connection pool. Now undeploy your application, and deploy it again. This time the EJB can find the RA, since it finds the connection pool. Sounds odd, but it is the only way to make it work, unless this conceptional bug of GlassFish is solved.
Regards
Markus
> -----Original Message-----
> From: glassfish_at_javadesktop.org [mailto:glassfish_at_javadesktop.org]
> Sent: Donnerstag, 25. Dezember 2008 04:39
> To: users_at_glassfish.dev.java.net
> Subject: ResourceAdapter (JCA) from EJB, in EAR
>
> Hi,
>
> Currently I am having some difficulties with using a resource adapter
> (JCA) from an EJB inside an EAR file. I need to get this working in Sun
> AppServer 9 or GlassFish v2.
>
> I succesfully tested the following setup:
> Remote Client <-> Stateless Session Bean (EJB) <-> JCA <-> File system
>
> It works for me when I deploy the EJB as EJB Module and the JCA as
> Connector.
>
> The problem is that I need to deploy my application as Enterprise
> Application Project since both the EJB Module and JCA share some
> libraries. I do not want to put those libraries in the lib folder of my
> domain to prevent ClassLoader problems.
>
> I read the documentation "Deploying and Configuring an Embedded
> Resource Adapter" in the Sun Java System Application Server Platform
> Edition 9 Developer's Guide. (http://docs.sun.com/app/docs/doc/819-
> 3659/bealq?a=view). The documentation says [i]The association between
> the physical JNDI name for the connector module in the Application
> Server and the logical JNDI name used in the application component is
> specified in the Application Server specific XML descriptor sun-ejb-
> jar.xml.[/i]
>
> I am looking for a code example of how to use the sun-ejb-jar in my
> example. When I deploy the Connector (JCA) stand alone I need to create
> a connection pool and resource. This works very fine. I just cannot get
> it working inside the EAR. Do I also need to create the connection pool
> and resource when I deploy my connector (resource adapter) inside an
> EAR?
>
> All the examples I see are related to MDb but I am using a Stateless
> Session Bean and my JCA reads some file from the file system, something
> I would like to avoid in my EJB.
>
> Does anybody have an idea or code example?
>
> Thanks and merry christmas to all of you!
>
> Jelte
> [Message sent by forum member 'jeltejansons' (jeltejansons)]
>
> http://forums.java.net/jive/thread.jspa?messageID=323246
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_glassfish.dev.java.net
> For additional commands, e-mail: users-help_at_glassfish.dev.java.net