Results 1 to 1 of 1
- 06-09-2011, 12:17 PM #1
Member
- Join Date
- Aug 2010
- Posts
- 3
- Rep Power
- 0
Multiple Instance of Web Application end Up Using Same JCA Resource
Hi Guys,
I am not sure If I should ask this question in this area but this is a closest match I found for my problem on this forum.
I am stuck at very unusual problem i.e. when I am deploying multiple instances of my web application, each instance is configured to use different data source (JCA Cx Factory) definition but both are end up using same data source (whichever used first). Let me explain a bit, say I have two instance of same web application renamed as ABCLive and ABCTest.
ABCLive deployment descriptor (web.xml) contains following resource ref definition;
and corresponding jboss-web.xml has following mappings to bind above resource to an actual JNDI;Java Code:<resource-ref id="ResourceRef_ABCConnectionFactory"> <description>ABC</description> <res-ref-name>jca/abcConnectionFactory</res-ref-name> <res-type>com.....ConnectionFactory</res-type> <res-auth>Container</res-auth> </resource-ref>
In ABCTest deployment descriptor (web.xml) contains following resource ref definition (exactly same, as we do not have to edit this bit);Java Code:<resource-ref> <res-ref-name>jca/abcConnectionFactory</res-ref-name> <res-type>com.....ConnectionFactory</res-type> <jndi-name>java:jca/abcConnectionFactoryLIVE</jndi-name> </resource-ref>
and corresponding jboss-web.xml has following mappings to bind above resource to some other JNDIJava Code:<resource-ref id="ResourceRef_ABCConnectionFactory"> <description>ABC</description> <res-ref-name>jca/abcConnectionFactory</res-ref-name> <res-type>com.....ConnectionFactory</res-type> <res-auth>Container</res-auth> </resource-ref>
Now theoretically when I will access 'http://localhost:8080/ABCLive' instance it should use resource 'jca/abcConnectionFactoryLive' and for 'http://localhost:8080/ABCTest' instance it should use resource 'jca/abcConnectionFactoryTEST', BUT that's not the case, whichever I use first the other will use the same. For example, if I use ABCTest instance first, it successfully access 'jca/abcConnectionFactoryTEST' and now when I start using 'ABCLive' instance it also uses 'jca/abcConnectionFactoryTEST' which is incorrect, it should use 'jca/abcConnectionFactoryLIVE' and vice versa.Java Code:<resource-ref> <res-ref-name>jca/abcConnectionFactory</res-ref-name> <res-type>com.....ConnectionFactory</res-type> <jndi-name>java:jca/abcConnectionFactoryTEST</jndi-name> </resource-ref>
NOTE: I am using jBoss 5.1.0 GA release and verified the behaviour on jBoss 6.0.0.Final but same setup is working on jBoss 4.2.3GA.
Your help and comments will be appreciated.
Thanks & regards
--
SJunejo
Similar Threads
-
Find instance that owns instance?
By Addez in forum New To JavaReplies: 2Last Post: 04-04-2010, 03:36 PM -
Multiple views on user interface application
By dand_dd in forum SWT / JFaceReplies: 36Last Post: 04-24-2009, 09:05 AM -
how to run chat application on multiple systems
By jayeth in forum Advanced JavaReplies: 4Last Post: 03-27-2009, 03:25 PM -
Multiple Field Verification and Cross-Application Framework
By calexander in forum Advanced JavaReplies: 1Last Post: 11-23-2008, 02:21 AM -
[SOLVED] Hacking Singleton- Multiple instance of a Singleton class
By piyu.sha in forum New To JavaReplies: 2Last Post: 10-06-2008, 09:06 PM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks