Re: Where to put context.xml in webapp archetype ?
A little bit of update. You have to put context.xml in src/main/webapp/META-INF/context.xml not directly under the WEB-INF folder. On Sat, Aug 8, 2015 at 6:38 PM, jieryn jie...@gmail.com wrote: I personally find this a bit weird, but it's because the JPA persistence.xml needs to end up in war!WEB-INF/classes/META-INF/persistence.xml whereas Tomcat will expect to find context.xml in war!WEB-INF/context.xml. I suppose you could put it in src/main/webapp/WEB-INF/classes/META-INF/persistence.xml but then IDEs will probably not find it easily/at all. Glad it works for you. On Sat, Aug 8, 2015 at 8:47 AM, Sreyan Chakravarty sreyan.mail...@gmail.com wrote: Thanks On Sat, Aug 8, 2015 at 4:05 PM, jieryn jie...@gmail.com wrote: src/main/resources/META-INF/persistence.xml src/main/webapp/WEB-INF/context.xml On Fri, Aug 7, 2015 at 3:24 PM, Sreyan Chakravarty sreyan.mail...@gmail.com wrote: I am using Maven for building a simple webapp that uses JDBC connection pooling along with Hibernate. I am using the Maven Webapp Archetype to build the project. Where do I put context.xml and persistence.xml that I normally put under META-INF in a normal dynamic web project. - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org
RE: Where to put context.xml in webapp archetype ?
if you have Spring you can put it anywhere you want /** app context. */ private static org.springframework.context.support.ClassPathXmlApplicationContext.appContext; YourClassName.appContext = new org.springframework.context.support.ClassPathXmlApplicationContext(conf/applicationContext.xml); org.springframework.context.ApplicationContextcontext=(org.springframework.context.ApplicationContext) YourClassName.appContext; *gruss* Martin __ Date: Sun, 30 Aug 2015 02:48:07 +0530 Subject: Re: Where to put context.xml in webapp archetype ? From: sreyan.mail...@gmail.com To: users@maven.apache.org A little bit of update. You have to put context.xml in src/main/webapp/META-INF/context.xml not directly under the WEB-INF folder. On Sat, Aug 8, 2015 at 6:38 PM, jieryn jie...@gmail.com wrote: I personally find this a bit weird, but it's because the JPA persistence.xml needs to end up in war!WEB-INF/classes/META-INF/persistence.xml whereas Tomcat will expect to find context.xml in war!WEB-INF/context.xml. I suppose you could put it in src/main/webapp/WEB-INF/classes/META-INF/persistence.xml but then IDEs will probably not find it easily/at all. Glad it works for you. On Sat, Aug 8, 2015 at 8:47 AM, Sreyan Chakravarty sreyan.mail...@gmail.com wrote: Thanks On Sat, Aug 8, 2015 at 4:05 PM, jieryn jie...@gmail.com wrote: src/main/resources/META-INF/persistence.xml src/main/webapp/WEB-INF/context.xml On Fri, Aug 7, 2015 at 3:24 PM, Sreyan Chakravarty sreyan.mail...@gmail.com wrote: I am using Maven for building a simple webapp that uses JDBC connection pooling along with Hibernate. I am using the Maven Webapp Archetype to build the project. Where do I put context.xml and persistence.xml that I normally put under META-INF in a normal dynamic web project. - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org
Re: Where to put context.xml in webapp archetype ?
there is one misconception: the project *is not built with* Maven Webapp Archetype, but it *was generated from* Maven Webapp Archetype Once a project is generated from a Maven Archetype, it is a normal project, you can forget about its inception: the whole generated content is yours, to be maintained as if you wrote everything by hand I don't precisely know what is generated by Maven Webapp Archetype, I suppose it uses maven-war-plugin [1] Regards, Hervé [1] http://maven.apache.org/plugins/maven-war-plugin/usage.html - Mail original - De: Sreyan Chakravarty sreyan.mail...@gmail.com À: Maven Users List users@maven.apache.org Envoyé: Vendredi 7 Août 2015 21:24:25 Objet: Where to put context.xml in webapp archetype ? I am using Maven for building a simple webapp that uses JDBC connection pooling along with Hibernate. I am using the Maven Webapp Archetype to build the project. Where do I put context.xml and persistence.xml that I normally put under META-INF in a normal dynamic web project. - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org
Re: Where to put context.xml in webapp archetype ?
src/main/resources/META-INF/persistence.xml src/main/webapp/WEB-INF/context.xml On Fri, Aug 7, 2015 at 3:24 PM, Sreyan Chakravarty sreyan.mail...@gmail.com wrote: I am using Maven for building a simple webapp that uses JDBC connection pooling along with Hibernate. I am using the Maven Webapp Archetype to build the project. Where do I put context.xml and persistence.xml that I normally put under META-INF in a normal dynamic web project. - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org
Re: Where to put context.xml in webapp archetype ?
Thanks On Sat, Aug 8, 2015 at 4:05 PM, jieryn jie...@gmail.com wrote: src/main/resources/META-INF/persistence.xml src/main/webapp/WEB-INF/context.xml On Fri, Aug 7, 2015 at 3:24 PM, Sreyan Chakravarty sreyan.mail...@gmail.com wrote: I am using Maven for building a simple webapp that uses JDBC connection pooling along with Hibernate. I am using the Maven Webapp Archetype to build the project. Where do I put context.xml and persistence.xml that I normally put under META-INF in a normal dynamic web project. - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org
Re: Where to put context.xml in webapp archetype ?
I personally find this a bit weird, but it's because the JPA persistence.xml needs to end up in war!WEB-INF/classes/META-INF/persistence.xml whereas Tomcat will expect to find context.xml in war!WEB-INF/context.xml. I suppose you could put it in src/main/webapp/WEB-INF/classes/META-INF/persistence.xml but then IDEs will probably not find it easily/at all. Glad it works for you. On Sat, Aug 8, 2015 at 8:47 AM, Sreyan Chakravarty sreyan.mail...@gmail.com wrote: Thanks On Sat, Aug 8, 2015 at 4:05 PM, jieryn jie...@gmail.com wrote: src/main/resources/META-INF/persistence.xml src/main/webapp/WEB-INF/context.xml On Fri, Aug 7, 2015 at 3:24 PM, Sreyan Chakravarty sreyan.mail...@gmail.com wrote: I am using Maven for building a simple webapp that uses JDBC connection pooling along with Hibernate. I am using the Maven Webapp Archetype to build the project. Where do I put context.xml and persistence.xml that I normally put under META-INF in a normal dynamic web project. - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org
Where to put context.xml in webapp archetype ?
I am using Maven for building a simple webapp that uses JDBC connection pooling along with Hibernate. I am using the Maven Webapp Archetype to build the project. Where do I put context.xml and persistence.xml that I normally put under META-INF in a normal dynamic web project.