This content has been marked as final.
Show 2 replies
-
1. Re: Discovery of JCA ConnectionFactory without resource-ref
vickyk Nov 17, 2009 4:27 AM (in response to maffeis)"maffeis" wrote:
Is there a way of making such a JNDI lookup possible from a Servlet, without adding a <resource-ref> declaration to the web.xml file?
Yes you should be able to get theJCA CF by simply looking at the JNDI.
Just define the -ds.xml and deploy it in the JBoss, later on in the servlet(or any web component) just make this callInitialContext context = new InitialContext(); ConnectionFactory cf = (ConnectionFactory)context.lookup(JNDINAME);
The ConectionFactory/JNDINAME should be defined in the -ds.xml at <connection-definition>/ <jndi-name> tags.
Check this for more details
http://docs.jboss.org/jbossas/jboss4guide/r5/html/ch7.chapt.html -
2. Re: Discovery of JCA ConnectionFactory without resource-ref
maffeis Nov 18, 2009 4:19 PM (in response to maffeis)Thanks for your feedback, Vicky. The trick is to define a <res-ref-name> not starting with "ra" nor "jdbc" in jboss-web.xml. Once I avoided using the "ra" JNDI context, my connection factories became accessible without declaring them in web.xml