Re: Best Logging practices
Without an intent to offend anyone, I'd say majority of the posts were centered around what tools to use, rather than the best practices itself (apart from the posts of Jacob and Peter Lin). So, from what I understand: 1. Web applications written using tomcat should have the logging path configurable (via the parameters in the web.xml, for example) - since the webapp can be run directly from the .war archive. And Steve had a remark about not being able to have configurable files inside the jar. 2. While logging to a directory inside the webapp structure, its a good practice to check context.getRealPath(/) returns non-null first. 3. Keep an alternative - so when logging to your file fails, use ServletContext.log(string) to send the message string to application log. What about, like Peter mentioned (but did not quite elaborate) log rotation? report generation based on logs? log backups? Also guidelines for the developers to separate the log messages that are errors, and log messages that are produced by the application as indications of the outcome of some task? Thanks, Manav. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Best Logging practices
I agree. When I posted that, it was a summation of the posts that I had seen till that time. What I've been looking for is a standard way to configure my .war archives, such that we can call it a true deployable - without any interference from the users. Like someone else pointed out, the intent is to make have configuration free archive. I've had several instances in the past, where despite the best efforts, we ended up having to provide instructions to the end-user for deployment (and the worst is one you ask the end-user to open up the web.xml or some application-specific properties file that the applications reads from). Further, there are instances where certain servers do not explode the .war archive, so the end-user never gets to see those properties files themselves. Regards, Manav. - Original Message - From: Jacob Kjome [EMAIL PROTECTED] To: Tomcat Users List [EMAIL PROTECTED] Sent: Wednesday, February 19, 2003 8:51 PM Subject: Re: Best Logging practices Your question is now becoming a lot more logging-in-general oriented where it was about logging from webapps before. I suggest you look to the experts on the log4j-user list or, better yet, buy the book on using log4j: http://www.qos.ch/shop/products/clm_t.jsp This is loaded with information and I highly recommend getting it. It will answer most, if not all, of your logging questions. Jake At 09:27 AM 2/20/2003 -0800, you wrote: Without an intent to offend anyone, I'd say majority of the posts were centered around what tools to use, rather than the best practices itself (apart from the posts of Jacob and Peter Lin). So, from what I understand: 1. Web applications written using tomcat should have the logging path configurable (via the parameters in the web.xml, for example) - since the webapp can be run directly from the .war archive. And Steve had a remark about not being able to have configurable files inside the jar. 2. While logging to a directory inside the webapp structure, its a good practice to check context.getRealPath(/) returns non-null first. 3. Keep an alternative - so when logging to your file fails, use ServletContext.log(string) to send the message string to application log. What about, like Peter mentioned (but did not quite elaborate) log rotation? report generation based on logs? log backups? Also guidelines for the developers to separate the log messages that are errors, and log messages that are produced by the application as indications of the outcome of some task? Thanks, Manav. - 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: Best Logging practices
Hi Peter, Thanks a lot for the response. here are some other considerations. For some of the projects I've worked on in the past, there were established directories for logs. Therefore I used log4j to write my logs asynchronisly. Could you elaborate on established directories? I assume these directories were within your webapp context. If yes, then what if the application is deployed onto a server that does not explore your .war file? Secondly, there are instances where, thought the application is deployed correctly, there are no write permissions to that directory - how did you resolve such a situation? Finally, at times there are log files that are generated as a result of certain user action, not necessarily errors, but these have to be made available to the user as information. Would you store them into the same directory as other log files? Then there are other issues of such log files increasing in size and number continuously, and log rotation as well as backup. Any ideas about that? logging isn't as simple as write stuff to file. You have to take into consideration other things like how are the logs backed up, when are reports generated, and other system administration processes. Oh, I agree to that. Since the advent of Log4J, I've seen the logging process to be more standardized, and the though there might be one-off incidents of literally anything being logged, there is some level of sanity. Though yes, log backup, report etc still are prevalent issues. I typically stick configuration information in web.xml, if the application is meant to be a deployable web app in .war format. one thing to keep in mind is what happens if your log fails, you will want to direct the exceptions to the application log by passing it to ServletContext.log(string). In some situations, system administrators at the customer's facility insist they should know what directories your application shall write to, and that this directory can be changed, if required for them (say, you develop the application and its deployed on a cluster, and they might want to change this path). You might stick this path in web.xml but then again, there is no guarantee the web app will be exploded. Thanks, Manav. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Best Logging practices
Any pointers/thoughts about web application logging practices? You generally see almost each individual with different opinion about this (from logging into the system temporary directory to inside WEB-INF). Are there any best practices for this? Thanks, Manav. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Tomcat security configuration guide
Hi, I have begun to work on a tomcat security configuration guide as a one-stop guide for helping system administrators, security professionals and programmers to configure system user accounts and groups, file permissions, tomcat security realms, java security manager, etc in the optimal way thereby ensuring their system is not vulnerable to common security exploits. 1. Has this already been done? If yes, can someone share the document/URL where I can find more information? 2. Will there be professionals/enthusiasts out there to contribute/critique? 3. In general, what does the list think about this? Kind Regards, Manav. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Filter problems
Hi, I have a simple security filter for authentication used for a custom MVC framework application. Everything works properly, however, if a large file is uploaded (about 17MB), I get the error listed below. As you can see the root cause is RTIFilter.java line 67. This line has the following code: next.doFilter(request, response); Any idea why that NullPointerException exception would occur? Thanks, Manav. java.lang.NullPointerException at com.bsil.rti.controller.FrontController.doProcess(FrontController.java:172) at com.bsil.rti.controller.FrontController.doPost(FrontController.java:140) at javax.servlet.http.HttpServlet.service(HttpServlet.java:760) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Application FilterChain.java:247) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterCh ain.java:193) at com.bsil.rti.filter.RTIFilter.doFilter(RTIFilter.java:67) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Application FilterChain.java:213) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterCh ain.java:193) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.ja va:260) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok eNext(StandardPipeline.java:643) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.ja va:191) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok eNext(StandardPipeline.java:643) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995) at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2415) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180 ) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok eNext(StandardPipeline.java:643) at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve. java:170) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok eNext(StandardPipeline.java:641) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:172 ) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok eNext(StandardPipeline.java:641) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java :174) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok eNext(StandardPipeline.java:643) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995) at org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:223) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:432) at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConne ction(Http11Protocol.java:386) at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:534) at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.jav a:530) at java.lang.Thread.run(Thread.java:536) - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: may i have answer and help
what do the logs say? - Original Message - From: rekha upadhyaya [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Sunday, February 02, 2003 2:41 AM Subject: may i have answer and help hello sir/madam i have operating system 98. and i have develop a small project on online bookshopping. i have used MsAccess as database. and Jsp as server pages. the problem is that while working and executing the files the server is automatically shutdown. that is i start the tomcat server by startup and startting doing work after execution of one or two pages it automatically gives an error message server not found and when i see in cmd promt the java startup program is alredy shutdown and i againg have to startup and then do work . i have develop this project for the book shop if such condition is arises when the users are using it is not the way a programmer develop. i have gone through ur site i have got many help from it but may i have solution of this problem. 1) The tomcat server is automatically shutdown. The work i am doing is in my pc the server and the client is in same machine. pls i am glad if i get the solution of the problem thanks the user rekha upadhyaya Software Engineer(Nepal) - Do you Yahoo!? Yahoo! Mail Plus - Powerful. Affordable. Sign up now - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: WAR Problem
You said you were able to see the first jsp page, but not the servlet. Do you have a web.xml inside your war ? - Original Message - From: eric [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Sunday, January 19, 2003 12:40 AM Subject: WAR Problem Greetings! New to Jakarta and I'm stuck. Again, most likely an easy solution but I can't find it. I'm following the instructions in a book on deploying a war file yet it won't automatically expand when I restart Tomcat. Here's the steps I took and some config stuff: I cd to the working directory of the application, in this case /usr/local/tomcat/webapps/apress jar cvf apress.war . I then move apress.war to /usr/local/tomcat/webapps and delete the apress directory. In my server.xml file I have !-- Define the default virtual host -- Host name=localhost debug=0 appBase=webapps unpackWARs=true autoDeploy=true Context path=/apress docBase=apress debug=9 reloadable=true / Yet when I restart Tomcat the apress.war file remains and there is no directory called apress. I've read that Tomcat can use the war file rather than a directory but there are some problems. In my case the first page (jsp) appears ok, but it chokes when calling the servlet. What am I missing? Thanks! Eric -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: WAR Problem - No Go
Hi Eric, I'm not sure what has happened. I see two things in error.log that you posted: 1. tomcat tries to remove the child while shutting down, and gets an error that the context /apress has not been started yet. 2. while starting up, tomcat again tries to bring up the context /apress but encounters an error while trying to configure resources, and does not load the context. Also, you mentioned you have that context mentioned in the server.xml - i don't think you need to do that. maybe, while starting up, tomcat sees that context in server.xml and tries to load it and finds nothing and fails. when it next finds the apress.war maybe it doesn't load it since it assumes that a context with the same name had to failed to start. could you try cleaning up your work folders, removing the entry from the server.xml about the context apress and try again? ~manav. - Original Message - From: eric [EMAIL PROTECTED] To: Tomcat Users List [EMAIL PROTECTED] Sent: Sunday, January 19, 2003 1:45 AM Subject: Re: WAR Problem - No Go Mark, Tried that and it still didn't work. Here's the output of the error log. Perhaps I need to disable the context /apress in server.xml? Doesn't make much sense though. 2003-01-19 10:39:46 StandardHost[localhost]: Removing web application at context path /admin 2003-01-19 10:39:46 StandardHost[localhost]: Removing web application at context path /webdav 2003-01-19 10:39:46 StandardHost[localhost]: Removing web application at context path /apress 2003-01-19 10:39:46 StandardHost[localhost]: ContainerBase.removeChild: stop: LifecycleException: Container StandardContext[/apress] has not been started at org.apache.catalina.core.StandardContext.stop(StandardContext.java:3643) at org.apache.catalina.core.ContainerBase.removeChild(ContainerBase.java:1036) at org.apache.catalina.core.StandardHostDeployer.remove(StandardHostDeployer.ja va:420) at org.apache.catalina.core.StandardHost.remove(StandardHost.java:852) at org.apache.catalina.startup.HostConfig.undeployApps(HostConfig.java:919) at org.apache.catalina.startup.HostConfig.stop(HostConfig.java:899) at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:370) at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSuppor t.java:166) at org.apache.catalina.core.ContainerBase.stop(ContainerBase.java:1221) at org.apache.catalina.core.ContainerBase.stop(ContainerBase.java:1233) at org.apache.catalina.core.StandardService.stop(StandardService.java:554) at org.apache.catalina.core.StandardServer.stop(StandardServer.java:2224) at org.apache.catalina.startup.Catalina.start(Catalina.java:543) at org.apache.catalina.startup.Catalina.execute(Catalina.java:400) at org.apache.catalina.startup.Catalina.process(Catalina.java:180) 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:324) at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:203) 2003-01-19 10:39:46 StandardHost[localhost]: Removing web application at context path /examples 2003-01-19 10:39:46 StandardHost[localhost]: Removing web application at context path /tomcat-docs 2003-01-19 10:39:46 StandardHost[localhost]: Removing web application at context path 2003-01-19 10:39:46 StandardHost[localhost]: Removing web application at context path /manager 2003-01-19 10:39:46 StandardHost[localhost]: Removing web application at context path /ch03 2003-01-19 10:39:53 StandardContext[/apress]: Starting 2003-01-19 10:39:53 StandardContext[/apress]: Processing start(), current available=false 2003-01-19 10:39:53 StandardContext[/apress]: Configuring default Resources 2003-01-19 10:39:53 StandardContext[/apress]: Resources start failed: 2003-01-19 10:39:53 StandardContext[/apress]: Configuring non-privileged default Loader 2003-01-19 10:39:53 StandardContext[/apress]: Configuring default Manager 2003-01-19 10:39:53 StandardContext[/apress]: Processing standard container startup 2003-01-19 10:39:53 StandardContext[/apress]: Context startup failed due to previous errors 2003-01-19 10:39:53 StandardContext[/apress]: Exception during cleanup after start failed LifecycleException: Container StandardContext[/apress] has not been started at org.apache.catalina.core.StandardContext.stop(StandardContext.java:3643) at org.apache.catalina.core.StandardContext.start(StandardContext.java:3621) at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1188) at org.apache.catalina.core.StandardHost.start(StandardHost.java:738) at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1188) at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:347) at org.apache.catalina.core.StandardService.start(StandardService.java:497) at
Re: WAR Problem - That was it
Well, AFAIK, each directory in the webapps folder is treated as a context, and tomcat searches for web.xml inside the WEB-INF folder (if not found it uses the default web.xml - i'd like the experts to interject, if i am mistaken). so, the assumption of your program running without a context is not valid - there is indeed a context created for your application. You need to create a context specifically in server.xml if you want some default initializations to happen - configuration of datasources for example, prior to the context loading. most applications, while being deployed, do not need an explicit context (again, i suggest you also read up the opinion of other experts on the list - i'm not that good at tomcat, yet). ~manav. - Original Message - From: eric [EMAIL PROTECTED] To: Tomcat Users List [EMAIL PROTECTED] Sent: Sunday, January 19, 2003 6:49 AM Subject: Re: WAR Problem - That was it Manav, Your suggestion did the trick. I commented out the context for apress in server.xml and the war was unpacked. Next question is: The program seems to be running ok without a Context. What happened? Suppose I just leave the Context for apress commented out. What will be the effect of that? Thanks for your help!! Eric On Monday 20 January 2003 02:53, Manavendra Gupta wrote: Hi Eric, I'm not sure what has happened. I see two things in error.log that you posted: 1. tomcat tries to remove the child while shutting down, and gets an error that the context /apress has not been started yet. 2. while starting up, tomcat again tries to bring up the context /apress but encounters an error while trying to configure resources, and does not load the context. Also, you mentioned you have that context mentioned in the server.xml - i don't think you need to do that. maybe, while starting up, tomcat sees that context in server.xml and tries to load it and finds nothing and fails. when it next finds the apress.war maybe it doesn't load it since it assumes that a context with the same name had to failed to start. could you try cleaning up your work folders, removing the entry from the server.xml about the context apress and try again? ~manav. - Original Message - From: eric [EMAIL PROTECTED] To: Tomcat Users List [EMAIL PROTECTED] Sent: Sunday, January 19, 2003 1:45 AM Subject: Re: WAR Problem - No Go Mark, Tried that and it still didn't work. Here's the output of the error log. Perhaps I need to disable the context /apress in server.xml? Doesn't make much sense though. 2003-01-19 10:39:46 StandardHost[localhost]: Removing web application at context path /admin 2003-01-19 10:39:46 StandardHost[localhost]: Removing web application at context path /webdav 2003-01-19 10:39:46 StandardHost[localhost]: Removing web application at context path /apress 2003-01-19 10:39:46 StandardHost[localhost]: ContainerBase.removeChild: stop: LifecycleException: Container StandardContext[/apress] has not been started at org.apache.catalina.core.StandardContext.stop(StandardContext.java:3643) at org.apache.catalina.core.ContainerBase.removeChild(ContainerBase.java:1036) at org.apache.catalina.core.StandardHostDeployer.remove(StandardHostDeployer.j a va:420) at org.apache.catalina.core.StandardHost.remove(StandardHost.java:852) at org.apache.catalina.startup.HostConfig.undeployApps(HostConfig.java:919) at org.apache.catalina.startup.HostConfig.stop(HostConfig.java:899) at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:370) at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSuppo r t.java:166) at org.apache.catalina.core.ContainerBase.stop(ContainerBase.java:1221) at org.apache.catalina.core.ContainerBase.stop(ContainerBase.java:1233) at org.apache.catalina.core.StandardService.stop(StandardService.java:554) at org.apache.catalina.core.StandardServer.stop(StandardServer.java:2224) at org.apache.catalina.startup.Catalina.start(Catalina.java:543) at org.apache.catalina.startup.Catalina.execute(Catalina.java:400) at org.apache.catalina.startup.Catalina.process(Catalina.java:180) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:3 9 ) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImp l .java:25) at java.lang.reflect.Method.invoke(Method.java:324) at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:203) 2003-01-19 10:39:46 StandardHost[localhost]: Removing web application at context path /examples 2003-01-19 10:39:46 StandardHost[localhost]: Removing web application at context path /tomcat-docs 2003-01-19 10:39:46 StandardHost[localhost]: Removing web application at context path 2003-01-19 10:39:46 StandardHost
Re: Tool for HTTP Request Stress Test
1. Apache JMeter (http://jakarta.apache.org/jmeter) 2. http://grinder.sourceforge.net 3. LoadRunner (www.merc-int.com/products/loadrunner/) 4. openSTA (http://www.opensta.org/) ~Manav. - Original Message - From: randie ursal [EMAIL PROTECTED] To: A mailing list about TOMCAT [EMAIL PROTECTED]; A mailing list for discussion about Sun Microsystem's Java Servlet API Technology. [EMAIL PROTECTED] Sent: Thursday, January 16, 2003 6:37 PM Subject: Tool for HTTP Request Stress Test Hi, can anyone suggest an HTTP Stress Test tool. coz i wanna stress test my web application which is deployed on Tomcat. thanks. -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: Tomcat Won't start on NT
This problem of running tomcat 4.1 and above, with JDK 1.4 and above has been documented (and quite well too) at http://jakarta.apache.org/tomcat/tomcat-4.1-doc/class-loader-howto.html (scroll down to the section XML Parsers and JDK 1.4). In essence, the conflict is caused by the built-in JAXP parser supplied with JDK1.4 and the one you are trying to use for your application. You can still use JDK 1.4 or above, but you'd need to set the parameter java.endorsed.dirs, while installing the application.Read http://java.sun.com/j2se/1.4/docs/guide/standards/index.html for more information. ~Manav. - Original Message - From: Stefán Freyr Stefánsson [EMAIL PROTECTED] To: Tomcat Users List [EMAIL PROTECTED] Sent: Monday, January 13, 2003 5:13 AM Subject: Re: Tomcat Won't start on NT I think you can still use JDK 1.3 but I'd reccommend using 1.4. How you get this to work on JDK 1.3, I'm not sure... you can start by trying to get an XML parser implementation (like Xerces) and either put that somewhere in your classpath or (better yet since I hate the global classpath) put it in your {TOMCAT_HOME}/lib directory. I don't know if it's enough to just put it there but at least it's a starting point. You may need to configure some things but I don't know more about that. I seem to recall reading that you need to remove the jaxp.jar and parser.jar files when you put xerces.jar instead so the classloader doesn't get confused. Go ahead and try that and let us know how it works out. Regards, Stefan. p.s. don't completely delete the jaxp.jar and parser.jar files... just move them somewhere temporarily since I only vaguely remember reading this... this might not even be neccessary at all. On Monday 13 January 2003 12:33, Raj wrote: But can't I use JDK 1.3? Is it absolutely necessary to use 1.4? - Original Message - From: Stefán Freyr Stefánsson [EMAIL PROTECTED] To: Tomcat Users List [EMAIL PROTECTED] Sent: Monday, January 13, 2003 5:51 PM Subject: Re: Tomcat Won't start on NT I imagine that you have a problem with an XML parser definition. If you have JDK 1.4.x installed you might try to run tomcat using that JDK since it has a built in XML implementation. Regards, Stefan. On Monday 13 January 2003 12:03, Raj wrote: Hello Reynir, This is what I get. What could be wrong? C:\Program Files\Apache Group\Tomcat 4.1\bincatalina run Using CATALINA_BASE: .. Using CATALINA_HOME: .. Using CATALINA_TMPDIR: ..\temp Using JAVA_HOME: c:\jdk1.3 Exception during startup processing java.lang.reflect.InvocationTargetException: javax.xml.parsers.FactoryConfigurat ionError: Provider null could not be instantiated: java.lang.NullPointerExceptio n at javax.xml.parsers.SAXParserFactory.newInstance(Unknown Source) at org.apache.commons.digester.Digester.getFactory(Digester.java:511) at org.apache.commons.digester.Digester.getParser(Digester.java:676) at org.apache.commons.digester.Digester.getXMLReader(Digester.java:892) at org.apache.commons.digester.Digester.parse(Digester.java:1495) at org.apache.catalina.startup.Catalina.start(Catalina.java:449) at org.apache.catalina.startup.Catalina.execute(Catalina.java:400) at org.apache.catalina.startup.Catalina.process(Catalina.java:180) at java.lang.reflect.Method.invoke(Native Method) at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:203) C:\Program Files\Apache Group\Tomcat 4.1\bin -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Common problems faced with tomcat configuration
Hi, In the past several months that I have been in the list, I have seen the following problems faced commonly by the users (new or old): 1. Configuring DataSource with tomcat 2. Configuring tomcat to run with apache (using AJP or JK2) I would like to know if there is anything being done to make it easier for the new users to get around these bottlenecks. Also, I am sure there are a number of experienced users on this list who have successfully done the two things above, and I would request them to post the steps for a successful configuration. We can then collaborate and post a better documentation to configure these. Finally, I would also like other users to contribute to this (small) list above, the problems they think have been faced commonly and repititively by tomcat users, so that we can strengthen the documentation for those too. Thanks, Manav. -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
tomcat in production mode
Hi, What are the steps/precautions that should be taken to run tomcat 4.1.x in production on windows (apart from running it as a service, and turning auto-compilation of JSP pages off)? Is there a checklist of standard practices out there? Regards, Manav. -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
setting up classpath for tomcat running as windows NT service
Hi, How to setup classpath for tomcat 4.x running as windows NT service? Apparently, when started, tomcat.exe does not read from catalina.bat (or so i think). Regards, Manav.
Re: tomcat 4.1.12 just stopped working, help !
You said your tomcat stopped working somewhere around christmas. What were the last servlets you deployed and in what contexts? Or is that /examples is the only context that you have? ~manav. - Original Message - From: [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, January 07, 2003 1:18 AM Subject: SV: tomcat 4.1.12 just stopped working, help ! I checked the .../webapps/examples/WEB-INF/web.xml and I checked line 115 as suggested in the log, I found some servlets that I had added and removed these lines just to get Tomcat working again, but it still doesn´t work. So now when I run .../bin/catalina.sh run I get this: [root@star bin]# ./catalina.sh run Using CATALINA_BASE: /etc/jakarta-tomcat-4.1.12 Using CATALINA_HOME: /etc/jakarta-tomcat-4.1.12 Using CATALINA_TMPDIR: /etc/jakarta-tomcat-4.1.12/temp Using JAVA_HOME: /usr/java/j2sdk1.4.1 Jan 7, 2003 10:25:49 AM org.apache.commons.modeler.Registry loadRegistry INFO: Loading registry information Jan 7, 2003 10:25:49 AM org.apache.commons.modeler.Registry getRegistry INFO: Creating new Registry instance Jan 7, 2003 10:25:53 AM org.apache.commons.modeler.Registry getServer INFO: Creating MBeanServer Jan 7, 2003 10:25:58 AM org.apache.coyote.http11.Http11Protocol init INFO: Initializing Coyote HTTP/1.1 on port 8080 Starting service Tomcat-Standalone Apache Tomcat/4.1.12 Jan 7, 2003 10:26:29 AM org.apache.coyote.http11.Http11Protocol start INFO: Starting Coyote HTTP/1.1 on port 8080 Jan 7, 2003 10:26:29 AM org.apache.jk.common.ChannelSocket init INFO: JK2: ajp13 listening on tcp port 8009 Jan 7, 2003 10:26:29 AM org.apache.jk.server.JkMain start INFO: Jk running ID=0 time=6/291 config=/etc/jakarta-tomcat-4.1.12/conf/jk2.properties I still don´t get any answer from port 8080 :(( /Dan -Ursprungligt meddelande- Från: Manavendra Gupta [mailto:[EMAIL PROTECTED]] Skickat: den 7 januari 2003 23:42 Till: Tomcat Users List Ämne: Re: tomcat 4.1.12 just stopped working, help ! As the log suggests, the deployment descriptor of the servlet does not conform to the DTD : The content of element type servlet must match (icon?,servlet-name,display-name?,description?,(servlet-class|jsp-file),ini t-param*,load-on-startup?,run-as?,security-role-ref*). Check the web.xml file for the last few servlets you deployed. The descriptor elements should occur in the same order as mentioned above. ~Manav. - Original Message - From: [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, January 07, 2003 12:44 AM Subject: tomcat 4.1.12 just stopped working, help ! Hi all Some time during christmas Tomcat 4.1.12 stopped working for me, I don´t know why, thought anyone here might have a clue. This is what I know: If I start tomcat with .../bin/startup.sh and then run a portscan I can see: 8009/tcp openajp13 8080/tcp openhttp-proxy So evidently something happens ;) But if I try to access http://my.ip:8080/index.wml (or just http://my.ip:8080) I don´t get any answer at all, it seems totally dead. If I then stop Tomcat (.../bin/shutdown.sh) and run a portscan the services on ports 8009 and 8080 are gone. But if I directly run .../bin/catalina.sh run I get this: (if someone can get any clue from this) [root@star bin]# ./catalina.sh run Using CATALINA_BASE: /etc/jakarta-tomcat-4.1.12 Using CATALINA_HOME: /etc/jakarta-tomcat-4.1.12 Using CATALINA_TMPDIR: /etc/jakarta-tomcat-4.1.12/temp Using JAVA_HOME: /usr/java/j2sdk1.4.1 Jan 7, 2003 9:40:58 AM org.apache.commons.modeler.Registry loadRegistry INFO: Loading registry information Jan 7, 2003 9:40:58 AM org.apache.commons.modeler.Registry getRegistry INFO: Creating new Registry instance Jan 7, 2003 9:41:03 AM org.apache.commons.modeler.Registry getServer INFO: Creating MBeanServer Starting service Tomcat-Standalone Apache Tomcat/4.1.12 Jan 7, 2003 9:47:29 AM org.apache.commons.digester.Digester error SEVERE: Parse Error at line 114 column 15: The content of element type servlet must match (icon?,servlet-name,display-name?,description?,(servlet-class|jsp-file),ini t-param*,load-on-startup?,run-as?,security-role-ref*). org.xml.sax.SAXParseException: The content of element type servlet must match (icon?,servlet-name,display-name?,description?,(servlet-class|jsp-file),ini t-param*,load-on-startup?,run-as?,security-role-ref*). at org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException(ErrorHand lerWrapper.java:232) at org.apache.xerces.util.ErrorHandlerWrapper.error(ErrorHandlerWrapper.java:17 3) at org.apache.xerces.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:36 2) at org.apache.xerces.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:29 6) at org.apache.xerces.impl.dtd.XMLDTDValidator.handleEndElement(XMLDTDValidator. java:1953
Re: DataSource error (DBCP)
tomcat 4.x doesn't like classes in the root directory - place that class into a package and then try again. - Original Message - From: [EMAIL PROTECTED] To: Tomcat Users List [EMAIL PROTECTED] Sent: Monday, December 23, 2002 12:42 AM Subject: Re: DataSource error (DBCP) while executing ... http://195.54.247.110:8080/DBTest/test.jsp getting the error message org.apache.jasper.JasperException: Unable to compile class for JSP An error occurred at line: 6 in the jsp file: /test.jsp Generated servlet error: [javac] Compiling 1 source file /home/sunil/jakarta-tomcat-4.1.18/work/Standalone/localhost/DBTest/test_jsp. java:48: cannot resolve symbol symbol : class DBTest location: class org.apache.jsp.test_jsp DBTest tst = new DBTest(); ^ An error occurred at line: 6 in the jsp file: /test.jsp Generated servlet error: /home/sunil/jakarta-tomcat-4.1.18/work/Standalone/localhost/DBTest/test_jsp. java:48: cannot resolve symbol symbol : class DBTest location: class org.apache.jsp.test_jsp DBTest tst = new DBTest(); ^ 2 errors anyone can help a. on this. b. see the first posting (compile error..) T I A -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
bizarre error
Hi, I have a home-grown framework akin to struts, and a li'l Filter for authorization and authentication. Sometimes, when upon starting tomcat, I get the error listed below. If I refresh the page, everything starts working - and its not necessary that the error will occur on every restart. So what am i missing? In the listing below, following are my own classes/servlets: FrontController - servlet to map user requests to events. ScreenFlowManager - for view selection RTIFilter - the filter for authorization and authentication Thanks for any help. regards, manav java.lang.NullPointerException at org.apache.jsp.partner$jsp._jspService(partner$jsp.java:73) at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:107) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServlet.java:202) at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:382) at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:474) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:679) at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:431) at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:355) at com.bsil.rti.controller.ScreenFlowManager.forwardToNextScreen(ScreenFlowManager.java:43) at com.bsil.rti.controller.FrontController.doProcess(FrontController.java:119) at com.bsil.rti.controller.FrontController.doPost(FrontController.java:98) at javax.servlet.http.HttpServlet.service(HttpServlet.java:760) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193) at com.bsil.rti.filter.RTIFilter.doFilter(RTIFilter.java:60) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:213) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:243) at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:201) at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566) at org.apache.catalina.valves.CertificatesValve.invoke(CertificatesValve.java:246) at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943) at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2344) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:164) at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566) at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:170) at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:170) at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564) at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:462) at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:163) at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943) at org.apache.catalina.connector.http.HttpProcessor.process(HttpProcessor.java:1011) at org.apache.catalina.connector.http.HttpProcessor.run(HttpProcessor.java:1106) at java.lang.Thread.run(Thread.java:536)
slightly OT: tag library for paging
Hi, I apologize for the slightly off-topic post, but is there a tag library available out there for pagination of records fetched from the database? I did google, but didn't find any. thanks, manav.
Re: slightly OT: tag library for paging
Thanks a lot. I see one example here for auto paging long lists - that should help, hopefully. Regards, manav. - Original Message - From: Samuel Cheung [EMAIL PROTECTED] To: 'Tomcat Users List' [EMAIL PROTECTED] Sent: Thursday, December 19, 2002 8:03 AM Subject: RE: slightly OT: tag library for paging Will this work: http://edhill.its.uiowa.edu/display-examples-0.8/ -Original Message- From: Manavendra Gupta [mailto:[EMAIL PROTECTED]] Sent: Thursday, December 19, 2002 11:26 PM To: Tomcat Users List Subject: slightly OT: tag library for paging Hi, I apologize for the slightly off-topic post, but is there a tag library available out there for pagination of records fetched from the database? I did google, but didn't find any. thanks, manav. -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
nulls in tomcat logs
Hi, I had posted a similar message (on the datasource thread) a few days ago, but I guess it was lost in the flurry of I don't understand the objective of this list messages. Below is a snippet of the tomcat 4.1 logs on my NT workstation. Notice there are two null entries... while, both the filter as well as the DataSource work. My tomcat 4.1 setup on RHL 7.3 box shows me the nulls too, but the DataSource doesn't work there (no, I'm not trying to mix two topics together). Anybody got any idea why there is this null entry in the log messages? log-entry XmlMapper: org.apache.catalina.core.StandardContext.setPublicId(-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN) XmlMapper: org.apache.catalina.core.StandardContext.setDisplayName( Real Time Image Billing System) XmlMapper: org.apache.catalina.core.StandardContext.addParameter( webmaster,[EMAIL PROTECTED]) XmlMapper: new null org.apache.catalina.deploy.FilterDef filter FilterDef[filterName=null, filterClass=null] XmlMapper: org.apache.catalina.deploy.FilterMap.setFilterName( RTIFilter) XmlMapper: org.apache.catalina.deploy.FilterMap.setURLPattern( *.do) XmlMapper: Calling org.apache.catalina.core.StandardContext.addFilterMap FilterMap[filterName=RTIFilter, urlPattern=*.do] XmlMapper: pop filter-mapping org.apache.catalina.deploy.FilterMap: FilterMap[filterName=RTIFilter, urlPattern=*.do] XmlMapper: org.apache.catalina.core.StandardContext.addApplicationListener( com.bsil.mx.TomcatTestListener) XmlMapper: new org.apache.catalina.core.StandardWrapperXmlMapper: org.apache.catalina.core.StandardWrapper.setName( FrontController) XmlMapper: org.apache.catalina.core.StandardWrapper.setServletClass( com.bsil.rti.controller.FrontController) XmlMapper: org.apache.catalina.core.StandardWrapper.addInitParameter( mappingPath, /WEB-INF) XmlMapper: org.apache.catalina.core.StandardWrapper.addInitParameter( mappingFile, mappings.xml) XmlMapper: org.apache.catalina.core.StandardWrapper.setLoadOnStartupString( 5) XmlMapper: Calling org.apache.catalina.core.StandardContext.addChild StandardWrapper[FrontController] XmlMapper: pop org.apache.catalina.core.StandardWrapper XmlMapper: org.apache.catalina.core.StandardContext.addServletMapping( *.do, FrontController) XmlMapper: org.apache.catalina.core.StandardContext.setSessionTimeout( 30) XmlMapper: new null org.apache.catalina.deploy.ContextResource resource-ref ContextResource[name=null, scope=Shareable] XmlMapper: org.apache.catalina.deploy.ContextResource.setDescription( Oracle Datasource example) XmlMapper: org.apache.catalina.deploy.ContextResource.setName( jdbc/myoracle) XmlMapper: org.apache.catalina.deploy.ContextResource.setType( javax.sql.DataSource) XmlMapper: org.apache.catalina.deploy.ContextResource.setAuth( Container) XmlMapper: Calling org.apache.catalina.core.StandardContext.addResource ContextResource[name=jdbc/myoracle, description=Oracle Datasource example, type=javax.sql.DataSource, auth=Container, scope=Shareable] XmlMapper: pop resource-ref org.apache.catalina.deploy.ContextResource: ContextResource[name=jdbc/myoracle, description=Oracle Datasource example, type=javax.sql.DataSource, auth=Container, scope=Shareable] /log-entry Regards, manav.
RE: learning filters
I wrote a simple filter for authentication: public void doFilter(ServletRequest request, ServletResponse response, FilterChain next) throws java.io.IOException, javax.servlet.ServletException { // HTTP request and response that we work with. HttpServletRequest httpRequest = (HttpServletRequest) request; HttpServletResponse httpResonse = (HttpServletResponse) response; HttpSession theSession = httpRequest.getSession(); if ( (userid != null password != null) (selectedURL.equals(login.do)) ) { next.doFilter(request, response); } else if ( (theSession.getAttribute(firstname) == null) ) { LoginJSPData loginJSPData = new LoginJSPData(MessageKey.BAD_SESSION); ServletContext context = this.filterConfig.getServletContext(); context.getRequestDispatcher(/badlogin.jsp).forward(request, response); } else next.doFilter(request, response); } // end doFilter 1. Is it a good idea to do so? 2. The filter mapping tag in the web.xml now looks like: a. filter-mapping/*/filter-mapping b. Would this not slow down the application, since in a standalone scenario, all request for images will also go through the filter? Regards Manav. -Original Message- From: Aleksandr Shneyderman [mailto:[EMAIL PROTECTED]] Sent: Thursday, December 12, 2002 12:05 AM To: Tomcat Users List Subject:RE: learning filters there is also a nice article on JavaPro here is the link http://www.fawcette.com/javapro/2002_02/magazine/features/kjones/ -Original Message- From: Subir Sengupta [mailto:[EMAIL PROTECTED]] Sent: Wednesday, December 11, 2002 1:21 PM To: 'Tomcat Users List' Subject: RE: learning filters Filters are covered in the More Servlets book, which is the next edition of the Core Servlets book. -Original Message- From: Price, Erik [mailto:[EMAIL PROTECTED]] Sent: Wednesday, December 11, 2002 9:06 AM To: [EMAIL PROTECTED] Subject: learning filters I have been learning about servlet programming from Core Servlets. I like this book. But, since subscribing to this list, I have seen mention of filters. In a message from Yoav Shapira I was recommended to use filters to validate form data before passing it to a servlet. This seems to me a cleaner means of doing it, as opposed to putting form-validation code in the servlet. However, Core Servlets does not describe how to use filters (that I know of). Is there a reference for this technique somewhere, or is it a generic term for a servlet that intercepts, acts upon, and passes along data ? If it is the latter then I can figure it out from using getDispatcher().forward() etc but if it is a specific technique then where can I learn more? My Tomcat container is v. 4.0.6. Erik -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: oracle+tomcat 4.1.x+dbcp = driverClassName is required!
My server.xml file now looks like this: DefaultContext reloadable=true debug=4 Resource name=jdbc/rtidb auth=CONTAINER type=javax.sql.DataSource/ ResourceParams name=jdbc/rtidb parameter nameuser/name valuerealtime/value /parameter parameter namepassword/name valuerealtime/value /parameter parameter namedriverClassName/name valueoracle.jdbc.driver.OracleDriver/value /parameter parameter namedriverName/name valuejdbc:oracle:thin:@rti:1521:rti/value /parameter parameter namemaxActive/name value20/value /parameter parameter namemaxIdle/name value10/value /parameter parameter namemaxWait/name value-1/value /parameter /ResourceParams /DefaultContext The CLASSPATH is: /usr/local/jdk/lib/tools.jar:/usr/local/jdk/lib/dt.jar:/usr/local/tomcat/web apps/rti/WEB-INF/classes:/usr/local/oracle:/usr/local/oracle:/usr/local/tomc at/lib/naming-factory.jar:/usr/local/tomcat/common/lib/naming-resources.jar: /usr/local/tomcat/common/lib/naming-common.jar:. classes12.zip has been renamed classes12.jar and has been copied in $CATALINA_HOME/common/lib and also in directory /usr/local/oracle Following is what i see in catalina.out: XmlMapper: new null org.apache.catalina.deploy.ContextResource resource-ref ContextResource[name=null, scope=Shareable] XmlMapper: org.apache.catalina.deploy.ContextResource.setDescription( Oracle Datasource example) XmlMapper: org.apache.catalina.deploy.ContextResource.setName( jdbc/rtidb) XmlMapper: org.apache.catalina.deploy.ContextResource.setType( javax.sql.DataSource) XmlMapper: org.apache.catalina.deploy.ContextResource.setAuth( Container) XmlMapper: Calling org.apache.catalina.core.StandardContext.addResource ContextResource[name=jdbc/rtidb, description=Oracle Datasource example, type=javax.sql.DataSource, auth=Container, scope=Shareable] XmlMapper: pop resource-ref org.apache.catalina.deploy.ContextResource: ContextResource[name=jdbc/rtidb, description=Oracle Datasource example, type=javax.sql.DataSource, auth=Container, scope=Shareable] hmm... First of all, whats that null doing up there in line 1? Does anyone else see the same in their logs? What am i doing wrong? Regards, Manav. -Original Message- From: Pedro Salazar [mailto:[EMAIL PROTECTED]] Sent: Monday, December 09, 2002 11:57 PM To: Tomcat Users List Cc: Troy Campano; [EMAIL PROTECTED] Subject: RE: oracle+tomcat 4.1.x+dbcp = driverClassName is required! Greetings, I find a way of put it to work (tested on 4.0.4, 4.1.2). I put the Resource inside a *DefaultContext*. I couldn't put it to work inside a specific context or even through a resourceLink to a global resource. Now, I don't know why is that happens! I'm deploying in war file, and apparently my context element I put in server.xml isn't mapping resources right: context docBase=ngincare.war debug=0 reloadable=true path=ngincare {Resource+ResourceParam|ResourceLink} /context If you could explain this, it would be just fine! For now I'll use the DefaultContext... thanks, Pedro Salazar On Mon, 2002-12-09 at 16:09, Manavendra Gupta wrote: Hi Pedro, Welcome to the club - there are a number of ppl facing the exact same problem, but are unable to find answer. Do let me know what you did if you find a solution. Manav. -Original Message- From: Pedro Salazar [mailto:[EMAIL PROTECTED]] Sent: Monday, December 09, 2002 9:12 PM To: Tomcat Users List Subject: RE: oracle+tomcat 4.1.x+dbcp = driverClassName is required! Greetings, Eric, I'm getting a javax.naming.NameNotFoundException: Name jdbc is not bound in this Context exception! I have a resource link inside my context (no resource here or resource-ref in web.xml): resourceLink name=jdbc/ngincaredb global=jdbc/ngincaredb_global type=javax.sql.DataSource / and I'm doing a lookup in my code for jdbc/ngincaredb: Context initCtx = new InitialContext(); Context envCtx = (Context)initCtx.lookup(java:comp/env); this.ds = (DataSource)envCtx.lookup(/jdbc/ngincaredb); So, what's wrong here? thanks, Pedro Salazar. On Mon, 2002-12-09 at 13:06, Roberts, Eric wrote: Pedro, You need javax.sql - that is the package containing DataSource. Your Resource type should be: type=javax.sql.DataSource You need these parameters in addition to url, username and password: parameter namedriverClassName/name valueoracle.jdbc.driver.OracleDriver/value /parameter parameter namefactory/name valueorg.apache.commons.dbcp.BasicDataSourceFactory/value /parameter In the Context
slight OT: RequestInterceptor
Hi, This probably is slightly off-topic, but I would like to know: 1. How to implement a RequestInterceptor? Is there some sample code available? 2. Is it a good idea to implement one for managing sessions? Thanks, Manav. -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Valve [was slight OT: RequestInterceptor]
Hunting around on the web I found an interesting document comparing the approaches used in tomcat 3.2 and 4.0, comparing RequestInterceptor used in the former with the Valve used in the latter. The page can be located at: http://218.223.25.90:8080/docs/filters.htm Has anyone worked with Valves before and would share some docs/code? Or do i need to look into the tomcat-dev list? :-) Manav. -Original Message- From: Manavendra Gupta [mailto:[EMAIL PROTECTED]] Sent: Tuesday, December 10, 2002 5:04 PM To: Tomcat Users List Subject: slight OT: RequestInterceptor Hi, This probably is slightly off-topic, but I would like to know: 1. How to implement a RequestInterceptor? Is there some sample code available? 2. Is it a good idea to implement one for managing sessions? Thanks, Manav. -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: Enough please!
-Original Message- From: Roberts, Eric [mailto:[EMAIL PROTECTED]] Sent: Tuesday, December 10, 2002 7:35 PM To: Tomcat Users List Subject: Enough please! have been attempting to help people with database pooling (mine works :-)) for the last few days, but I have had to spend far too much time deleting the hundred or so reponses to this thread. some ppl are lucky :-s -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: Enough please!
i agree! and if i don't get any replies for my posts, i can be the next one to spam and resend all my emails :-) woohoo! -Original Message- From: Caton, Paul [mailto:[EMAIL PROTECTED]] Sent: Tuesday, December 10, 2002 7:41 PM To: Tomcat Users List Subject: RE: Enough please! I agree. As hard as it is to restrain from responding to flamebait and as tempting as it is to have the last word, I think this thread needs to die now. Paul Caton. -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: Connection Pooling Help
I am surprised with the number of ppl facing this problem, including myself. And it makes me wonder how others on this list have been able to use DataSource/Connection Pooling with tomcat. It seems to be one feature where majority of ppl have been facing problems, yet there is not much of information on this (including the JNDI HOW-TO). It would be interesting to hear from someone who had faced and subsequently resolved this problem. Manav. -Original Message- From: Hari Venkatesan [mailto:[EMAIL PROTECTED]] Sent: Monday, December 09, 2002 7:27 PM To: Tomcat Users List Subject: RE: Connection Pooling Help Try changing the following parameter value in server.xml file valuejdbc:as400://10.0.0.1/value valuejdbc:as400://{name of your machine} /value instead of the ip address of the as400 Hari -Original Message- From: Kevin Passey [mailto:[EMAIL PROTECTED]] Sent: Monday, December 09, 2002 8:40 AM To: 'Tomcat Users List' Subject: RE: Connection Pooling Help Eric, It's the same - DS == null. :-( Thanks anyway. Kevin -Original Message- From: Roberts, Eric [mailto:[EMAIL PROTECTED]] Sent: 09 December 2002 13:33 To: Tomcat Users List Subject: RE: Connection Pooling Help Kevin, Try: Context ctx = new InitialContext(); Context envCtx = (Context) ctx.lookup(java:/comp/env/); DataSource ds = (DataSource) envCtx.lookup(/jdbc/shiltonDB); -Original Message- From: Kevin Passey [mailto:[EMAIL PROTECTED]] Sent: Montag, 09. Dezember 2002 14:25 To: Tomcat Users List (E-mail) Subject: Connection Pooling Help Hi, Can somebody point out my mistake for me - I'm starting to bang my head.. I am trying to get connection pooling working on my AS/400 using the Commons-DBCP. I have placed this JAR in TOMCAT_HOME/common/lib along with the JT400.JAR I have added the context entries to my server.xml file - thus:- !-- AS400 Connection Pooling Test -- Context path=/shilton docBase=shilton debug=5 reloadable=true crossContext=true Resource name=jdbc/shiltonDB auth=Container type=javax.sql.DataSource / ResourceParams name=jdbc/shiltonDB parameter namefactory/name valueorg.apache.commons.dbcp.BasicDataSourceFactory/value /parameter parameter namemaxActive/name value100/value /parameter parameter namemaxIdle/name value3/value /parameter parameter namemaxWait/name value100/value /parameter parameter nameusername/name valueINTERNET/value /parameter parameter namepassword/name valueINTERNET/value /parameter parameter namedriverClassName/name valuecom.ibm.as400.access.AS400JDBCDriver/value /parameter parameter nameurl/name valuejdbc:as400://10.0.0.1/value /parameter /ResourceParams /Context I have added this to my WEB-INF web.xml file:- resource-ref description Resource reference to a factory for java.sql.Connection instances that may be used for talking to a particular database that is configured in the server.xml file. /description res-ref-name jdbc/shiltonDB /res-ref-name res-type javax.sql.DataSource /res-type res-auth Container /res-auth /resource-ref And I have this java program to test the connection import javax.naming.*; import javax.sql.*; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import javax.servlet.ServletOutputStream; import java.sql.*; public class DBCPServlet extends HttpServlet { public void doGet(HttpServletRequest req, HttpServletResponse res) { try { ServletOutputStream out = res.getOutputStream(); out.println(htmlbody); out.println(h2Using Tomcat Connection Pooling with DBCP/h2); Context ctx = new InitialContext(); if (ctx == null) out.println(Something is wrong with Tomcat); DataSource ds = (DataSource) ctx.lookup(java:comp/env/jdbc/shiltonDB); if (ds != null) { Connection conn = ds.getConnection(); if (conn != null) { out.println(bGot Connection:/b + conn.toString() + p); Statement stmt = conn.createStatement(); String sql = select * from BSSTYL;
RE: Connection Pooling Help
Thanks for the reply. How do i make it a global resource? Just declare the resource in the global section? -Original Message- From: Bodycombe, Andrew [mailto:[EMAIL PROTECTED]] Sent: Monday, December 09, 2002 8:09 PM To: '[EMAIL PROTECTED]' Subject: RE: Connection Pooling Help I've not done it myself in tomcat, only in EJB containers, but as a starting point, I would suggest trying to get it to work by setting the connection pool as a global resource instead of a resource specific to your context. Then try and get your context-specific connection pool working. I too am surprised by the number of people facing this problem. Andy. -Original Message- From: Manavendra Gupta To: Tomcat Users List Sent: 09/12/2002 14:14 Subject: RE: Connection Pooling Help I am surprised with the number of ppl facing this problem, including myself. And it makes me wonder how others on this list have been able to use DataSource/Connection Pooling with tomcat. It seems to be one feature where majority of ppl have been facing problems, yet there is not much of information on this (including the JNDI HOW-TO). It would be interesting to hear from someone who had faced and subsequently resolved this problem. Manav. -Original Message- From: Hari Venkatesan [mailto:[EMAIL PROTECTED]] Sent: Monday, December 09, 2002 7:27 PM To: Tomcat Users List Subject: RE: Connection Pooling Help Try changing the following parameter value in server.xml file valuejdbc:as400://10.0.0.1/value valuejdbc:as400://{name of your machine} /value instead of the ip address of the as400 Hari -Original Message- From: Kevin Passey [mailto:[EMAIL PROTECTED]] Sent: Monday, December 09, 2002 8:40 AM To: 'Tomcat Users List' Subject: RE: Connection Pooling Help Eric, It's the same - DS == null. :-( Thanks anyway. Kevin -Original Message- From: Roberts, Eric [mailto:[EMAIL PROTECTED]] Sent: 09 December 2002 13:33 To: Tomcat Users List Subject: RE: Connection Pooling Help Kevin, Try: Context ctx = new InitialContext(); Context envCtx = (Context) ctx.lookup(java:/comp/env/); DataSource ds = (DataSource) envCtx.lookup(/jdbc/shiltonDB); -Original Message- From: Kevin Passey [mailto:[EMAIL PROTECTED]] Sent: Montag, 09. Dezember 2002 14:25 To: Tomcat Users List (E-mail) Subject: Connection Pooling Help Hi, Can somebody point out my mistake for me - I'm starting to bang my head.. I am trying to get connection pooling working on my AS/400 using the Commons-DBCP. I have placed this JAR in TOMCAT_HOME/common/lib along with the JT400.JAR I have added the context entries to my server.xml file - thus:- !-- AS400 Connection Pooling Test -- Context path=/shilton docBase=shilton debug=5 reloadable=true crossContext=true Resource name=jdbc/shiltonDB auth=Container type=javax.sql.DataSource / ResourceParams name=jdbc/shiltonDB parameter namefactory/name valueorg.apache.commons.dbcp.BasicDataSourceFactory/value /parameter parameter namemaxActive/name value100/value /parameter parameter namemaxIdle/name value3/value /parameter parameter namemaxWait/name value100/value /parameter parameter nameusername/name valueINTERNET/value /parameter parameter namepassword/name valueINTERNET/value /parameter parameter namedriverClassName/name valuecom.ibm.as400.access.AS400JDBCDriver/value /parameter parameter nameurl/name valuejdbc:as400://10.0.0.1/value /parameter /ResourceParams /Context I have added this to my WEB-INF web.xml file:- resource-ref description Resource reference to a factory for java.sql.Connection instances that may be used for talking to a particular database that is configured in the server.xml file. /description res-ref-name jdbc/shiltonDB /res-ref-name res-type javax.sql.DataSource /res-type res-auth Container /res-auth /resource-ref And I have this java program to test the connection import javax.naming.*; import javax.sql.*; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import javax.servlet.ServletOutputStream; import java.sql.*; public class DBCPServlet
RE: Connection Pooling Help
No, i am not using apache - its a standalone version of tomcat. To be honest, I find it rather awkward to be worried about the mod_jk versions, or whether i have a paricular module installed or using a particular connector, etc. With a tool being into such a wide use, I'm sure there are people who have done this before, but somehow, either I am missing something significant, or maybe others went through the same ordeal and have been unable to reproduce what they did, or maybe its just dumb hard luck! -Original Message- From: Roberto Bouza [mailto:[EMAIL PROTECTED]] Sent: Monday, December 09, 2002 8:19 PM To: Tomcat Users List; [EMAIL PROTECTED] Subject: RE: Connection Pooling Help The main problem if you are using apache or not, is the connector. I don't know if you are using apache but if you are using apache with tomcat DON'T USE the WebApp connector, is not maintained anymore and does not work correctly with apache 1.*, 2.*. USE mod_jk2 it works fine with the pool connection. I had the same problem a few days ago and I resolve the problem changing connectors. I hope this help. Quoting Manavendra Gupta [EMAIL PROTECTED]: I am surprised with the number of ppl facing this problem, including myself. And it makes me wonder how others on this list have been able to use DataSource/Connection Pooling with tomcat. It seems to be one feature where majority of ppl have been facing problems, yet there is not much of information on this (including the JNDI HOW-TO). It would be interesting to hear from someone who had faced and subsequently resolved this problem. Manav. -Original Message- From: Hari Venkatesan [mailto:[EMAIL PROTECTED]] Sent: Monday, December 09, 2002 7:27 PM To: Tomcat Users List Subject: RE: Connection Pooling Help Try changing the following parameter value in server.xml file valuejdbc:as400://10.0.0.1/value valuejdbc:as400://{name of your machine} /value instead of the ip address of the as400 Hari -Original Message- From: Kevin Passey [mailto:[EMAIL PROTECTED]] Sent: Monday, December 09, 2002 8:40 AM To: 'Tomcat Users List' Subject: RE: Connection Pooling Help Eric, It's the same - DS == null. :-( Thanks anyway. Kevin -Original Message- From: Roberts, Eric [mailto:[EMAIL PROTECTED]] Sent: 09 December 2002 13:33 To: Tomcat Users List Subject: RE: Connection Pooling Help Kevin, Try: Context ctx = new InitialContext(); Context envCtx = (Context) ctx.lookup(java:/comp/env/); DataSource ds = (DataSource) envCtx.lookup(/jdbc/shiltonDB); -Original Message- From: Kevin Passey [mailto:[EMAIL PROTECTED]] Sent: Montag, 09. Dezember 2002 14:25 To: Tomcat Users List (E-mail) Subject: Connection Pooling Help Hi, Can somebody point out my mistake for me - I'm starting to bang my head.. I am trying to get connection pooling working on my AS/400 using the Commons-DBCP. I have placed this JAR in TOMCAT_HOME/common/lib along with the JT400.JAR I have added the context entries to my server.xml file - thus:- !-- AS400 Connection Pooling Test -- Context path=/shilton docBase=shilton debug=5 reloadable=true crossContext=true Resource name=jdbc/shiltonDB auth=Container type=javax.sql.DataSource / ResourceParams name=jdbc/shiltonDB parameter namefactory/name valueorg.apache.commons.dbcp.BasicDataSourceFactory/value /parameter parameter namemaxActive/name value100/value /parameter parameter namemaxIdle/name value3/value /parameter parameter namemaxWait/name value100/value /parameter parameter nameusername/name valueINTERNET/value /parameter parameter namepassword/name valueINTERNET/value /parameter parameter namedriverClassName/name valuecom.ibm.as400.access.AS400JDBCDriver/value /parameter parameter nameurl/name valuejdbc:as400://10.0.0.1/value /parameter /ResourceParams /Context I have added this to my WEB-INF web.xml file:- resource-ref description Resource reference to a factory for java.sql.Connection instances that may be used for talking to a particular database that is configured in the server.xml file. /description res-ref-name jdbc/shiltonDB /res-ref
RE: oracle+tomcat 4.1.x+dbcp = driverClassName is required!
Hi Pedro, Welcome to the club - there are a number of ppl facing the exact same problem, but are unable to find answer. Do let me know what you did if you find a solution. Manav. -Original Message- From: Pedro Salazar [mailto:[EMAIL PROTECTED]] Sent: Monday, December 09, 2002 9:12 PM To: Tomcat Users List Subject: RE: oracle+tomcat 4.1.x+dbcp = driverClassName is required! Greetings, Eric, I'm getting a javax.naming.NameNotFoundException: Name jdbc is not bound in this Context exception! I have a resource link inside my context (no resource here or resource-ref in web.xml): resourceLink name=jdbc/ngincaredb global=jdbc/ngincaredb_global type=javax.sql.DataSource / and I'm doing a lookup in my code for jdbc/ngincaredb: Context initCtx = new InitialContext(); Context envCtx = (Context)initCtx.lookup(java:comp/env); this.ds = (DataSource)envCtx.lookup(/jdbc/ngincaredb); So, what's wrong here? thanks, Pedro Salazar. On Mon, 2002-12-09 at 13:06, Roberts, Eric wrote: Pedro, You need javax.sql - that is the package containing DataSource. Your Resource type should be: type=javax.sql.DataSource You need these parameters in addition to url, username and password: parameter namedriverClassName/name valueoracle.jdbc.driver.OracleDriver/value /parameter parameter namefactory/name valueorg.apache.commons.dbcp.BasicDataSourceFactory/value /parameter In the Context the ResourceLink type should be: type=javax.sql.DataSource You do not need any resource-ref in your web.xml - just use your ResourceLink name as follows: Context ctx = new InitialContext(); Context envCtx = (Context) ctx.lookup(java:/comp/env/); DataSource ds = (DataSource) envCtx.lookup(/{name_of_resource_link}); if (ds != null) { DbCon = ds.getConnection(); } Hope this helps. -- pedro salazar (pt-inovacao) [EMAIL PROTECTED] key id: D803BC61 -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: Tomcat 4.1, DBCP and Oracle
Oracle has changed the driver class for version 1.1x to 1.2. In 1.1x it was oracle.jdbc.driver.OracleDriver while in 1.2 is oracle.jdbc.OracleDriver - so use the driver depending upon the version you are using (you can unjar/unzip and you'd find what class you really have). Regards, Manav. -Original Message- From: Campano, Troy [mailto:[EMAIL PROTECTED]] Sent: Monday, December 09, 2002 9:52 PM To: Tomcat Users List Subject: RE: Tomcat 4.1, DBCP and Oracle Hi Thomas... What version of Tomcat are you using? Are you using classes12.jar (zip)? thanks! ~ t r o y ~ -Original Message- From: Thomas Achleitner [mailto:[EMAIL PROTECTED]] Sent: Monday, December 09, 2002 11:15 AM To: Tomcat Users List Subject: RE: Tomcat 4.1, DBCP and Oracle hi troy! You can take oracle.jdbc.OracleDriver as well (the oracle forum told me that oracle.jdbc.driver.OracleDriver is only kept for backwards compatibility). If I remove following parameters then it works fine with my application: parameter namemaxLimit/name value10/value /parameter parameter nameminLimit/name value5/value /parameter parameter namecacheScheme/name value1/value /parameter I think you should have a look at the docu for those parameters. I just have no idea why they don't work. The parameter user should be changed to userName as well (casesensitive). thomas -Original Message- From: Campano, Troy [mailto:[EMAIL PROTECTED]] Sent: Monday, December 09, 2002 4:53 PM To: Tomcat Users List Subject: RE: Tomcat 4.1, DBCP and Oracle Hello Thomas, I take it you mean oracle.jdbc.driver.OracleDriver. I added it, bounced the server, and still the same dreadful error: java.sql.SQLException: Cannot load JDBC driver class 'null' thank you for your help though! ~ t r o y ~ -Original Message- From: Thomas Achleitner [mailto:[EMAIL PROTECTED]] Sent: Monday, December 09, 2002 10:44 AM To: Tomcat Users List Subject: RE: Tomcat 4.1, DBCP and Oracle Hi! I think paraemter driverClassName is missing. Try: parameternamedriverClassName/namevalueoracle.jdbc.OracleDriver/valu e/parameter hope this helps! thomas -Original Message- From: Campano, Troy [mailto:[EMAIL PROTECTED]] Sent: Monday, December 09, 2002 4:36 PM To: Balzarotti Paolo; Tomcat Users List Subject: RE: Tomcat 4.1, DBCP and Oracle Nope...no luck. Same error: java.sql.SQLException: Cannot load JDBC driver class 'null' My server.xml looks like this now: Context path=/inventoryServer docBase=inventoryServer debug=5 reloadable=false crossContext=false Resource name=jdbc/inventoryPool type=oracle.jdbc.pool.OracleConnectionCacheImpl/ ResourceParams name=jdbc/inventoryPool parameter namefactory/name valueoracle.jdbc.pool.OracleDataSourceFactory/value /parameter parameter nameurl/name valuejdbc:oracle:thin:@myNode:1521:myIstance/value /parameter parameter nameuser/name valuemyUser/value /parameter parameter namepassword/name valuemyPass/value /parameter parameter namemaxLimit/name value10/value /parameter parameter nameminLimit/name value5/value /parameter parameter namecacheScheme/name value1/value /parameter /ResourceParams /Context Any ideas? ~ t r o y ~ -Original Message- From: Balzarotti Paolo [mailto:[EMAIL PROTECTED]] Sent: Monday, December 09, 2002 10:11 AM To: Campano, Troy Subject: R: Tomcat 4.1, DBCP and Oracle No, they suggest to use an oracle.jdbc.pool.OracleConnectionCacheImpl and an oracle.jdbc.pool.OracleDataSourceFactory look in chapter 5 It's an old post, I don't know its validity 8-? - Oracle JDBC DataSource Example This example shows how to configure Tomcat to use Oracle's JDBC connection cache data source. First ensure the Oracle JDBC driver is installed correctly. The Oracle drivers can typically be located in the $ORACLE_HOME/jdbc/lib directory: The Oracle JDBC driver must be added to the $CATALINA_HOME/common/lib directory, so that it can be loaded as a JNDI Resource. Ensure the driver file(s) has a .jar extension, so that it can be automatically loaded by Tomcat's class loader. Add a Tomcat Resource and ResourceParams element to the web application's Context in the $CATALINA_HOME/conf/server.xml file: Context ... ... Resource name=jdbc/EmployeeDB type=oracle.jdbc.pool.OracleConnectionCacheImpl/ ResourceParams name=jdbc/EmployeeDB parameter namefactory/name valueoracle.jdbc.pool.OracleDataSourceFactory/value /parameter parameter nameurl/name valuejdbc:oracle:thin:@localhost:1521:EmployeeDB/value /parameter parameter nameuser/name valuedbusername/value /parameter parameter namepassword/name valuedbpassword/value /parameter parameter namemaxLimit/name value10/value /parameter parameter nameminLimit/name value5/value /parameter parameter namecacheScheme/name value1/value
RE: Tomcat 4.1, DBCP and Oracle
I had faced a similar situation, but wasn't sure why it was working on windoze! -Original Message- From: Campano, Troy [mailto:[EMAIL PROTECTED]] Sent: Monday, December 09, 2002 11:15 PM To: Tomcat Users List Subject: RE: Tomcat 4.1, DBCP and Oracle Ok...now the problem is stranger. I am running this on RedHat Linux. So I downloaded Tomcat 4.1.12 for Windows (the ZIP file). I set up Tomcat and the environment variables, and I configured my web app and Data Source stuff the same way...and it works! So I'm wondering why I get this error on Linux: java.sql.SQLException: Cannot load JDBC driver class 'null' Can I copy my tomcat instance on my Windows machine over to Linux? Will it run? I'm thinking that might help out find the source of this problem. thank you! -Original Message- From: Thomas Achleitner [mailto:[EMAIL PROTECTED]] Sent: Monday, December 09, 2002 11:38 AM To: Tomcat Users List Subject: RE: Tomcat 4.1, DBCP and Oracle Here are the relevant snapshots of the code (classes12.jar in common/lib): server.xml: Resource name=jdbc/OracleDS auth=Container type=oracle.jdbc.pool.OracleConnectionCacheImpl/ ResourceParams name=jdbc/OracleDS parameternamefactory/namevalueoracle.jdbc.pool.OracleDataSourceFacto ry/value/parameter parameternameuserName/namevaluescott/value/parameter parameternamepassword/namevaluetiger/value/parameter parameternamedriverClassName/namevalueoracle.jdbc.OracleDriver/valu e/parameter parameternameurl/namevaluejdbc:oracle:thin:@testdb:1525:ORA5/value /parameter /ResourceParams web.xml: resource-ref descriptionResource reference to a factory for java.sql.Connection instances that may be used for talking to a particular database that is configured in the server.xml file./description res-ref-namejdbc/OracleDS/res-ref-name res-typejavax.sql.DataSource/res-type res-authContainer/res-auth /resource-ref Source code that obtains connection: initCtx = new InitialContext(); envCtx = (Context) initCtx.lookup(java:comp/env); dataSource = (DataSource) envCtx.lookup(jdbc/OracleDS); con = dataSource.getConnection(); hope that helps ! thomas -Original Message- From: Campano, Troy [mailto:[EMAIL PROTECTED]] Sent: Monday, December 09, 2002 5:26 PM To: Tomcat Users List Subject: RE: Tomcat 4.1, DBCP and Oracle Woa... Could you send me a copy of your server.xml, web.xml, and how you create the connection in your Servlet/JSP? That would be greatly appreciated. thank you very much! ~ t r o y ~ -Original Message- From: Thomas Achleitner [mailto:[EMAIL PROTECTED]] Sent: Monday, December 09, 2002 11:24 AM To: Tomcat Users List Subject: RE: Tomcat 4.1, DBCP and Oracle hi! tomcat 4.1.12 classes12.jar thomas -Original Message- From: Campano, Troy [mailto:[EMAIL PROTECTED]] Sent: Monday, December 09, 2002 5:22 PM To: Tomcat Users List Subject: RE: Tomcat 4.1, DBCP and Oracle Hi Thomas... What version of Tomcat are you using? Are you using classes12.jar (zip)? thanks! ~ t r o y ~ -Original Message- From: Thomas Achleitner [mailto:[EMAIL PROTECTED]] Sent: Monday, December 09, 2002 11:15 AM To: Tomcat Users List Subject: RE: Tomcat 4.1, DBCP and Oracle hi troy! You can take oracle.jdbc.OracleDriver as well (the oracle forum told me that oracle.jdbc.driver.OracleDriver is only kept for backwards compatibility). If I remove following parameters then it works fine with my application: parameter namemaxLimit/name value10/value /parameter parameter nameminLimit/name value5/value /parameter parameter namecacheScheme/name value1/value /parameter I think you should have a look at the docu for those parameters. I just have no idea why they don't work. The parameter user should be changed to userName as well (casesensitive). thomas -Original Message- From: Campano, Troy [mailto:[EMAIL PROTECTED]] Sent: Monday, December 09, 2002 4:53 PM To: Tomcat Users List Subject: RE: Tomcat 4.1, DBCP and Oracle Hello Thomas, I take it you mean oracle.jdbc.driver.OracleDriver. I added it, bounced the server, and still the same dreadful error: java.sql.SQLException: Cannot load JDBC driver class 'null' thank you for your help though! ~ t r o y ~ -Original Message- From: Thomas Achleitner [mailto:[EMAIL PROTECTED]] Sent: Monday, December 09, 2002 10:44 AM To: Tomcat Users List Subject: RE: Tomcat 4.1, DBCP and Oracle Hi! I think paraemter driverClassName is missing. Try: parameternamedriverClassName/namevalueoracle.jdbc.OracleDriver/valu e/parameter hope this helps! thomas -Original Message- From: Campano, Troy [mailto:[EMAIL PROTECTED]] Sent: Monday, December 09, 2002 4:36 PM To: Balzarotti Paolo; Tomcat Users List Subject: RE: Tomcat 4.1, DBCP and Oracle Nope...no luck. Same error: java.sql.SQLException: Cannot load JDBC driver class 'null' My server.xml looks like this now: Context path=/inventoryServer docBase=inventoryServer debug=5
RE: Tomcat 4.1, DBCP and Oracle
If you change the debug level of the root application to 4, tomcat shows following in the thread dump (on windows): XmlMapper: pop resource-ref org.apache.catalina.deploy.ContextResource: ContextResource name=jdbc/myoracle, description=Oracle Datasource example, type=javax.sql.DataSource, auth=Container, scope=Shareable] No such message on linux though. -Original Message- From: Manavendra Gupta [mailto:[EMAIL PROTECTED]] Sent: Tuesday, December 10, 2002 10:30 AM To: Tomcat Users List Subject: RE: Tomcat 4.1, DBCP and Oracle I had faced a similar situation, but wasn't sure why it was working on windoze! -Original Message- From: Campano, Troy [mailto:[EMAIL PROTECTED]] Sent: Monday, December 09, 2002 11:15 PM To: Tomcat Users List Subject: RE: Tomcat 4.1, DBCP and Oracle Ok...now the problem is stranger. I am running this on RedHat Linux. So I downloaded Tomcat 4.1.12 for Windows (the ZIP file). I set up Tomcat and the environment variables, and I configured my web app and Data Source stuff the same way...and it works! So I'm wondering why I get this error on Linux: java.sql.SQLException: Cannot load JDBC driver class 'null' Can I copy my tomcat instance on my Windows machine over to Linux? Will it run? I'm thinking that might help out find the source of this problem. thank you! -Original Message- From: Thomas Achleitner [mailto:[EMAIL PROTECTED]] Sent: Monday, December 09, 2002 11:38 AM To: Tomcat Users List Subject: RE: Tomcat 4.1, DBCP and Oracle Here are the relevant snapshots of the code (classes12.jar in common/lib): server.xml: Resource name=jdbc/OracleDS auth=Container type=oracle.jdbc.pool.OracleConnectionCacheImpl/ ResourceParams name=jdbc/OracleDS parameternamefactory/namevalueoracle.jdbc.pool.OracleDataSourceFacto ry/value/parameter parameternameuserName/namevaluescott/value/parameter parameternamepassword/namevaluetiger/value/parameter parameternamedriverClassName/namevalueoracle.jdbc.OracleDriver/valu e/parameter parameternameurl/namevaluejdbc:oracle:thin:@testdb:1525:ORA5/value /parameter /ResourceParams web.xml: resource-ref descriptionResource reference to a factory for java.sql.Connection instances that may be used for talking to a particular database that is configured in the server.xml file./description res-ref-namejdbc/OracleDS/res-ref-name res-typejavax.sql.DataSource/res-type res-authContainer/res-auth /resource-ref Source code that obtains connection: initCtx = new InitialContext(); envCtx = (Context) initCtx.lookup(java:comp/env); dataSource = (DataSource) envCtx.lookup(jdbc/OracleDS); con = dataSource.getConnection(); hope that helps ! thomas -Original Message- From: Campano, Troy [mailto:[EMAIL PROTECTED]] Sent: Monday, December 09, 2002 5:26 PM To: Tomcat Users List Subject: RE: Tomcat 4.1, DBCP and Oracle Woa... Could you send me a copy of your server.xml, web.xml, and how you create the connection in your Servlet/JSP? That would be greatly appreciated. thank you very much! ~ t r o y ~ -Original Message- From: Thomas Achleitner [mailto:[EMAIL PROTECTED]] Sent: Monday, December 09, 2002 11:24 AM To: Tomcat Users List Subject: RE: Tomcat 4.1, DBCP and Oracle hi! tomcat 4.1.12 classes12.jar thomas -Original Message- From: Campano, Troy [mailto:[EMAIL PROTECTED]] Sent: Monday, December 09, 2002 5:22 PM To: Tomcat Users List Subject: RE: Tomcat 4.1, DBCP and Oracle Hi Thomas... What version of Tomcat are you using? Are you using classes12.jar (zip)? thanks! ~ t r o y ~ -Original Message- From: Thomas Achleitner [mailto:[EMAIL PROTECTED]] Sent: Monday, December 09, 2002 11:15 AM To: Tomcat Users List Subject: RE: Tomcat 4.1, DBCP and Oracle hi troy! You can take oracle.jdbc.OracleDriver as well (the oracle forum told me that oracle.jdbc.driver.OracleDriver is only kept for backwards compatibility). If I remove following parameters then it works fine with my application: parameter namemaxLimit/name value10/value /parameter parameter nameminLimit/name value5/value /parameter parameter namecacheScheme/name value1/value /parameter I think you should have a look at the docu for those parameters. I just have no idea why they don't work. The parameter user should be changed to userName as well (casesensitive). thomas -Original Message- From: Campano, Troy [mailto:[EMAIL PROTECTED]] Sent: Monday, December 09, 2002 4:53 PM To: Tomcat Users List Subject: RE: Tomcat 4.1, DBCP and Oracle Hello Thomas, I take it you mean oracle.jdbc.driver.OracleDriver. I added it, bounced the server, and still the same dreadful error: java.sql.SQLException: Cannot load JDBC driver class 'null' thank you for your help though! ~ t r o y ~ -Original Message- From: Thomas Achleitner [mailto:[EMAIL PROTECTED]] Sent: Monday, December 09, 2002 10:44 AM To: Tomcat Users List Subject: RE: Tomcat 4.1, DBCP and Oracle Hi! I
newbie: Realm
Hi, Like all web applications, I need to provide some kind of session maintenance. Would the concept of a Realm help in this? 1. Is this the correct application/use of a realm? 2. Is a realm akin to a SSO/LDAP server, where the user's roles and mapping to actions is stored? 3. How extensible is a realm? Can someone provide a step-by-step example of how to setup and use a realm? Manav. -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
(apparent) tomcat configuration problem
Hi, tomcat 4.1 starts succesfully, but on shutdown gives the following error: Uing CATALINA_TMPDIR: /usr/local/tomcat/temp Using JAVA_HOME: /usr/local/jdk PARSE error at line 1 column -1 of /usr/local/tomcat/conf/server.xml org.xml.sax.SAXParseException: Document root element is missing. Catalina.stop: org.xml.sax.SAXParseException: Document root element is missing. org.xml.sax.SAXParseException: Document root element is missing. at org.apache.crimson.parser.Parser2.fatal(Parser2.java:3182) at org.apache.crimson.parser.Parser2.fatal(Parser2.java:3170) at org.apache.crimson.parser.Parser2.parseInternal(Parser2.java:501) at org.apache.crimson.parser.Parser2.parse(Parser2.java:305) at org.apache.crimson.parser.XMLReaderImpl.parse(XMLReaderImpl.java:442) at org.xml.sax.helpers.XMLReaderAdapter.parse(XMLReaderAdapter.java:223) at javax.xml.parsers.SAXParser.parse(SAXParser.java:314) at javax.xml.parsers.SAXParser.parse(SAXParser.java:253) at org.apache.catalina.util.xml.XmlMapper.readXml(XmlMapper.java:228) at org.apache.catalina.startup.Catalina.stop(Catalina.java:822) at org.apache.catalina.startup.Catalina.execute(Catalina.java:683) at org.apache.catalina.startup.Catalina.process(Catalina.java:179) 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:324) at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:243) -- Any clues? Manav. -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
DataSource problem.
Hi, I am trying to obtain a connection from a DataSource in a test class and get the following error: javax.naming.NoInitialContextException: Need to specify class name in environment or system property, or as an applet parameter, or in an application resource file: java.naming.factory.initial at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:640) at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:243) at javax.naming.InitialContext.getURLOrDefaultInitCtx(InitialContext.java:280) at javax.naming.InitialContext.lookup(InitialContext.java:347) at tmp.DBTest.init(DBTest.java:15) at tmp.DBTest.main(DBTest.java:49) server.xml == Context path=/rti docBase=rti debug=4 reloadable=true Logger className=org.apache.catalina.logger.FileLogger prefix=rti_log. suffix=.txt timestamp=true/ Resource name=jdbc/rtidb auth=CONTAINER type=javax.sql.DataSource/ ResourceParams name=jdbc/rtidb parameternameuser/namevaluerealtime/value/parameter parameternamepassword/namevaluerealtime/value/parameter parameternamedriverClassName/name valueoracle.jdbc.driver.OracleDriver/value/parameter parameternamedriverName/name valuejdbc:oracle:thin:@rti:1521:rti/value/parameter /ResourceParams /Context web.xml (for the context rti) == resource-ref descriptionOracle Datasource example/description res-ref-namejdbc/rtidb/res-ref-name res-typejavax.sql.DataSource/res-type res-authContainer/res-auth /resource-ref Any idea? Thanks, Manav. -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: DataSource problem.
Tried the same with a simplistic jsp page: %@ page import=java.sql.*, javax.sql.*, javax.naming.* % HTML BODY % out.println(hello); Context initCtx = new InitialContext(); Context envCtx = (Context) initCtx.lookup(java:comp/env); DataSource ds = (DataSource) envCtx.lookup(jdbc/rtidb); Connection con = ds.getConnection(); //DB access code here % And this is what i get: java.lang.NullPointerException at org.apache.jsp.test$jsp._jspService(test$jsp.java:66) at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:107) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServlet.ja va:202) at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:382) at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:474) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Application FilterChain.java:247) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterCh ain.java:193) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.ja va:243) at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:5 66) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.ja va:190) at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:5 66) at org.apache.catalina.valves.CertificatesValve.invoke(CertificatesValve.java:2 46) at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:5 64) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943) at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2343) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180 ) at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:5 66) at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve. java:170) at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:5 64) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:170 ) at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:5 64) at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:468) at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:5 64) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java :174) at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:5 66) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943) at org.apache.catalina.connector.http.HttpProcessor.process(HttpProcessor.java: 1012) at org.apache.catalina.connector.http.HttpProcessor.run(HttpProcessor.java:1107 ) at java.lang.Thread.run(Thread.java:536) -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: DataSource problem.
I haven't been able to solve this yet... but was wondering if tomcat logs somewhere that the Resource Manager added a new resource (a DataSource)? Thanks, Manav. -Original Message- From: Manavendra Gupta [mailto:[EMAIL PROTECTED]] Sent: Friday, December 06, 2002 3:46 PM To: Tomcat Users List Subject: RE: DataSource problem. Tried the same with a simplistic jsp page: %@ page import=java.sql.*, javax.sql.*, javax.naming.* % HTML BODY % out.println(hello); Context initCtx = new InitialContext(); Context envCtx = (Context) initCtx.lookup(java:comp/env); DataSource ds = (DataSource) envCtx.lookup(jdbc/rtidb); Connection con = ds.getConnection(); //DB access code here % And this is what i get: java.lang.NullPointerException at org.apache.jsp.test$jsp._jspService(test$jsp.java:66) at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:107) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServlet.ja va:202) at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:382) at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:474) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Application FilterChain.java:247) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterCh ain.java:193) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.ja va:243) at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:5 66) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.ja va:190) at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:5 66) at org.apache.catalina.valves.CertificatesValve.invoke(CertificatesValve.java:2 46) at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:5 64) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943) at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2343) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180 ) at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:5 66) at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve. java:170) at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:5 64) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:170 ) at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:5 64) at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:468) at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:5 64) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java :174) at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:5 66) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943) at org.apache.catalina.connector.http.HttpProcessor.process(HttpProcessor.java: 1012) at org.apache.catalina.connector.http.HttpProcessor.run(HttpProcessor.java:1107 ) at java.lang.Thread.run(Thread.java:536) -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Thread dump
I have tomcat 4.1 running on Linux. How do i see the thread dump? The startup.sh on linux just starts it in the background, while i could use startup.bat on windows and get the thread dump. thanks, manav. -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: Thread dump
Beg your pardon? would that not actually kill the process, rather than displaying the thread dump? And what if one wants to see the thread dump right from the moment tomcat starts up? Thanks, manav. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: Friday, December 06, 2002 9:18 PM To: Tomcat Users List Subject: Re: Thread dump kill -3 pid RS Manavendra Gupta To: Tomcat Users List [EMAIL PROTECTED] [EMAIL PROTECTED] cc: 12/06/02 09:53 AMSubject: Thread dump Please respond to Tomcat Users List I have tomcat 4.1 running on Linux. How do i see the thread dump? The startup.sh on linux just starts it in the background, while i could use startup.bat on windows and get the thread dump. thanks, manav. -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: Thread dump
Thanks. I'm gonna try jpda - i have just started exploring it. i was interested to see the thread dump from the point tomcat's main() starts, to get a hang of the sequence of the class loaders/resource managers/security realms, etc starting up. thanks, manav. -Original Message- From: Denis Haskin [mailto:[EMAIL PROTECTED]] Sent: Friday, December 06, 2002 9:53 PM To: Tomcat Users List Subject: Re: Thread dump Run it under a JPDA debugger and use something like - Xrunjdwp:transport=dt_shmem,server=y,suspend=y so that the JVM stops and waits for debugger commands right away. Then you could get to the right point in your code, and with any decent debugger look at the thread dump without needing to send the signal. By the way, what exactly do you mean by right from the moment tomcat starts up? Do you mean before the tomcat's main() starts? Before your servlet is loaded? dwh [EMAIL PROTECTED] wrote: You could use Thread.enumerate(Thread [] ) and then do a Thread.dumpStack() on each thread in your code. I can't provide any definite answers on how to get a thread dump right from the moment Tomcat starts, but I suppose you could modify Tomcat code (call the about the methods in your code) to do this. -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: DataSource problem.
*deep breath. I'm lost about this... would anyone take a shot at helping me? Thanks Manav. -Original Message- From: Manavendra Gupta [mailto:[EMAIL PROTECTED]] Sent: Friday, December 06, 2002 9:19 PM To: Tomcat Users List Subject: RE: DataSource problem. I haven't been able to solve this yet... but was wondering if tomcat logs somewhere that the Resource Manager added a new resource (a DataSource)? Thanks, Manav. -Original Message- From: Manavendra Gupta [mailto:[EMAIL PROTECTED]] Sent: Friday, December 06, 2002 3:46 PM To: Tomcat Users List Subject: RE: DataSource problem. Tried the same with a simplistic jsp page: %@ page import=java.sql.*, javax.sql.*, javax.naming.* % HTML BODY % out.println(hello); Context initCtx = new InitialContext(); Context envCtx = (Context) initCtx.lookup(java:comp/env); DataSource ds = (DataSource) envCtx.lookup(jdbc/rtidb); Connection con = ds.getConnection(); //DB access code here % And this is what i get: java.lang.NullPointerException at org.apache.jsp.test$jsp._jspService(test$jsp.java:66) at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:107) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServlet.ja va:202) at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:382) at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:474) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Application FilterChain.java:247) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterCh ain.java:193) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.ja va:243) at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:5 66) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.ja va:190) at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:5 66) at org.apache.catalina.valves.CertificatesValve.invoke(CertificatesValve.java:2 46) at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:5 64) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943) at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2343) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180 ) at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:5 66) at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve. java:170) at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:5 64) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:170 ) at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:5 64) at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:468) at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:5 64) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java :174) at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:5 66) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943) at org.apache.catalina.connector.http.HttpProcessor.process(HttpProcessor.java: 1012) at org.apache.catalina.connector.http.HttpProcessor.run(HttpProcessor.java:1107 ) at java.lang.Thread.run(Thread.java:536) -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Transactions
Hi, 1. How do I implement transactions in tomcat for a non-J2EE web application? 2. Can anyone provide me with any links on this? 3. Do I need to use JTA for this? 4. Does tomcat support JTA? TIA, Manav. -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: configuring tomcat not to generate java source
so what do you think should happen to the jsp pages if tomcat does not generate code? -Original Message- From: Ronen Shenkar [mailto:[EMAIL PROTECTED]] Sent: Thursday, December 05, 2002 1:12 PM To: [EMAIL PROTECTED] Subject: configuring tomcat not to generate java source I wonder if there is a way to configure tomcat 3.2 not to generate the java code, I suppose that it should make some performance improvement. Thanks, ronen -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: Problems running Tomcat from command line
Hi, All your problems stem from the lack of environment space. If you run this on '95/98 you'd get the same error. While running tomcat, do you really need to have such a long path (as specified)? You could write a small batch file to keep the path to the bare minimum - this way you'd have more space for initialization of tomcat. this is a temporary solution - since most of the jar files you'd come across force you to include them in the classpath. Manav. - Original Message - From: Steve Russell [EMAIL PROTECTED] To: Tomcat Users List [EMAIL PROTECTED] Sent: Tuesday, November 26, 2002 3:25 AM Subject: Re: Problems running Tomcat from command line Hi; I'm reposting this, hoping that this version is more clear. -- I'm on Windows 2000 using Tomcat 3.2.4 ( not my choice ). I can start tomcat by double clicking the startup.bat file in C:\TOMCAT\bin. However, I can't start tomcat programmatically by typing startup.bat or startup ( without quotes ) from a dos prompt that is in C:\TOMCAT\bin I have tried running C:\TOMCAT\bin directly. It complains that it is out of environment space ( how do you set that in win 2000 )AND that it cant find C:\TOMCAT\lib\servlet.jar Its there. Here are the Windows 2000 environmental variables I have set for system: CLASSPATH: ..;C:\W2Kimage_c\cygwin\home\steve\Projects\Classes;C:\TOMCAT\lib\servlet.ja r PATH: %SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;%SystemRoot%\s ystem32\nls;%SystemRoot%\system32\nls\English;C:JDK\bin;C:\ProgramFiles\GnuE macs21.2\bin;C:\ProgramFiles;C:\PROGRA~1\ULTRAE~1;C:\Program Files\Microsoft SQL Server\80\Tools\BINN; JAVA_HOME: C:\JDK TOMCAT_HOME C:\TOMCAT Thanks in advance for any clues Steve -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: Problems running Tomcat from command line
Did you try this by opening a new command window? (After you change the comspec parameters, the changes take place only in a new window). Manav. - Original Message - From: Steve Russell [EMAIL PROTECTED] To: Tomcat Users List [EMAIL PROTECTED] Sent: Tuesday, November 26, 2002 4:09 AM Subject: Re: Problems running Tomcat from command line ComSpec, I made a typo Steve At 04:09 AM 11/26/2002 +0530, you wrote: Are you sure you modified ComSpec or ComSec (as you mentioned)? Manav. - Original Message - From: Steve Russell [EMAIL PROTECTED] To: Tomcat Users List [EMAIL PROTECTED] Sent: Tuesday, November 26, 2002 3:56 AM Subject: RE: Problems running Tomcat from command line At 02:04 PM 11/25/2002 -0800, you wrote: Steve Russell, Perhaps this link will help: http://www.google.com/search?q=out+of+environment+space+tomcat Try to get that out of environment space error to go away, then we'll work on the absentee servlet.jar issue. Win 2000 does it differently. I went into control panel | system | advanced | environment and set ComSec to C:\WINNT\sysem32\cmd.exe /e:32768 No effect -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] Steve Russell Applications Developer 301-251-1161 x 275 [EMAIL PROTECTED] Emmes Corporation 401 N. Washington Street, Suite 700 Rockville, MD 20850 - 1785 -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Fw: Oracle thin client DataSource configuration with tomcat
Hi, Any hints anyone? Joel Sather gave me a couple of replies, but I haven't been able to proceed. Thanks, manav. - Original Message - From: Manavendra Gupta [EMAIL PROTECTED] To: Tomcat Users List [EMAIL PROTECTED] Sent: Monday, November 18, 2002 8:59 PM Subject: Oracle thin client DataSource configuration with tomcat Hi, I'm sure the gurus have discussed this issue a number of times and probably found a solution too, but after reading all the documents i found, i came to a naught. Its the same problem: server.xml and web.xml seem to have been configured properly, yet when i try to obtain a datasource i get nothing. Here's the scenario: setup: tomcat 4.0.3 LE, jdk1.4, RHL 7.3 server.xml !-- RTI Billing Context -- Context path=/rti docBase=rti debug=0 reloadable=true crossContext=true Logger className=org.apache.catalina.logger.FileLogger prefix=rti_log. suffix=.txt timestamp=true/ Resource name=jdbc/RtiDB auth=Container type=javax.sql.DataSource/ ResourceParams name=jdbc/RtiDB parameter nameuser/name valuerti/value /parameter parameter namepassword/name valuerti/value /parameter parameter namedriverClassName/name valueoracle.driver.OracleDriver/value /parameter parameter nameURL/name valuejdbc:odbc:thin:@rti:1521:rti?user=rti;password=rti/value /parameter parameter namemaxActive/name value20/value /parameter parameter namemaxIdle/name value10/value /parameter parameter namemaxWait/name value-1/value /parameter /ResourceParams /Context web.xml !-- Resource references -- resource-ref descriptionDB Connection/description res-ref-namejdbc/RtiDB/res-ref-name res-typejavax.sql.DataSource/res-type res-authContainer/res-auth /resource-ref DBTest.jsp % String foo = Not Connected; String bar = ; javax.naming.Context ctx = new javax.naming.InitialContext(); javax.naming.Context envCtx = (javax.naming.Context) ctx.lookup(java:comp/env); if(ctx == null ) throw new Exception(Boom - No Context); javax.sql.DataSource ds = (javax.sql.DataSource)envCtx.lookup(jdbc/RtiDB); if (ds != null) { java.sql.Connection conn = ds.getConnection(); out.println(got a connection); } out.println(no luck yet); % And I never get the message got a connection. Any clues? Btw, I have not touched the Realm - I don't understand what that is meant for. Not yet. TIA, Manav. -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: Fw: Oracle thin client DataSource configuration with tomcat
No, I wish I did - for that would at least mean something. It just fails to get a DataSource. manav. - Original Message - From: Kwok Peng Tuck [EMAIL PROTECTED] To: Tomcat Users List [EMAIL PROTECTED] Sent: Tuesday, November 19, 2002 2:06 PM Subject: Re: Fw: Oracle thin client DataSource configuration with tomcat Do you get a neverending page ? Manavendra Gupta wrote: Hi, Any hints anyone? Joel Sather gave me a couple of replies, but I haven't been able to proceed. Thanks, manav. - Original Message - From: Manavendra Gupta [EMAIL PROTECTED] To: Tomcat Users List [EMAIL PROTECTED] Sent: Monday, November 18, 2002 8:59 PM Subject: Oracle thin client DataSource configuration with tomcat Hi, I'm sure the gurus have discussed this issue a number of times and probably found a solution too, but after reading all the documents i found, i came to a naught. Its the same problem: server.xml and web.xml seem to have been configured properly, yet when i try to obtain a datasource i get nothing. Here's the scenario: setup: tomcat 4.0.3 LE, jdk1.4, RHL 7.3 server.xml !-- RTI Billing Context -- Context path=/rti docBase=rti debug=0 reloadable=true crossContext=true Logger className=org.apache.catalina.logger.FileLogger prefix=rti_log. suffix=.txt timestamp=true/ Resource name=jdbc/RtiDB auth=Container type=javax.sql.DataSource/ ResourceParams name=jdbc/RtiDB parameter nameuser/name valuerti/value /parameter parameter namepassword/name valuerti/value /parameter parameter namedriverClassName/name valueoracle.driver.OracleDriver/value /parameter parameter nameURL/name valuejdbc:odbc:thin:@rti:1521:rti?user=rti;password=rti/value /parameter parameter namemaxActive/name value20/value /parameter parameter namemaxIdle/name value10/value /parameter parameter namemaxWait/name value-1/value /parameter /ResourceParams /Context web.xml !-- Resource references -- resource-ref descriptionDB Connection/description res-ref-namejdbc/RtiDB/res-ref-name res-typejavax.sql.DataSource/res-type res-authContainer/res-auth /resource-ref DBTest.jsp % String foo = Not Connected; String bar = ; javax.naming.Context ctx = new javax.naming.InitialContext(); javax.naming.Context envCtx = (javax.naming.Context) ctx.lookup(java:comp/env); if(ctx == null ) throw new Exception(Boom - No Context); javax.sql.DataSource ds = (javax.sql.DataSource)envCtx.lookup(jdbc/RtiDB); if (ds != null) { java.sql.Connection conn = ds.getConnection(); out.println(got a connection); } out.println(no luck yet); % And I never get the message got a connection. Any clues? Btw, I have not touched the Realm - I don't understand what that is meant for. Not yet. TIA, Manav. -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Fw: Oracle thin client DataSource configuration with tomcat
Hey Gurus, any ideas what could be the problem? following are the settings (revised): server.xml: Context path=/rti docBase=rti debug=4 reloadable=true Logger className=org.apache.catalina.logger.FileLogger prefix=rti_log. suffix=.txt timestamp=true / Resource name=jdbc/rtidb auth=CONTAINER type=javax.sql.DataSource / ResourceParams name=jdbc/rtidb parameter nameuser/name valuerti/value /parameter parameternamepassword/namevaluerti/value /parameter parameter namedriverClassName/name valueoracle.jdbc.driver.OracleDriver/value /parameter parameternamedriverName/name valuejdbc:oracle:thin:@rti:1521:rti/value/parameter /ResourceParams /Context web.xml: web-app resource-ref res-ref-namejdbc/rtidb/res-ref-name res-typejavax.sql.DataSource/res-type res-authContainer/res-auth /resource-ref /web-app test.java Context ctx = new InitialContext(); if(ctx == null ) throw new Exception(Boom - No Context); Context envCtx = (Context) ctx.lookup(java:comp/env); DataSource ds = (DataSource)envCtx.lookup(jdbc/rtidb); System.out.println(DataSource: + ds); if (ds != null) { Connection conn = ds.getConnection(); } - DataSource is always null. (excerpt) thread dump of catalina: XmlMapper: org.apache.catalina.deploy.ContextResource.setName( jdbc/rtidb) XmlMapper: org.apache.catalina.deploy.ContextResource.setType( javax.sql.DataSource) XmlMapper: org.apache.catalina.deploy.ContextResource.setAuth( Container) XmlMapper: Calling org.apache.catalina.core.StandardContext.addResource ContextResource[name=jdbc/rtidb, type=javax.sql.DataSource, auth=Container, scope=Shareable] XmlMapper: pop resource-ref org.apache.catalina.deploy.ContextResource: ContextResource[name=jdbc/rtidb, type=javax.sql.DataSource, auth=Container, scope=Shareable] Any clues? TIA, Manav. - Original Message - From: Manavendra Gupta [EMAIL PROTECTED] To: Manavendra Gupta [EMAIL PROTECTED] Sent: Wednesday, November 20, 2002 5:50 AM Subject: Re: Oracle thin client DataSource configuration with tomcat Sorry, forgot to attach the thread dump... Thanks manav === javax.naming.NameNotFoundException: Name java:comp is not bound in this Context at org.apache.naming.NamingContext.lookup(NamingContext.java:811) at org.apache.naming.NamingContext.lookup(NamingContext.java:194) at tmp.DBTest.init(DBTest.java:20) at org.apache.jsp.test$jsp._jspService(test$jsp.java:60) at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:107) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspSe vlet.java:202) at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java: 82) at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:474) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(App icationFilterChain.java:247) at org.apache.catalina.core.ApplicationFilterChain.doFilter(Application ilterChain.java:193) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapper alve.java:243) at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipelin .java:566) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.ja a:472) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943 at org.apache.catalina.core.StandardContextValve.invoke(StandardContext alve.java:201) at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipelin .java:566) at org.apache.catalina.valves.CertificatesValve.invoke(CertificatesValv .java:246) at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipelin .java:564) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.ja a:472) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943 at org.apache.catalina.core.StandardContext.invoke(StandardContext.java 2344) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve. ava:164) at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipelin .java:566) at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatch rValve.java:170) at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipelin .java:564) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve. ava:170) at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipelin .java:564) at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java 462) at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipelin .java:564
Oracle thin client DataSource configuration with tomcat
Hi, I'm sure the gurus have discussed this issue a number of times and probably found a solution too, but after reading all the documents i found, i came to a naught. Its the same problem: server.xml and web.xml seem to have been configured properly, yet when i try to obtain a datasource i get nothing. Here's the scenario: setup: tomcat 4.0.3 LE, jdk1.4, RHL 7.3 server.xml !-- RTI Billing Context -- Context path=/rti docBase=rti debug=0 reloadable=true crossContext=true Logger className=org.apache.catalina.logger.FileLogger prefix=rti_log. suffix=.txt timestamp=true/ Resource name=jdbc/RtiDB auth=Container type=javax.sql.DataSource/ ResourceParams name=jdbc/RtiDB parameter nameuser/name valuerti/value /parameter parameter namepassword/name valuerti/value /parameter parameter namedriverClassName/name valueoracle.driver.OracleDriver/value /parameter parameter nameURL/name valuejdbc:odbc:thin:@rti:1521:rti?user=rti;password=rti/value /parameter parameter namemaxActive/name value20/value /parameter parameter namemaxIdle/name value10/value /parameter parameter namemaxWait/name value-1/value /parameter /ResourceParams /Context web.xml !-- Resource references -- resource-ref descriptionDB Connection/description res-ref-namejdbc/RtiDB/res-ref-name res-typejavax.sql.DataSource/res-type res-authContainer/res-auth /resource-ref DBTest.jsp % String foo = Not Connected; String bar = ; javax.naming.Context ctx = new javax.naming.InitialContext(); javax.naming.Context envCtx = (javax.naming.Context) ctx.lookup(java:comp/env); if(ctx == null ) throw new Exception(Boom - No Context); javax.sql.DataSource ds = (javax.sql.DataSource)envCtx.lookup(jdbc/RtiDB); if (ds != null) { java.sql.Connection conn = ds.getConnection(); out.println(got a connection); } out.println(no luck yet); % And I never get the message got a connection. Any clues? Btw, I have not touched the Realm - I don't understand what that is meant for. Not yet. TIA, Manav. -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: Who can help ???
Did you try using the '.htaccess' from apache? Manav. - Original Message - From: Jean-Luc BEAUDET [EMAIL PROTECTED] To: Tomcat Users List [EMAIL PROTECTED]; tomcat-user [EMAIL PROTECTED] Sent: Monday, November 18, 2002 8:52 PM Subject: Who can help ??? Hi all, Runnin' Tomcat 4.0.2 and Apache 1.3.26 on SOLARIS 8 in Production. I'd like to get /webapp-info/ secured by login/password - even BASIC - when asked by http://my.sever.com/webapp-info/ Any help welcome. Jean-Luc B :O) -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: Oracle thin client DataSource configuration with tomcat
I always get the line no luck yet (as printed in the JSP page). The dataSource is never created. Manav. - Original Message - From: Sinclair, Alan (CORP, GEAccess) [EMAIL PROTECTED] To: 'Tomcat Users List' [EMAIL PROTECTED] Sent: Monday, November 18, 2002 9:10 PM Subject: RE: Oracle thin client DataSource configuration with tomcat What happens when you attempt to refrence the JSP from a browser ? The connection pool with Oracle is not established until a JSP which uses the pool is requested. as -Original Message- From: Manavendra Gupta [mailto:[EMAIL PROTECTED]] Sent: Monday, November 18, 2002 8:30 AM To: Tomcat Users List Subject: Oracle thin client DataSource configuration with tomcat Hi, I'm sure the gurus have discussed this issue a number of times and probably found a solution too, but after reading all the documents i found, i came to a naught. Its the same problem: server.xml and web.xml seem to have been configured properly, yet when i try to obtain a datasource i get nothing. Here's the scenario: setup: tomcat 4.0.3 LE, jdk1.4, RHL 7.3 server.xml !-- RTI Billing Context -- Context path=/rti docBase=rti debug=0 reloadable=true crossContext=true Logger className=org.apache.catalina.logger.FileLogger prefix=rti_log. suffix=.txt timestamp=true/ Resource name=jdbc/RtiDB auth=Container type=javax.sql.DataSource/ ResourceParams name=jdbc/RtiDB parameter nameuser/name valuerti/value /parameter parameter namepassword/name valuerti/value /parameter parameter namedriverClassName/name valueoracle.driver.OracleDriver/value /parameter parameter nameURL/name valuejdbc:odbc:thin:@rti:1521:rti?user=rti;password=rti/value /parameter parameter namemaxActive/name value20/value /parameter parameter namemaxIdle/name value10/value /parameter parameter namemaxWait/name value-1/value /parameter /ResourceParams /Context web.xml !-- Resource references -- resource-ref descriptionDB Connection/description res-ref-namejdbc/RtiDB/res-ref-name res-typejavax.sql.DataSource/res-type res-authContainer/res-auth /resource-ref DBTest.jsp % String foo = Not Connected; String bar = ; javax.naming.Context ctx = new javax.naming.InitialContext(); javax.naming.Context envCtx = (javax.naming.Context) ctx.lookup(java:comp/env); if(ctx == null ) throw new Exception(Boom - No Context); javax.sql.DataSource ds = (javax.sql.DataSource)envCtx.lookup(jdbc/RtiDB); if (ds != null) { java.sql.Connection conn = ds.getConnection(); out.println(got a connection); } out.println(no luck yet); % And I never get the message got a connection. Any clues? Btw, I have not touched the Realm - I don't understand what that is meant for. Not yet. TIA, Manav. -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]