RE: Same data source config on two contexts, different result
The differences I can see are in the Context element and the url param value. The question is what difference is significant. I would try making the second config more similar to the first, and see when it starts working. Eg. Is it because the url lookup is failing? Is it because it is no allowed to load the class from that url. Assuming the error message is misleading. Do you have a security policy file? Just a thought Martin -Original Message- From: Stig Stavik [mailto:[EMAIL PROTECTED] Sent: 27 March 2004 09:55 To: [EMAIL PROTECTED] Subject: Same data source config on two contexts, different result Hi! I'm having difficulties setting up datasources! At the moment I have two contexts that I'm testing this on. The first is this one. It works fine. Context docBase=/home/stig/public_jsp path=/stig Resource name=nutshellTestSource type=javax.sql.DataSource/ ResourceParams name=nutshellTestSource parameter namemaxWait/name value5000/value /parameter parameter namemaxActive/name value4/value /parameter parameter namepassword/name valuea/value /parameter parameter nameurl/name valuejdbc:mysql://localhost:3306/dev/value /parameter parameter namedriverClassName/name valuecom.mysql.jdbc.Driver/value /parameter parameter namemaxIdle/name value2/value /parameter parameter nameusername/name valuestig/value /parameter /ResourceParams /Context The other one is on another v-host on the same server. However this one doesen't work at all. In the admin-webapp I get an exception when I try to view the datasource saying: javax.servlet.ServletException: Exception retrieving attribute 'driverClassName' Context docBase=ROOT path=/ reloadable=true Resource name=nutshellTestSource type=javax.sql.DataSource/ ResourceParams name=nutshellTestSource parameter namemaxWait/name value5000/value /parameter parameter namemaxActive/name value4/value /parameter parameter namepassword/name valuehest/value /parameter parameter nameurl/name valuejdbc:mysql://nutshell.vestkant.no:3306/dev/value /parameter parameter namedriverClassName/name valuecom.mysql.jdbc.Driver/value /parameter parameter namemaxIdle/name value2/value /parameter parameter nameusername/name valueflux/value /parameter /ResourceParams /Context This has really been bugging me over the past weeks! -- StSt - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Same data source config on two contexts, different result
Martin Alley wrote: The differences I can see are in the Context element and the url param value. The question is what difference is significant. The URL have been switched back and forth, but with the same result. This goes for all the other parameters also - but in the end it's always the javax.servlet.ServletException: Exception retrieving attribute 'driverClassName' which is thrown in the admin-webapp. Do you have a security policy file? Nope. -- StSt - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Same data source config on two contexts, different result
So you can change any parameter and it still fails? Have you tried playing with the attributes in the context element? -Original Message- From: Stig Stavik [mailto:[EMAIL PROTECTED] Sent: 27 March 2004 10:15 To: Tomcat Users List Subject: Re: Same data source config on two contexts, different result Martin Alley wrote: The differences I can see are in the Context element and the url param value. The question is what difference is significant. The URL have been switched back and forth, but with the same result. This goes for all the other parameters also - but in the end it's always the javax.servlet.ServletException: Exception retrieving attribute 'driverClassName' which is thrown in the admin-webapp. Do you have a security policy file? Nope. -- StSt - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Same data source config on two contexts, different result
Martin Alley wrote: So you can change any parameter and it still fails? Have you tried playing with the attributes in the context element? No, I haven't. What sort of playful attributes do you recomend? :) -- StSt - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Same data source config on two contexts, different result
Reloadable Docbase Path In that order. Martin -Original Message- From: Stig Stavik [mailto:[EMAIL PROTECTED] Sent: 27 March 2004 10:32 To: Tomcat Users List Subject: Re: Same data source config on two contexts, different result Martin Alley wrote: So you can change any parameter and it still fails? Have you tried playing with the attributes in the context element? No, I haven't. What sort of playful attributes do you recomend? :) -- StSt - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Same data source config on two contexts, different result
Furthermore, I'm thinking about the semantics of the driver class and doc base. Do you have the driver class in the right place so it can be found when docroot is ROOT? -Original Message- From: Martin Alley [mailto:[EMAIL PROTECTED] Sent: 27 March 2004 10:37 To: 'Tomcat Users List' Subject: RE: Same data source config on two contexts, different result Reloadable Docbase Path In that order. Martin -Original Message- From: Stig Stavik [mailto:[EMAIL PROTECTED] Sent: 27 March 2004 10:32 To: Tomcat Users List Subject: Re: Same data source config on two contexts, different result Martin Alley wrote: So you can change any parameter and it still fails? Have you tried playing with the attributes in the context element? No, I haven't. What sort of playful attributes do you recomend? :) -- StSt - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Same data source config on two contexts, different result
Martin Alley wrote: Do you have the driver class in the right place so it can be found when docroot is ROOT? As long as the connector is to be found in tomcats classpath, it should be ok, shouldn't it? Ok. New approach - total chaos. I removed the v-host and created a new one using the admin-tool. No datasource added this time. When I now press the datasource, I get the same error regarding the driverClassName. However, the logging for the new host works, and here the following is stated: java.lang.IllegalStateException: Context path / is already in use 2004-03-27 11:50:19 StandardHost[www.mydomain.com]: Error deploying application at context path null java.lang.IllegalStateException: Context path / is already in use at org.apache.commons.digester.Digester.createSAXException(Digester.java:2540) . . . In spite of this, the v-host is working, and so does the other default-/ on the server. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Same data source config on two contexts, different result
What version of tomcat are you using? -Original Message- From: Stig Stavik [mailto:[EMAIL PROTECTED] Sent: 27 March 2004 11:23 To: Tomcat Users List Subject: Re: Same data source config on two contexts, different result Martin Alley wrote: Do you have the driver class in the right place so it can be found when docroot is ROOT? As long as the connector is to be found in tomcats classpath, it should be ok, shouldn't it? Ok. New approach - total chaos. I removed the v-host and created a new one using the admin-tool. No datasource added this time. When I now press the datasource, I get the same error regarding the driverClassName. However, the logging for the new host works, and here the following is stated: java.lang.IllegalStateException: Context path / is already in use 2004-03-27 11:50:19 StandardHost[www.mydomain.com]: Error deploying application at context path null java.lang.IllegalStateException: Context path / is already in use at org.apache.commons.digester.Digester.createSAXException(Digester.java:25 40) . . . In spite of this, the v-host is working, and so does the other default-/ on the server. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Same data source config on two contexts, different result
Martin Alley wrote: What version of tomcat are you using? 5.0.16 -- StSt - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Same data source config on two contexts, different result
Stig Stavik wrote: Context docBase=ROOT path=/ reloadable=true The path should be an empty String. That's the likely cause of the problems. -- x Rémy Maucherat Developer Consultant JBoss Group (Europe) SàRL x - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Same data source config on two contexts, different result
I believe the driver either needs to be in WEB-INF/lib or $CATALINA_HOME/common/lib Martin -Original Message- From: Stig Stavik [mailto:[EMAIL PROTECTED] Sent: 27 March 2004 11:23 To: Tomcat Users List Subject: Re: Same data source config on two contexts, different result Martin Alley wrote: Do you have the driver class in the right place so it can be found when docroot is ROOT? As long as the connector is to be found in tomcats classpath, it should be ok, shouldn't it? Ok. New approach - total chaos. I removed the v-host and created a new one using the admin-tool. No datasource added this time. When I now press the datasource, I get the same error regarding the driverClassName. However, the logging for the new host works, and here the following is stated: java.lang.IllegalStateException: Context path / is already in use 2004-03-27 11:50:19 StandardHost[www.mydomain.com]: Error deploying application at context path null java.lang.IllegalStateException: Context path / is already in use at org.apache.commons.digester.Digester.createSAXException(Digester.java:25 40) . . . In spite of this, the v-host is working, and so does the other default-/ on the server. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Same data source config on two contexts, different result
Remy Maucherat wrote: Context docBase=ROOT path=/ reloadable=true The path should be an empty String. That's the likely cause of the problems. Thanks. That cleaned up the errorlog, though it made no other difference ... -- StSt - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Same data source config on two contexts, different result
Martin Alley wrote: I believe the driver either needs to be in WEB-INF/lib or $CATALINA_HOME/common/lib The driver is in $CATALINA_HOME/common/lib -- StSt - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Same data source config on two contexts, different result
Is that where your other context is finding it also? Where else is the driver? If you remove it from $CATALINA_HOME/common/lib does the other context fail in the same way as the /stig context? -Original Message- From: Stig Stavik [mailto:[EMAIL PROTECTED] Sent: 27 March 2004 11:45 To: Tomcat Users List Subject: Re: Same data source config on two contexts, different result Martin Alley wrote: I believe the driver either needs to be in WEB-INF/lib or $CATALINA_HOME/common/lib The driver is in $CATALINA_HOME/common/lib -- StSt - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Same data source config on two contexts, different result
Can you validate your config against a DTD? I find the wording of the error message suspicious - it sounds like it can't read the config file properly, rather than it can't find the driver file that is configured. Martin -Original Message- From: Martin Alley [mailto:[EMAIL PROTECTED] Sent: 27 March 2004 11:49 To: 'Tomcat Users List' Subject: RE: Same data source config on two contexts, different result Is that where your other context is finding it also? Where else is the driver? If you remove it from $CATALINA_HOME/common/lib does the other context fail in the same way as the /stig context? -Original Message- From: Stig Stavik [mailto:[EMAIL PROTECTED] Sent: 27 March 2004 11:45 To: Tomcat Users List Subject: Re: Same data source config on two contexts, different result Martin Alley wrote: I believe the driver either needs to be in WEB-INF/lib or $CATALINA_HOME/common/lib The driver is in $CATALINA_HOME/common/lib -- StSt - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Same data source config on two contexts, different result
Stig, There only needs to be one copy of the driver in the common/lib directory. Change the name on your resource that is not working. You should not use the same name on both. If that doesn't fix it (remember to change the name in your web.xml and application) then repost your current context from both apps along with your web.xml and code section that you are using to call the resource. Doug www.parsonstechnical.com - Original Message - From: Stig Stavik [EMAIL PROTECTED] To: Tomcat Users List [EMAIL PROTECTED] Sent: Saturday, March 27, 2004 6:45 AM Subject: Re: Same data source config on two contexts, different result Martin Alley wrote: I believe the driver either needs to be in WEB-INF/lib or $CATALINA_HOME/common/lib The driver is in $CATALINA_HOME/common/lib -- StSt - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Same data source config on two contexts, different result
Martin Alley wrote: Can you validate your config against a DTD? Well, when I made a new context on the v-host, tomcat makes a config for me. Context docBase=/home/stig/blablabla/ path= useNaming=false /Context I haven't touched it - and I recon tomcat should be able to read its own config files! It's also a bit strange that it complains about a attribute which never should have been there in the first place since there is no datasource configured for that context. -- StSt - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Same data source config on two contexts, different result
I'm confused! An attribute that never should have been there??? I agree with Doug, please post full configs and the relevant code. -Original Message- From: Stig Stavik [mailto:[EMAIL PROTECTED] Sent: 27 March 2004 12:03 To: Tomcat Users List Subject: Re: Same data source config on two contexts, different result Martin Alley wrote: Can you validate your config against a DTD? Well, when I made a new context on the v-host, tomcat makes a config for me. Context docBase=/home/stig/blablabla/ path= useNaming=false /Context I haven't touched it - and I recon tomcat should be able to read its own config files! It's also a bit strange that it complains about a attribute which never should have been there in the first place since there is no datasource configured for that context. -- StSt - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Same data source config on two contexts, different result
I agree with Doug, please post full configs and the relevant code. Ok, here goes: /usr/tomcat/conf/server.xml: ?xml version='1.0' encoding='utf-8'? Server Listener className=org.apache.catalina.mbeans.ServerLifecycleListener/ Listener className=org.apache.catalina.mbeans.GlobalResourcesLifecycleListener/ GlobalNamingResources Environment name=simpleValue type=java.lang.Integer value=30/ Resource auth=Container description=User database that can be updated and saved name=UserDatabase type=org.apache.catalina.UserDatabase/ ResourceParams name=UserDatabase parameter namefactory/name valueorg.apache.catalina.users.MemoryUserDatabaseFactory/value /parameter parameter namepathname/name valueconf/tomcat-users.xml/value /parameter /ResourceParams /GlobalNamingResources Service name=Catalina Connector acceptCount=100 address=82.96.66.210 connectionTimeout=2 disableUploadTimeout=true port=80 redirectPort=8443 /Connector Connector port=8009 protocol=AJP/1.3 protocolHandlerClassName=org.apache.jk.server.JkCoyoteHandler redirectPort=8443 /Connector Engine defaultHost=localhost name=Catalina Host appBase=webapps name=localhost Logger className=org.apache.catalina.logger.FileLogger prefix=localhost_log. suffix=.txt timestamp=true/ /Host Host appBase=/home/stig/pilsen.no/www.pilsen.no/ name=www.pilsen.no Logger className=org.apache.catalina.logger.SystemErrLogger verbosity=0/ /Host Logger className=org.apache.catalina.logger.FileLogger prefix=catalina_log. suffix=.txt timestamp=true/ Realm className=org.apache.catalina.realm.UserDatabaseRealm/ /Engine /Service /Server /usr/tomcat/conf/Catalina/localhost/stig.xml --- Context docBase=/home/stig/public_jsp path=/stig Resource name=nutshellTestSource type=javax.sql.DataSource/ ResourceParams name=nutshellTestSource parameter nameurl/name valuejdbc:mysql://localhost:3306/dev/value /parameter parameter namepassword/name valuea/value /parameter parameter namemaxActive/name value4/value /parameter parameter namemaxWait/name value5000/value /parameter parameter namedriverClassName/name valuecom.mysql.jdbc.Driver/value /parameter parameter nameusername/name valuestig/value /parameter parameter namemaxIdle/name value2/value /parameter /ResourceParams /Context /usr/tomcat/conf/Catalina/www.pilsen.no/ROOT.xml Context docBase=/home/stig/pilsen.no/www.pilsen.no/ path= useNaming=false /Context -- StSt - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]