You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ofbiz.apache.org by Cameron Smith <ca...@yahoo.co.uk> on 2006/09/27 09:26:23 UTC

Embedded Catalina - DataSources / context.xml

[Originally posted on OpenTAPS General User Discussion
Forum - Si Chen suggested I re-post here.]

Hi all, I am converting a J2EE webapp which currently
runs standalone in Tomcat 5.5 (and is based on Struts
+ Spring), to be an OfBiz module. It will continue
running like this for a while, and then we will
gradually phase the business logic layer to use OfBiz
entity-engine and services instead of Spring JDBC.
Now, I have got it all working, but I have come up
against one unpleasant hack that I would rather not go
into Production with. 
 
This stems from the fact that in standalone Tomcat, we
can get TC to load up DataSources via a context XML
file in conf/Catalina/localhost, and register it in
JNDI. Spring (and hence the whole app) then gets it
out of JNDI.  
 
The problem now, is that the embedded
CatalinaContainer does not appear to support this
usage. However I notice from the source that it DOES
set framework/catalina/hosts as the base dir of the
default Catalina Host instance. Would I be write in
assuming that any xml files there, whose names match
webapp names, will be picked up by the Host? 
 
If not, is there a way in entityengine.xml to say that
a configured DataSource should be REGISTERED IN (as
opposed to LOOKED UP FROM) JNDI with a certain name?
This would be an alternate and slightly nicer solution
to my problem.


		
___________________________________________________________ 
To help you stay safe and secure online, we've developed the all new Yahoo! Security Centre. http://uk.security.yahoo.com