Re: Tomcat - Hibernate
--- Giorgio Clavelli [EMAIL PROTECTED] wrote: Hi, I'm not an exper at all, but I try to put my 2 cents. The fact that your app can connect successfully after the server restart, suggests that you should have your app's context.xml (or whatever it is called) not in the server.xml but in the correct location inside your app directories. I seem to have read, the correct location being under the META-INF directory and that Tomcat tries first to look for context in this dir and then use that one under server.xml. I hope expert user, will comfirm in one way or the other this understanding of your problem. As of TC 5.0 the prefered way of configuring a context (web application) is to use a XML context fragment file. That file will either be placed in ${CATALINA_HOME}/conf/${HOSTNAME}/${CONTEXT_NAME}.xml, if you're deploying from a directory or in ./META-INF/${CONTEXT_NAME}.xml, if it is a WAR file. That way, deploying of an app can be free from editing the server.xml. As for the original problem, that is NOT it. The fact that TC's restart picks up everything suggests that the config is OK. Or at least relatively OK. I think that TC will create a XML fragment for the app and it could be that *that* fragment is interfering with the deployment process. Since I can see nothing wrong with the config, I would advise the original poster to go the correct route. Create the config fragment, pack it into your WAR, clean up server.xml and try to deploy/undeploy/redeploy. It will have no effect on TC 4.x, if you're warried that you might be forced to use it some day, TC4 ignores that file (one question to the authoritative guys: will that dir be accessable? - a potential security hole). Nix. __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
is mod_jk status manager available in linux shell?
hi, I would like to know whether there is some other way to get the information avaiable on jkmanager page(other than in browser). I would love to be able to receive this information in linux shell. thx for any help Kuba Straszewski Na specjalne zaproszenie Telewizji Polsat przybędzie gwiazda światowej sławy. Jedyny ekskluzywny koncert Lisy Stansfield w Polsce. http://klik.wp.pl/?adr=http%3A%2F%2Fadv.reklama.wp.pl%2Fas%2Flisa.htmlsid=684 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Tomcat - Hibernate
You want ENGINE_NAME in there too, i.e.: ${CATALINA_HOME}/conf/${ENGINE_NAME}/${HOSTNAME}/${CONTEXT_NAME}.xml or, for example (spaces delineate variables above, don't really use them), /usr/local/tomcat /conf /Catalina /localhost /ROOT.xml == http://localhost:8080/ /usr/local/tomcat /conf /Catalina /localhost /myapp.xml == http://localhost:8080/myapp Tim -Original Message- From: Nikola Milutinovic [mailto:[EMAIL PROTECTED] Sent: Thursday, March 02, 2006 3:28 AM To: Tomcat Users List Subject: Re: Tomcat - Hibernate --- Giorgio Clavelli [EMAIL PROTECTED] wrote: Hi, I'm not an exper at all, but I try to put my 2 cents. The fact that your app can connect successfully after the server restart, suggests that you should have your app's context.xml (or whatever it is called) not in the server.xml but in the correct location inside your app directories. I seem to have read, the correct location being under the META-INF directory and that Tomcat tries first to look for context in this dir and then use that one under server.xml. I hope expert user, will comfirm in one way or the other this understanding of your problem. As of TC 5.0 the prefered way of configuring a context (web application) is to use a XML context fragment file. That file will either be placed in ${CATALINA_HOME}/conf/${HOSTNAME}/${CONTEXT_NAME}.xml, if you're deploying from a directory or in ./META-INF/${CONTEXT_NAME}.xml, if it is a WAR file. That way, deploying of an app can be free from editing the server.xml. As for the original problem, that is NOT it. The fact that TC's restart picks up everything suggests that the config is OK. Or at least relatively OK. I think that TC will create a XML fragment for the app and it could be that *that* fragment is interfering with the deployment process. Since I can see nothing wrong with the config, I would advise the original poster to go the correct route. Create the config fragment, pack it into your WAR, clean up server.xml and try to deploy/undeploy/redeploy. It will have no effect on TC 4.x, if you're warried that you might be forced to use it some day, TC4 ignores that file (one question to the authoritative guys: will that dir be accessable? - a potential security hole). Nix. __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com - 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: Cannot create JDBC driver of class '' for connect URL 'null'
I've done several developments with MySQL and Tomcat. Never defined the datasource in the DefaultContext element so I can't speak to how that should work. The error is usually the result of a configuration element out of place between where the Resource element is declared and your java code. The Resource config looks good though. My advice is : - Move this Resource/ definition to your context's Context element in [tomcat_dir]conf/Catalina/localhost/[webapp_name_here].xml. If deploying in a .war file, the file should be named context.xml and placed in the META-INF directory of your .war file. - Make sure you have a resource-ref section in the web.xml file of your webapp. - This is pretty much a laundry list item, but make sure your mysql.jar file is in [tomcat_dir]/common/lib. The jar has to be there to be picked up by the tomcat container and instantiate a database pool. If you make these changes, restart tomcat to make sure it catches the new config. --David David McMinn wrote: Tomcat Server 5.5.15 - I searched for solutions and most mention a Context element in the server.xml. I only have a DefaultContext tag within with I have my resouce tag: DefaultContext Resource auth=Container driverClassName=com.mysql.jdbc.Driver logAbandoned=true maxActive=100 maxIdle=30 maxWait=1 name=jdbc/wroxTC5 password=everypass removeAbandoned=true removeAbandonedTimeout=300 type=javax.sql.DataSource url=jdbc:mysql://localhost:3306/everycitizen?autoReconnect=true username=everyuser / /DefaultContext The actual failure is on the connection = ds.getConnection(); line in the jsp if that helps any. SEVERE: Servlet.service() for servlet jsp threw exception org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot create JDBC driver of class '' for connect URL 'null' at org.apache.tomcat.dbcp.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:780) at org.apache.tomcat.dbcp.dbcp.BasicDataSource.getConnection(BasicDataSource.java:540) at org.apache.jsp.wroxjdbc.JDBCTest_jsp._jspService(org.apache.jsp.wroxjdbc.JDBCTest_jsp:83) at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97) at javax.servlet.http.HttpServlet.service(HttpServlet.java:802) at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:332) at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314) at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264) at javax.servlet.http.HttpServlet.service(HttpServlet.java:802) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178) at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:432) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148) at org.apache.coyote.http11.Http11AprProcessor.process(Http11AprProcessor.java:831) at org.apache.coyote.http11.Http11AprProtocol$Http11ConnectionHandler.process(Http11AprProtocol.java:639) at org.apache.tomcat.util.net.AprEndpoint$Worker.run(AprEndpoint.java:1203) at java.lang.Thread.run(Unknown Source) Caused by: java.sql.SQLException: No suitable driver at java.sql.DriverManager.getDriver(Unknown Source) at org.apache.tomcat.dbcp.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:773) ... 21 more - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: WHY TOMCAT MEMORY FROM 1G TO 15M IN 10 MINUTES
I would consider 15M pretty low. If the memory drops,what problem are you having? Sounds like it would be worse going the other way. jiang ying wrote: Hi. When I run the TPCW bookstore application, I found the server behave erratic. Experiment enviroment: Hardware: a client PC, two server PCs. Each PC has two 1.59 GHz AMD Opteron, 2GB RAM, and a 30 GB disk. One server machine runs theWeb server and application server software, while the other contains the database. All the machines run 2.4 Linux Kernel and are connected through a LAN of 1000Mb/s. Web Server: Tomcat 5.5.12 Database: mysql 5.0.18 Client Workload Generator: the freely available Java TPC-W implementation developed by the PHARM research group at the University of Wisconsin-Madison http://www.ece.wisc.edu/~pharm/tpcw.shtml The file descriptor limit has been increased to 8192. The maxconnection of Tomcat is 1000. To solve the heap exception of Tomcat, JAVA_OPTS='-Xms256m -Xmx256m' is set. Q1: When I emulate 100 EBs ( the command line: java rbe.RBE -EB rbe.EBTPCW1Factory 400 -OUT run1.m -RU 100 -MI 600 -RD 100 -WWW http://tomcatserver:8080/ -CUST 288000 -DEBUG 2) , the tomcat memory drops severly from 1G to 15M. Could anyone kindly tell me why the tomcat cosumes so much memory? Thank you. yours cylinder _ 与联机的朋友进行交流,请使用 MSN Messenger: http://messenger.msn.com/cn - 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: how to find out who is logging in?
This is doable, but you have to do it by yourself. If you want it on the client side (in John's browser) just let your webapp set a cookie. If you need it on the server side, your webapp has to perform it's own session management. If you have to write this solution by yourself you'll end up with approx. 100 lines of code. regards Leon On 3/2/06, epyonne [EMAIL PROTECTED] wrote: I don't know why my post during the day was not getting thru. So let me try again. I am going to rephrase my question and hope to get better response. Is it possible to get the username or simply the IP address of the session running on the Tomcat server? Currently, on the Tomcat admin page, I can see how many sessions are running on which program, but there is no information of who they are. Is it doable? Any help or comment is very much appreciated. epy. - Original Message - From: epyonne [EMAIL PROTECTED] To: users@tomcat.apache.org Sent: Tuesday, February 28, 2006 9:29 PM Subject: how to find out who is logging in? All, I manage an intranet environment with 3 web app servers running Tomcat. There is load balancing between these 3 servers. If a user, says John, logs on to the system, his session will be randomly on one of these 3 servers. Now, how can I find out which server John's session is on? Any help will be very much appreciated. epy. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: WHY TOMCAT MEMORY FROM 1G TO 15M IN 10 MINUTES
JAVA_OPTS='-Xms256m -Xmx256m' -- your tomcat memory should never reach 1G with this parameter! the tomcat memory drops severly from 1G to 15M -- do you mean tomcat memory usage or tomcat free memory? jiang ying a écrit : Hi. When I run the TPCW bookstore application, I found the server behave erratic. Experiment enviroment: Hardware: a client PC, two server PCs. Each PC has two 1.59 GHz AMD Opteron, 2GB RAM, and a 30 GB disk. One server machine runs theWeb server and application server software, while the other contains the database. All the machines run 2.4 Linux Kernel and are connected through a LAN of 1000Mb/s. Web Server: Tomcat 5.5.12 Database: mysql 5.0.18 Client Workload Generator: the freely available Java TPC-W implementation developed by the PHARM research group at the University of Wisconsin-Madison http://www.ece.wisc.edu/~pharm/tpcw.shtml The file descriptor limit has been increased to 8192. The maxconnection of Tomcat is 1000. To solve the heap exception of Tomcat, JAVA_OPTS='-Xms256m -Xmx256m' is set. Q1: When I emulate 100 EBs ( the command line: java rbe.RBE -EB rbe.EBTPCW1Factory 400 -OUT run1.m -RU 100 -MI 600 -RD 100 -WWW http://tomcatserver:8080/ -CUST 288000 -DEBUG 2) , the tomcat memory drops severly from 1G to 15M. Could anyone kindly tell me why the tomcat cosumes so much memory? Thank you. yours cylinder _ 与联机的朋友进行交流,请使用 MSN Messenger: http://messenger.msn.com/cn - 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]
worker mapping problem
i have two tomcats and IIS, i want two virtual hosts served by two tomcats. i declared two wrokers, one for each tomcat, and thats fine. however i have problem with mappings uriworkermap.properties /app1/*=worker1 /app1=worker1 /*=worker2 this is what i get from log Attempting to map URI '/mysite.com/app1' from 3 maps Attempting to map context URI '/app1/*' Attempting to map context URI '/app1' Attempting to map context URI '/*' Found a wildchar match worker2 - /* so, even though there is closer match for worker1, worker2 is selected. when i remove /* mapping, it works. i need /* because it needs to serve default context for virtaul host. so everything is fine but i don't understand this mapping thing. can i set priorities or anything? any ideas? tahnk you for any help! cheers, dario - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
httpd.conf equivalent options in Tomcat's xml config files
We ran a vulnerability assessment (results follow below) and here are 2 issues that popped up, and the results suggest changing directives from the httpd.conf file, which of course we don't have. What Tomcat equivalent options in the XML config file(s) are needed to be set to fix these? The Mac OS X Finder creates a file called .DS_Store in each directory that it views. Some versions of OS X include system configuration information and file location information in these files. The .DS_Store files can be accessed from this server via a web request such as http://IP/.DS_Store. Service: Apache-Coyote/1.1 Bugtraq:3316 Configure your Apache server to block access to these files with the FileMatch feature of httpd.conf. Some distributions of Apache, especially in Red Hat 7.0, allow an attacker to probe a system for user names via requests for user home pages (e.g., http://host/~username). Service: Apache-Coyote/1.1 CVE:CAN-2001-1013 Bugtraq:3335 Disabling the UserDir directive in the Apache configuration file (httpd.conf) will prevent this, although it will also prevent users from providing their own web pages. Alternately, specify ErrorDocuments for both 403 (Forbidden) and 404 (Page Not Found) responses. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
ClassLoader IllegalStateException
Hi, I have a web application that uses Tomcat 5.5.15, MySQL, Torque and ZK (a XUL/Ajax library). If I use this application with one client all works well, but when I try to use another client I got this exception: 2-mar-2006 16.14.00 org.apache.catalina.loader.WebappClassLoader loadClass INFO: Illegal access: this web application instance has been stopped already. Could not load com.mysql.jdbc.Messages. The eventual following stack trace is caused by an error thrown for debugging purposes as well as to attempt to terminate the thread which caused the illegal access, and has no functional impact. java.lang.IllegalStateException at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1238) at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1198) at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319) at com.mysql.jdbc.CommunicationsException.init(CommunicationsException.java:174) at com.mysql.jdbc.MysqlIO.send(MysqlIO.java:2710) at com.mysql.jdbc.MysqlIO.send(MysqlIO.java:2621) at com.mysql.jdbc.MysqlIO.quit(MysqlIO.java:1338) at com.mysql.jdbc.Connection.realClose(Connection.java:4429) at com.mysql.jdbc.Connection.cleanup(Connection.java:1973) at com.mysql.jdbc.Connection.finalize(Connection.java:3114) at java.lang.ref.Finalizer.invokeFinalizeMethod(Native Method) at java.lang.ref.Finalizer.runFinalizer(Finalizer.java:83) at java.lang.ref.Finalizer.access$100(Finalizer.java:14) at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:160) 2-mar-2006 16.14.00 org.apache.catalina.loader.WebappClassLoader loadClass INFO: Illegal access: this web application instance has been stopped already. Could not load com.mysql.jdbc.Messages. The eventual following stack trace is caused by an error thrown for debugging purposes as well as to attempt to terminate the thread which caused the illegal access, and has no functional impact. java.lang.IllegalStateException at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1238) at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1198) at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319) at com.mysql.jdbc.CommunicationsException.init(CommunicationsException.java:174) at com.mysql.jdbc.MysqlIO.send(MysqlIO.java:2710) at com.mysql.jdbc.MysqlIO.send(MysqlIO.java:2621) at com.mysql.jdbc.MysqlIO.quit(MysqlIO.java:1338) at com.mysql.jdbc.Connection.realClose(Connection.java:4429) at com.mysql.jdbc.Connection.cleanup(Connection.java:1973) at com.mysql.jdbc.Connection.finalize(Connection.java:3114) at java.lang.ref.Finalizer.invokeFinalizeMethod(Native Method) at java.lang.ref.Finalizer.runFinalizer(Finalizer.java:83) at java.lang.ref.Finalizer.access$100(Finalizer.java:14) at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:160) I've already asked around but nobody seems to know what causes it. Any idea? Thanks. -- Matteo Barbieri S.T.E. s.r.l. [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: ClassLoader IllegalStateException
Sorry, the correct exception is: 2-mar-2006 16.14.00 org.apache.catalina.loader.WebappClassLoader loadClass INFO: Illegal access: this web application instance has been stopped already. Could not load java.net.BindException. The eventual following stack trace is caused by an error thrown for debugging purposes as well as to attempt to terminate the thread which caused the illegal access, and has no functional impact. java.lang.IllegalStateException at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1238) at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1198) at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319) at com.mysql.jdbc.CommunicationsException.init(CommunicationsException.java:155) at com.mysql.jdbc.MysqlIO.send(MysqlIO.java:2710) at com.mysql.jdbc.MysqlIO.send(MysqlIO.java:2621) at com.mysql.jdbc.MysqlIO.quit(MysqlIO.java:1338) at com.mysql.jdbc.Connection.realClose(Connection.java:4429) at com.mysql.jdbc.Connection.cleanup(Connection.java:1973) at com.mysql.jdbc.Connection.finalize(Connection.java:3114) at java.lang.ref.Finalizer.invokeFinalizeMethod(Native Method) at java.lang.ref.Finalizer.runFinalizer(Finalizer.java:83) at java.lang.ref.Finalizer.access$100(Finalizer.java:14) at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:160) 2-mar-2006 16.14.00 org.apache.catalina.loader.WebappClassLoader loadClass INFO: Illegal access: this web application instance has been stopped already. Could not load com.mysql.jdbc.Messages. The eventual following stack trace is caused by an error thrown for debugging purposes as well as to attempt to terminate the thread which caused the illegal access, and has no functional impact. java.lang.IllegalStateException at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1238) at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1198) at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319) at com.mysql.jdbc.CommunicationsException.init(CommunicationsException.java:174) at com.mysql.jdbc.MysqlIO.send(MysqlIO.java:2710) at com.mysql.jdbc.MysqlIO.send(MysqlIO.java:2621) at com.mysql.jdbc.MysqlIO.quit(MysqlIO.java:1338) at com.mysql.jdbc.Connection.realClose(Connection.java:4429) at com.mysql.jdbc.Connection.cleanup(Connection.java:1973) at com.mysql.jdbc.Connection.finalize(Connection.java:3114) at java.lang.ref.Finalizer.invokeFinalizeMethod(Native Method) at java.lang.ref.Finalizer.runFinalizer(Finalizer.java:83) at java.lang.ref.Finalizer.access$100(Finalizer.java:14) at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:160) - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: ClassLoader IllegalStateException
what is a client? browser? if the webapp has stopped, or is stopping, that means that the .war file or WEB-INF/web.xml timestamp changed, and the webapp might be reloading. more info would be needed for further analysis Filip Matteo Barbieri wrote: Hi, I have a web application that uses Tomcat 5.5.15, MySQL, Torque and ZK (a XUL/Ajax library). If I use this application with one client all works well, but when I try to use another client I got this exception: 2-mar-2006 16.14.00 org.apache.catalina.loader.WebappClassLoader loadClass INFO: Illegal access: this web application instance has been stopped already. Could not load com.mysql.jdbc.Messages. The eventual following stack trace is caused by an error thrown for debugging purposes as well as to attempt to terminate the thread which caused the illegal access, and has no functional impact. java.lang.IllegalStateException at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1238) at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1198) at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319) at com.mysql.jdbc.CommunicationsException.init(CommunicationsException.java:174) at com.mysql.jdbc.MysqlIO.send(MysqlIO.java:2710) at com.mysql.jdbc.MysqlIO.send(MysqlIO.java:2621) at com.mysql.jdbc.MysqlIO.quit(MysqlIO.java:1338) at com.mysql.jdbc.Connection.realClose(Connection.java:4429) at com.mysql.jdbc.Connection.cleanup(Connection.java:1973) at com.mysql.jdbc.Connection.finalize(Connection.java:3114) at java.lang.ref.Finalizer.invokeFinalizeMethod(Native Method) at java.lang.ref.Finalizer.runFinalizer(Finalizer.java:83) at java.lang.ref.Finalizer.access$100(Finalizer.java:14) at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:160) 2-mar-2006 16.14.00 org.apache.catalina.loader.WebappClassLoader loadClass INFO: Illegal access: this web application instance has been stopped already. Could not load com.mysql.jdbc.Messages. The eventual following stack trace is caused by an error thrown for debugging purposes as well as to attempt to terminate the thread which caused the illegal access, and has no functional impact. java.lang.IllegalStateException at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1238) at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1198) at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319) at com.mysql.jdbc.CommunicationsException.init(CommunicationsException.java:174) at com.mysql.jdbc.MysqlIO.send(MysqlIO.java:2710) at com.mysql.jdbc.MysqlIO.send(MysqlIO.java:2621) at com.mysql.jdbc.MysqlIO.quit(MysqlIO.java:1338) at com.mysql.jdbc.Connection.realClose(Connection.java:4429) at com.mysql.jdbc.Connection.cleanup(Connection.java:1973) at com.mysql.jdbc.Connection.finalize(Connection.java:3114) at java.lang.ref.Finalizer.invokeFinalizeMethod(Native Method) at java.lang.ref.Finalizer.runFinalizer(Finalizer.java:83) at java.lang.ref.Finalizer.access$100(Finalizer.java:14) at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:160) I've already asked around but nobody seems to know what causes it. Any idea? Thanks. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: ClassLoader IllegalStateException
Filip Hanik - Dev Lists ha scritto: what is a client? browser? Yes, browser. if the webapp has stopped, or is stopping, that means that the .war file or WEB-INF/web.xml timestamp changed, and the webapp might be reloading. more info would be needed for further analysis Filip the webapp hasn't stopped, because the first browser keeps working. And I don't change the web.xml file. Please tell me what kind of informations you need. Thank you for the quick reply! Bye - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: ClassLoader IllegalStateException
ok, there could be plenty of things. but basically this is what is happening: one of your JDBC connections is being garbage collected. When this happens, it tries to close itself and in doing so, it needs to load a class. But the webapp is in a state where it has stopped (either been stopped, or reloaded) and throws an error. as mentioned earlier, more info on when this happens and in what circumstance. Matteo Barbieri wrote: Sorry, the correct exception is: 2-mar-2006 16.14.00 org.apache.catalina.loader.WebappClassLoader loadClass INFO: Illegal access: this web application instance has been stopped already. Could not load java.net.BindException. The eventual following stack trace is caused by an error thrown for debugging purposes as well as to attempt to terminate the thread which caused the illegal access, and has no functional impact. java.lang.IllegalStateException at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1238) at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1198) at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319) at com.mysql.jdbc.CommunicationsException.init(CommunicationsException.java:155) at com.mysql.jdbc.MysqlIO.send(MysqlIO.java:2710) at com.mysql.jdbc.MysqlIO.send(MysqlIO.java:2621) at com.mysql.jdbc.MysqlIO.quit(MysqlIO.java:1338) at com.mysql.jdbc.Connection.realClose(Connection.java:4429) at com.mysql.jdbc.Connection.cleanup(Connection.java:1973) at com.mysql.jdbc.Connection.finalize(Connection.java:3114) at java.lang.ref.Finalizer.invokeFinalizeMethod(Native Method) at java.lang.ref.Finalizer.runFinalizer(Finalizer.java:83) at java.lang.ref.Finalizer.access$100(Finalizer.java:14) at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:160) 2-mar-2006 16.14.00 org.apache.catalina.loader.WebappClassLoader loadClass INFO: Illegal access: this web application instance has been stopped already. Could not load com.mysql.jdbc.Messages. The eventual following stack trace is caused by an error thrown for debugging purposes as well as to attempt to terminate the thread which caused the illegal access, and has no functional impact. java.lang.IllegalStateException at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1238) at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1198) at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319) at com.mysql.jdbc.CommunicationsException.init(CommunicationsException.java:174) at com.mysql.jdbc.MysqlIO.send(MysqlIO.java:2710) at com.mysql.jdbc.MysqlIO.send(MysqlIO.java:2621) at com.mysql.jdbc.MysqlIO.quit(MysqlIO.java:1338) at com.mysql.jdbc.Connection.realClose(Connection.java:4429) at com.mysql.jdbc.Connection.cleanup(Connection.java:1973) at com.mysql.jdbc.Connection.finalize(Connection.java:3114) at java.lang.ref.Finalizer.invokeFinalizeMethod(Native Method) at java.lang.ref.Finalizer.runFinalizer(Finalizer.java:83) at java.lang.ref.Finalizer.access$100(Finalizer.java:14) at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:160) - 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: Sad: Tomcat 5.5.x crashes almost every single day.
Remy Maucherat wrote: On 2/28/06, Peter Lin [EMAIL PROTECTED] wrote: honestly, besides Weblogic, most servlet and ejb containers do not provide simple and clear instructions for tracing issues. With websphere, you have to buy an expensive license of WASD and even then debugging an issue won't be better in my experience. Debugging an webapp is a difficult task and very time consuming. I sympathize with you, but the only real way to trace is to use a profiler like optimizeIt, jprofiler or yourkit. An alternative would be to run tomcat with Sun's JFluid VM which is experimental. How does BEA do that ? JRockit ? JFluid could be a way (when you're not profiling, the overhead is limited), but on production servers it's still not doable as enabling profiling would kill it. Of course, memory profiling could be low impact, and would be great already. On production, you can always use JDK jhat/jmap available in 1.5 and Mustang. This can gives you a snapshot of the heap/memory and other usefull things without paying the price of a profiler -- Jeanfrancois -- x Rémy Maucherat Developer Consultant JBoss Europe x - 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: ClassLoader IllegalStateException
1. where in the tomcat directory structure is the mysql jdbc driver JAR file stored? 2. when does this happen? all the time? or as soon as you have more than one browser connect? 3. are you using a connectionpool? 4. how are you closing your connections? Matteo Barbieri wrote: Filip Hanik - Dev Lists ha scritto: what is a client? browser? Yes, browser. if the webapp has stopped, or is stopping, that means that the .war file or WEB-INF/web.xml timestamp changed, and the webapp might be reloading. more info would be needed for further analysis Filip the webapp hasn't stopped, because the first browser keeps working. And I don't change the web.xml file. Please tell me what kind of informations you need. Thank you for the quick reply! Bye - 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: ClassLoader IllegalStateException
Filip Hanik - Dev Lists ha scritto: 1. where in the tomcat directory structure is the mysql jdbc driver JAR file stored? webapps/my-application/WEB-INF/lib/mysql-connector-java-3.1.12-bin.jar 2. when does this happen? all the time? or as soon as you have more than one browser connect? - I connect with the first browser (A), I login on my application and I select some data from the database; - I load the second browser (B), login and when I do a query on the database I got the exception. The curious thing is that it happens not with the first query that I do with B, because to do the login with B I access the db and it works correctly. 3. are you using a connectionpool? 4. how are you closing your connections? As said I use Torque, I think it uses a connection pool, because on the configuration I have something like this: torque.dsfactory.MyApp.factory = org.apache.torque.dsfactory.SharedPoolDataSourceFactory I don't know how it closes connections, I'll ask them. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: double cluster in one server.xml?
I'm gonna let Peter Rossbach give you the final answer since he developed the simpleconfig concept. My guess is yes, if your hosts have webapps with the same names, they will most likely get mixed up. my suggestion to try would be Host name=test1.example.com appBase=webapps autoDeploy=false Context docBase=/home/ronald/tmp/HEAD/crm/web path= / Cluster className=org.apache.catalina.cluster.tcp.SimpleTcpCluster service.domain=vhost1/ /Host Host name=test2.example.com appBase=webapps autoDeploy=false Context docBase=/home/ronald/tmp/VERSIE_2_1/crm/web path= / Cluster className=org.apache.catalina.cluster.tcp.SimpleTcpCluster service.domain=vhost2/ /Host and that should stop the data from flowing between vhosts Filip Ronald Klop wrote: Hello, I have this in my server.xml. Host name=test1.example.com appBase=webapps autoDeploy=false Context docBase=/home/ronald/tmp/HEAD/crm/web path= / Cluster className=org.apache.catalina.cluster.tcp.SimpleTcpCluster/ /Host Host name=test2.example.com appBase=webapps autoDeploy=false Context docBase=/home/ronald/tmp/VERSIE_2_1/crm/web path= / Cluster className=org.apache.catalina.cluster.tcp.SimpleTcpCluster/ /Host This seems to work. The sessions aren't mixed up between de hosts. Is this supported behaviour? Or is there a change the sessions wil mix up? Ronald. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Executing Manager Commands With Ant and SSL
On 3/1/06, ash ag [EMAIL PROTECTED] wrote: BUILD FAILED /opt/Ant/apache-ant-1.6.1/build.xml:47: javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException : No trusted certificate found Total time: 0 seconds How can i configure the certificate in this case. Are you using a self-signed SSL cert? Looks to be the case. If so, you have two options: 1) Buy a commercially signed SSL certificate. 2) Import the self-signed root CA into the $JAVA_HOME/jre/lib/security/cacerts file I never bothered to figure out how to do number 2, but this[1] may be helpful. -- brian [1] - http://www.davtar.org/~david/makekeys.html - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Form login UTF-8 username problem
Dave- I believe you can effect this encoding if you specify encoding=UTF-8 in the xml element e.g. ?xml version=1.0 encoding=UTF-8? I am not aware of CJK implementations that use UTF-8 ..you may want to consider UTF-16 Scott does this look ok? HTH, Martin- - Original Message - From: Dave [EMAIL PROTECTED] To: users@tomcat.apache.org Sent: Thursday, March 02, 2006 12:02 PM Subject: Form login UTF-8 username problem Web application using JBoss 4.0.3SP1 and servlets. I am using FORM authentication. Can username be UTF-8? I create an account, its username is in UTF-8 encoding, chinese characters. But login was not successful. Can JBoss built-in authentication handle UTF-8 encoding for username? Ascii username works. I tried to use a filter to set request encoding to UTF-8, but the filter was not called for URL pattern j_security_check. filter-mapping filter-namefilter/filter-name url-pattern/j_security_check/url-pattern /filter-mapping Right now I am using a filter to set request encoding to UTF-8 for all requests in order to support chinese characters. It works great except Form login. The username is created in UTF-8 and stored in database. The related part in login-config.xml login-module code=org.jboss.security.auth.spi.DatabaseServerLoginModule flag=required module-option name=dsJndiNamejava:/DefaultDS/module-option module-option name=principalsQuery select password from User where username=? /module-option So I suspect the FORM login need to go through a filter to set its encoding to UTF-8. Otherwise, the server side would assume iso-8859-1 encoding, and it would not find the username in database table. Is there a way to tell Web Container about the request encoding? Thanks for help. Have a nice day! - Yahoo! Mail Bring photos to life! New PhotoMail makes sharing a breeze.
JNDI Datasourse Best Practice
I'm happy to report that this newbie successfully set up a JNDI Datasource insert self-satisfied cheer here. I now have a question about the best way to create connections in my web application. Previously, I used this class in other beans in order to create and access connections: public class dbConnection { private static String url = jdbc:oracle:thin:@server:1521:sid; private static String username = scott; private static String password = tiger; public boolean driverLoaded = false; public synchronized Connection getConnection() throws SQLException { Connection connection; if (!driverLoaded) { try { Class.forName(oracle.jdbc.driver.OracleDriver).newInstance(); driverLoaded = true; } catch (ClassNotFoundException ex) { throw new SQLException(Can't find driver + ex.getMessage()); } catch (Exception e) { System.out.println(Something else happened in dbConnection: + e.getMessage()); e.printStackTrace(); } } connection = DriverManager.getConnection(getUrl(), getUsername(), getPassword()); return connection; } I'm planning using the same class, modified slightly, to serve up connections from the Pool: public class dbConnection { private static String url = jdbc:oracle:thin:@server:1521:sid; private static String username = scott; private static String password = tiger; public boolean driverLoaded = false; public synchronized Connection getConnection() throws SQLException { Connection connection; Context initContext = new InitialContext(); Context envContext = (Context)initContext.lookup(java:/comp/env); DataSource ds = (DataSource)envContext.lookup(jdbc/myoracle); connection = ds.getConnection(); return connection; } Am I on the right track with this, or can I expect some grief? I'm using the Shale framework with JavaServer Faces. Thanks for your time. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Form login UTF-8 username problem
Hi Martin, Thanks! I already have the following at the beginning of all the jsp pages. %@ page contentType=text/html; charset=UTF-8% Martin Gainty [EMAIL PROTECTED] wrote: Dave- I believe you can effect this encoding if you specify encoding=UTF-8 in the xml element e.g. I am not aware of CJK implementations that use UTF-8 ..you may want to consider UTF-16 Scott does this look ok? HTH, Martin- - Original Message - From: Dave To: Sent: Thursday, March 02, 2006 12:02 PM Subject: Form login UTF-8 username problem Web application using JBoss 4.0.3SP1 and servlets. I am using FORM authentication. Can username be UTF-8? I create an account, its username is in UTF-8 encoding, chinese characters. But login was not successful. Can JBoss built-in authentication handle UTF-8 encoding for username? Ascii username works. I tried to use a filter to set request encoding to UTF-8, but the filter was not called for URL pattern j_security_check. filter /j_security_check Right now I am using a filter to set request encoding to UTF-8 for all requests in order to support chinese characters. It works great except Form login. The username is created in UTF-8 and stored in database. The related part in login-config.xml flag=required java:/DefaultDS select password from User where username=? So I suspect the FORM login need to go through a filter to set its encoding to UTF-8. Otherwise, the server side would assume iso-8859-1 encoding, and it would not find the username in database table. Is there a way to tell Web Container about the request encoding? Thanks for help. Have a nice day! - Yahoo! Mail Bring photos to life! New PhotoMail makes sharing a breeze. - Yahoo! Mail Bring photos to life! New PhotoMail makes sharing a breeze.
DefaultContext problems
Hello all, I've been struggling to setup a datasource that is accessible from all my webapps. As I understand it, I define a Resource(/Server/GlobalNamingResources/Resource) and then a link it in a DefaultContext(/Server/Engine/Host/DefaultContext) like so: mailto:users@tomcat.apache.orgDefaultContext ResourceLink name=jdbc/apps global=jdbc/apps type=javax.sql.DataSource/ /DefaultContext The above doesn't work, but this does: Context path=/apply ResourceLink name=jdbc/apps global=jdbc/apps type=javax.sql.DataSource/ /Context I have nothing special in my servlet's web.xml file. Is there any reason this servlet wouldn't be using the declared default context? Any help other than, Don't use global resources, would be much appreciated. Thanks, --Evan - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Problems with extracting beans from a JavaServer Page
Hey all, This may seem like a really dense question so apologies if it is but I have the following code on a jsp page: jsp:useBean id=gameBean type=FYPCode.GameBean scope=request / FORM ACTION=MatchController p jsp:getProperty name=gameBean property=day /nbsp; jsp:getProperty name=gameBean property=dayNumber /nbsp; jsp:getProperty name=gameBean property=month /nbsp; jsp:getProperty name=gameBean property=year /br jsp:getProperty name=gameBean property=homeTeam /nbsp;vsnbsp; jsp:getProperty name=gameBean property=awayTeam /br jsp:getProperty name=gameBean property=venue /nbsp; jsp:getProperty name=gameBean property=kickOffTime /, kick off.br bAllocated Tickets:nbsp;/bjsp:getProperty name=gameBean property=allocatedTickets / /p p To choose to buy tickets for this match, click on the button below which will take you to the ground page where you can choose which stand to sit in.br INPUT TYPE=SUBMIT NAME=BuyMatch VALUE=Buy Tickets for this matchbr INPUT TYPE=SUBMIT NAME=ViewMatch VALUE=View Stadium Plan of the match venue /p /FORM Now when I press one of the buttons it diverts to the right servlet but I am having a problem with the JavaBean in the servlet. You see I want to extract the Bean from the page and use it in the code in my servlet. Now the servlet that loads up that page is different (it's called SearchServlet) to the one that deals with the button pressing (MatchServlet). SearchServlet passes it to the page as follows: GameBean gameBean = (GameBean) matches.get(0); request.setAttribute(gameBean, gameBean); address = /match.jsp; RequestDispatcher dispatcher = request.getRequestDispatcher(address); dispatcher.forward(request, response); Now in the MatchServlet servlet I have tried extracting the Bean using the code: GameBean gb = (GameBean) request.getAttribute(gameBean); But it is coming back as a null pointer error. I've also tried getting it using this code: HttpSession session = request.getSession(true); GameBean gb = (GameBean) session.getAttribute(gameBean); But again I'm getting a null pointer error. Can anyone help me and tell me how I can extract the gameBean from the page? Many thanks Mark Whitby [EMAIL PROTECTED]
RE: [SPAM] - Problems with extracting beans from a JavaServer Page - Bayesian Filter detected spam
If I have followed your code fragments correctly, it looks like your bean is in request scope and it will go away between requests. Ron Day Senior Developer e-Rewards, Inc. 8401 N. Central Expressway, Suite 900 Dallas, TX 75225 Voice: 214.782.2834 Fax: 214.782.2900 -Original Message- From: Mark Whitby [mailto:[EMAIL PROTECTED] Sent: Thursday, March 02, 2006 1:47 PM To: Tomcat Users List Subject: [SPAM] - Problems with extracting beans from a JavaServer Page - Bayesian Filter detected spam Hey all, This may seem like a really dense question so apologies if it is but I have the following code on a jsp page: jsp:useBean id=gameBean type=FYPCode.GameBean scope=request / FORM ACTION=MatchController p jsp:getProperty name=gameBean property=day /nbsp; jsp:getProperty name=gameBean property=dayNumber /nbsp; jsp:getProperty name=gameBean property=month /nbsp; jsp:getProperty name=gameBean property=year /br jsp:getProperty name=gameBean property=homeTeam /nbsp;vsnbsp; jsp:getProperty name=gameBean property=awayTeam /br jsp:getProperty name=gameBean property=venue /nbsp; jsp:getProperty name=gameBean property=kickOffTime /, kick off.br bAllocated Tickets:nbsp;/bjsp:getProperty name=gameBean property=allocatedTickets / /p p To choose to buy tickets for this match, click on the button below which will take you to the ground page where you can choose which stand to sit in.br INPUT TYPE=SUBMIT NAME=BuyMatch VALUE=Buy Tickets for this matchbr INPUT TYPE=SUBMIT NAME=ViewMatch VALUE=View Stadium Plan of the match venue /p /FORM Now when I press one of the buttons it diverts to the right servlet but I am having a problem with the JavaBean in the servlet. You see I want to extract the Bean from the page and use it in the code in my servlet. Now the servlet that loads up that page is different (it's called SearchServlet) to the one that deals with the button pressing (MatchServlet). SearchServlet passes it to the page as follows: GameBean gameBean = (GameBean) matches.get(0); request.setAttribute(gameBean, gameBean); address = /match.jsp; RequestDispatcher dispatcher = request.getRequestDispatcher(address); dispatcher.forward(request, response); Now in the MatchServlet servlet I have tried extracting the Bean using the code: GameBean gb = (GameBean) request.getAttribute(gameBean); But it is coming back as a null pointer error. I've also tried getting it using this code: HttpSession session = request.getSession(true); GameBean gb = (GameBean) session.getAttribute(gameBean); But again I'm getting a null pointer error. Can anyone help me and tell me how I can extract the gameBean from the page? Many thanks Mark Whitby [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: - Problems with extracting beans from a JavaServer Page
Thanks for the reply Ron So what you're saying is that once the page has loaded the bean, it discards it? Which means I can send a bean from a servlet to a page but I can't extract a bean from a page? Is that correct based on my code? So what I'm thinking now is to store the bean in the session.setAttribute method, would that save the bean and allow me to extract it in another servlet? Mark - Original Message - From: Day, Ron [EMAIL PROTECTED] To: Tomcat Users List users@tomcat.apache.org Sent: Thursday, March 02, 2006 7:56 PM Subject: RE: [SPAM] - Problems with extracting beans from a JavaServer Page - Bayesian Filter detected spam If I have followed your code fragments correctly, it looks like your bean is in request scope and it will go away between requests. Ron Day Senior Developer e-Rewards, Inc. 8401 N. Central Expressway, Suite 900 Dallas, TX 75225 Voice: 214.782.2834 Fax: 214.782.2900 -Original Message- From: Mark Whitby [mailto:[EMAIL PROTECTED] Sent: Thursday, March 02, 2006 1:47 PM To: Tomcat Users List Subject: [SPAM] - Problems with extracting beans from a JavaServer Page - Bayesian Filter detected spam Hey all, This may seem like a really dense question so apologies if it is but I have the following code on a jsp page: jsp:useBean id=gameBean type=FYPCode.GameBean scope=request / FORM ACTION=MatchController p jsp:getProperty name=gameBean property=day /nbsp; jsp:getProperty name=gameBean property=dayNumber /nbsp; jsp:getProperty name=gameBean property=month /nbsp; jsp:getProperty name=gameBean property=year /br jsp:getProperty name=gameBean property=homeTeam /nbsp;vsnbsp; jsp:getProperty name=gameBean property=awayTeam /br jsp:getProperty name=gameBean property=venue /nbsp; jsp:getProperty name=gameBean property=kickOffTime /, kick off.br bAllocated Tickets:nbsp;/bjsp:getProperty name=gameBean property=allocatedTickets / /p p To choose to buy tickets for this match, click on the button below which will take you to the ground page where you can choose which stand to sit in.br INPUT TYPE=SUBMIT NAME=BuyMatch VALUE=Buy Tickets for this matchbr INPUT TYPE=SUBMIT NAME=ViewMatch VALUE=View Stadium Plan of the match venue /p /FORM Now when I press one of the buttons it diverts to the right servlet but I am having a problem with the JavaBean in the servlet. You see I want to extract the Bean from the page and use it in the code in my servlet. Now the servlet that loads up that page is different (it's called SearchServlet) to the one that deals with the button pressing (MatchServlet). SearchServlet passes it to the page as follows: GameBean gameBean = (GameBean) matches.get(0); request.setAttribute(gameBean, gameBean); address = /match.jsp; RequestDispatcher dispatcher = request.getRequestDispatcher(address); dispatcher.forward(request, response); Now in the MatchServlet servlet I have tried extracting the Bean using the code: GameBean gb = (GameBean) request.getAttribute(gameBean); But it is coming back as a null pointer error. I've also tried getting it using this code: HttpSession session = request.getSession(true); GameBean gb = (GameBean) session.getAttribute(gameBean); But again I'm getting a null pointer error. Can anyone help me and tell me how I can extract the gameBean from the page? Many thanks Mark Whitby [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
tomcat stops responding (err=-104)
Hi everybody, I've got a problem with tomcat since a week. It seems to be related to the traffic, which is more important than usual these days. Tomcat stops responding, wile the tomcat process is still running. Restaring tomcat+apache makes everything working fine. version information : jakarta-tomcat-5.0.28 apache 2.0.54 Linux Mandriva 2006 JDK 1.5.0_05-b05 mod_jk 1.2 mod_jk.log : [Thu Mar 02 11:13:58 2006] [error] ajp_connection_tcp_get_message::jk_ajp_common.c (961): Can't receive the response message from tomcat, network problems or tomcat is down (127.0.0.1:8009), err=-104 [Thu Mar 02 11:13:58 2006] [error] ajp_get_reply::jk_ajp_common.c (1503): Tomcat is down or refused connection. No response has been sent to the client (yet) [Thu Mar 02 11:13:58 2006] [info] ajp_service::jk_ajp_common.c (1721): Receiving from tomcat failed, recoverable operation attempt=0 [Thu Mar 02 11:13:58 2006] [info] ajp_service::jk_ajp_common.c (1749): Sending request to tomcat failed, recoverable operation attempt=1 ... and so on, until restart mod_jk.conf is quite simple : JkWorkersFile /usr/tomcat/current/conf/worker.properties JkLogFile /etc/httpd/logs/mod_jk.log JkLogLevelinfo JkLogStampFormat [%a %b %d %H:%M:%S %Y] JkOptions +ForwardKeySize +ForwardURICompat -ForwardDirectories JkRequestLogFormat %w %V %T ... + 2 JkMount Nothing in apache error_log, nor in catalina.out. Tomcat and Apache are running with the same user (apache). I was thinking about a problem of too many file descriptors opened ; do you think it could be possible ? Is there a misconfiguration somewhere ? Have somebody encountered a similar problem ? Philippe - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: - Problems with extracting beans from a JavaServer Page
Yes, if I interpreted your code correctly. The scope attribute determines where the bean is stored, i.e. in what object. Ron Day Senior Developer e-Rewards, Inc. 8401 N. Central Expressway, Suite 900 Dallas, TX 75225 Voice: 214.782.2834 Fax: 214.782.2900 -Original Message- From: Mark Whitby [mailto:[EMAIL PROTECTED] Sent: Thursday, March 02, 2006 2:00 PM To: Tomcat Users List Subject: Re: - Problems with extracting beans from a JavaServer Page Thanks for the reply Ron So what you're saying is that once the page has loaded the bean, it discards it? Which means I can send a bean from a servlet to a page but I can't extract a bean from a page? Is that correct based on my code? So what I'm thinking now is to store the bean in the session.setAttribute method, would that save the bean and allow me to extract it in another servlet? Mark - Original Message - From: Day, Ron [EMAIL PROTECTED] To: Tomcat Users List users@tomcat.apache.org Sent: Thursday, March 02, 2006 7:56 PM Subject: RE: [SPAM] - Problems with extracting beans from a JavaServer Page - Bayesian Filter detected spam If I have followed your code fragments correctly, it looks like your bean is in request scope and it will go away between requests. Ron Day Senior Developer e-Rewards, Inc. 8401 N. Central Expressway, Suite 900 Dallas, TX 75225 Voice: 214.782.2834 Fax: 214.782.2900 -Original Message- From: Mark Whitby [mailto:[EMAIL PROTECTED] Sent: Thursday, March 02, 2006 1:47 PM To: Tomcat Users List Subject: [SPAM] - Problems with extracting beans from a JavaServer Page - Bayesian Filter detected spam Hey all, This may seem like a really dense question so apologies if it is but I have the following code on a jsp page: jsp:useBean id=gameBean type=FYPCode.GameBean scope=request / FORM ACTION=MatchController p jsp:getProperty name=gameBean property=day /nbsp; jsp:getProperty name=gameBean property=dayNumber /nbsp; jsp:getProperty name=gameBean property=month /nbsp; jsp:getProperty name=gameBean property=year /br jsp:getProperty name=gameBean property=homeTeam /nbsp;vsnbsp; jsp:getProperty name=gameBean property=awayTeam /br jsp:getProperty name=gameBean property=venue /nbsp; jsp:getProperty name=gameBean property=kickOffTime /, kick off.br bAllocated Tickets:nbsp;/bjsp:getProperty name=gameBean property=allocatedTickets / /p p To choose to buy tickets for this match, click on the button below which will take you to the ground page where you can choose which stand to sit in.br INPUT TYPE=SUBMIT NAME=BuyMatch VALUE=Buy Tickets for this matchbr INPUT TYPE=SUBMIT NAME=ViewMatch VALUE=View Stadium Plan of the match venue /p /FORM Now when I press one of the buttons it diverts to the right servlet but I am having a problem with the JavaBean in the servlet. You see I want to extract the Bean from the page and use it in the code in my servlet. Now the servlet that loads up that page is different (it's called SearchServlet) to the one that deals with the button pressing (MatchServlet). SearchServlet passes it to the page as follows: GameBean gameBean = (GameBean) matches.get(0); request.setAttribute(gameBean, gameBean); address = /match.jsp; RequestDispatcher dispatcher = request.getRequestDispatcher(address); dispatcher.forward(request, response); Now in the MatchServlet servlet I have tried extracting the Bean using the code: GameBean gb = (GameBean) request.getAttribute(gameBean); But it is coming back as a null pointer error. I've also tried getting it using this code: HttpSession session = request.getSession(true); GameBean gb = (GameBean) session.getAttribute(gameBean); But again I'm getting a null pointer error. Can anyone help me and tell me how I can extract the gameBean from the page? Many thanks Mark Whitby [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: - Problems with extracting beans from a JavaServer Page
Thanks Ron, I've now changed it to store the item both in the session and the request and this has done the trick. I store it in the request for the jsp page and in the httpsession for the following bean. Or is this inefficient? Mark - Original Message - From: Day, Ron [EMAIL PROTECTED] To: Tomcat Users List users@tomcat.apache.org Sent: Thursday, March 02, 2006 8:16 PM Subject: RE: - Problems with extracting beans from a JavaServer Page Yes, if I interpreted your code correctly. The scope attribute determines where the bean is stored, i.e. in what object. Ron Day Senior Developer e-Rewards, Inc. 8401 N. Central Expressway, Suite 900 Dallas, TX 75225 Voice: 214.782.2834 Fax: 214.782.2900 -Original Message- From: Mark Whitby [mailto:[EMAIL PROTECTED] Sent: Thursday, March 02, 2006 2:00 PM To: Tomcat Users List Subject: Re: - Problems with extracting beans from a JavaServer Page Thanks for the reply Ron So what you're saying is that once the page has loaded the bean, it discards it? Which means I can send a bean from a servlet to a page but I can't extract a bean from a page? Is that correct based on my code? So what I'm thinking now is to store the bean in the session.setAttribute method, would that save the bean and allow me to extract it in another servlet? Mark - Original Message - From: Day, Ron [EMAIL PROTECTED] To: Tomcat Users List users@tomcat.apache.org Sent: Thursday, March 02, 2006 7:56 PM Subject: RE: [SPAM] - Problems with extracting beans from a JavaServer Page - Bayesian Filter detected spam If I have followed your code fragments correctly, it looks like your bean is in request scope and it will go away between requests. Ron Day Senior Developer e-Rewards, Inc. 8401 N. Central Expressway, Suite 900 Dallas, TX 75225 Voice: 214.782.2834 Fax: 214.782.2900 -Original Message- From: Mark Whitby [mailto:[EMAIL PROTECTED] Sent: Thursday, March 02, 2006 1:47 PM To: Tomcat Users List Subject: [SPAM] - Problems with extracting beans from a JavaServer Page - Bayesian Filter detected spam Hey all, This may seem like a really dense question so apologies if it is but I have the following code on a jsp page: jsp:useBean id=gameBean type=FYPCode.GameBean scope=request / FORM ACTION=MatchController p jsp:getProperty name=gameBean property=day /nbsp; jsp:getProperty name=gameBean property=dayNumber /nbsp; jsp:getProperty name=gameBean property=month /nbsp; jsp:getProperty name=gameBean property=year /br jsp:getProperty name=gameBean property=homeTeam /nbsp;vsnbsp; jsp:getProperty name=gameBean property=awayTeam /br jsp:getProperty name=gameBean property=venue /nbsp; jsp:getProperty name=gameBean property=kickOffTime /, kick off.br bAllocated Tickets:nbsp;/bjsp:getProperty name=gameBean property=allocatedTickets / /p p To choose to buy tickets for this match, click on the button below which will take you to the ground page where you can choose which stand to sit in.br INPUT TYPE=SUBMIT NAME=BuyMatch VALUE=Buy Tickets for this matchbr INPUT TYPE=SUBMIT NAME=ViewMatch VALUE=View Stadium Plan of the match venue /p /FORM Now when I press one of the buttons it diverts to the right servlet but I am having a problem with the JavaBean in the servlet. You see I want to extract the Bean from the page and use it in the code in my servlet. Now the servlet that loads up that page is different (it's called SearchServlet) to the one that deals with the button pressing (MatchServlet). SearchServlet passes it to the page as follows: GameBean gameBean = (GameBean) matches.get(0); request.setAttribute(gameBean, gameBean); address = /match.jsp; RequestDispatcher dispatcher = request.getRequestDispatcher(address); dispatcher.forward(request, response); Now in the MatchServlet servlet I have tried extracting the Bean using the code: GameBean gb = (GameBean) request.getAttribute(gameBean); But it is coming back as a null pointer error. I've also tried getting it using this code: HttpSession session = request.getSession(true); GameBean gb = (GameBean) session.getAttribute(gameBean); But again I'm getting a null pointer error. Can anyone help me and tell me how I can extract the gameBean from the page? Many thanks Mark Whitby [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
mod_jk errors - are these normal?
If our setup was completely stable, and configured perfectly, should there be NO mod_jk errors ever? Or, are some errors part of normal operation? The system seems to work fine from a user's perspective, but we still occasionally get these: [Wed Mar 01 20:00:42 2006] [error] ajp_connection_tcp_get_message::jk_ajp_common.c (961): Can't receive the response message from tomcat, network problems or tomcat is down (10.0.0.9:8009), err=-113 [Wed Mar 01 20:00:42 2006] [error] ajp_get_reply::jk_ajp_common.c (1503): Tomcat is down or refused connection. No response has been sent to the client (yet) [Wed Mar 01 20:00:42 2006] [info] ajp_service::jk_ajp_common.c (1721): Receiving from tomcat failed, recoverable operation attempt=0 [Wed Mar 01 20:00:42 2006] [info] ajp_service::jk_ajp_common.c (1749): Sending request to tomcat failed, recoverable operation attempt=1 We don't get them that often... about once every 30 minutes. But, we also don't have much traffic right now. (Only about 700 visitors a day, with about 15 page views per visitor.) We've ran load tests, but the error message count doesn't seem to inrease by much if any. Are these error messages a normal part of mod_jk, or do they definitely indicate some sort of problem (like network issues)? We are using mod_jk 1.2.15, Apache 2.0.55 and Tomcat 5.5.15. For what it's worth, we have other completely separate system setups using mod_jk2, and they also all seem to get occasional ajp errors. This is our first setup using mod_jk, and we are assuming these errors are a bad thing. Thanks, -Michael __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Tomcat - Hibernate
Hello, I think we are getting very close I just need clarification on a few things. First off I made the changes of taking out the Context setting in the server.xml and created a context.xml file and put it into the META-INF directory of my application. (Side note: I think this is a lot easier and cleaner way of doing it) I deployed my war file through Tomcat Manager with the context.xml file in the META-INF directory and it would deploy but not connect to the database. So, I also put the context.xml file in the following path: ${CATALINA_HOME}/conf/${ENGINE_NAME}/${HOSTNAME}/${CONTEXT_NAME}.xml This would work great, but I still had to restart TC once I did this. !--- Question 1 -- First Question: Is this correct to place the context.xml file in both places when uploading with a WAR through Tomcat Manager? I reviewed both these resources for more information but I didn't really find what I was looking for. http://tomcat.apache.org/tomcat-5.5-doc/deployer-howto.html http://tomcat.apache.org/tomcat-5.5-doc/manager-howto.html !--- End Question 1 -- What I would like to do is use Tomcat Manager to deploy, undeploy and redeploy my apps. But remotely there is no way to upload the context.xml file into the correct ${CATALINA_HOME}/conf/${ENGINE_NAME}/${HOSTNAME}/${CONTEXT_NAME}.xml path. Below is an example of my context.xml file that I put into my META-INF. I don't think you would have to change anything from the server.xml to this, but I'm not sure. !-- CODE !-- Context path for application Cohorts -- Context path=/Cohorts docBase=Cohorts reloadable=true crossContext=true Resource name=jdbc/dbus5 scope=Shareable type=javax.sql.DataSource/ ResourceParams name=jdbc/dbus5 parameter namefactory/name valueorg.apache.commons.dbcp.BasicDataSourceFactory/value /parameter !-- DBCP database connection settings -- parameter nameurl/name valuejdbc:mysql://server:3306/us?autoReconnect=true/value /parameter parameter namedriverClassName/namevaluecom.mysql.jdbc.Driver/value /parameter ... /ResourceParams /Context ! End Code --- !--- Server.xml Settings - Host name=localhost debug=0 appBase=webapps unpackWARs=true autoDeploy=true xmlValidation=false xmlNamespaceAware=false ! End Server.xml Settings --- Thanks again for all your help. -Lucas -Original Message- From: Tim Lucia [mailto:[EMAIL PROTECTED] Sent: Thursday, March 02, 2006 5:22 AM To: 'Tomcat Users List' Subject: RE: Tomcat - Hibernate You want ENGINE_NAME in there too, i.e.: ${CATALINA_HOME}/conf/${ENGINE_NAME}/${HOSTNAME}/${CONTEXT_NAME}.xml or, for example (spaces delineate variables above, don't really use them), /usr/local/tomcat /conf /Catalina /localhost /ROOT.xml == http://localhost:8080/ /usr/local/tomcat /conf /Catalina /localhost /myapp.xml == http://localhost:8080/myapp Tim -Original Message- From: Nikola Milutinovic [mailto:[EMAIL PROTECTED] Sent: Thursday, March 02, 2006 3:28 AM To: Tomcat Users List Subject: Re: Tomcat - Hibernate --- Giorgio Clavelli [EMAIL PROTECTED] wrote: Hi, I'm not an exper at all, but I try to put my 2 cents. The fact that your app can connect successfully after the server restart, suggests that you should have your app's context.xml (or whatever it is called) not in the server.xml but in the correct location inside your app directories. I seem to have read, the correct location being under the META-INF directory and that Tomcat tries first to look for context in this dir and then use that one under server.xml. I hope expert user, will comfirm in one way or the other this understanding of your problem. As of TC 5.0 the prefered way of configuring a context (web application) is to use a XML context fragment file. That file will either be placed in ${CATALINA_HOME}/conf/${HOSTNAME}/${CONTEXT_NAME}.xml, if you're deploying from a directory or in ./META-INF/${CONTEXT_NAME}.xml, if it is a WAR file. That way, deploying of an app can be free from editing the server.xml. As for the original problem, that is NOT it. The fact that TC's restart picks up everything suggests that the config is OK. Or at least relatively OK. I think that TC will create a XML fragment for the app and it could be that *that* fragment is interfering with the deployment process. Since I can see nothing wrong with the config, I would advise the original poster to go the correct route. Create the config fragment, pack it into your WAR, clean up server.xml and try to deploy/undeploy/redeploy. It will have no effect on TC 4.x, if
Response already committed when redirecting from error page?
Hi all, I'm using Apache 2.something, mod_jk and Tomcat 5.5.15. mod_jk sends all requests to Tomcat, so Tomcat needs to handle requests for nonexistent paths. Our application handles requests to more than one hostname, and the error response depends on the host to which the request was sent. OK, just one more wrinkle: one of the error responses should be a redirect. That is, http://somehost.com/nosuchpath should return an error page served by Tomcat, but http://otherhost.com/nosuchpath should redirect to http://elsewhere.com/404. Right now this is implemented thus: - error-page in web.xml goes to /errorpage - /errorpage is mapped to a servlet - the servlet inspects the server name; if the server is somehost.com the servlet forwards to somehosterror.jsp; if the server is otherhost.com the servlet forwards to otherhosterror.jsp. - The somehosterror.jsp part works fine, so enough about that. - Right now otherhosterror.jsp does a jsp:import of http://elsewhere.com/404. This works, but (since it's not a redirect) the user still sees nosuchpath in their browser. I'd prefer to do a redirect in the servlet. But if I do that, although the redirect works, I get Mar 2, 2006 2:15:47 PM org.apache.jk.core.MsgContext action INFO: Response already committed Same deal if otherhosterror.jsp does a c:redirect. As far as I can tell nothing here should be writing much output, much less committing it. So, why does this happen, and is it a problem? I hate to deploy something that spews mysterious log messages, especially if they mean the something might not always work or there's a resource leak or whatever. Thanks, -- David C. Schweisguth, Senior Software Engineer Healthline Networks, Inc., 660 Third Street, San Francisco, CA 94107 phone 415-281-3121 / fax 415-281-3199 / www.healthline.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Optimizing tomcat
Hello, I have the following setup. Java jdk 1.4.2 tomcat 5.0.19 Apache 2.0 mod_jk 2.0 ok there are 3 instances of tomcat and one of them with 4 webapps contexts. and 3 large applications that are used a lot. And I do some preloading of some data from database into objects at start up... About every week or so I get out of memory errors... Some of them are due to Java advanace imageing API. Its a little buggy but also sometimes because of tomcat needing more memory. and I am fixing some of my own apps bugs... So my questions: 1. I experimented with setting JVM memory options larger but I am not sure what's a good amount for each of the tomcats? 256MB.. 512MB...?? I only have 1GB of RAM and 2GB of swap and the machine has 2 Xeon and runs Redhat. 2. based on what should I make changes to these settings? or should just take the defaults? maxThreads=150 minSpareThreads=25 maxSpareThreads=75 enableLookups=false acceptCount=100 3. If I upgrade JDK and tomcat would that improve things? I did see some bugs related to JDK 1.4.2 but 1.5 could have some other things too :) 4. I don't use jsp and infact I could even run things on Jserv so what tomcat version is faster and needs less memory? Thanks - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
DataSourceRealm Configuration Question (5.5.15)
Can a JNDI DataSourceRealm be defined in my web app's context.xml file, or must it be in the container's server.xml file? Thanks - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: DataSourceRealm Configuration Question (5.5.15)
It can be in the context. I have mine within the context... inside server.xml but I guess if you have your context in context.xml thats fine too. Can a JNDI DataSourceRealm be defined in my web app's context.xml file, or must it be in the container's server.xml file? Thanks - 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: mod_jk errors - are these normal?
The system seems to work fine from a user's perspective, but we still occasionally get these: [Wed Mar 01 20:00:42 2006] [error] ajp_connection_tcp_get_message::jk_ajp_common.c (961): Can't receive the response message from tomcat, network problems or tomcat is down (10.0.0.9:8009), err=-113 [Wed Mar 01 20:00:42 2006] [error] ajp_get_reply::jk_ajp_common.c (1503): Tomcat is down or refused connection. No response has been sent to the client (yet) [Wed Mar 01 20:00:42 2006] [info] ajp_service::jk_ajp_common.c (1721): Receiving from tomcat failed, recoverable operation attempt=0 [Wed Mar 01 20:00:42 2006] [info] ajp_service::jk_ajp_common.c (1749): Sending request to tomcat failed, recoverable operation attempt=1 For what it's worth, we have other completely separate system setups using mod_jk2, and they also all seem to get occasional ajp errors. This is our first setup using mod_jk, and we are assuming these errors are a bad thing. I always had those errors. I did anything i could do - change timeouts, change backlog, change this, change that - whatever - these errors remain. Just make sure, that the tomcat allows as much or more ajp-connctions, than there will be apache-processes/threads. I think the programmers have given up on solving this - whatever the problem is. AFAIK, mod_jk prints that error-messages to the log and then tries another connect which usually works. Actually i hear the developers say: this is not a problem - or something like that. Well, no comment on that ... - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Tomcat - Hibernate
I'm jumping in the middle here so forgive me if this has already been covered. If you notice that your context.xml is not being deployed from your own META-INF directory, try putting the following in your server.xml : Host name=localhost debug=0 appBase=webapps unpackWARs=true autoDeploy=false deployOnStartup=true xmlValidation=false xmlNamespaceAware=false deployXML=true The deployXML=true is the important part. I'm not certain if that defaults to false or not. When I have the above and my context.xml in the META-INF, then tomcat creates the mywebappname.xml within the conf/Catalina/blah blah/ directory. Hope this helps. -Dennis -Original Message- From: Lucas Bee [mailto:[EMAIL PROTECTED] Sent: Thursday, March 02, 2006 5:11 PM To: 'Tomcat Users List' Subject: RE: Tomcat - Hibernate Hello, I think we are getting very close I just need clarification on a few things. First off I made the changes of taking out the Context setting in the server.xml and created a context.xml file and put it into the META-INF directory of my application. (Side note: I think this is a lot easier and cleaner way of doing it) I deployed my war file through Tomcat Manager with the context.xml file in the META-INF directory and it would deploy but not connect to the database. So, I also put the context.xml file in the following path: ${CATALINA_HOME}/conf/${ENGINE_NAME}/${HOSTNAME}/${CONTEXT_NAME}.xml This would work great, but I still had to restart TC once I did this. !--- Question 1 -- First Question: Is this correct to place the context.xml file in both places when uploading with a WAR through Tomcat Manager? I reviewed both these resources for more information but I didn't really find what I was looking for. http://tomcat.apache.org/tomcat-5.5-doc/deployer-howto.html http://tomcat.apache.org/tomcat-5.5-doc/manager-howto.html !--- End Question 1 -- What I would like to do is use Tomcat Manager to deploy, undeploy and redeploy my apps. But remotely there is no way to upload the context.xml file into the correct ${CATALINA_HOME}/conf/${ENGINE_NAME}/${HOSTNAME}/${CONTEXT_NAME}.xml path. Below is an example of my context.xml file that I put into my META-INF. I don't think you would have to change anything from the server.xml to this, but I'm not sure. !-- CODE !-- Context path for application Cohorts -- Context path=/Cohorts docBase=Cohorts reloadable=true crossContext=true Resource name=jdbc/dbus5 scope=Shareable type=javax.sql.DataSource/ ResourceParams name=jdbc/dbus5 parameter namefactory/name valueorg.apache.commons.dbcp.BasicDataSourceFactory/value /parameter !-- DBCP database connection settings -- parameter nameurl/name valuejdbc:mysql://server:3306/us?autoReconnect=true/value /parameter parameter namedriverClassName/namevaluecom.mysql.jdbc.Driver/value /parameter ... /ResourceParams /Context ! End Code --- !--- Server.xml Settings - Host name=localhost debug=0 appBase=webapps unpackWARs=true autoDeploy=true xmlValidation=false xmlNamespaceAware=false ! End Server.xml Settings --- Thanks again for all your help. -Lucas -Original Message- From: Tim Lucia [mailto:[EMAIL PROTECTED] Sent: Thursday, March 02, 2006 5:22 AM To: 'Tomcat Users List' Subject: RE: Tomcat - Hibernate You want ENGINE_NAME in there too, i.e.: ${CATALINA_HOME}/conf/${ENGINE_NAME}/${HOSTNAME}/${CONTEXT_NAME}.xml or, for example (spaces delineate variables above, don't really use them), /usr/local/tomcat /conf /Catalina /localhost /ROOT.xml == http://localhost:8080/ /usr/local/tomcat /conf /Catalina /localhost /myapp.xml == http://localhost:8080/myapp Tim -Original Message- From: Nikola Milutinovic [mailto:[EMAIL PROTECTED] Sent: Thursday, March 02, 2006 3:28 AM To: Tomcat Users List Subject: Re: Tomcat - Hibernate --- Giorgio Clavelli [EMAIL PROTECTED] wrote: Hi, I'm not an exper at all, but I try to put my 2 cents. The fact that your app can connect successfully after the server restart, suggests that you should have your app's context.xml (or whatever it is called) not in the server.xml but in the correct location inside your app directories. I seem to have read, the correct location being under the META-INF directory and that Tomcat tries first to look for context in this dir and then use that one under server.xml. I hope expert user, will comfirm in one way or the other this understanding of your problem. As of TC 5.0 the prefered way of configuring a context (web application) is to use a XML context fragment file. That
RE: DataSourceRealm Configuration Question (5.5.15)
It can be either. The recommended way, 5.0 and later, is in the war's context.xml. If you have a global resource, that is defined in server.xml, and referenced from each context wishing to make use of it. Tim -Original Message- From: Alex Jalali [mailto:[EMAIL PROTECTED] Sent: Thursday, March 02, 2006 5:39 PM To: Tomcat Users List Subject: Re: DataSourceRealm Configuration Question (5.5.15) It can be in the context. I have mine within the context... inside server.xml but I guess if you have your context in context.xml thats fine too. Can a JNDI DataSourceRealm be defined in my web app's context.xml file, or must it be in the container's server.xml file? Thanks - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: DataSourceRealm Configuration Question (5.5.15)
As other's have noted, both. The difference is that in the context will limit to just that app being able to access it and in the server is global so that all apps can access it. Doug - Original Message - From: James Reynolds [EMAIL PROTECTED] To: Tomcat Users List users@tomcat.apache.org Sent: Thursday, March 02, 2006 5:44 PM Subject: DataSourceRealm Configuration Question (5.5.15) Can a JNDI DataSourceRealm be defined in my web app's context.xml file, or must it be in the container's server.xml file? Thanks - 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: Response already committed when redirecting from error page?
David C. Schweisguth [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Hi all, I'm using Apache 2.something, mod_jk and Tomcat 5.5.15. mod_jk sends all requests to Tomcat, so Tomcat needs to handle requests for nonexistent paths. Our application handles requests to more than one hostname, and the error response depends on the host to which the request was sent. OK, just one more wrinkle: one of the error responses should be a redirect. That is, http://somehost.com/nosuchpath should return an error page served by Tomcat, but http://otherhost.com/nosuchpath should redirect to http://elsewhere.com/404. Right now this is implemented thus: - error-page in web.xml goes to /errorpage - /errorpage is mapped to a servlet - the servlet inspects the server name; if the server is somehost.com the servlet forwards to somehosterror.jsp; if the server is otherhost.com the servlet forwards to otherhosterror.jsp. - The somehosterror.jsp part works fine, so enough about that. - Right now otherhosterror.jsp does a jsp:import of http://elsewhere.com/404. This works, but (since it's not a redirect) the user still sees nosuchpath in their browser. I'd prefer to do a redirect in the servlet. But if I do that, although the redirect works, I get Mar 2, 2006 2:15:47 PM org.apache.jk.core.MsgContext action INFO: Response already committed That message really should be dropped to DEBUG level. It's pretty much harmless. For some reason, Tomcat thinks it should send the Headers twice, but it's smart enough to not actually do it. Same deal if otherhosterror.jsp does a c:redirect. As far as I can tell nothing here should be writing much output, much less committing it. So, why does this happen, and is it a problem? I hate to deploy something that spews mysterious log messages, especially if they mean the something might not always work or there's a resource leak or whatever. Thanks, -- David C. Schweisguth, Senior Software Engineer Healthline Networks, Inc., 660 Third Street, San Francisco, CA 94107 phone 415-281-3121 / fax 415-281-3199 / www.healthline.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]