RE: Tomcat 5.5.16 configuration problem--THIRD RESEND
OK. Everything is now working. Things I learned: 1. The Info message concerning servlet.jar is really an error message. Things simply don't work if you have a servlet.jar, servlet-api.jar or jsp-api.jar file in your WEB-INF/lib directory. This was most of my problem. 2. The docBase is not required in a Context (despite what the documentation says). If you think about a context.xml file in a META-INF directory, it makes sense that would be the case. You don't need a path either. 3. There was a minor problem in the Realm I presented. If the Realm and the Resource it refers to are together in a Context, then you need a localDataSource=true in the Realm to make it work. Thanks to everyone who offered suggestions. It got me going down the right path. Scott -Original Message- From: Filip Hanik - Dev Lists [mailto:[EMAIL PROTECTED] Sent: Monday, April 17, 2006 7:29 AM To: Tomcat Users List Subject: Re: Tomcat 5.5.16 configuration problem--THIRD RESEND do you have more than one docBase specified? also, servlet.jar etc should not be in your WEB-INF/lib Scott Smith wrote: OK, I removed the unnecessary Contexts (at least they are unnecessary for the time being) and did notice the following messages. WARNING: A docBase c:\webapps\myapp inside the host appBase has been specified, and will be ignored Apr 15, 2006 2:09:41 AM org.apache.catalina.loader.WebappClassLoader validateJarFile INFO: validateJarFile(D:\MSD\Prog0\NewsBrowser\webapps\medias\WEB-INF\lib\serv let-api.jar) - jar not loaded. See Servlet Spec 2.3, section 9.7.2. Offending class: javax/servlet/Servlet.class Apr 15, 2006 2:09:41 AM org.apache.catalina.loader.WebappClassLoader validateJarFile INFO: validateJarFile(D:\MSD\Prog0\NewsBrowser\webapps\medias\WEB-INF\lib\serv let.jar) - jar not loaded. See Servlet Spec 2.3, section 9.7.2. Offending class: javax/servlet/Servlet.class The first Warning certainly sounds ominous--but, I don't know what it means. I did some googling which seemed to imply that it's probably caused by the Context error in the webapp itself. I don't know what the others mean. So, I'm still at square one. -Original Message- From: Filip Hanik - Dev Lists [mailto:[EMAIL PROTECTED] Sent: Friday, April 14, 2006 6:58 PM To: Tomcat Users List Subject: Re: Tomcat 5.5.16 configuration problem--THIRD RESEND maybe I should read the docs ;) yes, any container can have it, Filip Hanik - Dev Lists wrote: exactly, the realm element doesn't belong there, read up on the docs Scott Smith wrote: I am also doing Forms authentication...but I haven't got that far since the webapp doesn't initialize yet. This app used to use the struts data-sources tag, but I'm trying to move it to jndi. -Original Message- From: Marc Farrow [mailto:[EMAIL PROTECTED] Sent: Friday, April 14, 2006 5:05 PM To: Tomcat Users List Subject: Re: Tomcat 5.5.16 configuration problem--THIRD RESEND What are you trying to accomplish with the realm tag? On 4/14/06, Filip Hanik - Dev Lists [EMAIL PROTECTED] wrote: check your log files upon startup, your myapp.xml doesn't have a docBase attribute to associate it with the app itself. Context docBase=${catalina.home}/server/webapps/myapp path=/myapp. Scott Smith wrote: Sorry, I sent this so many times. Hopefully, I have all of the typos out of it this time... I have specified the following as myapp.xml in the conf\Catalina\locahost directory: Context path=/myapp Resource name=jdbc/MyDB auth=Container type=javax.sql.DataSource username=user password=pswd driverClassName=net.sourceforge.jtds.jdbc.Driver url=jdbc:jtds:sqlserver://127.0.0.1:1433;DatabaseName=MyDB;SelectMethod =cursor maxActive=30 maxIdle=20 minIdle=10 maxWait=2 / Realm className=org.apache.catalina.realm.DataSourceRealm debug=99 dataSourceName=jdbc/MyDB userTable=zUsers userNameCol=zUserName userCredCol=zPassword userRoleTable=wsViewRoles roleNameCol=zRole / /Context In my web.xml file I have: resource-ref res-ref-namejdbc/MyDB/res-ref-name res-typejavax.sql.DataSource/res-type res-authContainer/res-auth /resource-ref But, when I execute the code DataSource ds = null; try { Context initCtx = new InitialContext(); Context envCtx = (Context) initCtx.lookup(java:comp/env); ds = (DataSource) envCtx.lookup(jdbc/MyDB); } catch
Re: Tomcat 5.5.16 configuration problem--THIRD RESEND
thanks for the recap. On 4/18/06, Scott Smith [EMAIL PROTECTED] wrote: OK. Everything is now working. Things I learned: 1. The Info message concerning servlet.jar is really an error message. Things simply don't work if you have a servlet.jar, servlet-api.jar or jsp-api.jar file in your WEB-INF/lib directory. This was most of my problem. 2. The docBase is not required in a Context (despite what the documentation says). If you think about a context.xml file in a META-INF directory, it makes sense that would be the case. You don't need a path either. 3. There was a minor problem in the Realm I presented. If the Realm and the Resource it refers to are together in a Context, then you need a localDataSource=true in the Realm to make it work. Thanks to everyone who offered suggestions. It got me going down the right path. Scott -Original Message- From: Filip Hanik - Dev Lists [mailto:[EMAIL PROTECTED] Sent: Monday, April 17, 2006 7:29 AM To: Tomcat Users List Subject: Re: Tomcat 5.5.16 configuration problem--THIRD RESEND do you have more than one docBase specified? also, servlet.jar etc should not be in your WEB-INF/lib Scott Smith wrote: OK, I removed the unnecessary Contexts (at least they are unnecessary for the time being) and did notice the following messages. WARNING: A docBase c:\webapps\myapp inside the host appBase has been specified, and will be ignored Apr 15, 2006 2:09:41 AM org.apache.catalina.loader.WebappClassLoader validateJarFile INFO: validateJarFile(D:\MSD\Prog0\NewsBrowser\webapps\medias\WEB-INF\lib\serv let-api.jar) - jar not loaded. See Servlet Spec 2.3, section 9.7.2. Offending class: javax/servlet/Servlet.class Apr 15, 2006 2:09:41 AM org.apache.catalina.loader.WebappClassLoader validateJarFile INFO: validateJarFile(D:\MSD\Prog0\NewsBrowser\webapps\medias\WEB-INF\lib\serv let.jar) - jar not loaded. See Servlet Spec 2.3, section 9.7.2. Offending class: javax/servlet/Servlet.class The first Warning certainly sounds ominous--but, I don't know what it means. I did some googling which seemed to imply that it's probably caused by the Context error in the webapp itself. I don't know what the others mean. So, I'm still at square one. -Original Message- From: Filip Hanik - Dev Lists [mailto:[EMAIL PROTECTED] Sent: Friday, April 14, 2006 6:58 PM To: Tomcat Users List Subject: Re: Tomcat 5.5.16 configuration problem--THIRD RESEND maybe I should read the docs ;) yes, any container can have it, Filip Hanik - Dev Lists wrote: exactly, the realm element doesn't belong there, read up on the docs Scott Smith wrote: I am also doing Forms authentication...but I haven't got that far since the webapp doesn't initialize yet. This app used to use the struts data-sources tag, but I'm trying to move it to jndi. -Original Message- From: Marc Farrow [mailto:[EMAIL PROTECTED] Sent: Friday, April 14, 2006 5:05 PM To: Tomcat Users List Subject: Re: Tomcat 5.5.16 configuration problem--THIRD RESEND What are you trying to accomplish with the realm tag? On 4/14/06, Filip Hanik - Dev Lists [EMAIL PROTECTED] wrote: check your log files upon startup, your myapp.xml doesn't have a docBase attribute to associate it with the app itself. Context docBase=${catalina.home}/server/webapps/myapp path=/myapp. Scott Smith wrote: Sorry, I sent this so many times. Hopefully, I have all of the typos out of it this time... I have specified the following as myapp.xml in the conf\Catalina\locahost directory: Context path=/myapp Resource name=jdbc/MyDB auth=Container type=javax.sql.DataSource username=user password=pswd driverClassName=net.sourceforge.jtds.jdbc.Driver url=jdbc:jtds:sqlserver://127.0.0.1:1433;DatabaseName=MyDB;SelectMethod =cursor maxActive=30 maxIdle=20 minIdle=10 maxWait=2 / Realm className=org.apache.catalina.realm.DataSourceRealm debug=99 dataSourceName=jdbc/MyDB userTable=zUsers userNameCol=zUserName userCredCol=zPassword userRoleTable=wsViewRoles roleNameCol=zRole / /Context In my web.xml file I have: resource-ref res-ref-namejdbc/MyDB/res-ref-name res-typejavax.sql.DataSource/res-type res-authContainer/res-auth /resource-ref But, when I execute the code DataSource ds = null; try { Context initCtx = new InitialContext(); Context envCtx = (Context) initCtx.lookup(java:comp/env); ds
Re: Tomcat 5.5.16 configuration problem--THIRD RESEND
do you have more than one docBase specified? also, servlet.jar etc should not be in your WEB-INF/lib Scott Smith wrote: OK, I removed the unnecessary Contexts (at least they are unnecessary for the time being) and did notice the following messages. WARNING: A docBase c:\webapps\myapp inside the host appBase has been specified, and will be ignored Apr 15, 2006 2:09:41 AM org.apache.catalina.loader.WebappClassLoader validateJarFile INFO: validateJarFile(D:\MSD\Prog0\NewsBrowser\webapps\medias\WEB-INF\lib\serv let-api.jar) - jar not loaded. See Servlet Spec 2.3, section 9.7.2. Offending class: javax/servlet/Servlet.class Apr 15, 2006 2:09:41 AM org.apache.catalina.loader.WebappClassLoader validateJarFile INFO: validateJarFile(D:\MSD\Prog0\NewsBrowser\webapps\medias\WEB-INF\lib\serv let.jar) - jar not loaded. See Servlet Spec 2.3, section 9.7.2. Offending class: javax/servlet/Servlet.class The first Warning certainly sounds ominous--but, I don't know what it means. I did some googling which seemed to imply that it's probably caused by the Context error in the webapp itself. I don't know what the others mean. So, I'm still at square one. -Original Message- From: Filip Hanik - Dev Lists [mailto:[EMAIL PROTECTED] Sent: Friday, April 14, 2006 6:58 PM To: Tomcat Users List Subject: Re: Tomcat 5.5.16 configuration problem--THIRD RESEND maybe I should read the docs ;) yes, any container can have it, Filip Hanik - Dev Lists wrote: exactly, the realm element doesn't belong there, read up on the docs Scott Smith wrote: I am also doing Forms authentication...but I haven't got that far since the webapp doesn't initialize yet. This app used to use the struts data-sources tag, but I'm trying to move it to jndi. -Original Message- From: Marc Farrow [mailto:[EMAIL PROTECTED] Sent: Friday, April 14, 2006 5:05 PM To: Tomcat Users List Subject: Re: Tomcat 5.5.16 configuration problem--THIRD RESEND What are you trying to accomplish with the realm tag? On 4/14/06, Filip Hanik - Dev Lists [EMAIL PROTECTED] wrote: check your log files upon startup, your myapp.xml doesn't have a docBase attribute to associate it with the app itself. Context docBase=${catalina.home}/server/webapps/myapp path=/myapp. Scott Smith wrote: Sorry, I sent this so many times. Hopefully, I have all of the typos out of it this time... I have specified the following as myapp.xml in the conf\Catalina\locahost directory: Context path=/myapp Resource name=jdbc/MyDB auth=Container type=javax.sql.DataSource username=user password=pswd driverClassName=net.sourceforge.jtds.jdbc.Driver url=jdbc:jtds:sqlserver://127.0.0.1:1433;DatabaseName=MyDB;SelectMethod =cursor maxActive=30 maxIdle=20 minIdle=10 maxWait=2 / Realm className=org.apache.catalina.realm.DataSourceRealm debug=99 dataSourceName=jdbc/MyDB userTable=zUsers userNameCol=zUserName userCredCol=zPassword userRoleTable=wsViewRoles roleNameCol=zRole / /Context In my web.xml file I have: resource-ref res-ref-namejdbc/MyDB/res-ref-name res-typejavax.sql.DataSource/res-type res-authContainer/res-auth /resource-ref But, when I execute the code DataSource ds = null; try { Context initCtx = new InitialContext(); Context envCtx = (Context) initCtx.lookup(java:comp/env); ds = (DataSource) envCtx.lookup(jdbc/MyDB); } catch (NamingException e) { _log.error(Unable to retrieve MyDB DataSource, e); ds = null; } The exception is caught and I get an error message which says javax.naming.NamingException: Name is not bound to a Context. I verified that the name in the Resource, resource-ref and the context lookup are the same. I suspect I understand the message. I just don't know what I've done wrong. Any suggestions? Scott - 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
FW: Tomcat 5.5.16 configuration problem--THIRD RESEND
Hi, Do you really need that resource-ref in the web.xml. Your resource is defined under Context so you shouldn't need one. Other than that Your code looks fine and I can't see any problems with it. Regards. Hi, Why have you got servlet-api.jar under your WEB-INF/lib. You should Be using the servlet implementation that comes with tomcat (under common/lib). I don't know enough about tomcat to know what it would mean if you have the jar under WEB-INF/lib, but I am sure it won't be very happy with it. Regards. OK, I removed the unnecessary Contexts (at least they are unnecessary for the time being) and did notice the following messages. WARNING: A docBase c:\webapps\myapp inside the host appBase has been specified, and will be ignored Apr 15, 2006 2:09:41 AM org.apache.catalina.loader.WebappClassLoader validateJarFile INFO: validateJarFile(D:\MSD\Prog0\NewsBrowser\webapps\medias\WEB-INF\lib\serv let-api.jar) - jar not loaded. See Servlet Spec 2.3, section 9.7.2. Offending class: javax/servlet/Servlet.class Apr 15, 2006 2:09:41 AM org.apache.catalina.loader.WebappClassLoader validateJarFile INFO: validateJarFile(D:\MSD\Prog0\NewsBrowser\webapps\medias\WEB-INF\lib\serv let.jar) - jar not loaded. See Servlet Spec 2.3, section 9.7.2. Offending class: javax/servlet/Servlet.class - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Tomcat 5.5.16 configuration problem--THIRD RESEND
Sorry, I sent this so many times. Hopefully, I have all of the typos out of it this time... I have specified the following as myapp.xml in the conf\Catalina\locahost directory: Context path=/myapp Resource name=jdbc/MyDB auth=Container type=javax.sql.DataSource username=user password=pswd driverClassName=net.sourceforge.jtds.jdbc.Driver url=jdbc:jtds:sqlserver://127.0.0.1:1433;DatabaseName=MyDB;SelectMethod =cursor maxActive=30 maxIdle=20 minIdle=10 maxWait=2 / Realm className=org.apache.catalina.realm.DataSourceRealm debug=99 dataSourceName=jdbc/MyDB userTable=zUsers userNameCol=zUserName userCredCol=zPassword userRoleTable=wsViewRoles roleNameCol=zRole / /Context In my web.xml file I have: resource-ref res-ref-namejdbc/MyDB/res-ref-name res-typejavax.sql.DataSource/res-type res-authContainer/res-auth /resource-ref But, when I execute the code DataSource ds = null; try { Context initCtx = new InitialContext(); Context envCtx = (Context) initCtx.lookup(java:comp/env); ds = (DataSource) envCtx.lookup(jdbc/MyDB); } catch (NamingException e) { _log.error(Unable to retrieve MyDB DataSource, e); ds = null; } The exception is caught and I get an error message which says javax.naming.NamingException: Name is not bound to a Context. I verified that the name in the Resource, resource-ref and the context lookup are the same. I suspect I understand the message. I just don't know what I've done wrong. Any suggestions? Scott
Re: Tomcat 5.5.16 configuration problem--THIRD RESEND
check your log files upon startup, your myapp.xml doesn't have a docBase attribute to associate it with the app itself. Context docBase=${catalina.home}/server/webapps/myapp path=/myapp. Scott Smith wrote: Sorry, I sent this so many times. Hopefully, I have all of the typos out of it this time... I have specified the following as myapp.xml in the conf\Catalina\locahost directory: Context path=/myapp Resource name=jdbc/MyDB auth=Container type=javax.sql.DataSource username=user password=pswd driverClassName=net.sourceforge.jtds.jdbc.Driver url=jdbc:jtds:sqlserver://127.0.0.1:1433;DatabaseName=MyDB;SelectMethod =cursor maxActive=30 maxIdle=20 minIdle=10 maxWait=2 / Realm className=org.apache.catalina.realm.DataSourceRealm debug=99 dataSourceName=jdbc/MyDB userTable=zUsers userNameCol=zUserName userCredCol=zPassword userRoleTable=wsViewRoles roleNameCol=zRole / /Context In my web.xml file I have: resource-ref res-ref-namejdbc/MyDB/res-ref-name res-typejavax.sql.DataSource/res-type res-authContainer/res-auth /resource-ref But, when I execute the code DataSource ds = null; try { Context initCtx = new InitialContext(); Context envCtx = (Context) initCtx.lookup(java:comp/env); ds = (DataSource) envCtx.lookup(jdbc/MyDB); } catch (NamingException e) { _log.error(Unable to retrieve MyDB DataSource, e); ds = null; } The exception is caught and I get an error message which says javax.naming.NamingException: Name is not bound to a Context. I verified that the name in the Resource, resource-ref and the context lookup are the same. I suspect I understand the message. I just don't know what I've done wrong. Any suggestions? Scott - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Tomcat 5.5.16 configuration problem--THIRD RESEND
What are you trying to accomplish with the realm tag? On 4/14/06, Filip Hanik - Dev Lists [EMAIL PROTECTED] wrote: check your log files upon startup, your myapp.xml doesn't have a docBase attribute to associate it with the app itself. Context docBase=${catalina.home}/server/webapps/myapp path=/myapp. Scott Smith wrote: Sorry, I sent this so many times. Hopefully, I have all of the typos out of it this time... I have specified the following as myapp.xml in the conf\Catalina\locahost directory: Context path=/myapp Resource name=jdbc/MyDB auth=Container type=javax.sql.DataSource username=user password=pswd driverClassName=net.sourceforge.jtds.jdbc.Driver url=jdbc:jtds:sqlserver://127.0.0.1:1433;DatabaseName=MyDB;SelectMethod =cursor maxActive=30 maxIdle=20 minIdle=10 maxWait=2 / Realm className=org.apache.catalina.realm.DataSourceRealm debug=99 dataSourceName=jdbc/MyDB userTable=zUsers userNameCol=zUserName userCredCol=zPassword userRoleTable=wsViewRoles roleNameCol=zRole / /Context In my web.xml file I have: resource-ref res-ref-namejdbc/MyDB/res-ref-name res-typejavax.sql.DataSource/res-type res-authContainer/res-auth /resource-ref But, when I execute the code DataSource ds = null; try { Context initCtx = new InitialContext(); Context envCtx = (Context) initCtx.lookup(java:comp/env); ds = (DataSource) envCtx.lookup(jdbc/MyDB); } catch (NamingException e) { _log.error(Unable to retrieve MyDB DataSource, e); ds = null; } The exception is caught and I get an error message which says javax.naming.NamingException: Name is not bound to a Context. I verified that the name in the Resource, resource-ref and the context lookup are the same. I suspect I understand the message. I just don't know what I've done wrong. Any suggestions? Scott - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Tomcat 5.5.16 configuration problem--THIRD RESEND
You are correct. I thought path was required and implied the docBase (I guess it's the other way around). So I changed it to: Context docBase=myapp path=/myapp However, that didn't change the error message. -Original Message- From: Filip Hanik - Dev Lists [mailto:[EMAIL PROTECTED] Sent: Friday, April 14, 2006 4:56 PM To: Tomcat Users List Subject: Re: Tomcat 5.5.16 configuration problem--THIRD RESEND check your log files upon startup, your myapp.xml doesn't have a docBase attribute to associate it with the app itself. Context docBase=${catalina.home}/server/webapps/myapp path=/myapp. Scott Smith wrote: Sorry, I sent this so many times. Hopefully, I have all of the typos out of it this time... I have specified the following as myapp.xml in the conf\Catalina\locahost directory: Context path=/myapp Resource name=jdbc/MyDB auth=Container type=javax.sql.DataSource username=user password=pswd driverClassName=net.sourceforge.jtds.jdbc.Driver url=jdbc:jtds:sqlserver://127.0.0.1:1433;DatabaseName=MyDB;SelectMethod =cursor maxActive=30 maxIdle=20 minIdle=10 maxWait=2 / Realm className=org.apache.catalina.realm.DataSourceRealm debug=99 dataSourceName=jdbc/MyDB userTable=zUsers userNameCol=zUserName userCredCol=zPassword userRoleTable=wsViewRoles roleNameCol=zRole / /Context In my web.xml file I have: resource-ref res-ref-namejdbc/MyDB/res-ref-name res-typejavax.sql.DataSource/res-type res-authContainer/res-auth /resource-ref But, when I execute the code DataSource ds = null; try { Context initCtx = new InitialContext(); Context envCtx = (Context) initCtx.lookup(java:comp/env); ds = (DataSource) envCtx.lookup(jdbc/MyDB); } catch (NamingException e) { _log.error(Unable to retrieve MyDB DataSource, e); ds = null; } The exception is caught and I get an error message which says javax.naming.NamingException: Name is not bound to a Context. I verified that the name in the Resource, resource-ref and the context lookup are the same. I suspect I understand the message. I just don't know what I've done wrong. Any suggestions? Scott - 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: Tomcat 5.5.16 configuration problem--THIRD RESEND
I am also doing Forms authentication...but I haven't got that far since the webapp doesn't initialize yet. This app used to use the struts data-sources tag, but I'm trying to move it to jndi. -Original Message- From: Marc Farrow [mailto:[EMAIL PROTECTED] Sent: Friday, April 14, 2006 5:05 PM To: Tomcat Users List Subject: Re: Tomcat 5.5.16 configuration problem--THIRD RESEND What are you trying to accomplish with the realm tag? On 4/14/06, Filip Hanik - Dev Lists [EMAIL PROTECTED] wrote: check your log files upon startup, your myapp.xml doesn't have a docBase attribute to associate it with the app itself. Context docBase=${catalina.home}/server/webapps/myapp path=/myapp. Scott Smith wrote: Sorry, I sent this so many times. Hopefully, I have all of the typos out of it this time... I have specified the following as myapp.xml in the conf\Catalina\locahost directory: Context path=/myapp Resource name=jdbc/MyDB auth=Container type=javax.sql.DataSource username=user password=pswd driverClassName=net.sourceforge.jtds.jdbc.Driver url=jdbc:jtds:sqlserver://127.0.0.1:1433;DatabaseName=MyDB;SelectMethod =cursor maxActive=30 maxIdle=20 minIdle=10 maxWait=2 / Realm className=org.apache.catalina.realm.DataSourceRealm debug=99 dataSourceName=jdbc/MyDB userTable=zUsers userNameCol=zUserName userCredCol=zPassword userRoleTable=wsViewRoles roleNameCol=zRole / /Context In my web.xml file I have: resource-ref res-ref-namejdbc/MyDB/res-ref-name res-typejavax.sql.DataSource/res-type res-authContainer/res-auth /resource-ref But, when I execute the code DataSource ds = null; try { Context initCtx = new InitialContext(); Context envCtx = (Context) initCtx.lookup(java:comp/env); ds = (DataSource) envCtx.lookup(jdbc/MyDB); } catch (NamingException e) { _log.error(Unable to retrieve MyDB DataSource, e); ds = null; } The exception is caught and I get an error message which says javax.naming.NamingException: Name is not bound to a Context. I verified that the name in the Resource, resource-ref and the context lookup are the same. I suspect I understand the message. I just don't know what I've done wrong. Any suggestions? Scott - 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]
FW: Tomcat 5.5.16 configuration problem--THIRD RESEND
Hi, Do you really need that resource-ref in the web.xml. Your resource is defined under Context so you shouldn't need one. Other than that Your code looks fine and I can't see any problems with it. Regards. On 4/14/06, Filip Hanik - Dev Lists [EMAIL PROTECTED] wrote: check your log files upon startup, your myapp.xml doesn't have a docBase attribute to associate it with the app itself. Context docBase=${catalina.home}/server/webapps/myapp path=/myapp. Scott Smith wrote: Sorry, I sent this so many times. Hopefully, I have all of the typos out of it this time... I have specified the following as myapp.xml in the conf\Catalina\locahost directory: Context path=/myapp Resource name=jdbc/MyDB auth=Container type=javax.sql.DataSource username=user password=pswd driverClassName=net.sourceforge.jtds.jdbc.Driver url=jdbc:jtds:sqlserver://127.0.0.1:1433;DatabaseName=MyDB;SelectMethod =cursor maxActive=30 maxIdle=20 minIdle=10 maxWait=2 / Realm className=org.apache.catalina.realm.DataSourceRealm debug=99 dataSourceName=jdbc/MyDB userTable=zUsers userNameCol=zUserName userCredCol=zPassword userRoleTable=wsViewRoles roleNameCol=zRole / /Context In my web.xml file I have: resource-ref res-ref-namejdbc/MyDB/res-ref-name res-typejavax.sql.DataSource/res-type res-authContainer/res-auth /resource-ref But, when I execute the code DataSource ds = null; try { Context initCtx = new InitialContext(); Context envCtx = (Context) initCtx.lookup(java:comp/env); ds = (DataSource) envCtx.lookup(jdbc/MyDB); } catch (NamingException e) { _log.error(Unable to retrieve MyDB DataSource, e); ds = null; } The exception is caught and I get an error message which says javax.naming.NamingException: Name is not bound to a Context. I verified that the name in the Resource, resource-ref and the context lookup are the same. I suspect I understand the message. I just don't know what I've done wrong. Any suggestions? Scott - 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: Tomcat 5.5.16 configuration problem--THIRD RESEND
exactly, the realm element doesn't belong there, read up on the docs Scott Smith wrote: I am also doing Forms authentication...but I haven't got that far since the webapp doesn't initialize yet. This app used to use the struts data-sources tag, but I'm trying to move it to jndi. -Original Message- From: Marc Farrow [mailto:[EMAIL PROTECTED] Sent: Friday, April 14, 2006 5:05 PM To: Tomcat Users List Subject: Re: Tomcat 5.5.16 configuration problem--THIRD RESEND What are you trying to accomplish with the realm tag? On 4/14/06, Filip Hanik - Dev Lists [EMAIL PROTECTED] wrote: check your log files upon startup, your myapp.xml doesn't have a docBase attribute to associate it with the app itself. Context docBase=${catalina.home}/server/webapps/myapp path=/myapp. Scott Smith wrote: Sorry, I sent this so many times. Hopefully, I have all of the typos out of it this time... I have specified the following as myapp.xml in the conf\Catalina\locahost directory: Context path=/myapp Resource name=jdbc/MyDB auth=Container type=javax.sql.DataSource username=user password=pswd driverClassName=net.sourceforge.jtds.jdbc.Driver url=jdbc:jtds:sqlserver://127.0.0.1:1433;DatabaseName=MyDB;SelectMethod =cursor maxActive=30 maxIdle=20 minIdle=10 maxWait=2 / Realm className=org.apache.catalina.realm.DataSourceRealm debug=99 dataSourceName=jdbc/MyDB userTable=zUsers userNameCol=zUserName userCredCol=zPassword userRoleTable=wsViewRoles roleNameCol=zRole / /Context In my web.xml file I have: resource-ref res-ref-namejdbc/MyDB/res-ref-name res-typejavax.sql.DataSource/res-type res-authContainer/res-auth /resource-ref But, when I execute the code DataSource ds = null; try { Context initCtx = new InitialContext(); Context envCtx = (Context) initCtx.lookup(java:comp/env); ds = (DataSource) envCtx.lookup(jdbc/MyDB); } catch (NamingException e) { _log.error(Unable to retrieve MyDB DataSource, e); ds = null; } The exception is caught and I get an error message which says javax.naming.NamingException: Name is not bound to a Context. I verified that the name in the Resource, resource-ref and the context lookup are the same. I suspect I understand the message. I just don't know what I've done wrong. Any suggestions? Scott - 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: Tomcat 5.5.16 configuration problem--THIRD RESEND
also, did you check your logs yet? I bet there is a nice little error message in there for you :) Filip Scott Smith wrote: You are correct. I thought path was required and implied the docBase (I guess it's the other way around). So I changed it to: Context docBase=myapp path=/myapp However, that didn't change the error message. -Original Message- From: Filip Hanik - Dev Lists [mailto:[EMAIL PROTECTED] Sent: Friday, April 14, 2006 4:56 PM To: Tomcat Users List Subject: Re: Tomcat 5.5.16 configuration problem--THIRD RESEND check your log files upon startup, your myapp.xml doesn't have a docBase attribute to associate it with the app itself. Context docBase=${catalina.home}/server/webapps/myapp path=/myapp. Scott Smith wrote: Sorry, I sent this so many times. Hopefully, I have all of the typos out of it this time... I have specified the following as myapp.xml in the conf\Catalina\locahost directory: Context path=/myapp Resource name=jdbc/MyDB auth=Container type=javax.sql.DataSource username=user password=pswd driverClassName=net.sourceforge.jtds.jdbc.Driver url=jdbc:jtds:sqlserver://127.0.0.1:1433;DatabaseName=MyDB;SelectMethod =cursor maxActive=30 maxIdle=20 minIdle=10 maxWait=2 / Realm className=org.apache.catalina.realm.DataSourceRealm debug=99 dataSourceName=jdbc/MyDB userTable=zUsers userNameCol=zUserName userCredCol=zPassword userRoleTable=wsViewRoles roleNameCol=zRole / /Context In my web.xml file I have: resource-ref res-ref-namejdbc/MyDB/res-ref-name res-typejavax.sql.DataSource/res-type res-authContainer/res-auth /resource-ref But, when I execute the code DataSource ds = null; try { Context initCtx = new InitialContext(); Context envCtx = (Context) initCtx.lookup(java:comp/env); ds = (DataSource) envCtx.lookup(jdbc/MyDB); } catch (NamingException e) { _log.error(Unable to retrieve MyDB DataSource, e); ds = null; } The exception is caught and I get an error message which says javax.naming.NamingException: Name is not bound to a Context. I verified that the name in the Resource, resource-ref and the context lookup are the same. I suspect I understand the message. I just don't know what I've done wrong. Any suggestions? Scott - 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: Tomcat 5.5.16 configuration problem--THIRD RESEND
I don't know. It's there because when I looked in the JNDI DataSource How-to, it was there. Originally, I had the database Resource (not the Realm) in the GlobalResources (which didn't work either; I then had a ResourceLink in the Context). I moved the Resource to the Context in an attempt to figure out why it wasn't working. As I mentioned in a previous post, this is the first time I've tried to use JNDI and I suspect I've got some minor detail wrong. I'm beginning to be suspicious that somehow the context isn't really getting tied to the webapp directory. I did move the webapps directory (per Moczar) and maybe I've screwed that up. Is there someway to get Tomcat to give more error details about missing stuff? Do I need to configure log4j and check the debug/info stuff as well as errors? Suggestions? -Original Message- From: Arshad Mahmood [mailto:[EMAIL PROTECTED] Sent: Friday, April 14, 2006 6:37 PM To: users@tomcat.apache.org Subject: FW: Tomcat 5.5.16 configuration problem--THIRD RESEND Hi, Do you really need that resource-ref in the web.xml. Your resource is defined under Context so you shouldn't need one. Other than that Your code looks fine and I can't see any problems with it. Regards. On 4/14/06, Filip Hanik - Dev Lists [EMAIL PROTECTED] wrote: check your log files upon startup, your myapp.xml doesn't have a docBase attribute to associate it with the app itself. Context docBase=${catalina.home}/server/webapps/myapp path=/myapp. Scott Smith wrote: Sorry, I sent this so many times. Hopefully, I have all of the typos out of it this time... I have specified the following as myapp.xml in the conf\Catalina\locahost directory: Context path=/myapp Resource name=jdbc/MyDB auth=Container type=javax.sql.DataSource username=user password=pswd driverClassName=net.sourceforge.jtds.jdbc.Driver url=jdbc:jtds:sqlserver://127.0.0.1:1433;DatabaseName=MyDB;SelectMethod =cursor maxActive=30 maxIdle=20 minIdle=10 maxWait=2 / Realm className=org.apache.catalina.realm.DataSourceRealm debug=99 dataSourceName=jdbc/MyDB userTable=zUsers userNameCol=zUserName userCredCol=zPassword userRoleTable=wsViewRoles roleNameCol=zRole / /Context In my web.xml file I have: resource-ref res-ref-namejdbc/MyDB/res-ref-name res-typejavax.sql.DataSource/res-type res-authContainer/res-auth /resource-ref But, when I execute the code DataSource ds = null; try { Context initCtx = new InitialContext(); Context envCtx = (Context) initCtx.lookup(java:comp/env); ds = (DataSource) envCtx.lookup(jdbc/MyDB); } catch (NamingException e) { _log.error(Unable to retrieve MyDB DataSource, e); ds = null; } The exception is caught and I get an error message which says javax.naming.NamingException: Name is not bound to a Context. I verified that the name in the Resource, resource-ref and the context lookup are the same. I suspect I understand the message. I just don't know what I've done wrong. Any suggestions? Scott - 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: Tomcat 5.5.16 configuration problem--THIRD RESEND
I've read the logs a half-dozen times. If there's something there, I've missed it. Now, having said that, there is another Context that's giving me an error message. I need to set up a couple of Contexts that point to static content in directories outside of the web application (assume they have images in them). There's no WEB-INF directory in either one of them, so Tomcat complains it can't start one of the Contexts (but only in one of them--don't understand why it complains about one and not the other). Still, if I reference an item through that path, Tomcat seems to find it. But, since it's a different Context than myapp, I assume it's not what's affecting things here. Yes, I did look at the docs, but since it took me three times to send this email the first time, I'm hardly in a position to criticize :-). Scott -Original Message- From: Filip Hanik - Dev Lists [mailto:[EMAIL PROTECTED] Sent: Friday, April 14, 2006 6:57 PM To: Tomcat Users List Subject: Re: Tomcat 5.5.16 configuration problem--THIRD RESEND also, did you check your logs yet? I bet there is a nice little error message in there for you :) Filip Scott Smith wrote: You are correct. I thought path was required and implied the docBase (I guess it's the other way around). So I changed it to: Context docBase=myapp path=/myapp However, that didn't change the error message. -Original Message- From: Filip Hanik - Dev Lists [mailto:[EMAIL PROTECTED] Sent: Friday, April 14, 2006 4:56 PM To: Tomcat Users List Subject: Re: Tomcat 5.5.16 configuration problem--THIRD RESEND check your log files upon startup, your myapp.xml doesn't have a docBase attribute to associate it with the app itself. Context docBase=${catalina.home}/server/webapps/myapp path=/myapp. Scott Smith wrote: Sorry, I sent this so many times. Hopefully, I have all of the typos out of it this time... I have specified the following as myapp.xml in the conf\Catalina\locahost directory: Context path=/myapp Resource name=jdbc/MyDB auth=Container type=javax.sql.DataSource username=user password=pswd driverClassName=net.sourceforge.jtds.jdbc.Driver url=jdbc:jtds:sqlserver://127.0.0.1:1433;DatabaseName=MyDB;SelectMethod =cursor maxActive=30 maxIdle=20 minIdle=10 maxWait=2 / Realm className=org.apache.catalina.realm.DataSourceRealm debug=99 dataSourceName=jdbc/MyDB userTable=zUsers userNameCol=zUserName userCredCol=zPassword userRoleTable=wsViewRoles roleNameCol=zRole / /Context In my web.xml file I have: resource-ref res-ref-namejdbc/MyDB/res-ref-name res-typejavax.sql.DataSource/res-type res-authContainer/res-auth /resource-ref But, when I execute the code DataSource ds = null; try { Context initCtx = new InitialContext(); Context envCtx = (Context) initCtx.lookup(java:comp/env); ds = (DataSource) envCtx.lookup(jdbc/MyDB); } catch (NamingException e) { _log.error(Unable to retrieve MyDB DataSource, e); ds = null; } The exception is caught and I get an error message which says javax.naming.NamingException: Name is not bound to a Context. I verified that the name in the Resource, resource-ref and the context lookup are the same. I suspect I understand the message. I just don't know what I've done wrong. Any suggestions? Scott - 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] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Tomcat 5.5.16 configuration problem--THIRD RESEND
OK, I removed the unnecessary Contexts (at least they are unnecessary for the time being) and did notice the following messages. WARNING: A docBase c:\webapps\myapp inside the host appBase has been specified, and will be ignored Apr 15, 2006 2:09:41 AM org.apache.catalina.loader.WebappClassLoader validateJarFile INFO: validateJarFile(D:\MSD\Prog0\NewsBrowser\webapps\medias\WEB-INF\lib\serv let-api.jar) - jar not loaded. See Servlet Spec 2.3, section 9.7.2. Offending class: javax/servlet/Servlet.class Apr 15, 2006 2:09:41 AM org.apache.catalina.loader.WebappClassLoader validateJarFile INFO: validateJarFile(D:\MSD\Prog0\NewsBrowser\webapps\medias\WEB-INF\lib\serv let.jar) - jar not loaded. See Servlet Spec 2.3, section 9.7.2. Offending class: javax/servlet/Servlet.class The first Warning certainly sounds ominous--but, I don't know what it means. I did some googling which seemed to imply that it's probably caused by the Context error in the webapp itself. I don't know what the others mean. So, I'm still at square one. -Original Message- From: Filip Hanik - Dev Lists [mailto:[EMAIL PROTECTED] Sent: Friday, April 14, 2006 6:58 PM To: Tomcat Users List Subject: Re: Tomcat 5.5.16 configuration problem--THIRD RESEND maybe I should read the docs ;) yes, any container can have it, Filip Hanik - Dev Lists wrote: exactly, the realm element doesn't belong there, read up on the docs Scott Smith wrote: I am also doing Forms authentication...but I haven't got that far since the webapp doesn't initialize yet. This app used to use the struts data-sources tag, but I'm trying to move it to jndi. -Original Message- From: Marc Farrow [mailto:[EMAIL PROTECTED] Sent: Friday, April 14, 2006 5:05 PM To: Tomcat Users List Subject: Re: Tomcat 5.5.16 configuration problem--THIRD RESEND What are you trying to accomplish with the realm tag? On 4/14/06, Filip Hanik - Dev Lists [EMAIL PROTECTED] wrote: check your log files upon startup, your myapp.xml doesn't have a docBase attribute to associate it with the app itself. Context docBase=${catalina.home}/server/webapps/myapp path=/myapp. Scott Smith wrote: Sorry, I sent this so many times. Hopefully, I have all of the typos out of it this time... I have specified the following as myapp.xml in the conf\Catalina\locahost directory: Context path=/myapp Resource name=jdbc/MyDB auth=Container type=javax.sql.DataSource username=user password=pswd driverClassName=net.sourceforge.jtds.jdbc.Driver url=jdbc:jtds:sqlserver://127.0.0.1:1433;DatabaseName=MyDB;SelectMethod =cursor maxActive=30 maxIdle=20 minIdle=10 maxWait=2 / Realm className=org.apache.catalina.realm.DataSourceRealm debug=99 dataSourceName=jdbc/MyDB userTable=zUsers userNameCol=zUserName userCredCol=zPassword userRoleTable=wsViewRoles roleNameCol=zRole / /Context In my web.xml file I have: resource-ref res-ref-namejdbc/MyDB/res-ref-name res-typejavax.sql.DataSource/res-type res-authContainer/res-auth /resource-ref But, when I execute the code DataSource ds = null; try { Context initCtx = new InitialContext(); Context envCtx = (Context) initCtx.lookup(java:comp/env); ds = (DataSource) envCtx.lookup(jdbc/MyDB); } catch (NamingException e) { _log.error(Unable to retrieve MyDB DataSource, e); ds = null; } The exception is caught and I get an error message which says javax.naming.NamingException: Name is not bound to a Context. I verified that the name in the Resource, resource-ref and the context lookup are the same. I suspect I understand the message. I just don't know what I've done wrong. Any suggestions? Scott - 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] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED