tomee-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Laird Nelson <ljnel...@gmail.com>
Subject Re: RARs, LocalClients and JNDI naming
Date Wed, 17 Feb 2010 21:04:56 GMT
Ah, found
http://markmail.org/thread/kp4wft7lnwq4sybh#query:+page:1+mid:ebfybgjawllun4ke+state:results

That did the trick (though of course it is somewhat non-obvious! :-)).

Best,
Laird

On Wed, Feb 17, 2010 at 2:42 PM, Laird Nelson <ljnelson@gmail.com> wrote:

> I am sure that I am missing something obvious, but perhaps not, as I cannot
> find any information on this subject.
>
> I am writing a resource adapter.  For its unit tests, I am attempting to
> deploy it, unpackaged, into an instance of OpenEJB 3.1.3-SNAPSHOT.  A patch
> that was committed in January somewhere seems to let OpenEJB 3.1.3-SNAPSHOT
> auto-discover @LocalClients, such as my unit test, in projects that have an
> META-INF/ra.xml file present.  This is great--I can tell from some of the
> logging messages that OpenEJB is at least attempting to instantiate my
> ResourceAdapter implementation.
>
> I've used @LocalClient before, too, and so I have the InitialContext all
> set up, and I can tell that indeed, OpenEJB is firing up.  So far so good.
>
> Now the obvious/stupid part.  I've built this resource adapter
> implementation, I have the ra.xml...but where...where do I indicate what
> JNDI name I would like it to have?  Obviously this information shouldn't be
> part of the final resource adapter hairball, since by definition you're
> supposed to be able to pick a .rar file up, put it in an app server, and
> have it install itself.
>
> In JBoss, I believe I'd accomplish this with some sort of .xml file a la
> *-ds.xml; either its name or some element within that file would designate
> the JNDI name.  I'm not terribly familiar with JBoss.
>
> In Glassfish, I believe I'd have to do this with the Glassfish command line
> tools; something like asadmin deploy myrar.rar.
>
> What do I do in OpenEJB in an in-memory unit testing scenario?
>
> My ultimate goal is to have my @LocalClient simply do:
>
>   @Resource(name="...") // whatever the name is
>   private MyConnectionFactoryImplementation myConnector;
>
> and have it "just work".
>
> Any pointers in any direction are gratefully accepted.
>
> Best,
> Laird
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message