I don't like to use server.xml for JNDI configuration for several reasons, but the main is that JDBC driver classes should be on server classpath, which means you have to manually put them there. Which personally I don't like because driver jar usually specified at pom.xml/build.gradle and this is simply not that DRY.
And also this is not recommended by tomcat team and here's why: http://tomcat.apache.org/tomcat-7.0-doc/config/context.html#Defining_a_context What I prefer to do is to create context file (ROOT context at this example) at ./apache-tomcat-7.0.35/conf/Catalina/localhost/ROOT.xml with the following content: <?xml version="1.0" encoding="UTF-8"?> <Context> <Loader delegate="true"/> <Resource name="jdbc/xxx-db" type="javax.sql.DataSource" auth="Container" maxActive="100" maxIdle="30" maxWait="10000" driverClassName="org.postgresql.Driver" url="jdbc:postgresql://localhost/xxx" username="xxx" /> </Context> For several recent projects I found it convenient to also develop with Tomcat using Sysdeo Eclipse Plugin. For this to work there I have to put content of /Context node into "Extra information" textarea at Project Properties -> Tomcat. Though, I agree its more difficult to setup Tomcat plugin than Jetty in Eclipse, but when you did this once -- every other projects will be easier to setup. And you usually might want to have exactly the same web container that will be in production if you use, say, web sockets API. // PS: Sorry for offtopic On Tue, Mar 26, 2013 at 3:28 PM, Barry Books <trs...@gmail.com> wrote: > I also host on Amazon with Tomcat and develop with Jetty. > > Hibernate just gets the datasource from the container. When running > locally that's Jetty and Jetty reads the jetty-web.xml file to build > the connection. When deployed under Tomcat that would most likely be > the server.xml file in the Tomcat conf directory. Tomcat requires a > mapping between the server.xml configurations and each web app. I do > this by creating a META-INF/context.xml file in the project. When > Tomcat deploys the app it will pick up that file and use the mapping > you provide. The contents would be something like > > <?xml version="1.0" encoding="UTF-8"?> > <Context> > <ResourceLink name="jdbc/wind" global="jdbc/wind" > type="javax.sql.DataSource"/> > </Context> > > --------------------------------------------------------------------- > To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org > For additional commands, e-mail: users-h...@tapestry.apache.org > > -- Dmitry Gusev AnjLab Team http://anjlab.com