cayenne-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andrus Adamchik <and...@objectstyle.org>
Subject Re: How to use JNDI in development
Date Fri, 25 Apr 2014 15:59:22 GMT

> I don't necessarily have to solve these problems if you can recommend an alternative
way of keeping database config separate to the war.

Absolutely! Cayenne 3.1 solves this exact problem. You specify JNDI in the mapping, but in
development you’d override that with a set of properties with -D. Here is a list of properties:

http://cayenne.apache.org/docs/3.1/cayenne-guide/configuration-properties.html

Those that start with “cayenne.jdbc.*” is what you need to define to get yourself a local
DataSource without JNDI.

Andrus

On Apr 25, 2014, at 4:38 AM, D Tim Cummings <tim@triptera.com.au> wrote:

> Hi
> 
> I am using cayenne in a tapestry project and my final deployment will be in Tomcat 7
using JNDI for defining the data source. I am developing in Eclipse 4.3.1 and would like my
development environment to be as close to deployment as possible. What is the recommended
way of using JNDI in development.
> 
> I have tried the instructions on 
> 
> http://tynamo.org/Developing+with+Tomcat+and+Eclipse
> 
> using sysdeo tomcat plugin for eclipse. I haven't been able to get it to read the jndi
information. 
> 
> Apr 25, 2014 11:25:40 AM org.apache.catalina.deploy.NamingResources addResource
> WARNING: Failed to create MBean for naming resource [null]
> 
> I have tried using RunJettyRun but get.
> 
> Exception happened when loading Jetty.xml:
> java.lang.ClassNotFoundException: org.eclipse.jetty.plus.jndi.Resource
> 
> 
> RunJettyRun works great when I configure cayenne-project.xml to XMLPoolingDataSourceFactory
but I don't want to have to keep switching between this and JNDI when ready to deploy. I would
also prefer to use tomcat in dev so it is same as prod.
> 
> JNDI works great when I build a war file and deploy to tomcat but that would slow my
development if I had to do that every time.
> 
> I don't necessarily have to solve these problems if you can recommend an alternative
way of keeping database config separate to the war. The war will be deployed by unskilled
users on Windows and skilled users on Linux and Mac so I am trying to keep the steps to deploy
simple and not hard code absolute paths of properties files into my app.
> 
> Thanks
> 
> Tim


Mime
View raw message