You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomee.apache.org by Laird Nelson <lj...@gmail.com> on 2010/02/17 20:42:02 UTC

RARs, LocalClients and JNDI naming

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

Re: RARs, LocalClients and JNDI naming

Posted by ljnelson <lj...@gmail.com>.
I found the issue and it is I.  :-)

Woe to those whose connection factories return null connections--Geronimo's
connection pooling infrastructure will bomb out with an AssertionError
rather than informing you of the problem.

Thanks,
Laird
-- 
View this message in context: http://n4.nabble.com/RARs-LocalClients-and-JNDI-naming-tp1559231p1567554.html
Sent from the OpenEJB User mailing list archive at Nabble.com.

Re: RARs, LocalClients and JNDI naming

Posted by Laird Nelson <lj...@gmail.com>.
On Wed, Feb 17, 2010 at 6:43 PM, Stephen Connolly <
stephen.alan.connolly@gmail.com> wrote:

> are you sure the default pooling strategy is compatible with your outbound
> adapter... I spent some time figuring out how to control the pooling
> strategy. I'll see about posting a blog entry on the solution maybe tomorrow
> if I get a chance
>

No; I was under the impression that even in the case of an in-memory
unit-testing deployment--and believe me I'm cutting OpenEJB some slack here;
I'm not expecting such a deployment to conform to *all* the standards--I
could just have my resource adapter picked up and deployed.  Are there more
steps?  Part of the reason I'm vetting this with OpenEJB is that I'm hoping
to encounter most of the egregious problems early and up front before I
enter the long dark slogging time of yutzing around with JBoss and the like.

Best,
Laird

Re: RARs, LocalClients and JNDI naming

Posted by Stephen Connolly <st...@gmail.com>.
are you sure the default pooling strategy is compatible with your  
outbound adapter... I spent some time figuring out how to control the  
pooling strategy. I'll see about posting a blog entry on the solution  
maybe tomorrow if I get a chance

Sent from my [rhymes with tryPod] ;-)

On 17 Feb 2010, at 22:53, Laird Nelson <lj...@gmail.com> wrote:

> Bug filed, though assuredly the problem is with Geronimo since it  
> shouldn't
> be using assertions to check argument values:
> https://issues.apache.org/jira/browse/OPENEJB-1234
>
> Best,
> Laird
>
> On Wed, Feb 17, 2010 at 5:06 PM, Laird Nelson <lj...@gmail.com>  
> wrote:
>
>> Well, the long thread I followed suggests that the only way to get my
>> connection factory from a @LocalClient is to access it under
>> java:openejb/Resource/classes.  There isn't any other name I can  
>> give it,
>> and there isn't any other name I can look it up under.  I am  
>> thrilled if
>> there is in fact another possibility, but to my knowledge this and  
>> only this
>> works:
>>
>>  @Resource(name="java:openejb/Resource/classes")
>>  private MyConnectionFactoryImpl connectionFactory;
>>
>> ...and there is no other configuration located anywhere else (in  
>> XML, in
>> properties, in code).
>>
>> Now that I have it working, I can see that the connection factory is
>> correctly injected.  Hooray!
>>
>> However, when I call its method that gets me a new user connection,  
>> I'm
>> getting an AssertionError in the middle of the Geronimo connection
>> management infrastructure.  The stack is at the end of my message.   
>> Perhaps
>> David Jencks is lurking on this list?  I can provide any and all  
>> information
>> as necessary.
>>
>> Best,
>> Laird
>>
>> java.lang.AssertionError
>>    at
>> org.apache.geronimo.connector.outbound.GeronimoConnectionEventListener.addConnectionInfo( 
>> GeronimoConnectionEventListener.java:121)
>>    at
>> org.apache.geronimo.connector.outbound.ManagedConnectionInfo.addConnectionHandle( 
>> ManagedConnectionInfo.java:117)
>>    at
>> org.apache.geronimo.connector.outbound.ConnectionHandleInterceptor.getConnection( 
>> ConnectionHandleInterceptor.java:50)
>>    at
>> org.apache.geronimo.connector.outbound.TCCLInterceptor.getConnection 
>> (TCCLInterceptor.java:39)
>>    at
>> org.apache.geronimo.connector.outbound.ConnectionTrackingInterceptor.getConnection( 
>> ConnectionTrackingInterceptor.java:66)
>>    at
>> org.apache.geronimo.connector.outbound.AbstractConnectionManager.allocateConnection( 
>> AbstractConnectionManager.java:87)
>>    at
>> com.foobar.jca.StatelessKnowledgeSessionUserConnectionFactory.newStatelessKnowledgeSession( 
>> StatelessKnowledgeSessionUserConnectionFactory.java:229)
>>
>> (You'll note that I'm doing a JCA implementation for Drools 5.0.1; my
>> KnowledgeBase implementation serves as my connection factory; the  
>> user
>> connection to the Drools instance is represented by the
>> StatelessKnowledgeSession interface.)
>>
>>
>> On Wed, Feb 17, 2010 at 4:35 PM, Stephen Connolly <
>> stephen.alan.connolly@gmail.com> wrote:
>>
>>> 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 <lj...@gmail.com> 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 <lj...@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
>>>>>
>>>>>
>>

Re: RARs, LocalClients and JNDI naming

Posted by Laird Nelson <lj...@gmail.com>.
Bug filed, though assuredly the problem is with Geronimo since it shouldn't
be using assertions to check argument values:
https://issues.apache.org/jira/browse/OPENEJB-1234

