markmail is not iPod friendly, so I'm not sure if your like makes the
following redundant.
in general, I find openejb just wires things up for you, so if you are
looking for a MyConnectionFactory at java:eis/mcf even though you gave
not told openejb to bind it to that jndi name, openejb will see that
it has classesRA which provides MyConnectionFactory, and just wire it
up... which makes testing easier as you don't have to try and
replicate jboss jndi bindings in your openejb tests
Sent from my [rhymes with tryPod] ;-)
On 17 Feb 2010, at 21:04, Laird Nelson <[email protected]> wrote:
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 <[email protected]>
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