-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA256
On 1/22/13 1:50 PM, sry...@jsrsys.com wrote: > conf is: Program Files/Apache Software Foundation/Tomcat5.0/conf > (where server xml resides). > > When I put context.xml in that directory, it seemed to be ignored. If the file is in fact named context.xml, it should set the defaults for all loaded applications. You may not get a message on stdout saying that it is processed, but that doesn't mean it's not being processed. Remember that you are using an ancient, unsupported, buggy, and likely vulnerable version of Tomcat. My comments and suggestions reflect current best practices and how Tomcat currently works with a properly-supported version. YMMV. > I did some experimenting moving it around and when I put it in: > Program Files/Apache Software > Foundation/Tomcat5.0/conf/Catalina/localhost the console log in > Eclipse showed it was being processed AND gave me the path error. If the file was called context.xml, then you were trying to deploy a web application on the URL patn "/context". That's probably not what you wanted. > The max active 3 is for my development environment only so I will > catch my failure to do an sql.close() during testing on the > development machine. Why not 1? If anything else, you run the risk of deadlocking your DBCP in production. > Yes, I want one shared connection pool. Security is provided via > application code, and I personally code ALL the apps. each app has > it's own database. So you have separate databases but you want a shared connection pool? Odd, but it should work. > I attach the two files that are now both in ONLY the Program > Files/Apache Software Foundation/Tomcat5.0/conf directory. > > The exception stack is: :*WARNING*Connection to jdbc/MySql:: > connect Other exception: Name jdbc is not bound in this Context > 2013-01-22 > 12:42:00:Stack(6)=org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:94) > > 2013-01-22 > 12:42:00:Stack(5)=org.apache.jsp.SQLRep_jsp._jspService(SQLRep_jsp.java:610) > > 2013-01-22 > 12:42:00:Stack(4)=com.jsrsys.web.JsrSQL.(JsrSQL.java:42) > 2013-01-22 > 12:42:00:Stack(3)=com.jsrsys.web.JsrSQL.setDataBaseName(JsrSQL.java:86) > > 2013-01-22 12:42:00:Stack(2)=com.jsrsys.web.JsrSQL.connect(JsrSQL.java:504) > 2013-01-22 > 12:42:00:Stack(1)=org.apache.naming.NamingContext.lookup(NamingContext.java:151) > > 2013-01-22 > 12:42:00:Stack(0)=org.apache.naming.NamingContext.lookup(NamingContext.java:768) > > 2013-01-22 12:42:00:JsrSQL: Context cast successfull > > SQLRep is the jsp page, JsrSQL is my class that handles all SQL. > The base errors seems to be the NamingContextLookup error from > Apache tomcat. Okay. context.xml - ----------- <?xml version="1.0" encoding="UTF-8"?> <!-- The contents of this file will be loaded for each web application --> <Context> <!-- Default set of monitored resources --> <WatchedResource>WEB-INF/web.xml</WatchedResource> <Resource name="jdbc/MySql" auth="Container" type="javax.sql.DataSource" url="jdbc:mysql://localhost/autoReconnect=true" driverClassName="com.mysql.jdbc.Driver" password="jsrsys" username="jsrsys" maxWait="10000" maxActive="200" maxIdle="5" removeAbandoned="true" removeAbandonedTimeout="300" logAbandoned="true" validationQuery="SELECT 1" testOnBorrow="true" /> </Context> It's possible that Tomcat 5.0 doesn't support the short-form of <Resource> like Tomcat 5.5, 6.0, and 7.0 do. You might have to do it the long-way like you have in server.xml. I find it odd that you are defining once in server.xml and once in context.xml. How about this: server.xml <Resource name="jdbc/MySqlDB" ... /> <ResourceParams> ... </ResourceParams> context.xml <Context> <ResourceLink name="jdbc/MySql" type="javax.sql.DataSource" global="jdbc/MySqlDB" /> </Context> That should give you a single connection pool and then all web applications should get a link to it. I'm still not sure why you wouldn't just have a META-INF/context.xml file in each of your web applications... setting global defaults in conf/context.xml is usually not a great idea. - -chris -----BEGIN PGP SIGNATURE----- Version: GnuPG/MacGPG2 v2.0.17 (Darwin) Comment: GPGTools - http://gpgtools.org Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iEYEAREIAAYFAlD+4+EACgkQ9CaO5/Lv0PAMrACfaEzuSJKmWqVkKcmFH7hkoTbG CY4AoKD9QBI5cYEdrNo0fuubRLnlgdsB =t+eC -----END PGP SIGNATURE----- --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org