Nothing helps
Perhaps I misunderstood a few things and am trying to force something that works on my test rig to work in production? Can a resource be shared between tomcat authentication and hibernate? Should I let hibernate manage it's own resource and give tomcat it's own seperateresource for authentication? any help is hugely appreciated. -- From: Saurabh Agrawal saurabh.agra...@criticalpath.net Sent: Thursday, June 24, 2010 1:37 PM To: users@tomcat.apache.org Subject: Cannot configure apache-log4j-extras-1.0 with apache-log4j-1? Hi Friends, Tomcat version: apache-tomcat-5.5.27 Operating System: SunOS 10.0 / Linux Question: Problem: I've tried many times to configure apache-log4j-extras-1.0 with apache-log4j-1.2.16, but it is still failing to load classes from configure apache-log4j-extras-1.0 JAR file. What I want to do: Actually I want to do time based log rotation the my application specific log files. I could able to configure using 'net.cp.ps.sdk.util.log.DailyRollingFileAppender' class, but few problems are reported on Apache site for this class. Solution I can think of: So, I have to look for another option for 'net.cp.ps.sdk.util.log.DailyRollingFileAppender' class, and I found 'org.apache.log4j.rolling.RollingFileAppender' class and can use 'org.apache.log4j.rolling.TimeBasedRollingPolicy' in that. Steps I performed so far: 1. Downloaded apache-log4j-extras-1.0 with apache-log4j-1.2.16 JAR files from web. 2. Renamed apache-log4j-1.2.16.jar to simple 'log4j.jar'. 3. Copied apache-log4j-extras-1.0.jar in ~/WEB-INF/lib directory, where my old log4j is present. 4. Extracted new log4j.jar (1.2.16). 5. Edited the pom.xml file from new 'log4j.jar' to include 'apache-log4j-extras-1.0'. Steps are described here: (https://wiki.jasig.org/display/UPM30/log4j.xml). 6. Created jar file again, after editing pom.xml. 7. Then I added following configuration block, in my application specific log-conf.xml (present in ~/WEB-INF/etc/): !-- Presentation Server Access log appender -- appender name=access-log class=org.apache.log4j.rolling.RollingFileAppender FileWEB-INF/log-files/access.log/File rollingPolicy class=org.apache.log4j.rolling.TimeBasedRollingPolicy FileNamePatternWEB-INF/log-files/access.log.%d{-MM-dd}.log/FileNamePa ttern /rollingPolicy layout class=org.apache.log4j.PatternLayout param name=ConversionPattern value=%d{dd.MM. HH:mm:ss,SSS} [%t] %c %x%n %-5p - %m%n/ /layout /appender but, still I am getting following exception: 7202 [main] WARN net.cp.ps.sdk.server.ServerConfig - thread[main] Unable to parse invite request mappings: [The XPath='invite-requests/invite-mapping' does not exist] 7214 [main] WARN net.cp.ps.sdk.server.ServerConfig - thread[main] Unable to parse known profiles request mappings: [The XPath='known-profiles-requests/known-profiles-mapping' does not exist] 8114 [main] ERROR net.cp.ps.sdk.server.ServerConfig - thread[main] Missing configuration: couldn't find value for /ps-conf/regex-whitespace-keyword log4j:ERROR Could not create an Appender. Reported error follows. java.lang.ClassNotFoundException: org.apache.log4j.rolling.RollingFileAppender at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.jav a:1386) at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.jav a:1232) at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:164) at org.apache.log4j.helpers.Loader.loadClass(Loader.java:160) Can someone please help me with this, what's going wrong and what I am missing here? Thanks in advance. Regards, Saurabh Agrawal - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
fantastic! but what's going on?
I am pleased to say that myearlier issue appears to have solved itself? But what is happening? I had to remake, recompile, redeploy and restart just to get tomcat and hibernate to play nicely with the database! Now I am unable to use the realm to authenticate users but I don't know why. perhaps my wars are getting corrupted but what can i do to avoid this? I made NO code changes and the exception (jdbc is null) was no longer thrown ! It appears the same issue is now preventing my realm from running smoothly. -- From: superman sbw...@163.com Sent: Wednesday, June 23, 2010 12:13 PM To: users@tomcat.apache.org Subject: How to get session scop ? how to setup session scop at MemoryRealm class in tomcat ? - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
What's going on (are my wars getting corrupted?
I am pleased to say that myearlier issue appears to have solved itself? But what is happening? I had to remake, recompile, redeploy and restart just to get tomcat and hibernate to play nicely with the database! Now I am unable to use the realm to authenticate users but I don't know why. perhaps my wars are getting corrupted but what can i do to avoid this? I made NO code changes and the exception (jdbc is null) was no longer thrown ! It appears the same issue is now preventing my realm from running smoothly.
Re: fantastic! but what's going on?
aplogies -- From: Pid p...@pidster.com Sent: Wednesday, June 23, 2010 1:44 PM To: Tomcat Users List users@tomcat.apache.org Subject: Re: fantastic! but what's going on? - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot create JDBC driver of class '' for connect URL 'null' AGAIN!
tomcats!, clearly it is time to move onbecause there is a workaround to this issue by having hibernate manage it's own connection pool. I am not going to recheck my iurls again and jndi names because they are correct and my hosting provider has assisted me in checking and found no wrong. for future visitors to this thread, try allowing hibernate to manage own pool, it worked for me before i rwefactored my app in an attempt to gwt hibernate to use the tomcat pool. The guide over here: http://wiki.apache.org/tomcat/TomcatHibernate will still show you how to do that and is ver well written and overall the guide did allow me get hibernate to use my tomcat pool on my test rig but it failed with two production environments. I will try again to get it working on tomcat 7 in the future and report back here. -- From: David Smith david.sm...@cornell.edu Sent: Monday, June 21, 2010 2:54 PM To: Tomcat Users List users@tomcat.apache.org Subject: Re: org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot create JDBC driver of class '' for connect URL 'null' AGAIN! I do not see the mistake that you see I didn't say I saw a mistake ... just listing stuff to look at in diagnosing this issue. The file permission issue can definitely contribute to what you were seeing. Other comments inline --David On 6/21/2010 8:32 AM, yucca...@live.co.za wrote: -- From: Martin Gainty mgai...@hotmail.com Sent: Monday, June 21, 2010 1:16 PM To: Tomcat Users List users@tomcat.apache.org Subject: RE: org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot create JDBC driver of class '' for connect URL 'null' AGAIN! if you took time to look at tomcat-users archive you would've come across this post by david smith..the answer is just as good now as when originally posted On 6/19/2010 1:31 PM, yucca...@live.co.za wrote: I have no choice left but to not let hibernate use my tomcat datasource. This is not good. I have even moved host provider in hope that it was previous fult tomcat install from dailyrazor (tomcat 6 does not hav common/lib) and is meant to have tomcat/lib I can say that my new container is correct and that I am 100% sure that all mus jdbc configuration is correct in zml after having gone though it at least 20 times and checked the wiki that was linked here earlier and still have issues. Yes mysql jdbc bin is in tomcat/lib so that is not cause of the error. /the error is very weird though as I have another point that uses hibernate without error on the same database. It is not possible for me to use hibernate to use tomcat datasource sadly. Many thanks for all the help though. DS If you put the following into a jsp and call the jsp, does it work? %...@page import=java.sql.Connection% %...@page import=java.sql.DriverManager% %...@page import=java.sql.SQLException% % Class.forName(com.mysql.jdbc.Driver).newInstance(); conn = DriverManager.getConnection(jdbc:mysql://localhost/test? + user=montypassword=greatsqldb); out.println( The connection worked!! ) ; Did this and it works , I even made this page my welcome page at thejarbar.org Great! That's one giant step in the right direction. % If that works then your jdbc driver is available and installed properly (I trust there is only one copy of that jar in your entire tomcat install ... right?). I do not see or find another copy of the driver Now check to see if there's an xml in tomcat/conf/Catalina/localhost there isn't one Ok ... this is one of a couple of places a Context ... / element can be. It maybe in one of the others I mentioned like your webapp's META-INF folder. The one that might be in tomcat/conf/Catalina/localhost will take precedence over any in your webapp's META-INF folder. People have been bitten before changing the one in META-INF, not realizing there was an old copy in tomcat/conf/Catalina/localhost. matching your webapp's deployed name. For instance if you access your webapp as http://localhost:8088/mywebapp, there should be a mywebapp.xml file there. Take a look at it for the Resource ... / or ResourceLink ... / (which ever you setup) and make sure they are correct. If this file is not available, take a look at context.xml in your webapp's META-INF folder (same process). If it's not there, then the Context ... element for your webapp is in server.xml and it should NOT be there. It's bad practice and requires a full tomcat restart to make I did not do this If you mean restart, it's not necessary as long as the Context ... /Context element defining your app to tomcat is not in server.xml. changes. Did this and it works , I even made this page my welcome page at thejarbar.org ??? I'm confused here. What did you do at this point that works? Lastly, case matters. Be sure everything is typed correctly including whether it's upper or lower case. Now take a look at the logs and
Re: org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot create JDBC driver of class '' for connect URL 'null' AGAIN!
Ok I thought I found my solution yesterday with eapps but turns out not to be. I am posting a possible fix in hope that this may help someone els who reads this thread one day. apart from making sure that paths are correct, driver is inside tomcat/lib and that resource etc are defined correct, I hadnot ensured that tomcat had RW permission for the driver inside tomcat/lib upon doing so I was stuck with same issue but hope this may solve someone elses issue. -- From: Mark Thomas ma...@apache.org Sent: Monday, June 21, 2010 8:57 AM To: Tomcat Users List users@tomcat.apache.org Subject: Re: org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot create JDBC driver of class '' for connect URL 'null' AGAIN! On 20/06/2010 21:49, akhlaqur Rahman wrote: How do I unsubscribe from this list? I have tried following the unsubscribe link in the emails and it has not worked... Any tips would be appreciated. Ask one of the list owners for help. I'll unsubscribe you in a sec. Mark - 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: org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot create JDBC driver of class '' for connect URL 'null' AGAIN!
-- From: Martin Gainty mgai...@hotmail.com Sent: Monday, June 21, 2010 1:16 PM To: Tomcat Users List users@tomcat.apache.org Subject: RE: org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot create JDBC driver of class '' for connect URL 'null' AGAIN! if you took time to look at tomcat-users archive you would've come across this post by david smith..the answer is just as good now as when originally posted On 6/19/2010 1:31 PM, yucca...@live.co.za wrote: I have no choice left but to not let hibernate use my tomcat datasource. This is not good. I have even moved host provider in hope that it was previous fult tomcat install from dailyrazor (tomcat 6 does not hav common/lib) and is meant to have tomcat/lib I can say that my new container is correct and that I am 100% sure that all mus jdbc configuration is correct in zml after having gone though it at least 20 times and checked the wiki that was linked here earlier and still have issues. Yes mysql jdbc bin is in tomcat/lib so that is not cause of the error. /the error is very weird though as I have another point that uses hibernate without error on the same database. It is not possible for me to use hibernate to use tomcat datasource sadly. Many thanks for all the help though. DS If you put the following into a jsp and call the jsp, does it work? %...@page import=java.sql.Connection% %...@page import=java.sql.DriverManager% %...@page import=java.sql.SQLException% % Class.forName(com.mysql.jdbc.Driver).newInstance(); conn = DriverManager.getConnection(jdbc:mysql://localhost/test? + user=montypassword=greatsqldb); out.println( The connection worked!! ) ; Did this and it works , I even made this page my welcome page at thejarbar.org % If that works then your jdbc driver is available and installed properly (I trust there is only one copy of that jar in your entire tomcat install ... right?). I do not see or find another copy of the driver Now check to see if there's an xml in tomcat/conf/Catalina/localhost there isn't one matching your webapp's deployed name. For instance if you access your webapp as http://localhost:8088/mywebapp, there should be a mywebapp.xml file there. Take a look at it for the Resource ... / or ResourceLink ... / (which ever you setup) and make sure they are correct. If this file is not available, take a look at context.xml in your webapp's META-INF folder (same process). If it's not there, then the Context ... element for your webapp is in server.xml and it should NOT be there. It's bad practice and requires a full tomcat restart to make I did not do this changes. Did this and it works , I even made this page my welcome page at thejarbar.org Lastly, case matters. Be sure everything is typed correctly including whether it's upper or lower case. Now take a look at the logs and post any relevant messages including complete stacktraces of exceptions w/o edits except to protect usernames and passwords. I have checked this several times and see no syntax errors, further, if there were url syntax errors (because they can only be url errors due to it not being an accessdenied exception from mysql, it ould show on my test environment as I use same database names and table names. In fact I would say that because I am able to do that test page with success it proves my driver is in place and can be found . I do not see the mistake that you see --David /DS Martin Gainty __ Verzicht und Vertraulichkeitanmerkung/Note de déni et de confidentialité Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene Empfaenger sein, so bitten wir hoeflich um eine Mitteilung. Jede unbefugte Weiterleitung oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht dient lediglich dem Austausch von Informationen und entfaltet keine rechtliche Bindungswirkung. Aufgrund der leichten Manipulierbarkeit von E-Mails koennen wir keine Haftung fuer den Inhalt uebernehmen. Ce message est confidentiel et peut être privilégié. Si vous n'êtes pas le destinataire prévu, nous te demandons avec bonté que pour satisfaire informez l'expéditeur. N'importe quelle diffusion non autorisée ou la copie de ceci est interdite. Ce message sert à l'information seulement et n'aura pas n'importe quel effet légalement obligatoire. Étant donné que les email peuvent facilement être sujets à la manipulation, nous ne pouvons accepter aucune responsabilité pour le contenu fourni. From: yucca...@live.co.za To: users@tomcat.apache.org Subject: Re: org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot create JDBC driver of class '' for connect URL 'null' AGAIN! Date: Mon, 21 Jun 2010 10:49:41 +0200 Ok I thought I found my solution yesterday with eapps but turns out not to be. I am posting a possible fix in hope that this may help someone els who reads this thread one day. apart from making sure
Re: org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot create JDBC driver of class '' for connect URL 'null' AGAIN!
Hello, I have done as David suggested and has not fixed issue. If you visit thejarbar.org you will see the test page that confirms the jdbc has been opned and therefore the lib is present I found a possible reason in hibernate .cfg and fixed it but still got error after redeployment 1 my databse credentials are correct as I am not getting the mysql access denied exception this only leaves the possibilities of incorrect database url and names which is unlikely because my test environment uses same version of mysql and mysql driver and because I have removed resource and realm tags from server.xml in both test and production and because I get it running in the test environment I back my urls to be mapped right. This exception only happens from hibernate so have made extra sure to check hibernate xml but still can not find fault -- From: David Smith david.sm...@cornell.edu Sent: Monday, June 21, 2010 2:54 PM To: Tomcat Users List users@tomcat.apache.org Subject: Re: org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot create JDBC driver of class '' for connect URL 'null' AGAIN! I do not see the mistake that you see I didn't say I saw a mistake ... just listing stuff to look at in diagnosing this issue. The file permission issue can definitely contribute to what you were seeing. Other comments inline --David On 6/21/2010 8:32 AM, yucca...@live.co.za wrote: -- From: Martin Gainty mgai...@hotmail.com Sent: Monday, June 21, 2010 1:16 PM To: Tomcat Users List users@tomcat.apache.org Subject: RE: org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot create JDBC driver of class '' for connect URL 'null' AGAIN! if you took time to look at tomcat-users archive you would've come across this post by david smith..the answer is just as good now as when originally posted On 6/19/2010 1:31 PM, yucca...@live.co.za wrote: I have no choice left but to not let hibernate use my tomcat datasource. This is not good. I have even moved host provider in hope that it was previous fult tomcat install from dailyrazor (tomcat 6 does not hav common/lib) and is meant to have tomcat/lib I can say that my new container is correct and that I am 100% sure that all mus jdbc configuration is correct in zml after having gone though it at least 20 times and checked the wiki that was linked here earlier and still have issues. Yes mysql jdbc bin is in tomcat/lib so that is not cause of the error. /the error is very weird though as I have another point that uses hibernate without error on the same database. It is not possible for me to use hibernate to use tomcat datasource sadly. Many thanks for all the help though. DS If you put the following into a jsp and call the jsp, does it work? %...@page import=java.sql.Connection% %...@page import=java.sql.DriverManager% %...@page import=java.sql.SQLException% % Class.forName(com.mysql.jdbc.Driver).newInstance(); conn = DriverManager.getConnection(jdbc:mysql://localhost/test? + user=montypassword=greatsqldb); out.println( The connection worked!! ) ; Did this and it works , I even made this page my welcome page at thejarbar.org Great! That's one giant step in the right direction. % If that works then your jdbc driver is available and installed properly (I trust there is only one copy of that jar in your entire tomcat install ... right?). I do not see or find another copy of the driver Now check to see if there's an xml in tomcat/conf/Catalina/localhost there isn't one Ok ... this is one of a couple of places a Context ... / element can be. It maybe in one of the others I mentioned like your webapp's META-INF folder. The one that might be in tomcat/conf/Catalina/localhost will take precedence over any in your webapp's META-INF folder. People have been bitten before changing the one in META-INF, not realizing there was an old copy in tomcat/conf/Catalina/localhost. matching your webapp's deployed name. For instance if you access your webapp as http://localhost:8088/mywebapp, there should be a mywebapp.xml file there. Take a look at it for the Resource ... / or ResourceLink ... / (which ever you setup) and make sure they are correct. If this file is not available, take a look at context.xml in your webapp's META-INF folder (same process). If it's not there, then the Context ... element for your webapp is in server.xml and it should NOT be there. It's bad practice and requires a full tomcat restart to make I did not do this If you mean restart, it's not necessary as long as the Context ... /Context element defining your app to tomcat is not in server.xml. changes. Did this and it works , I even made this page my welcome page at thejarbar.org ??? I'm confused here. What did you do at this point that works? Lastly, case matters. Be sure everything is typed correctly including whether it's upper or lower case. Now take a
Re: org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot create JDBC driver of class '' for connect URL 'null'
I moved hosting provider and have found eapps to be excellent. Despite the same version of tomcat and same layout, I am unable to resolve this exception. my databases are correct, the jdbc jar is in tomcat/lib. I don't know what more to do :( -- From: yucca...@live.co.za Sent: Wednesday, June 16, 2010 1:08 PM To: Tomcat Users List users@tomcat.apache.org Subject: Re: org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot create JDBC driver of class '' for connect URL 'null' I manually added the lib dir to root of production server and am still stuck with same exception I now have also remove mysql connector as provider instructed me t because there is already a connector on server-side... My last hope, it would appear is that I missed something in config files so I am posting all 3 here in hope of moving on. SERVER: ?xml version='1.0' encoding='utf-8'? !-- Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to You under the Apache License, Version 2.0 (the License); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an AS IS BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. -- !-- Note: A Server is not itself a Container, so you may not define subcomponents such as Valves at this level. Documentation at /docs/config/server.html -- Server port=8005 shutdown=SHUTDOWN !--APR library loader. Documentation at /docs/apr.html -- Listener className=org.apache.catalina.core.AprLifecycleListener SSLEngine=on / !--Initialize Jasper prior to webapps are loaded. Documentation at /docs/jasper-howto.html -- Listener className=org.apache.catalina.core.JasperListener / !-- Prevent memory leaks due to use of particular java/javax APIs-- Listener className=org.apache.catalina.core.JreMemoryLeakPreventionListener / !-- JMX Support for the Tomcat server. Documentation at /docs/non-existent.html -- Listener className=org.apache.catalina.mbeans.ServerLifecycleListener / Listener className=org.apache.catalina.mbeans.GlobalResourcesLifecycleListener / !-- Global JNDI resources Documentation at /docs/jndi-resources-howto.html -- GlobalNamingResources !-- Editable user database that can also be used by UserDatabaseRealm to authenticate users -- Resource name=jdbc/auth description=The Jar Bar user authentication type=javax.sql.DataSource auth=Container driverClassName=com.mysql.jdbc.Driver maxActive=30 maxIdle=10 maxWait=1 password=pookie123 url=jdbc:mysql://localhost:3306/yucca123_thejarbar validationQuery=/* ping */ SELECT 1 username=yucca123_tom/ /GlobalNamingResources !-- A Service is a collection of one or more Connectors that share a single Container Note: A Service is not itself a Container, so you may not define subcomponents such as Valves at this level. Documentation at /docs/config/service.html -- Service name=Catalina !--The connectors can use a shared executor, you can define one or more named thread pools-- !-- Executor name=tomcatThreadPool namePrefix=catalina-exec- maxThreads=150 minSpareThreads=4/ -- !-- A Connector represents an endpoint by which requests are received and responses are returned. Documentation at : Java HTTP Connector: /docs/config/http.html (blocking non-blocking) Java AJP Connector: /docs/config/ajp.html APR (HTTP/AJP) Connector: /docs/apr.html Define a non-SSL HTTP/1.1 Connector on port 8080 -- Connector port=8080 protocol=HTTP/1.1 connectionTimeout=2 redirectPort=8443 / !-- A Connector using the shared thread pool-- !-- Connector executor=tomcatThreadPool port=8080 protocol=HTTP/1.1 connectionTimeout=2 redirectPort=8443 / -- !-- Define a SSL HTTP/1.1 Connector on port 8443 This connector uses the JSSE configuration, when using APR, the connector should be using the OpenSSL style configuration described in the APR documentation -- !-- Connector port=8443 protocol=HTTP/1.1 SSLEnabled=true maxThreads=150 scheme=https secure=true clientAuth=false sslProtocol=TLS / -- !-- Define an AJP 1.3 Connector on port 8009 -- Connector port=8009 protocol=AJP/1.3 redirectPort=8443 / !-- An Engine represents the
org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot create JDBC driver of class '' for connect URL 'null' AGAIN!
I have no choice left but to not let hibernate use my tomcat datasource. This is not good. I have even moved host provider in hope that it was previous fult tomcat install from dailyrazor (tomcat 6 does not hav common/lib) and is meant to have tomcat/lib I can say that my new container is correct and that I am 100% sure that all mus jdbc configuration is correct in zml after having gone though it at least 20 times and checked the wiki that was linked here earlier and still have issues. Yes mysql jdbc bin is in tomcat/lib so that is not cause of the error. /the error is very weird though as I have another point that uses hibernate without error on the same database. It is not possible for me to use hibernate to use tomcat datasource sadly. Many thanks for all the help though.
Re: org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot create JDBC driver of class '' for connect URL 'null'
my provider has asked me to use common/lib for connector or those wishing to argue that there is no common/lib. This is where I currently have it in production and am getting the runtime exception. as mentioned, in test server I am uaing tomcat/lib and all works, waiting to confirm that tomcat versions for test/production do not match but from what I am being told here, my production seems to be configured incorrectly as I have no tomcat/lib and DO have a tomcat/common/lib -- From: yucca...@live.co.za Sent: Wednesday, June 16, 2010 6:03 AM To: Tomcat Users List users@tomcat.apache.org Subject: Re: org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot create JDBC driver of class '' for connect URL 'null' Ok, no need to accuse me of lying, please see screenshot showing common/lib and other screenie showing there is no tomcat/lib :o -- From: Caldarale, Charles R chuck.caldar...@unisys.com Sent: Wednesday, June 16, 2010 4:03 AM To: Tomcat Users List users@tomcat.apache.org Subject: RE: org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot create JDBC driver of class '' for connect URL 'null' From: yucca...@live.co.za [mailto:yucca...@live.co.za] Subject: Re: org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot create JDBC driver of class '' for connect URL 'null' production is tomcat 6.0.20 Then there's no common/lib or shared/lib in production either. Get your story straight. I would strongly recommend that you do your development and testing on exactly the same Tomcat version that runs in production. Anything else puts you at risk for unexpected surprises. (I'd also upgrade production ASAP.) - 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 - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot create JDBC driver of class '' for connect URL 'null'
Ok I am getting to the bottom of this but my hosting provider wish to argue. They moved me over a month ago from tomcat 5 to 6 and I remember the installation was not clean because I had some stuff left over from the tomcat 5 in my new tomcat 6. I downloaded tomcat 5 and viewed the root directory layout which looks exactly like tomcat 5 and my current tomcat layout from provider. Clearly I am meant to have a lib dir in root if this is tomcat 6 and NOT a common/lib -- From: yucca...@live.co.za Sent: Wednesday, June 16, 2010 3:50 AM To: Tomcat Users List users@tomcat.apache.org Subject: Re: org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot create JDBC driver of class '' for connect URL 'null' production is tomcat 6.0.20 thanks for the reply. had to call it a night so sorry for delay in reply. -- From: Mark Eggers its_toas...@yahoo.com Sent: Wednesday, June 16, 2010 3:16 AM To: Tomcat Users List users@tomcat.apache.org Subject: Re: org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot create JDBC driver of class '' for connect URL 'null' Are you developing on 6.0.x but deploying on 5.?.x (5.0 or 5.5)? What version is running in production? --- On Tue, 6/15/10, yucca...@live.co.za yucca...@live.co.za wrote: From: yucca...@live.co.za yucca...@live.co.za Subject: org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot create JDBC driver of class '' for connect URL 'null' To: Tomcat Users List users@tomcat.apache.org Date: Tuesday, June 15, 2010, 1:11 PM I have tried to check why this exception is thrown in production but not development The difference between production snd development server is: development) put mysql jar into CATALINA/lib (tomcat 6.0.26) production) choice of common/lib or share/lib exception is thrown by hibernate which is wrapping the exception from realm - 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 - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot create JDBC driver of class '' for connect URL 'null'
I manually added the lib dir to root of production server and am still stuck with same exception I now have also remove mysql connector as provider instructed me t because there is already a connector on server-side... My last hope, it would appear is that I missed something in config files so I am posting all 3 here in hope of moving on. SERVER: ?xml version='1.0' encoding='utf-8'? !-- Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to You under the Apache License, Version 2.0 (the License); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an AS IS BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. -- !-- Note: A Server is not itself a Container, so you may not define subcomponents such as Valves at this level. Documentation at /docs/config/server.html -- Server port=8005 shutdown=SHUTDOWN !--APR library loader. Documentation at /docs/apr.html -- Listener className=org.apache.catalina.core.AprLifecycleListener SSLEngine=on / !--Initialize Jasper prior to webapps are loaded. Documentation at /docs/jasper-howto.html -- Listener className=org.apache.catalina.core.JasperListener / !-- Prevent memory leaks due to use of particular java/javax APIs-- Listener className=org.apache.catalina.core.JreMemoryLeakPreventionListener / !-- JMX Support for the Tomcat server. Documentation at /docs/non-existent.html -- Listener className=org.apache.catalina.mbeans.ServerLifecycleListener / Listener className=org.apache.catalina.mbeans.GlobalResourcesLifecycleListener / !-- Global JNDI resources Documentation at /docs/jndi-resources-howto.html -- GlobalNamingResources !-- Editable user database that can also be used by UserDatabaseRealm to authenticate users -- Resource name=jdbc/auth description=The Jar Bar user authentication type=javax.sql.DataSource auth=Container driverClassName=com.mysql.jdbc.Driver maxActive=30 maxIdle=10 maxWait=1 password=pookie123 url=jdbc:mysql://localhost:3306/yucca123_thejarbar validationQuery=/* ping */ SELECT 1 username=yucca123_tom/ /GlobalNamingResources !-- A Service is a collection of one or more Connectors that share a single Container Note: A Service is not itself a Container, so you may not define subcomponents such as Valves at this level. Documentation at /docs/config/service.html -- Service name=Catalina !--The connectors can use a shared executor, you can define one or more named thread pools-- !-- Executor name=tomcatThreadPool namePrefix=catalina-exec- maxThreads=150 minSpareThreads=4/ -- !-- A Connector represents an endpoint by which requests are received and responses are returned. Documentation at : Java HTTP Connector: /docs/config/http.html (blocking non-blocking) Java AJP Connector: /docs/config/ajp.html APR (HTTP/AJP) Connector: /docs/apr.html Define a non-SSL HTTP/1.1 Connector on port 8080 -- Connector port=8080 protocol=HTTP/1.1 connectionTimeout=2 redirectPort=8443 / !-- A Connector using the shared thread pool-- !-- Connector executor=tomcatThreadPool port=8080 protocol=HTTP/1.1 connectionTimeout=2 redirectPort=8443 / -- !-- Define a SSL HTTP/1.1 Connector on port 8443 This connector uses the JSSE configuration, when using APR, the connector should be using the OpenSSL style configuration described in the APR documentation -- !-- Connector port=8443 protocol=HTTP/1.1 SSLEnabled=true maxThreads=150 scheme=https secure=true clientAuth=false sslProtocol=TLS / -- !-- Define an AJP 1.3 Connector on port 8009 -- Connector port=8009 protocol=AJP/1.3 redirectPort=8443 / !-- An Engine represents the entry point (within Catalina) that processes every request. The Engine implementation for Tomcat stand alone analyzes the HTTP headers included with the request, and passes them on to the appropriate Host (virtual host). Documentation at /docs/config/engine.html -- !-- You should set jvmRoute to support load-balancing via AJP ie : Engine name=Catalina defaultHost=localhost jvmRoute=jvm1 -- Engine name=Catalina defaultHost=localhost !--For clustering, please take a look at
Re: org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot create JDBC driver of class '' for connect URL 'null'
The bottom line for me is that this exception from what I have read usually happens when container can not find the mysql connector. Gonna ask them to reinstall my tomcat instance and take it from there. -- From: Pid p...@pidster.com Sent: Wednesday, June 16, 2010 1:18 PM To: Tomcat Users List users@tomcat.apache.org Subject: Re: org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot create JDBC driver of class '' for connect URL 'null' - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
recommend a host please.
I would like some feedback on a hosting provider for me. I have had little choice but to cancel at dailyrazor as they failed to provide me with what I was paying for. To my horror, I asked for new tomcat and was given a tomcat 5 again as was evident again by the presence of no lib in root and presence of common/lib and shared/lib. They also have not provided shell access. New host should therefore have (in order of importance) out the box tomcat 6 with expected tomcat 6 layout, shell access and ok price.
Re: recommend a host please.
Please can someone also explain process of ensuring that my dns name comes with me to new host? -- From: Ken Bowen kbo...@als.com Sent: Wednesday, June 16, 2010 6:14 PM To: Tomcat Users List users@tomcat.apache.org Subject: Re: recommend a host please. Previously suggested eApps.com to you. On Jun 16, 2010, at 12:01 PM, yucca...@live.co.za wrote: I would like some feedback on a hosting provider for me. I have had little choice but to cancel at dailyrazor as they failed to provide me with what I was paying for. To my horror, I asked for new tomcat and was given a tomcat 5 again as was evident again by the presence of no lib in root and presence of common/lib and shared/lib. They also have not provided shell access. New host should therefore have (in order of importance) out the box tomcat 6 with expected tomcat 6 layout, shell access and ok price. - 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: hibernate not finding global resource datasource defined by tomcat
That is so fantastic! Well done. I was able to get it working. Perhaps someone can explain the reasons for runtime exception complaining that the jndi name was not bound in current context? The wiki is very good but I like to understand the work behind the ecene a little too. My guess is that like any resource we need to provide the jndi r tomcat resource in web.xml as done on that wiki but this is certainly not clear from tomcat documentation. Also, I am able to use that datasource in any webapp deployed with same server, provided that I provide ach deployed webapp with the metadata required? If so, there really is no point in tomcat documentation referring to us putting the realm and datasource in server.xml if i won't work gobally as the docs indicate it will. -- From: Mark Eggers its_toas...@yahoo.com Sent: Monday, June 14, 2010 11:45 PM To: Tomcat Users List users@tomcat.apache.org Subject: Re: hibernate not finding global resource datasource defined by tomcat Please read the following for a detailed description on how to configure Hibernate to use JNDI resources supplied by Tomcat. http://wiki.apache.org/tomcat/TomcatHibernate Then you will need a ResourceLink element in META-INF/context.xml to make the resource in GlobalNamingResources available to your application. The configuration for that information can be found here: http://tomcat.apache.org/tomcat-6.0-doc/config/context.html#Resource%20Links Finally, unless you place Tomcat's manager and admin application's authentication and authorization information in your database, removing the UserDatabaseRealm from GlobalNamingResources will prevent you from using the manager and admin application. You can place more than one Resource element in the GlobalNamingResources element of your server.xml. I'm trying to finish up a document on DataSourceRealms. Hopefully that will get posted on Tomcat's Wiki today or tomorrow, depending on other time constraints. just my two cents . . . . . /mde/ --- On Mon, 6/14/10, yucca...@live.co.za yucca...@live.co.za wrote: Hello tomcats!! Please advise as to why hibernate us unable to find jndi datasource configured in tomcat? Trying 2 different setups here: 1) server.xml resource as follows: GlobalNamingResources !-- Editable user database that can also be used by UserDatabaseRealm to authenticate users -- Resource name=jdbc/auth description=The Jar Bar user authentication type=javax.sql.DataSource auth=Container driverClassName=com.mysql.jdbc.Driver maxActive=30 maxIdle=10 maxWait=1 password=myPass url=jdbc:mysql://localhost:3306/yucca123_thejarbar validationQuery=/* ping */ SELECT 1 username=yucca123_tom/ /GlobalNamingResources with hibernate.cfg.xml: ?xml version='1.0' encoding='utf-8'? !DOCTYPE hibernate-configuration PUBLIC -//Hibernate/Hibernate Configuration DTD//EN http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd; hibernate-configuration session-factory property name=connection.urljdbc:mysql://localhost:3306/yucca123_thejarbar/property property name=hibernate.connection.datasourcejava:comp/env/jdbc/auth/property property name=connection.driver_classcom.mysql.jdbc.Driver/property property name=connection.usernameyucca123_tom/property property name=current_session_context_classthread/property property name=connection.passwordpookie123/property mapping resource=org/bar/jar/model/UserRolesEntity.hbm.xml/ mapping resource=org/bar/jar/model/UsercommentsEntity.hbm.xml/ mapping resource=org/bar/jar/model/UsersEntity.hbm.xml/ !-- DB schema will be updated if needed -- !-- property name=hbm2ddl.autoupdate/property -- /session-factory /hibernate-configuration so I try 2) moving resource and realm element to context.xml with adding localdatasource attribute to resource (true) and get same exception? What am I missing here? tomcat is latest 6.0.26 mysql 5 with global connector (inside common/lib) Ideally I want the global(server.xml) config for the resource as it WILL be shared among deployed applications, but because this is first application I am willing to use just contect configured resource. - 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
tomcat hibernate wiki
Please add to the wiki that hibernate dialect must still be set. Wiki says, must have NO database configuration properties but just got an exception complaining om missing dialect properties -- From: Mark Eggers its_toas...@yahoo.com Sent: Monday, June 14, 2010 11:45 PM To: Tomcat Users List users@tomcat.apache.org Subject: Re: hibernate not finding global resource datasource defined by tomcat Please read the following for a detailed description on how to configure Hibernate to use JNDI resources supplied by Tomcat. http://wiki.apache.org/tomcat/TomcatHibernate Then you will need a ResourceLink element in META-INF/context.xml to make the resource in GlobalNamingResources available to your application. The configuration for that information can be found here: http://tomcat.apache.org/tomcat-6.0-doc/config/context.html#Resource%20Links Finally, unless you place Tomcat's manager and admin application's authentication and authorization information in your database, removing the UserDatabaseRealm from GlobalNamingResources will prevent you from using the manager and admin application. You can place more than one Resource element in the GlobalNamingResources element of your server.xml. I'm trying to finish up a document on DataSourceRealms. Hopefully that will get posted on Tomcat's Wiki today or tomorrow, depending on other time constraints. just my two cents . . . . . /mde/ --- On Mon, 6/14/10, yucca...@live.co.za yucca...@live.co.za wrote: Hello tomcats!! Please advise as to why hibernate us unable to find jndi datasource configured in tomcat? Trying 2 different setups here: 1) server.xml resource as follows: GlobalNamingResources !-- Editable user database that can also be used by UserDatabaseRealm to authenticate users -- Resource name=jdbc/auth description=The Jar Bar user authentication type=javax.sql.DataSource auth=Container driverClassName=com.mysql.jdbc.Driver maxActive=30 maxIdle=10 maxWait=1 password=myPass url=jdbc:mysql://localhost:3306/yucca123_thejarbar validationQuery=/* ping */ SELECT 1 username=yucca123_tom/ /GlobalNamingResources with hibernate.cfg.xml: ?xml version='1.0' encoding='utf-8'? !DOCTYPE hibernate-configuration PUBLIC -//Hibernate/Hibernate Configuration DTD//EN http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd; hibernate-configuration session-factory property name=connection.urljdbc:mysql://localhost:3306/yucca123_thejarbar/property property name=hibernate.connection.datasourcejava:comp/env/jdbc/auth/property property name=connection.driver_classcom.mysql.jdbc.Driver/property property name=connection.usernameyucca123_tom/property property name=current_session_context_classthread/property property name=connection.passwordpookie123/property mapping resource=org/bar/jar/model/UserRolesEntity.hbm.xml/ mapping resource=org/bar/jar/model/UsercommentsEntity.hbm.xml/ mapping resource=org/bar/jar/model/UsersEntity.hbm.xml/ !-- DB schema will be updated if needed -- !-- property name=hbm2ddl.autoupdate/property -- /session-factory /hibernate-configuration so I try 2) moving resource and realm element to context.xml with adding localdatasource attribute to resource (true) and get same exception? What am I missing here? tomcat is latest 6.0.26 mysql 5 with global connector (inside common/lib) Ideally I want the global(server.xml) config for the resource as it WILL be shared among deployed applications, but because this is first application I am willing to use just contect configured resource. - 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: tomcat hibernate wiki
Much appreciated, Very nice wiki that got me up and running apart from some odd exception (does not happen in development only production) root cause org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot create JDBC driver of class '' for connect URL 'null' org.apache.tomcat.dbcp.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:1150) org.apache.tomcat.dbcp.dbcp.BasicDataSource.getConnection(BasicDataSource.java:880) org.hibernate.connection.DatasourceConnectionProvider.getConnection(DatasourceConnectionProvider.java:69) org.hibernate.jdbc.ConnectionManager.openConnection(ConnectionManager.java:423) org.hibernate.jdbc.ConnectionManager.getConnection(ConnectionManager.java:144) org.hibernate.jdbc.JDBCContext.connection(JDBCContext.java:119) org.hibernate.transaction.JDBCTransaction.begin(JDBCTransaction.java:57) org.hibernate.impl.SessionImpl.beginTransaction(SessionImpl.java:1326) sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) java.lang.reflect.Method.invoke(Method.java:597) org.hibernate.context.ThreadLocalSessionContext$TransactionProtectionWrapper.invoke(ThreadLocalSessionContext.java:301) $Proxy0.beginTransaction(Unknown Source) org.bar.jar.view.validators.EmailExistsValidator.validate(EmailExistsValidator.java:28) javax.faces.component.UIInput.validateValue(UIInput.java:1019) javax.faces.component.UIInput.validate(UIInput.java:875) javax.faces.component.UIInput.executeValidate(UIInput.java:1072) javax.faces.component.UIInput.processValidators(UIInput.java:672) javax.faces.component.UIComponentBase.processValidators(UIComponentBase.java:1058) javax.faces.component.UIForm.processValidators(UIForm.java:235) javax.faces.component.UIComponentBase.processValidators(UIComponentBase.java:1058) javax.faces.component.UIViewRoot.processValidators(UIViewRoot.java:700) com.sun.faces.lifecycle.ProcessValidationsPhase.execute(ProcessValidationsPhase.java:76) com.sun.faces.lifecycle.Phase.doPhase(Phase.java:100) com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:118) javax.faces.webapp.FacesServlet.service(FacesServlet.java:265) root cause java.lang.NullPointerException sun.jdbc.odbc.JdbcOdbcDriver.getProtocol(JdbcOdbcDriver.java:507) sun.jdbc.odbc.JdbcOdbcDriver.knownURL(JdbcOdbcDriver.java:476) sun.jdbc.odbc.JdbcOdbcDriver.acceptsURL(JdbcOdbcDriver.java:307) java.sql.DriverManager.getDriver(DriverManager.java:253) org.apache.tomcat.dbcp.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:1143) org.apache.tomcat.dbcp.dbcp.BasicDataSource.getConnection(BasicDataSource.java:880) org.hibernate.connection.DatasourceConnectionProvider.getConnection(DatasourceConnectionProvider.java:69) org.hibernate.jdbc.ConnectionManager.openConnection(ConnectionManager.java:423) org.hibernate.jdbc.ConnectionManager.getConnection(ConnectionManager.java:144) org.hibernate.jdbc.JDBCContext.connection(JDBCContext.java:119) org.hibernate.transaction.JDBCTransaction.begin(JDBCTransaction.java:57) org.hibernate.impl.SessionImpl.beginTransaction(SessionImpl.java:1326) sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) java.lang.reflect.Method.invoke(Method.java:597) org.hibernate.context.ThreadLocalSessionContext$TransactionProtectionWrapper.invoke(ThreadLocalSessionContext.java:301) $Proxy0.beginTransaction(Unknown Source) org.bar.jar.view.validators.EmailExistsValidator.validate(EmailExistsValidator.java:28) javax.faces.component.UIInput.validateValue(UIInput.java:1019) javax.faces.component.UIInput.validate(UIInput.java:875) javax.faces.component.UIInput.executeValidate(UIInput.java:1072) javax.faces.component.UIInput.processValidators(UIInput.java:672) javax.faces.component.UIComponentBase.processValidators(UIComponentBase.java:1058) javax.faces.component.UIForm.processValidators(UIForm.java:235) javax.faces.component.UIComponentBase.processValidators(UIComponentBase.java:1058) javax.faces.component.UIViewRoot.processValidators(UIViewRoot.java:700) com.sun.faces.lifecycle.ProcessValidationsPhase.execute(ProcessValidationsPhase.java:76) com.sun.faces.lifecycle.Phase.doPhase(Phase.java:100) com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:118)
org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot create JDBC driver of class '' for connect URL 'null'
I have tried to check why this exception is thrown in production but not development The difference between production snd development server is: development) put mysql jar into CATALINA/lib (tomcat 6.0.26) production) choice of common/lib or share/lib exception is thrown by hibernate which is wrapping the exception from realm
Re: org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot create JDBC driver of class '' for connect URL 'null'
production is tomcat 6.0.20 thanks for the reply. had to call it a night so sorry for delay in reply. -- From: Mark Eggers its_toas...@yahoo.com Sent: Wednesday, June 16, 2010 3:16 AM To: Tomcat Users List users@tomcat.apache.org Subject: Re: org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot create JDBC driver of class '' for connect URL 'null' Are you developing on 6.0.x but deploying on 5.?.x (5.0 or 5.5)? What version is running in production? --- On Tue, 6/15/10, yucca...@live.co.za yucca...@live.co.za wrote: From: yucca...@live.co.za yucca...@live.co.za Subject: org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot create JDBC driver of class '' for connect URL 'null' To: Tomcat Users List users@tomcat.apache.org Date: Tuesday, June 15, 2010, 1:11 PM I have tried to check why this exception is thrown in production but not development The difference between production snd development server is: development) put mysql jar into CATALINA/lib (tomcat 6.0.26) production) choice of common/lib or share/lib exception is thrown by hibernate which is wrapping the exception from realm - 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: org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot create JDBC driver of class '' for connect URL 'null'
Ok, no need to accuse me of lying, please see screenshot showing common/lib and other screenie showing there is no tomcat/lib :o -- From: Caldarale, Charles R chuck.caldar...@unisys.com Sent: Wednesday, June 16, 2010 4:03 AM To: Tomcat Users List users@tomcat.apache.org Subject: RE: org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot create JDBC driver of class '' for connect URL 'null' From: yucca...@live.co.za [mailto:yucca...@live.co.za] Subject: Re: org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot create JDBC driver of class '' for connect URL 'null' production is tomcat 6.0.20 Then there's no common/lib or shared/lib in production either. Get your story straight. I would strongly recommend that you do your development and testing on exactly the same Tomcat version that runs in production. Anything else puts you at risk for unexpected surprises. (I'd also upgrade production ASAP.) - 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
How to bind jndi realm datasource so that my hibernate can find it can find it
Hello tomcats !! I learnt a lot since last discussion(problems at thejarbar.org) and am moving on... I now wish to configure the datasource used by the realm to also be used by hibernate Currently my server.xml looks as follows: ?xml version='1.0' encoding='utf-8'? !-- Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to You under the Apache License, Version 2.0 (the License); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an AS IS BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. -- !-- Note: A Server is not itself a Container, so you may not define subcomponents such as Valves at this level. Documentation at /docs/config/server.html -- Server port=8005 shutdown=SHUTDOWN !--APR library loader. Documentation at /docs/apr.html -- Listener className=org.apache.catalina.core.AprLifecycleListener SSLEngine=on / !--Initialize Jasper prior to webapps are loaded. Documentation at /docs/jasper-howto.html -- Listener className=org.apache.catalina.core.JasperListener / !-- Prevent memory leaks due to use of particular java/javax APIs-- Listener className=org.apache.catalina.core.JreMemoryLeakPreventionListener / !-- JMX Support for the Tomcat server. Documentation at /docs/non-existent.html -- Listener className=org.apache.catalina.mbeans.ServerLifecycleListener / Listener className=org.apache.catalina.mbeans.GlobalResourcesLifecycleListener / !-- Global JNDI resources Documentation at /docs/jndi-resources-howto.html -- GlobalNamingResources !-- Editable user database that can also be used by UserDatabaseRealm to authenticate users -- Resource name=jdbc/auth description=The Jar Bar user authentication type=javax.sql.DataSource auth=Container driverClassName=com.mysql.jdbc.Driver maxActive=30 maxIdle=10 maxWait=1 password=myPass url=jdbc:mysql://localhost:3306/yucca123_thejarbar validationQuery=/* ping */ SELECT 1 username=yucca123_tom/ /GlobalNamingResources !-- A Service is a collection of one or more Connectors that share a single Container Note: A Service is not itself a Container, so you may not define subcomponents such as Valves at this level. Documentation at /docs/config/service.html -- Service name=Catalina !--The connectors can use a shared executor, you can define one or more named thread pools-- !-- Executor name=tomcatThreadPool namePrefix=catalina-exec- maxThreads=150 minSpareThreads=4/ -- !-- A Connector represents an endpoint by which requests are received and responses are returned. Documentation at : Java HTTP Connector: /docs/config/http.html (blocking non-blocking) Java AJP Connector: /docs/config/ajp.html APR (HTTP/AJP) Connector: /docs/apr.html Define a non-SSL HTTP/1.1 Connector on port 8080 -- Connector port=8080 protocol=HTTP/1.1 connectionTimeout=2 redirectPort=8443 / !-- A Connector using the shared thread pool-- !-- Connector executor=tomcatThreadPool port=8080 protocol=HTTP/1.1 connectionTimeout=2 redirectPort=8443 / -- !-- Define a SSL HTTP/1.1 Connector on port 8443 This connector uses the JSSE configuration, when using APR, the connector should be using the OpenSSL style configuration described in the APR documentation -- !-- Connector port=8443 protocol=HTTP/1.1 SSLEnabled=true maxThreads=150 scheme=https secure=true clientAuth=false sslProtocol=TLS / -- !-- Define an AJP 1.3 Connector on port 8009 -- Connector port=8009 protocol=AJP/1.3 redirectPort=8443 / !-- An Engine represents the entry point (within Catalina) that processes every request. The Engine implementation for Tomcat stand alone analyzes the HTTP headers included with the request, and passes them on to the appropriate Host (virtual host). Documentation at /docs/config/engine.html -- !-- You should set jvmRoute to support load-balancing via AJP ie : Engine name=Catalina defaultHost=localhost jvmRoute=jvm1 -- Engine name=Catalina defaultHost=localhost !--For clustering, please take a look at
hibernate not finding global resource datasource defined by tomcat
Hello tomcats!! Please advise as to why hibernate us unable to find jndi datasource configured in tomcat? Trying 2 different setups here: 1) server.xml resource as follows: GlobalNamingResources !-- Editable user database that can also be used by UserDatabaseRealm to authenticate users -- Resource name=jdbc/auth description=The Jar Bar user authentication type=javax.sql.DataSource auth=Container driverClassName=com.mysql.jdbc.Driver maxActive=30 maxIdle=10 maxWait=1 password=myPass url=jdbc:mysql://localhost:3306/yucca123_thejarbar validationQuery=/* ping */ SELECT 1 username=yucca123_tom/ /GlobalNamingResources throws: Jun 14, 2010 10:13:20 PM org.apache.catalina.core.ApplicationContext log Jun 14, 2010 10:13:20 PM org.apache.catalina.core.ApplicationContext log Jun 14, 2010 10:13:46 PM org.apache.catalina.core.StandardWrapperValve invoke SEVERE: Servlet.service() for servlet Faces Servlet threw exception javax.naming.NameNotFoundException: Name jdbc is not bound in this Context at org.apache.naming.NamingContext.lookup(NamingContext.java:770) at org.apache.naming.NamingContext.lookup(NamingContext.java:140) at org.apache.naming.NamingContext.lookup(NamingContext.java:781) at org.apache.naming.NamingContext.lookup(NamingContext.java:140) at org.apache.naming.NamingContext.lookup(NamingContext.java:781) at org.apache.naming.NamingContext.lookup(NamingContext.java:153) at org.apache.naming.SelectorContext.lookup(SelectorContext.java:152) at javax.naming.InitialContext.lookup(InitialContext.java:392) at org.hibernate.connection.DatasourceConnectionProvider.configure(DatasourceConnectionProvider.java:52) at org.hibernate.connection.ConnectionProviderFactory.newConnectionProvider(ConnectionProviderFactory.java:124) at org.hibernate.connection.ConnectionProviderFactory.newConnectionProvider(ConnectionProviderFactory.java:56) at org.hibernate.cfg.SettingsFactory.createConnectionProvider(SettingsFactory.java:414) at org.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:62) at org.hibernate.cfg.Configuration.buildSettings(Configuration.java:2009) at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1292) at org.hibernate.cfg.AnnotationConfiguration.buildSessionFactory(AnnotationConfiguration.java:859) at org.bar.jar.util.HibernateUtil.clinit(HibernateUtil.java:24) at org.bar.jar.backing.TutorialIndexBacking.getAllUnflaggedComments(TutorialIndexBacking.java:21) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at javax.el.BeanELResolver.getValue(BeanELResolver.java:62) at javax.el.CompositeELResolver.getValue(CompositeELResolver.java:54) at com.sun.faces.el.FacesCompositeELResolver.getValue(FacesCompositeELResolver.java:72) at org.apache.el.parser.AstValue.getValue(AstValue.java:123) at org.apache.el.ValueExpressionImpl.getValue(ValueExpressionImpl.java:186) at org.apache.jasper.el.JspValueExpression.getValue(JspValueExpression.java:101) at javax.faces.component.UIData.getValue(UIData.java:609) at javax.faces.component.UIData.getDataModel(UIData.java:1124) at javax.faces.component.UIData.setRowIndex(UIData.java:451) at com.sun.faces.renderkit.html_basic.TableRenderer.encodeBegin(TableRenderer.java:77) at javax.faces.component.UIComponentBase.encodeBegin(UIComponentBase.java:813) at javax.faces.component.UIData.encodeBegin(UIData.java:962) at javax.faces.component.UIComponent.encodeAll(UIComponent.java:928) at javax.faces.component.UIComponent.encodeAll(UIComponent.java:933) at com.sun.faces.application.ViewHandlerImpl.doRenderView(ViewHandlerImpl.java:266) at com.sun.faces.application.ViewHandlerImpl.renderView(ViewHandlerImpl.java:197) at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:110) at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:100) at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:139) at javax.faces.webapp.FacesServlet.service(FacesServlet.java:266) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191) at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:465) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) at
Re: hibernate not finding global resource datasource defined by tomcat
-- From: Christopher Schultz ch...@christopherschultz.net Sent: Tuesday, June 15, 2010 12:03 AM To: Tomcat Users List users@tomcat.apache.org Subject: Re: hibernate not finding global resource datasource defined by tomcat -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Yuccal Nel, On 6/14/2010 4:26 PM, yucca...@live.co.za wrote: Please advise as to why hibernate us unable to find jndi datasource configured in tomcat? I'm not sure why Hibernate can't find your JNDI resource, but... property name=connection.urljdbc:mysql://localhost:3306/yucca123_thejarbar/property property name=connection.driver_classcom.mysql.jdbc.Driver/property property name=connection.usernameyucca123_tom/property property name=current_session_context_classthread/property property name=connection.passwordpookie123/property Why do you need these properties in your hibernate configuration? The DataSource already knows all these things and you're just confusing Hibernate (and yourself) by having them in here. :) No I was just trying to hurry to get working copy up :) 2) moving resource and realm element to context.xml with adding localdatasource attribute to resource (true) and get same exception? IIRC, localDataSource is a Realm option, and has nothing to do with the Resource or any Hibernate configuration. What am I missing here? Maybe you need a resource-ref element in your web.xml? Can you explain? tomcat is latest 6.0.26 mysql 5 with global connector (inside common/lib) Tomcat 6 doesn't have a common/lib by default. Did you add that? No I was merely referring to the fact that I included driver in the lib directory of server - -chris -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.10 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAkwWpyYACgkQ9CaO5/Lv0PDoKwCgoVpt0TcF0EPX8yMhNH2JHivf ce8AoK6T283631l+J1hWmxUpFpIyMC8y =CZ3Y -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: [OT] Re: problems at thejarbar.org
Hello tomcats !! :) A quick question as I tackle configuring jndi resource for first time: I was referred to using jndi in production environmrnt snd hsve noted through documentation found in test server that there are 3 possible places to define jndi resources: 1)the server .xml(for every webapp in server if I am correct. 2)context.xml 3)web.xml As I am planning on only using this resource for multiple webapps in same domain, am I right in asuming server.xml is correct choice to define jndi resource? In addition I am to define jndi used in server.xml again in web.xml? I now need to know how / where to configure parameters for mysql connections or are the defaults acceptable for production? -- From: yucca...@live.co.za Sent: Thursday, June 03, 2010 12:41 AM To: Tomcat Users List users@tomcat.apache.org Subject: Re: [OT] Re: problems at thejarbar.org Ok I appreciatethis big help. I am expecting a small amount of users though so does that mean that a datasource realm may be overkill? I am not implying that this is what was being said earlier, just trying to learn more. I have noticed though that forum posters seem to assume a lot at times, an example was that I need to learn maven which itself was a good headsup although I am familiar with it already. The sad thing is that with sun/oracle transition maven documentation is rotten and many of the plugins need a revamp, especially ones for full stack jee severs I learnt a little start of this year and everything was too fresh (jboss 6 not even released yet or is it?) or was very outdated for me as I started Java when JSE 6 was released so have little interest in knowing how to use maven in legacy systems unless I get employment in enterprise(hopefuly soon), Java is in a mess st the moment with no news on JSE7 and very little info from Oracle. I took it as a blessing in disguise an started getting to know JSF and hibernate and other stuff. PS can anyone confirm that there is firefox bug when selecting a different locale for i8n testing? I am able only to change locale few times. -- From: Christopher Schultz ch...@christopherschultz.net Sent: Wednesday, June 02, 2010 6:25 AM To: Tomcat Users List users@tomcat.apache.org Subject: Re: [OT] Re: problems at thejarbar.org -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Yucca Nel, On 6/2/2010 8:27 PM, yucca...@live.co.za wrote: There was a question as to why I am using a realm and application based realm and I have no idea howcome people think I am not using only tomcat realm? It's not that we think you're using a non-Tomcat Realm: it's that we think you're using the /wrong/ Tomcat Realm. See... JDBCRealm uses its own set of credentials to connect to the database and uses a single Connection object, requiring lots of synchronization to protect that shared resource. Basically, it's not appropriate for production because of those two facts. Instead, we're suggesting that you set up a DataSource and then use a DataSourceRealm which will use a connection-per-authentication-attempt and is much more high-performance. hibernate is not doing any security related stuff other than persisiting new users and thier credentials to mysql. Tomcat is only managing security and hibernate everything else... Hope this clears up discussion. :) Is hibernate using a Tomcat-created DataSource? If not, you're making your life harder by placing database connection configuration in several places instead of just one. - -chris -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.10 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAkwGW8IACgkQ9CaO5/Lv0PALlwCgwejhODA7bB92UMEbgpIPGb8R 3RoAn3BXDzQWZ5497EKzaSP1W84Mtqu2 =zCtF -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 - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: What is the difference between ${param.P} and %= request.getParameter(P) %?
-- From: Pid p...@pidster.com Sent: Wednesday, June 09, 2010 1:09 AM To: Tomcat Users List users@tomcat.apache.org Subject: Re: What is the difference between ${param.P} and %= request.getParameter(P) %? other than the one being EL and easier/quicker to code, not much I think. you are better off using${param.[P] though as the [] allows you to break away from identifer naming conventions so the identifier can be a numeric as an example. the expression becomes the argument to the printnl in the converted servlet for the JSP. IOW %= request.getParameter(P) % will become out.println ( request.getParameter(P) in translated servlet. just had a look in HF servlets and JSP and the only thing could find was what happens behind the scenes HF lists the use of EL as being there because the guys over using Adobe are more familiar with EL than code. - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: [OT] Re: problems at thejarbar.org
Hello, with all this confusion (and I am loving it) I will reveal what I am doing :p My website and webapp is to showcase my skills to get work and with a very long term goal of blogging about Java development and having a site to distribute stuff from. There was a question as to why I am using a realm and application based realm and I have no idea howcome people think I am not using only tomcat realm? I do access security stuff in application but only to determine if user is logged in to display in jsp as user is logged in as guest or not. I appreciate this forum and thank you all for replies. hibernate is not doing any security related stuff other than persisiting new users and thier credentials to mysql.Tomcat is only managing security and hibernate everything else... Hope this clears up discussion. :) -- From: Mark Eggers its_toas...@yahoo.com Sent: Tuesday, June 01, 2010 4:27 PM To: Tomcat Users List users@tomcat.apache.org Subject: [OT] Re: problems at thejarbar.org Chris, I think it all depends what you need your Realm to manage. In this instance (single application on Tomcat), then it probably doesn't matter if the Realm sits at the application, Host, or Engine level. Like you've pointed out before it's nice to have a self-contained application with all of the database configurations in one spot. Having some database configurations in META-INF/context.xml, and others in Tomcat's server.xml seems to be a maintenance / migration challenge waiting to happen. If you have multiple applications using the same Realm information, then it might make sense to move the Realm to a Host or Engine level. However I cannot think of a good use case off the top of my head to potentially run multiple hosts under one Engine with the same authentication Realm . . . . Maybe a better place to document all of this and some use case scenarios would be the Wiki. Since I'm thinking about this, I'll see what I can cobble up in the next few days. Thanks for the comments . . . . /mde/ --- On Tue, 6/1/10, Christopher Schultz ch...@christopherschultz.net wrote: From: Christopher Schultz ch...@christopherschultz.net Subject: Re: problems at thejarbar.org To: Tomcat Users List users@tomcat.apache.org Date: Tuesday, June 1, 2010, 3:03 PM -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Mark, Yes, but honestly, I'd put the Resource and Realm. configuration into my webapp's META-INF/context.xml file (which requires that localDataSource=true be set on the Realm, btw). - 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: [OT] Re: problems at thejarbar.org
Ok I appreciatethis big help. I am expecting a small amount of users though so does that mean that a datasource realm may be overkill? I am not implying that this is what was being said earlier, just trying to learn more. I have noticed though that forum posters seem to assume a lot at times, an example was that I need to learn maven which itself was a good headsup although I am familiar with it already. The sad thing is that with sun/oracle transition maven documentation is rotten and many of the plugins need a revamp, especially ones for full stack jee severs I learnt a little start of this year and everything was too fresh (jboss 6 not even released yet or is it?) or was very outdated for me as I started Java when JSE 6 was released so have little interest in knowing how to use maven in legacy systems unless I get employment in enterprise(hopefuly soon), Java is in a mess st the moment with no news on JSE7 and very little info from Oracle. I took it as a blessing in disguise an started getting to know JSF and hibernate and other stuff. PS can anyone confirm that there is firefox bug when selecting a different locale for i8n testing? I am able only to change locale few times. -- From: Christopher Schultz ch...@christopherschultz.net Sent: Wednesday, June 02, 2010 6:25 AM To: Tomcat Users List users@tomcat.apache.org Subject: Re: [OT] Re: problems at thejarbar.org -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Yucca Nel, On 6/2/2010 8:27 PM, yucca...@live.co.za wrote: There was a question as to why I am using a realm and application based realm and I have no idea howcome people think I am not using only tomcat realm? It's not that we think you're using a non-Tomcat Realm: it's that we think you're using the /wrong/ Tomcat Realm. See... JDBCRealm uses its own set of credentials to connect to the database and uses a single Connection object, requiring lots of synchronization to protect that shared resource. Basically, it's not appropriate for production because of those two facts. Instead, we're suggesting that you set up a DataSource and then use a DataSourceRealm which will use a connection-per-authentication-attempt and is much more high-performance. hibernate is not doing any security related stuff other than persisiting new users and thier credentials to mysql. Tomcat is only managing security and hibernate everything else... Hope this clears up discussion. :) Is hibernate using a Tomcat-created DataSource? If not, you're making your life harder by placing database connection configuration in several places instead of just one. - -chris -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.10 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAkwGW8IACgkQ9CaO5/Lv0PALlwCgwejhODA7bB92UMEbgpIPGb8R 3RoAn3BXDzQWZ5497EKzaSP1W84Mtqu2 =zCtF -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: problems at thejarbar.org
According to the stack trace I posted, is it possible that hibernate could also be a seperate casue of transient mysql exception or does this only need to be fixed in tomcat? -- From: Mark Eggers its_toas...@yahoo.com Sent: Monday, May 31, 2010 11:57 AM To: Tomcat Users List users@tomcat.apache.org Subject: Re: problems at thejarbar.org I think you are running into a MySQL database connection timeout. You can use a MySQL admin interface (command line, PHPAdmin, MySQL Workbench, etc.) to verify the idle connection timeout limit. There have been comments on the web concerning this. One such discussion and a solution are here: http://lists.mysql.com/java/6578 The explanation of the parameters given in the above link can be found here: http://dev.mysql.com/doc/refman/5.0/en/connector-j-reference-configuration-properties.html Based on those two references, you'll need to modify your Realm database URL: connectionURL=jdbc:mysql://localhost:3306/yucca123_thejarbarautoReconnect=truereconnectAtTxEnd=true Note, I have not tried this, so test before production. The other solution mentioned is to use a DataSource Realm. This requires you to configure a JNDI datasource describing your database connection as well as the DataSource Realm. You can add all of this information in your web application's META-INF/context.xml file if it's application-specific. If this is a host or service-based definition, then you'll have to define the JNDI resources in a GlobalNamingResources element. See the following: http://tomcat.apache.org/tomcat-6.0-doc/config/globalresources.html Note the warning that this resource will not be available to an individual web application unless you use a ResourceLink in your META-INF/context.xml file. See the globalresources link above for an example. Since you're using this connection for container managed authentication and authorization, I'm not sure why your web application would need access to this resource. However, it's 3 am, so I may have missed a few points that Chuck, Charles, or Pid will be happy to correct. To summarize - it seems the easiest fix is to add the following properties to your JDBC url: autoReconnect=true reconnectAtTxEnd=true Add them to the end of the URL, connected with ampersands. I hope this gets you up and running. . . . . . just my two cents /mde/ --- On Sun, 5/30/10, Yucca Nel yucca...@live.co.za wrote: From: Yucca Nel yucca...@live.co.za Subject: Re: problems at thejarbar.org To: Tomcat Users List users@tomcat.apache.org Date: Sunday, May 30, 2010, 9:34 AM Yes, but I am using JDBC and followed the setup step by step from tomcat docs ?xml version=1.0 encoding=UTF-8? Server port=9170 Listener className=org.apache.catalina.mbeans.GlobalResourcesLifecycleListener/ Listener className=org.apache.catalina.core.JasperListener / Listener className=org.apache.catalina.mbeans.ServerLifecycleListener/ GlobalNamingResources Resource auth=Container description=User database name=UserDatabase type=org.apache.catalina.UserDatabase pathname=conf/tomcat-users.xml factory=org.apache.catalina.users.MemoryUserDatabaseFactory/ /GlobalNamingResources Service name=Catalina Connector port=9670 minSpareThreads=1 address=127.0.0.1 maxThreads=50 maxSpareThreads=3 connectionTimeout=3 protocol=AJP/1.3 /Connector Engine defaultHost=thejarbar.org name=Catalina Realm className=org.apache.catalina.realm.UserDatabaseRealm/Realm className=org.apache.catalina.realm.JDBCRealm driverName=com.mysql.jdbc.Driver connectionURL=jdbc:mysql://localhost:3306/yucca123_thejarbar connectionName=yucca123_tom connectionPassword=myPass userTable=users userNameCol=user_name userCredCol=user_pass userRoleTable=user_roles roleNameCol=role_name/Host appBase=/home/yucca123/public_html name=thejarbar.org Aliaswww.thejarbar.org/Alias Context path=/the_jar_bar Listener className=org.apache.catalina.startup.TldConfig/ /Context Context docBase=/usr/local/tomcat/users/yucca123/tomcat/webapps/manager path=/manager privileged=true reloadable=true Listener className=org.apache.catalina.startup.TldConfig/ ResourceEnvRef name=users type=org.apache.catalina.UserDatabase/ /Context Context docBase=the_jar_bar path= reloadable=true Listener className=org.apache.catalina.startup.TldConfig/ /Context /Host /Engine /Service /Server May be missing something... http://tomcat.apache.org/tomcat-6.0-doc/jndi-resources-howto.html#JDBC%20Data%20Sources This error does not occur every time -- From: Jeff jwi...@cox.net Sent: Sunday, May 30, 2010 5:54 PM To: Tomcat Users List users@tomcat.apache.org Subject: Re: