Re: Realm and Datasource configuration in Context
I had come around the problem by reinstalling everything included Vista. I hadn't found out where the problem came from but now I can use my webapp. My only guess is there was some troubles with the network because I already had to reset it for avoiding white pages... Thanks everyone for your help! Guillaume. 2009/6/11, Guillaume M geama...@gmail.com: Hi Chuck, Yes I had only put the mysql jar in the tomcat's lib directory. I had just tried to add mySQL character encoding (UTF-8) on the url value. I still have the same problem... Thank you. 2009/6/11, Caldarale, Charles R chuck.caldar...@unisys.com: From: Guillaume M [mailto:geama...@gmail.com] Subject: Re: Realm and Datasource configuration in Context And I had put the mysql in the $CATALINA_BASE/lib directory. Is the MySQL jar in *only* Tomcat's lib directory? If it's also in your webapp's WEB-INF/lib, that can cause classloader conflicts and possibly the symptom you're seeing. - Chuck THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers. - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
RE: Realm and Datasource configuration in Context
From: Guillaume M [mailto:geama...@gmail.com] Subject: Realm and Datasource configuration in Context context.xml Let's get this sorted first. Where is your context.xml file located? It should be in your webapp's META-INF directory. Context docBase=${app.name} path=/CQC privileged=true You must not use the docBase or path attributes in a Context element, unless the element is declared in server.xml, which you should never do on any recent version of Tomcat. Answer the above question, fix your Context element, try again, and let us know what happens. - Chuck THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers. - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Realm and Datasource configuration in Context
My context.xml file is in my webapp's META-INF directory and my web.xml is in my webapp's WEB-INF directory. There isn't any change in the results after those corrections. This webapp worked fine enough for some years on my laptop, saddly it had broken down recently and I don't remember the exact configuration it had. I had to reinstall everything from the webapp I saved on USB key. Thank you for your help. Guillaume. 2009/6/11, Caldarale, Charles R chuck.caldar...@unisys.com: From: Guillaume M [mailto:geama...@gmail.com] Subject: Realm and Datasource configuration in Context context.xml Let's get this sorted first. Where is your context.xml file located? It should be in your webapp's META-INF directory. Context docBase=${app.name} path=/CQC privileged=true You must not use the docBase or path attributes in a Context element, unless the element is declared in server.xml, which you should never do on any recent version of Tomcat. Answer the above question, fix your Context element, try again, and let us know what happens. - Chuck THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers. - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Realm and Datasource configuration in Context
I had tried again with the realm off and I can use the database through the datasource in my vista version but on my XP version I have the message jdbc not bound to this context. 2009/6/11, Guillaume M geama...@gmail.com: My context.xml file is in my webapp's META-INF directory and my web.xml is in my webapp's WEB-INF directory. There isn't any change in the results after those corrections. This webapp worked fine enough for some years on my laptop, saddly it had broken down recently and I don't remember the exact configuration it had. I had to reinstall everything from the webapp I saved on USB key. Thank you for your help. Guillaume. 2009/6/11, Caldarale, Charles R chuck.caldar...@unisys.com: From: Guillaume M [mailto:geama...@gmail.com] Subject: Realm and Datasource configuration in Context context.xml Let's get this sorted first. Where is your context.xml file located? It should be in your webapp's META-INF directory. Context docBase=${app.name} path=/CQC privileged=true You must not use the docBase or path attributes in a Context element, unless the element is declared in server.xml, which you should never do on any recent version of Tomcat. Answer the above question, fix your Context element, try again, and let us know what happens. - Chuck THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers. - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Realm and Datasource configuration in Context
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Guillaume, On 6/11/2009 5:48 AM, Guillaume M wrote: On my Vista version, I have the error the name jdbc isn't bound to the context. Sounds like your JNDI name is not correct. Resource name=jdbc/authen This is correct. maxIdle=6000 maxWait=1000 maxActive=2 This is a LOT of connections. Are you sure you need 2 database connections? Are you sure MySQL will allow that many to connect? validationQuery=Select 1 Try: /* PING */ SELECT 1 -- you'll get better performance. removeAbandonnedTimeout=100 1000 minutes? That's an awfully long time to consider a connection abandoned. Do you have ridiculously-long-running queries? If not, consider dropping this value to something more reasonable like 5 minutes. dataSourceName=jdbc/authen This is also correct. localDataSource=true Excellent: you have read the documentation! autoReconnect=true I don't believe this has any effect. GRAVE: Exception performing authentication javax.naming.NameNotFoundException: Le Nom jdbc n'est pas lié à ce Contexte at org.apache.naming.NamingContext.lookup(NamingContext.java:770) at org.apache.naming.NamingContext.lookup(NamingContext.java:153) at org.apache.catalina.realm.DataSourceRealm.open(DataSourceRealm.java:403) at org.apache.catalina.realm.DataSourceRealm.authenticate(DataSourceRealm.java:284) Okay, so the DataSourceRealm is failing to pick-up the DataSource. INFO: Starting Coyote AJP/1.3 on ajp-8009 11 juin 2009 08:16:13 org.apache.catalina.startup.Catalina start INFO: Server startup in 1125 ms /code Is there anything in catalina.out after these lines? How about after the error (other than the exception itself)? Where do you have your mysql-connector.jar file located? In order for Tomcat to create this DataSource for you, you need to have it located in $CATALINA_BASE/lib. It won't work if you have it in your webapp's WEB-INF/lib directory. - -chris -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.9 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAkoxLjcACgkQ9CaO5/Lv0PBqWQCfUuYk0KL4sUMFUcx5vRN5h1pE B20AoMBmj1xJYzhMJoocAK87IdqMS0aL =Ze9m -END PGP SIGNATURE- - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Realm and Datasource configuration in Context
Hi Chris, Yes there is a lot of connections which can be very slow. I had been asked to do a complex sorting program on a web server. I wouldn't have use a web server especially knowing we can have above 100 sorts in a row but it's easier to update... I had used all I knew about Java to make it fast enough meaning prepared statements and threads because it lasted several days, and now I'm down to some hours for usual databases... I have to clean MySQL about once every five months to avoid overloading... There isn't any other line in the log files. And I had put the mysql in the $CATALINA_BASE/lib directory. Thank you for your time, Guillaume. 2009/6/11, Christopher Schultz ch...@christopherschultz.net: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Guillaume, On 6/11/2009 5:48 AM, Guillaume M wrote: On my Vista version, I have the error the name jdbc isn't bound to the context. Sounds like your JNDI name is not correct. Resource name=jdbc/authen This is correct. maxIdle=6000 maxWait=1000 maxActive=2 This is a LOT of connections. Are you sure you need 2 database connections? Are you sure MySQL will allow that many to connect? validationQuery=Select 1 Try: /* PING */ SELECT 1 -- you'll get better performance. removeAbandonnedTimeout=100 1000 minutes? That's an awfully long time to consider a connection abandoned. Do you have ridiculously-long-running queries? If not, consider dropping this value to something more reasonable like 5 minutes. dataSourceName=jdbc/authen This is also correct. localDataSource=true Excellent: you have read the documentation! autoReconnect=true I don't believe this has any effect. GRAVE: Exception performing authentication javax.naming.NameNotFoundException: Le Nom jdbc n'est pas lié à ce Contexte at org.apache.naming.NamingContext.lookup(NamingContext.java:770) at org.apache.naming.NamingContext.lookup(NamingContext.java:153) at org.apache.catalina.realm.DataSourceRealm.open(DataSourceRealm.java:403) at org.apache.catalina.realm.DataSourceRealm.authenticate(DataSourceRealm.java:284) Okay, so the DataSourceRealm is failing to pick-up the DataSource. INFO: Starting Coyote AJP/1.3 on ajp-8009 11 juin 2009 08:16:13 org.apache.catalina.startup.Catalina start INFO: Server startup in 1125 ms /code Is there anything in catalina.out after these lines? How about after the error (other than the exception itself)? Where do you have your mysql-connector.jar file located? In order for Tomcat to create this DataSource for you, you need to have it located in $CATALINA_BASE/lib. It won't work if you have it in your webapp's WEB-INF/lib directory. - -chris -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.9 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAkoxLjcACgkQ9CaO5/Lv0PBqWQCfUuYk0KL4sUMFUcx5vRN5h1pE B20AoMBmj1xJYzhMJoocAK87IdqMS0aL =Ze9m -END PGP SIGNATURE- - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
RE: Realm and Datasource configuration in Context
From: Guillaume M [mailto:geama...@gmail.com] Subject: Re: Realm and Datasource configuration in Context And I had put the mysql in the $CATALINA_BASE/lib directory. Is the MySQL jar in *only* Tomcat's lib directory? If it's also in your webapp's WEB-INF/lib, that can cause classloader conflicts and possibly the symptom you're seeing. - Chuck THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers. - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org