rherschke wrote
> The problem isn't regarding the development of a JCA Resource Adapter, but
> about configuring and referencing it in Tomee.
> 
> ...
> 
> I see, that there is an undocumented way to create Per-App-Instances of a
> Resource via 
> <Resource ... class="...">
>  (rather than type="...", as documented at the Tomee Site). 

You don't need to do any configuration in resources.xml for a connection
factory.  The standard ra.xml file is all you need.  If you have a war file,
then you can put the ra.xml in the WEB-INF folder (this is where tomee leads
the way by allowing packaging of resource adapters in war files).  If you
are packaging in a standard ear file, then you need a .rar file with the
ra.xml packaged up inside of that.  TomEE will create the resource and bind
it to JNDI using ra.xml.

To use a  jca connection factory from a managed bean (eg. an ejb), you can
get it using the @Resource annotation.  The normal rules regarding @Resource
apply.  You don't need to specify the name in the @Resource annotation if
the connection factory class is unique and tomee can resolve the dependency. 
The test case in the project i gave you a link to demonstrates how to inject
a connection factory.  That project wasn't about showing you how to develop
a resource adapter, it was more to demonstrate how a resource adapter is
instantiated and used from a test case.  The same technique applies in a
normal application.

I've found when i've had issues with tomee features, the community here is
very helpful.  If you can identify a defect or a place where tomee doesn't
properly implement the spec, then that will be immediately fixed.  I'm not
sure that is the case here.

Regards,

Anthony











--
View this message in context: 
http://tomee-openejb.979440.n4.nabble.com/Please-provide-a-working-example-for-configuring-any-kind-of-resource-adapters-in-tomee-tp4673033p4673075.html
Sent from the TomEE Users mailing list archive at Nabble.com.

Reply via email to