Best,
Laird

On Wed, Feb 17, 2010 at 5:06 PM, Laird Nelson <lj...@gmail.com> wrote:

> Well, the long thread I followed suggests that the only way to get my
> connection factory from a @LocalClient is to access it under
> java:openejb/Resource/classes.  There isn't any other name I can give it,
> and there isn't any other name I can look it up under.  I am thrilled if
> there is in fact another possibility, but to my knowledge this and only this
> works:
>
>   @Resource(name="java:openejb/Resource/classes")
>   private MyConnectionFactoryImpl connectionFactory;
>
> ...and there is no other configuration located anywhere else (in XML, in
> properties, in code).
>
> Now that I have it working, I can see that the connection factory is
> correctly injected.  Hooray!
>
> However, when I call its method that gets me a new user connection, I'm
> getting an AssertionError in the middle of the Geronimo connection
> management infrastructure.  The stack is at the end of my message.  Perhaps
> David Jencks is lurking on this list?  I can provide any and all information
> as necessary.
>
> Best,
> Laird
>
> java.lang.AssertionError
>     at
> org.apache.geronimo.connector.outbound.GeronimoConnectionEventListener.addConnectionInfo(GeronimoConnectionEventListener.java:121)
>     at
> org.apache.geronimo.connector.outbound.ManagedConnectionInfo.addConnectionHandle(ManagedConnectionInfo.java:117)
>     at
> org.apache.geronimo.connector.outbound.ConnectionHandleInterceptor.getConnection(ConnectionHandleInterceptor.java:50)
>     at
> org.apache.geronimo.connector.outbound.TCCLInterceptor.getConnection(TCCLInterceptor.java:39)
>     at
> org.apache.geronimo.connector.outbound.ConnectionTrackingInterceptor.getConnection(ConnectionTrackingInterceptor.java:66)
>     at
> org.apache.geronimo.connector.outbound.AbstractConnectionManager.allocateConnection(AbstractConnectionManager.java:87)
>     at
> com.foobar.jca.StatelessKnowledgeSessionUserConnectionFactory.newStatelessKnowledgeSession(StatelessKnowledgeSessionUserConnectionFactory.java:229)
>
> (You'll note that I'm doing a JCA implementation for Drools 5.0.1; my
> KnowledgeBase implementation serves as my connection factory; the user
> connection to the Drools instance is represented by the
> StatelessKnowledgeSession interface.)
>
>
> On Wed, Feb 17, 2010 at 4:35 PM, Stephen Connolly <
> stephen.alan.connolly@gmail.com> wrote:
>
>> 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 <lj...@gmail.com> 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 <lj...@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
>>>>
>>>>
>

Re: RARs, LocalClients and JNDI naming

Posted by Laird Nelson <lj...@gmail.com>.
Well, the long thread I followed suggests that the only way to get my
connection factory from a @LocalClient is to access it under
java:openejb/Resource/classes.  There isn't any other name I can give it,
and there isn't any other name I can look it up under.  I am thrilled if
there is in fact another possibility, but to my knowledge this and only this
works:

  @Resource(name="java:openejb/Resource/classes")
  private MyConnectionFactoryImpl connectionFactory;

...and there is no other configuration located anywhere else (in XML, in
properties, in code).

Now that I have it working, I can see that the connection factory is
correctly injected.  Hooray!

However, when I call its method that gets me a new user connection, I'm
getting an AssertionError in the middle of the Geronimo connection
management infrastructure.  The stack is at the end of my message.  Perhaps
David Jencks is lurking on this list?  I can provide any and all information
as necessary.

Best,
Laird

java.lang.AssertionError
    at
org.apache.geronimo.connector.outbound.GeronimoConnectionEventListener.addConnectionInfo(GeronimoConnectionEventListener.java:121)
    at
org.apache.geronimo.connector.outbound.ManagedConnectionInfo.addConnectionHandle(ManagedConnectionInfo.java:117)
    at
org.apache.geronimo.connector.outbound.ConnectionHandleInterceptor.getConnection(ConnectionHandleInterceptor.java:50)
    at
org.apache.geronimo.connector.outbound.TCCLInterceptor.getConnection(TCCLInterceptor.java:39)
    at
org.apache.geronimo.connector.outbound.ConnectionTrackingInterceptor.getConnection(ConnectionTrackingInterceptor.java:66)
    at
org.apache.geronimo.connector.outbound.AbstractConnectionManager.allocateConnection(AbstractConnectionManager.java:87)
    at
com.foobar.jca.StatelessKnowledgeSessionUserConnectionFactory.newStatelessKnowledgeSession(StatelessKnowledgeSessionUserConnectionFactory.java:229)

(You'll note that I'm doing a JCA implementation for Drools 5.0.1; my
KnowledgeBase implementation serves as my connection factory; the user
connection to the Drools instance is represented by the
StatelessKnowledgeSession interface.)

On Wed, Feb 17, 2010 at 4:35 PM, Stephen Connolly <
stephen.alan.connolly@gmail.com> wrote:

> 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 <lj...@gmail.com> 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 <lj...@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
>>>
>>>

Re: RARs, LocalClients and JNDI naming

Posted by Stephen Connolly <st...@gmail.com>.
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 <lj...@gmail.com> 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 <lj...@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
>>

Re: RARs, LocalClients and JNDI naming

Posted by Laird Nelson <lj...@gmail.com>.
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 <lj...@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
>