Mark, sorry I didn't reply so long, but my previous tomcat was messed with tests and many attempts, now I did everything from start with clean tomcat installation and confirm context xml disappears.
steps to reproduce 1) make dir C:\tomcat_test 2) download apache-tomcat-7.0.39.zip and unpack it in C:\tomcat_test 3) in C:\tomcat_test unpack attached jdbc.7z 4) start tomcat with startup.bat 4) in c:\tomcat_test\jdbc> call ant deploy-war 5) open http://localhost:8080/jdbc/select.jsp result is: org.apache.jasper.JasperException: An exception occurred processing JSP page /select.jsp at line 22 ..... root cause javax.servlet.ServletException: javax.naming.NameNotFoundException: Name [jdbc/Test] is not bound in this Context. Unable to find [jdbc]. 6) into C:\tomcat_test\apache-tomcat-7.0.39\conf\Catalina\localhost insert attached jdbc.xml 7) close tomcat console 8) start tomcat with startup.bat 9) again open result is OK, config works fine, error is caused by lack of h2 jar (org.apache.jasper.JasperException: javax.servlet.ServletException: org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot load JDBC driver class 'org.h2.Driver') 10) now in notepad++ open C:\tomcat_test\jdbc\src\main\webapp\select.jsp, change title to <title>Simple jsp page 2</t> 11) as in 4) in c:\tomcat_test\jdbc> call ant deploy-war jdbc.xml disappeared from C:\tomcat_test\apache-tomcat-7.0.39\conf\Catalina\localhost , go to 5) result is the same as in 5) I run it on windows 7 64 bit regards Jakub On Fri, Apr 19, 2013 at 12:34 AM, Mark Thomas <ma...@apache.org> wrote: > On 17/04/2013 23:46, Jakub 1983 wrote: > > I call ant task > > <target name="deploy-war" depends="create-war"> > > <copy file="${target.dir}/${war.file}" todir="${deploy.dir}"/> > > </target> > > > > application is called jdbc.war, and I create jdbc.xml in > > conf/Catalina/localhost/ after I deploy war and previous jdbc.xml > > disappears - I create it on running tomcat. > > When exactly do you create jdbc.xml? Can you explain, step-by-step, what > you do starting from a clean Tomcat install when Tomcat is not running. > I am looking for the order you: > - start or stop Tomcat > - copy any WAR / xml files > - delete any WAR / xml files > - do anything to change the timestamp of any WAR / xml files > > Mark > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org > For additional commands, e-mail: users-h...@tomcat.apache.org > >
<Context > <Resource name="jdbc/Test" auth="Container" type="javax.sql.DataSource" username="sa" password="" driverClassName="org.h2.Driver" url="jdbc:h2:tcp://localhost/databases/test1" maxActive="3" removeAbandoned="true" removeAbandonedTimeout="20" logAbandoned="true" /> </Context>
--------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org