Re: connection pooling basic help please
Krishnakant Mane wrote: hello, I refered to the docs in tomcat 5 for connection pooling. the document is pritty comprehencive and I understood the server.xml part of it. but now I want to know how exactly can I use a connection from the pool in my servlet. the example in tomcat documentation is on a jsp based applicatio. but I don't understand how I use a pooled connection in a servlet. You use a pooled connection in a simillar manner to a driver managed connection, except that you look up a resource (JNDI in this case). In your servlet just look up the resource. should I initialise the connection in the Init method? how and when should I close the connection? You should close the connection immediately when you are done with it. Best not to pass references of them around. You would close them as a you would in a driver managed connection, that is Connection.close() ; and wat entries in the web.xml file will effect connection pooling? Please help it is really urgent. thanks Krishnakant. Send instant messages to your online friends http://uk.messenger.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: FW: My very first servlet cannot be run
Hi Patrick, You use should use the servlet name you specified rather than the class name. Do you need the servlet-mapping as well ? Here's a example from tomcat: http://cvs.apache.org/viewcvs.cgi/jakarta-tomcat-catalina/webapps/admin/WEB-INF/web.xml?view=markup Van Den Bemt, Patrick (P.) wrote: Hi there, I have got an issue running a very first servlet on tomcat5. The valid Servlet code for Log4jTester : package test; public class Log4jTester { public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { } } The valid web.xml : ?xml version=1.0 encoding=ISO-8859-1? !DOCTYPE web-app PUBLIC -//Sun Microsystems, Inc.//DTD Web Application 2.3//EN http://java.sun.com/dtd/web-app_2_3.dtd; web-app display-namePatrickWorkspace/display-name descriptionThis is the Patrick workspace/description servlet servlet-namelog4j/servlet-name servlet-classtest.Log4jTester/servlet-class /servlet servlet-mapping servlet-namelog4j/servlet-name url-pattern/log4j/url-pattern /servlet-mapping /web-app The valid log4j.html HTML HEAD TITLE log4jtest /TITLE HEAD BODY FORM TYPE = submit ACTION=/test.Log4jTester METHOD=GET CENTER INPUT TYPE=submit NAME=submit VALUE=go /CENTER /FORM /BODY /HTML The valid index.html HTML HEAD /HEAD BODY A HREF = html/log4j.html log4j /A /BODY /HTML Deployment: The deployment works fine. Tomcat manager lists the PatrickWorkSpace. PatrickWorkSpace opens the index.html. Index.html opens the log4j.html Clicking the Go button on log4j.html results in following error HTTP Status 404 - /PatrickWorkSpace/test.Log4jTester type Status report message /PatrickWorkSpace/test.Log4jTester description The requested resource (/PatrickWorkSpace/test.Log4jTester) is not available. I hope anyone can give me some good hints and tips. Patrick. - 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 release connections in connection pool during reload?
You need to release connections when you are done with them, con.close() ; This is similar to using a direct connection to the jdbc except this time the only difference is where you got the connection object from. Calling con.close() ; will release the driver back to the connection pool. Lucie Chan wrote: Hi, I'm using Tomcat's connection pooling feature which is implemented with Jakarta's DBCP to manage database access, and I just noticed that each time when I do a reload (either via Ant or Tomcat manager), a database connection is added to the database server. Though this isn't a big problem in the production environment, but it's a bit annoying during development when I'm interactively developing and reloading the application. Currently, I will run reload till all the database connections have been exhausted, and then restart Tomcat server. There must a better way to do this. How do I destroy or reuse the connections in the pool? Any suggestion? --- Lucie - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Tomcat/Java and SMP
Dan, U have 10 application servers on one machine or 10 application on 10 distinct machines ? Dan Foreman wrote: Hi, I have a setup of 10 application servers using Tomcat 4/5, jsdk 1.4.2_02, SMP, win2k. In watching the performance under load I am concerned that only one CPU is being utilized at a time. To validate my theory I try hitting the application server with a request to generate a large report and then making another connection. The second connection is painfully slow and task manager only reports a 50% CPU utilization. After doing some reading on SMP/native threads and windows, I wrote a test java application that spawns n infinite loop threads from a single JVM with a delay between each creation. Sure enough one cpu (task manager reporting 50%) and then the other cpu are consumed (task manager reporting 100%). This test tells me that Java is capable of using both CPU's via native threading and some black magic in the windows dll's but that this scenario isn't happening in tomcat. Is it possible for tomcat to use more than one CPU or is there a critical flaw in my logic? -Dan - 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: EJB Compliance
Tony Colson wrote: This might be a re-post...sorry if it is... Is Tomcat 4.1 (or even 5.0) EJB Compliant? If so, is it compliant with the EJB 1.1 or 2.0 specification? No it is not EJB Compliant. There's no need for it to be. I can't seem to find appropriate documentation. Also, in the Tomcat docs under the Context element, it doesn't even mention the Ejb element, but, of course, it is provided in the sample server.xml file. It isn't there because it only implements the servlet/jsp specification. If you happen to want a ejb capable app server, JBoss might be a good idea. There are others like Jonas, enhydra that do the same thing. Thanks Tony - 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: Maximum page size before JasperException
What are you displaying in a JSP page that takes up 4 megs ? Peter Guyatt wrote: Hi There, Can anyone possibly tell me what the maximum page size allowed when compiling/presenting JSP page. The question arises when I try and display a 4meg file. If there is a limit is there any way to increase the maximum allowed size? Thanks Pete - 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: Maximum page size before JasperException
Hmm maybe you can just write out the file to the response body in a servlet ? Or do you need to do something in the jsp ? Peter Guyatt wrote: Hi there, Its an XML file Pete -Original Message- From: Kwok Peng Tuck [mailto:[EMAIL PROTECTED] Sent: 17 December 2003 11:12 To: Tomcat Users List Subject: Re: Maximum page size before JasperException What are you displaying in a JSP page that takes up 4 megs ? Peter Guyatt wrote: Hi There, Can anyone possibly tell me what the maximum page size allowed when compiling/presenting JSP page. The question arises when I try and display a 4meg file. If there is a limit is there any way to increase the maximum allowed size? Thanks Pete - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: UserDatabaseRealm 5.0.16 - immediately available for use by the Realm??
I think that is refering to a RDBMS realm. Last time I checked, tomcat-users.xml was only read on startup. Ron Andersen wrote: 1) I configured the default authentication realm - UserDatabaseRealm, which is setup to use conf/tomcat-users.xml. However, I am confused about the following statement: This Realm uses the UserDatabase configured in the global JNDI resources under the key UserDatabase. Any edits that are performed against this UserDatabase are immediately available for use by the Realm. 2) Does this mean that I can add user to the conf/tomcat-users.xml and Tomcat will be able to authenticate without restarting the server? - Do you Yahoo!? Protect your identity with Yahoo! Mail AddressGuard - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Security Policy
Hi list , With regards to the security manager in tomcat, is it possible to ship a policy file with each webapp ? - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Tomcat 5.0.16 DBCP Connection Pool Exhausted Error
Hmm maybe you are not returning connections after using them ? In the tomcat docs they do give a pattern you could use in your code, like try { }catch(SQLException e) { }finally { try { //Perform your close statements here. }catch(SQLException e) { } } HIH . Kausik Dey wrote: Hi Guys, Currently I am using 5.0.5 in production. I was trying to upgrade to 5.0.15 or 5.0.16. I made necessary changes to server.xml to create informix DBCP. Unfortunately, I am getting Connection Pool Exhausted error while trying to obtain the connection from Datasource. Is it a bug in these version or I am doing something wrong? Please advise me. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Tomcat 5.0.16 DBCP Connection Pool Exhausted Error
Isn't removeAbandoned deprecated ? If so is it still usable ? Hmm... are you getting the error right away or only after a few requests? Hard to say anything without further information. It is always a good idea to make sure you properly close all Statements, ResultSets anc Connections obtained from the pool. If you ae using commons dbcp, you could also add parameternamelogAbandoned/namevaluetrue/value/parameter parameternameremoveAbandoned/namevaluetrue/value/parameter - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Tomcat 5.0.16 DBCP Connection Pool Exhausted Error
This is where I saw it : http://jakarta.apache.org/commons/dbcp/apidocs/org/apache/commons/dbcp/AbandonedConfig.html But I think the code is still in there, just marked as deprecated :D Philipp Taprogge wrote: Hi! Kwok Peng Tuck wrote: Isn't removeAbandoned deprecated ? If so is it still usable ? I can't find a word about it being deprecated on http://jakarta.apache.org/commons/dbcp/configuration.html I am using this parameter quite successfully. Phil - 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: Web App Undeployment
Dunno if this helps, but could you try stopping the webapp first ? Pundalik Kudapkar wrote: I am using Tomcat 4.1.27 to deploy my web application. I am using the manager application for deployment and undeployment. The deployment is working just fine, however, the undeployment is not deleting all the jars under WEB-INF/lib directory. I am using following command: http://localhost:port/manager/remove?path=/xxx The command is getting executed successfully. I see the following message: OK - Removed application at context path /xxx But not all the jars under WEB-INF/lib directory are getting deleted. When I try to delete these jars manually, I get the OS message that these jars are locked by another process. This causes the subsequent deploy at the same context root to fail. I have to restart the Tomcat to get around this problem. Has anybody come across such kind of problem ? Any help in this matter would be highly appreciated. Thanks, Pundalik. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Not even close to on topic: smake n cdrecord for linux
So his 'Out of topic' is in fact out of topic ? :) Achana, maybe you can have a look at many of the linux mailling list out there ? Might be better help than the tomcat list. Oscar Carrillo wrote: You are waay off topic here. A google search is the way to go here. Regards, Oscar On Mon, 8 Dec 2003 [EMAIL PROTECTED] wrote: Hi, apologies for being out of topic. I've installed a new scsi cd-rw, a cursory cdrecord -scanbus shows that it is recognised as a scsi device (which is fine) but displayed as CD-ROM. Does anyone have a more concise and readable howto for Joerg Schilling's smake and cdrecord tools? Apologies again for being out of topic... TIA :-) - 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: Lock on database file not being released...
Chaikin, Yaakov Y (US SSA) wrote: Ok, I don't know why, but it's not letting me attach it. I think the list discards attachments . - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Lock on database file not being released...
Hmm, I could be wrong as well.. Chaikin, Yaakov Y (US SSA) wrote: Well, I've sent server.xml files over before and it went through. I am a bit confused about the attachment policy now. Thanks. Yaakov Chaikin Software Engineer BAE SYSTEMS 301-838-6899 (phone) 301-838-6802 (fax) [EMAIL PROTECTED] -Original Message- From: Kwok Peng Tuck [mailto:[EMAIL PROTECTED] Sent: Sunday, December 07, 2003 9:53 PM To: Tomcat Users List Subject: Re: Lock on database file not being released... Chaikin, Yaakov Y (US SSA) wrote: Ok, I don't know why, but it's not letting me attach it. I think the list discards attachments . - 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: trouble with servelts
You are missing the servlet.jar file, which contains the neccesary classes for your servlet to compile. Just make sure your compiler can find the jar file in your classpath. If you have a IDE like netbeans than you have it easy, just mount the jar file, and you will be able to compile without problems. kandathil girish wrote: i am a student and we use Tomcat as our server. I have been trying to run a basic servlet program but have been unsucessful as of yet. My tomact runs perfect, gives me the index page and stuff. Bu my servelt comiples with following errors C:\Tomcat 4.1\webapps\ROOT\WEB-INF\Classes\HelloWWW.java:2: package javax.servlet does not exist import javax.servlet.*; ^ C:\Tomcat 4.1\webapps\ROOT\WEB-INF\Classes\HelloWWW.java:3: package javax.servlet.http does not exist import javax.servlet.http.*; ^ C:\Tomcat 4.1\webapps\ROOT\WEB-INF\Classes\HelloWWW.java:13: cannot resolve symbol symbol : class HttpServlet location: class HelloWWW public class HelloWWW extends HttpServlet { ^ C:\Tomcat 4.1\webapps\ROOT\WEB-INF\Classes\HelloWWW.java:14: cannot resolve symbol symbol : class HttpServletRequest location: class HelloWWW public void doGet(HttpServletRequest request, ^ C:\Tomcat 4.1\webapps\ROOT\WEB-INF\Classes\HelloWWW.java:15: cannot resolve symbol symbol : class HttpServletResponse location: class HelloWWW HttpServletResponse response) ^ C:\Tomcat 4.1\webapps\ROOT\WEB-INF\Classes\HelloWWW.java:16: cannot resolve symbol symbol : class ServletException location: class HelloWWW throws ServletException, IOException { ^ 6 errors Tool completed with exit code the code for the same is as follow: import java.io.*; import javax.servlet.*; import javax.servlet.http.*; /** Simple servlet that generates HTML. * P * Taken from Core Servlets and JavaServer Pages * from Prentice Hall and Sun Microsystems Press, * http://www.coreservlets.com/. * copy; 2000 Marty Hall; may be freely used or adapted. */ public class HelloWWW extends HttpServlet { public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { response.setContentType(text/html); PrintWriter out = response.getWriter(); String docType = !DOCTYPE HTML PUBLIC \-//W3C//DTD HTML 4.0 + Transitional//EN\\n; out.println(docType + HTML\n + HEADTITLEHello WWW/TITLE/HEAD\n + BODY\n + H1Hello WWW/H1\n + /BODY/HTML); } } - Do you Yahoo!? Free Pop-Up Blocker - Get it now - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Servlets with JDBC connectivity
But this means I still have to get a connection, create a statement, and execute a query or update on the statement in every servlet where I want to use the connection. Yes, it locates the connection details (i.e., the JDBC connection method, the database name, user and password) somewhere centrally so that I don't have to keep coding it, but all of the connection overhead still has to be dealt with in every servlet in a webapp. The datasource solution that a few people in the list (including me :) ) have been asking you to look at provides a connection pool to your web application. In your code where you ask for a connection from JNDI, you are actually getting a connection from the pool, which is already setup. When you call the close() method of this connection, it is not actually destoryed but returned to the connection pool, ready to be used. Todd O'Bryan wrote: On Dec 3, 2003, at 2:59 AM, Nikola Milutinovic wrote: Peter Harrison wrote: On Wed, 03 Dec 2003 16:18, Todd O'Bryan wrote: How do people handle this elegantly? The requirements are: a single, globally visible (within a webapp) database interface and the ability to access multiple databases easily. The first point is to use a singleton to set up the database connection - or more correctly the connection pool. This way you can request a connection and return it to the pool easily. Of course every time you use one you will have to use try-catch blocks. Sorry no way around that. Both Tomcat and J2EE specification support javax.sql.DataSource objects over JNDI. That is how we handle it elegantly. A DataSource object is specified by the administrator and created by the container. Container then deploys it under specified JNDI name. A servlet (or EJB) can then lookup this object and use it, something like this: import java.sql.*; import javax.sql.*; import javax.naming.*; InitialContext ic = new InitialContext(); DataSource ds = (DataSource)ic.lookup( java:comp/env/jdbc/MyDataSource ); Connection conn = ds.getConnection(); At least, I think that's what it's doing. Am I missing something? Here's what I want. In every servlet in my webapp, I'm only going to be using one of a very few database connections. I'd like to be able to do something like: Test.executeQuery(SQL) without doing any setup because the Test class handles all the setup, initializes the connection the first time it's called, etc. Basically, it's a singleton class that never gets an instance created because if I create an instance, I'd have to pass it around to all the servlets in the webapp, which would kill the convenience of having it be available with minimal overhead. Oo, oo, oo... As I've been sitting here writing this, I had a brainstorm. What if I create an abstract class that has all the database connectivity built into it as static methods, but is just waiting for a connection method, a username, and a password. Then creating a new JDBC connection which is visible to all my servlets is just a matter of making a concrete subclass that defines those three variables and inherits all the functionality from its abstract parent class. Any reason this is a horrible idea? Thanks for being patient, Todd - 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: Servlets with JDBC connectivity
I think this link over here, might give you a hand. http://jakarta.apache.org/tomcat/tomcat-4.1-doc/jndi-datasource-examples-howto.html There are samples there for databases like mysql, but I think you should be ok. Todd O'Bryan wrote: This may not be the right place to ask this, but if you can direct me to the right place, I'd appreciate it. I'm looking for a design pattern that someone must have already thought through so that my head can stop hurting. Here's the problem: I'm designing a webapp that has several servlets that all access a database (or a couple of databases, actually) to either update or retrieve information. Rather than initializing these connections multiple times, dealing with SQLExceptions in every class that uses JDBC queries, and generally doing things multiple times, I thought I'd put all the database stuff into a single class. I created a setUp() method that initialized the database connection and then used static methods so I could do something like SQLUtils.executeQuery(a SQL statement); SQLUtils.executeUpdate(another one); anywhere in my webapp. If the database connection had not been created, it got created before executing the SQL statement. If it was already created, it just got done. I handled all the nastiest exceptions in the SQLUtils class, so I didn't have to deal with them elsewhere. You can probably guess the next part. I've discovered I need to connect to more than one database, and this design does not support that. Creating instances of a SQLUtil class would be a big pain, because then I have to pass those around between my servlets and I lose one of the huge advantages of this approach, namely a single, globally visible interface to the database. I thought about multiple classes, one for each database I'm connecting to, but I know that can't be right on so many levels. Meanwhile, I'm a little stumped. How do people handle this elegantly? The requirements are: a single, globally visible (within a webapp) database interface and the ability to access multiple databases easily. Thanks in advance for any ideas, Todd - 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: putting application war file not in webapps.
You can deploy your war file or unpacked app else where, just provide a context file for your application and in it specify the location of your web app. You can see that the manager app does this, just check out manager.xml , should get you started. sanjay paithankar wrote: Hello , I'm new to tomcat , The question is that if i don;t want to put my application war file in the webapps directory, so by putting it in some other directory and adding that context in the server.xml will the stuff work correctly , or we have to have put .war file in the webapps only please reply -Sanjay __ Do you Yahoo!? Free Pop-Up Blocker - Get it now http://companion.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: OutOfMemoryError
What apps are you running ? Maybe you are running something that consumes a lot of ram. Dhruva B. Reddy wrote: We get OutOfMemoryError's on Tomcat 4.1.27, running on RH 7.3, Sun JDK 1.4.1_02 (with 512MB allocated to it) The box has 1GB of RAM, 2GB of swap space, and four Xeon processors. This error seems to occur during periods of low load (like during the Thanksgiving holiday), after which Tomcat exits. According to the calls Runtime.freeMemory() and .totalMemory(), it comes nowhere near using that much (we track it every five minutes by hitting a servlet that calls these methods). Has anyone seen anything like this? Thanks, Dhruva __ Do you Yahoo!? Free Pop-Up Blocker - Get it now http://companion.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: Connection connection
It looks like getUser is actually passed a Connection object from somewhere, otherwise why pass it a Connection object. vic banta wrote: in the getUser() method below, it has the parameter Connection connection, is the connection to the database established in this line or is a connection object being passed to it? I assume since it is a get method nothing is being passed to it. public static synchronized User getUser(Connection connection, String emailAddress) throws SQLException{ newbie - Do you Yahoo!? Free Pop-Up Blocker - Get it now - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Installation problem (For Harry and the rest....)
Maybe the server.xml is malformed ? You can check by running catalina.bat instead of using the icon. That way it will run in the current window instead of disappearing. Try 'catalina run' [EMAIL PROTECTED] wrote: Harry, i follow through this problem... but if i am not wrong, sancha start from beginning is having this problem. 3. i. Now, i clicked the Start Tomcat icon the windows key + Program files + Apache tomcat. I find a window disappearing as soon as it appears. But after he/she try to change the catalina_home and Java_home then it's sovled. But i wonder what is happending to his/her situation I faced this kind of problem before, a window disappear as soon as it appears. I notice (after i checked the log files in the tomcat directory) that's because of the IP binding... my background environment is still running the services thus when i start again... give me the same syndrom. :-) so, anyone know what is happening to sancha setting?? [EMAIL PROTECTED] sancha Sent by: [EMAIL PROTECTED] 11/20/2003 04:03 AM Please respond to Tomcat Users List To: Tomcat Users List [EMAIL PROTECTED] cc: Subject:Re: Installation problem Hi Harry, Followed Wendell's instructions. when i ran in the cmd prompt i got the following message,(slightly long) -- C:\Program Files\Apache Software Foundation\Tomcat 5.0\bincatalina run Using CATALINA_BASE: C:\Program Files\Apache Software Foundation\Tomcat 5.0 Using CATALINA_HOME: C:\Program Files\Apache Software Foundation\Tomcat 5.0 Using CATALINA_TMPDIR: C:\Program Files\Apache Software Foundation\Tomcat 5.0\te mp Using JAVA_HOME: C:\Program Files\j2sdk_nb\j2sdk1.4.2 Nov 20, 2003 1:02:39 AM org.apache.coyote.http11.Http11Protocol init INFO: Initializing Coyote HTTP/1.1 on port 8080 Nov 20, 2003 1:02:39 AM org.apache.catalina.startup.Catalina load INFO: Initialization processed in 4807 ms Nov 20, 2003 1:02:40 AM org.apache.catalina.core.StandardService start INFO: Starting service Catalina Nov 20, 2003 1:02:40 AM org.apache.catalina.core.StandardEngine start INFO: Starting Servlet Engine: Apache Tomcat/5.0.14 Nov 20, 2003 1:02:40 AM org.apache.catalina.core.StandardHost start INFO: XML validation disabled Nov 20, 2003 1:02:40 AM org.apache.catalina.core.StandardHost getDeployer INFO: Create Host deployer for direct deployment ( non-jmx ) Nov 20, 2003 1:02:40 AM org.apache.catalina.core.StandardHostDeployer install INFO: Processing Context configuration file URL file:C:\Program Files\Apache Sof tware Foundation\Tomcat 5.0\conf\Catalina\localhost\manager.xml Nov 20, 2003 1:02:43 AM org.apache.catalina.core.StandardHostDeployer install INFO: Processing Context configuration file URL file:C:\Program Files\Apache Sof tware Foundation\Tomcat 5.0\conf\Catalina\localhost\admin.xml Nov 20, 2003 1:02:45 AM org.apache.struts.util.PropertyMessageResources init INFO: Initializing, config='org.apache.struts.util.LocalStrings', returnNull=tru e Nov 20, 2003 1:02:45 AM org.apache.struts.util.PropertyMessageResources init INFO: Initializing, config='org.apache.struts.action.ActionResources', returnNul l=true Nov 20, 2003 1:02:47 AM org.apache.struts.util.PropertyMessageResources init INFO: Initializing, config='org.apache.webapp.admin.ApplicationResources', retur nNull=true Nov 20, 2003 1:02:52 AM org.apache.catalina.core.StandardHostDeployer install INFO: Installing web application at context path from URL file:C:\Program Files \Apache Software Foundation\Tomcat 5.0\webapps\ROOT Nov 20, 2003 1:02:52 AM org.apache.catalina.core.StandardHostDeployer install INFO: Installing web application at context path /tomcat-docs from URL file:C:\P rogram Files\Apache Software Foundation\Tomcat 5.0\webapps\tomcat-docs Nov 20, 2003 1:02:52 AM org.apache.catalina.core.StandardHostDeployer install INFO: Installing web application at context path /jsp-examples from URL file:C:\ Program Files\Apache Software Foundation\Tomcat 5.0\webapps\jsp-examples Nov 20, 2003 1:02:53 AM org.apache.catalina.core.StandardHostDeployer install INFO: Installing web application at context path /servlets-examples from URL fil e:C:\Program Files\Apache Software Foundation\Tomcat 5.0\webapps\servlets-exampl es Nov 20, 2003 1:02:54 AM org.apache.coyote.http11.Http11Protocol start INFO: Starting Coyote HTTP/1.1 on port 8080 Nov 20, 2003 1:02:55 AM org.apache.jk.common.ChannelSocket init INFO: JK2: ajp13 listening on /0.0.0.0:8009 Nov 20, 2003 1:02:55 AM org.apache.jk.server.JkMain start INFO: Jk running ID=0 time=20/90 config=C:\Program Files\Apache Software Founda tion\Tomcat 5.0\conf\jk2.properties Nov 20, 2003 1:02:55 AM org.apache.catalina.startup.Catalina start INFO: Server startup in 15742 ms i tried accessing the welcome page. Then, got the welcome page . Could you please tell me as to how should i allow my file to viewed by my friend in another machine? Thanks for your help in
Re: Servlets -- help needed
Fire up your text editor and edit away. If you are on a penguin box, you can use 'vi' or if you are on windows, just use notepad or wordpad. Navanee wrote: I don't have any idea of how to edit the web.xml file. Any pointers would be helpful. [EMAIL PROTECTED] wrote: Navanee, Please check and edit the \WEB-INF\web.xml file, which holds the mappings. After that, you will only need http://localhost/your_servlet_urlname_from_web.xml Kostas Harvatis - National Center for Social Research - Directorate of Research Support www.ekke.gr - Original Message - From: Navanee [EMAIL PROTECTED] To: Tomcat Users List [EMAIL PROTECTED] Sent: Friday, November 14, 2003 9:11 AM Subject: Re: Servlets -- help needed Schalk, I wrote a java program (HelloWWW.java) and placed the file in this path: C:\Program Files\jakarta-tomcat-4.1.27\webapps\examples\WEB-INF\classes I also compiled that java code. Compilation was successful. I tried to execute that servlet in the browser using this link : http://localhost:8080/examples/WEB-INF/classes/HelloWWW But it is giving 404 (file not found) error. Why is it so? How can i access these files in the browser ..? Means, what link should i give in the browser ? -- Navanee - 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: Start Tomcat
Hello Simon, Run the catalina batch file, passing in the argument run like this(without the quotes of course): catalina.bat run This will run tomcat in the current window, from there you should be able to see the errors that tomcat throws out. Simon Allen wrote: I have now written pause at the end of startup.bat. This has no effect as the dos window doesn't open anyway. I notice that the target of the Start Tomcat button is Tomcatw.exe. When I try and run this file nothing happens. Bearing in mind that startup.bat works fine if run directly, should I have set an environment variable during set up? ta -Original Message- From: Patrick Willart [SMTP:[EMAIL PROTECTED] Sent: Wednesday, November 12, 2003 11:08 PM To: Tomcat Users List Subject:RE: Start Tomcat Simon, If you add 'pause' as last line in you startup.bat you can see what (error) messages Tomcat outputs. Patrick -Original Message- From: Simon Allen [mailto:[EMAIL PROTECTED] Sent: Wednesday, November 12, 2003 2:31 PM To: '[EMAIL PROTECTED]' Subject: Start Tomcat Hi I am able to start Tomcat from startup.bat but when I try to do so using the Start Tomcat in the Windows Start Menu the banner appears, disappears after a few seconds with no further action. Any advice? 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] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Problem with ConnectionPool on Linux
The new version of DBCP should be able to cope with this as well. I tested it with MaxDB and it works ok. Veselin Kovacevic wrote: Now, everything working fine. :) Thanks Jon. -Original Message- From: Jon Wingfield [mailto:[EMAIL PROTECTED] Sent: Tuesday, November 11, 2003 4:50 PM To: Tomcat Users List Subject: Re: Problem with ConnectionPool on Linux MySql times out idle connections. If your pool implementation doesn't take care of weeding out dead connections you need to add autoReconnect=true to your connection string. HTH, Jon Veselin Kovacevic wrote: Hi, I have o problem with Tomcat 4.1.24 on SuseLinux7.3. Our application has Controller servlet (below) where using connection objects from connection pool. When tomcat started, application working fine and everything OK that day. But next day when we try to start application we get error message in isUser method (PortalUserDB class). It's first place where we use connection object in application. Method isUser is very simple method for authenticate user (below). We get this exception: SQL Exception:java.sql.SQLException: No operations allowed after connection closed Connection object is not null in this case, and this message for me is not correct. Next, if I restart tomcat, everything working ok... (for next day). On windows (we using windows for development platform) we have not this problem. What is problem? Is configuration server.xml or similar configuration files on Linux different rather on windows? Note: On both platform we using Tomcat 4.1.24 and j2sdk1.4.1_03. public class Controller extends HttpServlet { private DataSource ds; public void init(ServletConfig config) throws ServletException { super.init(config); try { InitialContext initCtx = new InitialContext(); Context envCtx = (Context)initCtx.lookup(java:comp/env); ds = (DataSource)envCtx.lookup(jdbc/MySQLPool); } catch (Exception e){ throw new UnavailableException(e.getMessage()); } } public void doGet(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException { request.setCharacterEncoding(iso-8859-2); if (ds != null) { Connection conn = ds.getConnection(); if (conn != null) { boolean isUserExists = PortalUserDB.isUser(conn, userName, userPass); conn.close(); } } } public static boolean isUser(Connection conn, String userName, String userPass) throws SQLException, IOException { String query = SELECT user_name FROM admin_user + WHERE user_name = ? + AND user_pass = ?; boolean isUserExists = false; try { PreparedStatement pstmt = conn.prepareStatement(query); pstmt.setString(1, userName); pstmt.setString(2, userPass); ResultSet rs = pstmt.executeQuery(); isUserExists = rs.next(); rs.close(); rs = null; pstmt.close(); pstmt = null; } catch (SQLException sqle) { PortalLog.addLogLine(Class: PortalUserDB, Method: isUser. SQL Exception: + sqle, userName); } return isUserExists; } Thanks, Veso - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Problem with ConnectionPool on Linux
Actually I took the nightly build of DBCP a week before it went into release, built it on my own and replaced the one that shipped with tomcat (since I couldn't find a pre-built binary). I think you do need to change commons-pool as well. You also probably need testOnBorrow as well for this to work. With the dbcp that shipped with tomcat, if my db connections in the pool timed out (being idle), dbcp wasn't able to handle it. Veselin Kovacevic wrote: You think DBCP 1.1? I try to install Tomcat 4.1.29 but I get some error with connection pool. Is there some changes in server.xml settings? -Original Message- From: Kwok Peng Tuck [mailto:[EMAIL PROTECTED] Sent: Wednesday, November 12, 2003 9:13 AM To: Tomcat Users List Subject: Re: Problem with ConnectionPool on Linux The new version of DBCP should be able to cope with this as well. I tested it with MaxDB and it works ok. Veselin Kovacevic wrote: Now, everything working fine. :) Thanks Jon. -Original Message- From: Jon Wingfield [mailto:[EMAIL PROTECTED] Sent: Tuesday, November 11, 2003 4:50 PM To: Tomcat Users List Subject: Re: Problem with ConnectionPool on Linux MySql times out idle connections. If your pool implementation doesn't take care of weeding out dead connections you need to add autoReconnect=true to your connection string. HTH, Jon Veselin Kovacevic wrote: Hi, I have o problem with Tomcat 4.1.24 on SuseLinux7.3. Our application has Controller servlet (below) where using connection objects from connection pool. When tomcat started, application working fine and everything OK that day. But next day when we try to start application we get error message in isUser method (PortalUserDB class). It's first place where we use connection object in application. Method isUser is very simple method for authenticate user (below). We get this exception: SQL Exception:java.sql.SQLException: No operations allowed after connection closed Connection object is not null in this case, and this message for me is not correct. Next, if I restart tomcat, everything working ok... (for next day). On windows (we using windows for development platform) we have not this problem. What is problem? Is configuration server.xml or similar configuration files on Linux different rather on windows? Note: On both platform we using Tomcat 4.1.24 and j2sdk1.4.1_03. public class Controller extends HttpServlet { private DataSource ds; public void init(ServletConfig config) throws ServletException { super.init(config); try { InitialContext initCtx = new InitialContext(); Context envCtx = (Context)initCtx.lookup(java:comp/env); ds = (DataSource)envCtx.lookup(jdbc/MySQLPool); } catch (Exception e){ throw new UnavailableException(e.getMessage()); } } public void doGet(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException { request.setCharacterEncoding(iso-8859-2); if (ds != null) { Connection conn = ds.getConnection(); if (conn != null) { boolean isUserExists = PortalUserDB.isUser(conn, userName, userPass); conn.close(); } } } public static boolean isUser(Connection conn, String userName, String userPass) throws SQLException, IOException { String query = SELECT user_name FROM admin_user + WHERE user_name = ? + AND user_pass = ?; boolean isUserExists = false; try { PreparedStatement pstmt = conn.prepareStatement(query); pstmt.setString(1, userName); pstmt.setString(2, userPass); ResultSet rs = pstmt.executeQuery(); isUserExists = rs.next(); rs.close(); rs = null; pstmt.close(); pstmt = null; } catch (SQLException sqle) { PortalLog.addLogLine(Class: PortalUserDB, Method: isUser. SQL Exception: + sqle, userName); } return isUserExists; } Thanks, Veso - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED
Re: Tomcat Caching
If I remember correctly, you probably need to provide a servlet mapping for your servlet. Adam Dear wrote: Schalk, I added the following line to the server.xml file and restarted tomcat. context path=/servlet docBase=servlet debug=0 reloadable=true / That didn't work. Can you tell what is wrong. I have tomcat to load servlets from the classes dir so that I access servlets like this: http://mydomain.com:port#/servlet/File Will this make a difference with what I am trying to do? Thanks -Original Message- From: Schalk [mailto:[EMAIL PROTECTED] Sent: Tuesday, November 11, 2003 12:47 AM To: 'Tomcat Users List' Subject: RE: Tomcat Caching Adam In the Tomcat confide directory, there is a file called server.xml. Inside here you can create a Context-Path and set reloadable=true. Example: Context path=/meccafemme docBase=meccafemme debug=0 reloadable=true / Kind Regards Schalk Neethling Web Developer.Designer.Programmer.CEO Volume4.Development.Multimedia.Branding emotionalize.conceptualize.visualize.realize Tel: +27125468436 Fax: +27125468436 email:[EMAIL PROTECTED] web: www.volume4.co.za This message contains information that is considered to be sensitive or confidential and may not be forwarded or diclosed to any other party without the permission of the sender. If you received this message in error, please notify me immediately so that I can correct and delete the original email. Thank you. :: -Original Message- :: From: Adam Dear [mailto:[EMAIL PROTECTED] :: Sent: Saturday, October 11, 2003 7:36 AM :: To: tomcat :: Subject: Tomcat Caching :: :: hello, I have just started using Tomcat to host my java servlets. I want to :: know if there is anyway to turn off the caching for development purposes. :: As it is now, when I make change to a servlet, I have to restart the tomcat :: server for the changes to take effect. While this isn't hard, it is a tad :: bit annoying. Please be specific as I know very little about tomcat. :: :: 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] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: WinNT service problem
Putting the sql driver every where at once makes life that much difficult. Here's a document that points you in the right direction : http://jakarta.apache.org/tomcat/tomcat-4.1-doc/jndi-datasource-examples-howto.html HIH :) ArcherDaPunk wrote: Sorry if this is the second one, not sure if the other went through, I never seem to know exactly which lib directory I'm meant to put it in, so I put it in absolutly every lib directory, including my j2sdk dir. I konw it's not the code because I'm using the same driver and code as I was before I reformatted my computer. Jake - Original Message - From: ArcherDaPunk [EMAIL PROTECTED] To: Tomcat Users List [EMAIL PROTECTED] Sent: Tuesday, November 11, 2003 3:00 PM Subject: WinNT service problem Hi all, I'm trying to run tomcat on my WinXP machine but when I use the service I get the following error. Wierd thing is it works when I run the tomcat sserver manually using the supplied startup scipts. Is it where I have put my mysql DB driver?? description The server encountered an internal error (Internal Server Error) that prevented it from fulfilling this request. exception org.apache.jasper.JasperException: com.mysql.jdbc.Driver at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:2 54) at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:295) at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241) Any help would be much appriciated, Jake - 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: Strange behavior of runtime.exec(...)
If I'm not mistaken, the security manager is turned off by default. Stefan Frank wrote: I tried to tweak the security manager of tomcat(using no restrictions at all) - with no effect. And I have absolutely no idea how to set the security-settings for the Webapp: And if i knew, does anyone know if there is a level of control below the reight to call runtime.exec()?! I mean, if the webapp is allowed to spawn a process, can i restrict the abilities of this spawned process?! And in a platform independent matter?! Or is there a bug somwehere else?! Patrick Willart wrote: I suspect the problem to be that no external task that is started by Tomcat is allowed to open any connections. I had a similar problem with cgi and a windows executable. The executable tried to open a socket connection. The same setup had worked on a different server but not on Tomcat. I ended up rewritting the program as a java servlet. This worked. If you setup a Security Manager for Tomcat then you can control what the java code of your applications is allowed to do. Grts, Patrick -Original Message- From: Stefan Frank [mailto:[EMAIL PROTECTED] Sent: Saturday, November 08, 2003 6:52 AM To: [EMAIL PROTECTED] Subject: Strange behaviour of runtime.exec(...) Hi, we are trying to make some calls to scripts from within tomcat, so we are using runtime.exec() inside a Servlet: The script (it submits a Job to teh Sun Grid Engine, http://gridengine.sunsource.net/) runs fine from the command line, and also the java-class, which is called from the servlet for the submit, runs fine outside of tomcat: When the Class is called from inside tomcat, the job is submitted, but never reaches the scheduler: It looks like the spawned process is not allowed to make up sockets to the outside world - are there any restrictions on using Runtime.exec() from within tomcat?! And if there is, is there a way around these restrictions?! Greetingsthx in advance for any help Stefan - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Réf. : RE: Réf. : RE: dbcp pool size
Hello, meissa, please have a look at the email I sent to the commons-list. [EMAIL PROTECTED] wrote: I'm currently using the version which is shipped with tomcat 4.18 distrib I'm correctly closing all of my ressouces(connection,resulsets and statement) I'm still having the problem. Meissa Sakho NATEXIS ASSET MANAGEMENT Direction de l'organisation Tel. : 01 58 19 45 71 http://www.assetmanagement.natexis.fr Phillip Qin [EMAIL PROTECTED] 06/11/2003 16:51 Veuillez répondre à Tomcat Users List Pour : 'Tomcat Users List' [EMAIL PROTECTED] cc : Objet : RE: Réf. : RE: dbcp pool size Noop. Below is my config in context.xml. Try to use dbcp and pool version 1.1 Resource name=jdbc/abcd auth=Container type=javax.sql.DataSource/ ResourceParams name=jdbc/abcd parameter namedriverClassName/name valueoracle.jdbc.driver.OracleDriver/value /parameter parameter nameurl/name valuejdbc:oracle:thin:@your.com:1521:SID/value /parameter parameter nameusername/name valueusername/value /parameter parameter namepassword/name valuepassword/value /parameter parameter namemaxActive/name value20/value /parameter parameter namemaxIdle/name value10/value /parameter parameter nameminIdle/name value10/value /parameter parameter namemaxWait/name value15000/value /parameter parameter nameremoveAbandoned/name valuetrue/value /parameter parameter namelogAbandoned/name valuetrue/value /parameter parameter namevalidationQuery/name valueSELECT SYSDATE FROM DUAL/value /parameter parameter nametestOnBorrow/name valuetrue/value /parameter parameter nameminEvictableIdleTimeMillis/name value-1/value /parameter !-- sleeps 5 minutes -- parameter nametimeBetweenEvictionRunsMillis/name value30/value /parameter parameter namenumTestsPerEvictionRun/name value1/value /parameter parameter nametestWhileIdle/name valuetrue/value /parameter /ResourceParams -Original Message- From: Shapira, Yoav [mailto:[EMAIL PROTECTED] Sent: November 6, 2003 10:21 AM To: Tomcat Users List Subject: RE: Réf. : RE: dbcp pool size Howdy, Yup. Yoav Shapira Millennium ChemInformatics -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Thursday, November 06, 2003 10:20 AM To: Tomcat Users List Subject: Réf. : RE: dbcp pool size Do you think a factory name is mandatory? Meissa Sakho NATEXIS ASSET MANAGEMENT Direction de l'organisation Tel. : 01 58 19 45 71 http://www.assetmanagement.natexis.fr Shapira, Yoav [EMAIL PROTECTED] 06/11/2003 14:56 Veuillez répondre à Tomcat Users List Pour : Tomcat Users List [EMAIL PROTECTED] cc : Objet : RE: dbcp pool size Howdy, Perhaps a factory class name in your resource params? ;) Yoav Shapira Millennium ChemInformatics -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Thursday, November 06, 2003 8:12 AM To: [EMAIL PROTECTED] Subject: dbcp pool size hi all, I have configured my dbcp connection pool like the fragment below. Resource name=jdbc/recProduit auth=Container type=javax.sql.DataSource/ ResourceParams name=jdbc/recProduit parameternameusername/namevaluemailer/value/parameter parameternamepassword/namevaluemail2002/value/parameter parameternamemaxActive/namevalue3/value/parameter parameternamedriverClassName/name valuecom.sybase.jdbc2.jdbc.SybDriver/value/parameter parameternameurl/name
Re: need help
Make sure you have a JDK in your machine and that JAVA_HOME env variable points to it. Then click on the startup script to run tomcat. Should be able to run. S.Gokul wrote: Hi, I have installed tomcat 5 in my machine running windows 98. Is it compatible with 98 or do I have to do anything else to run it. Regards, S.Gokul - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: need help
Hello Gokul, It's helpful if we can see the exception, so you might want to run the script file catalina.bat located in the bin directory. Run it with:catalina run This makes tomcat run in the current window and you will be able to see the exceptions. I'm not really sure if jdk1.3 works with Tomcat 5 (some one correct me quick) , so keep that in mind as well. Cut the exceptions and send it back to the list to have a look. S.Gokul wrote: Hi, I do have jdk1.3 installed and I have made the changes in the startup.bat file in the tomcat bin folder. But still I am not able to run it. It starts up and then after a few seconds it closes the tomcat window. I think its throwing some java exception. Can u help me out. Regards, S.Gokul - Original Message - From: Kwok Peng Tuck [EMAIL PROTECTED] To: Tomcat Users List [EMAIL PROTECTED] Sent: Monday, November 03, 2003 1:46 PM Subject: Re: need help Make sure you have a JDK in your machine and that JAVA_HOME env variable points to it. Then click on the startup script to run tomcat. Should be able to run. S.Gokul wrote: Hi, I have installed tomcat 5 in my machine running windows 98. Is it compatible with 98 or do I have to do anything else to run it. Regards, S.Gokul - 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: need help
Heh, you are quick dude. So maybe he does need JDK 1.4 :D Basavaraju P. Banakar wrote: correct me if I'm wrong Tomcat 5 requires JDK 1.4 I remember reading that java.nio packages are used from JDK1.4 - Basu.. - Original Message - From: Kwok Peng Tuck [EMAIL PROTECTED] To: Tomcat Users List [EMAIL PROTECTED] Sent: Monday, November 03, 2003 2:20 PM Subject: Re: need help Hello Gokul, It's helpful if we can see the exception, so you might want to run the script file catalina.bat located in the bin directory. Run it with:catalina run This makes tomcat run in the current window and you will be able to see the exceptions. I'm not really sure if jdk1.3 works with Tomcat 5 (some one correct me quick) , so keep that in mind as well. Cut the exceptions and send it back to the list to have a look. S.Gokul wrote: Hi, I do have jdk1.3 installed and I have made the changes in the startup.bat file in the tomcat bin folder. But still I am not able to run it. It starts up and then after a few seconds it closes the tomcat window. I think its throwing some java exception. Can u help me out. Regards, S.Gokul - Original Message - From: Kwok Peng Tuck [EMAIL PROTECTED] To: Tomcat Users List [EMAIL PROTECTED] Sent: Monday, November 03, 2003 1:46 PM Subject: Re: need help Make sure you have a JDK in your machine and that JAVA_HOME env variable points to it. Then click on the startup script to run tomcat. Should be able to run. S.Gokul wrote: Hi, I have installed tomcat 5 in my machine running windows 98. Is it compatible with 98 or do I have to do anything else to run it. Regards, S.Gokul - 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] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Windows freeze...
Run as service instead :D Leo Larraquy wrote: It ´s a good idea, and but my client is Microsoft-mind-ahead - Original Message - From: Dov Rosenberg [EMAIL PROTECTED] To: Tomcat Users List [EMAIL PROTECTED] Sent: Tuesday, October 28, 2003 7:22 PM Subject: Re: Windows freeze... Fdisk Install linux :) On 10/28/03 2:25 PM, Leo Larraquy [EMAIL PROTECTED] wrote: Hi people, I`ve got a really simple question but a can`t solve on my own. On Windows, when an applicacion throws an Exception, for the first time, Tomcat freezes, until I hit the keyboard or I do something on the DOS console that appears when Tomcat starts up. But it doesn`t happen on Linux! I`ve been told that Windows losses control on that new window, and it can`t print the stackTrace, or even a System.out, until you do something to activate that window again. Is there some way to solve this?? Thanks in advance. Leonardo Lopez. - 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: Servlet and Beans.
Yes, as long as you import the classes and make them available in your webapp. anunay ashish wrote: If my bean and servlet are as package com.scheduler, then can I use make an object of the bean class in the servlet? - 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: Problem Compiling JSP Servlet
Did you by any chance import the class in the first place ? Like import javax.servlet.ServletException ; Billy Aplin wrote: Greetings, I am new to JSP development and I am trying to compile a simple servlet from the More Servlets and JavaServer Pages. I am getting the error cannot resolve symbol (see below), which is supposed to mean that I do not have my classpath setting correct, but I am fairly certain that the CLASSPATH settings are correct: CLASSPATH .; c:\JavaDev; c:\Tomcat\common\lib\servlet.jar As you can see, the CLASSPATH system variable is pointing to the servlet.jar file as well as my working directory, and the directories are correct. I have searched the email archives and I don't see anything that explains this problem. Any help would be appreciated. Thanks Billy ERROR --- HelloServlet.java:16: cannot resolve symbol symbol : class ServletException location: class HelloServlet throws ServletException, IOException { ^ _ Frustrated with dial-up? Get high-speed for as low as $29.95/month (depending on the local service providers in your area). https://broadband.msn.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: Problem Compiling JSP Servlet
This works: javac HelloServlet.java -classpath c:\Tomcat\common\lib\servlet.jar This doesn't: javac HelloServlet.java Billy, the second line implies that you did not include the classpath to servlet.jar, so that's why it is having problems with javax.servlet.ServletException. If you find it tedious to type that in the command line, try investing some time to learn ant to help you build and complie your files. -- Code --- import java.io.*; import javax.servlet.*; import javax.servlet.http.*; /** Simple servlet used to test server. * P * Taken from More Servlets and JavaServer Pages * from Prentice Hall and Sun Microsystems Press, * http://www.moreservlets.com/. * copy; 2002 Marty Hall; may be freely used or adapted. */ public class HelloServlet extends HttpServlet { public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { response.setContentType(text/html); PrintWriter out = response.getWriter(); String docType = !DOCTYPE HTML PUBLIC \-//W3C//DTD HTML 4.0 + Transitional//EN\\n; out.println(docType + HTML\n + HEADTITLEHello/TITLE/HEAD\n + BODY BGCOLOR=\#FDF5E6\\n + H1Hello/H1\n + /BODY/HTML); } } _ Instant message in style with MSN Messenger 6.0. Download it now FREE! http://msnmessenger-download.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: Problem Compiling JSP Servlet
Are you on windows 98/95/ME ? Billy Aplin wrote: Thanks again, but I don't understand. As I said, the classpath to servlet.jar is in my system's CLASSPATH environment environment. I thought the point of putting it in the CLASSPATH environment variable was so that it would find it when I attempt to compile, otherwise why create the CLASSPATH variable in the first place? Thanks Billy From: Kwok Peng Tuck [EMAIL PROTECTED] Reply-To: Tomcat Users List [EMAIL PROTECTED] To: Tomcat Users List [EMAIL PROTECTED] Subject: Re: Problem Compiling JSP Servlet Date: Fri, 03 Oct 2003 09:47:43 +0800 This works: javac HelloServlet.java -classpath c:\Tomcat\common\lib\servlet.jar This doesn't: javac HelloServlet.java Billy, the second line implies that you did not include the classpath to servlet.jar, so that's why it is having problems with javax.servlet.ServletException. If you find it tedious to type that in the command line, try investing some time to learn ant to help you build and complie your files. -- Code --- import java.io.*; import javax.servlet.*; import javax.servlet.http.*; /** Simple servlet used to test server. * P * Taken from More Servlets and JavaServer Pages * from Prentice Hall and Sun Microsystems Press, * http://www.moreservlets.com/. * copy; 2002 Marty Hall; may be freely used or adapted. */ public class HelloServlet extends HttpServlet { public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { response.setContentType(text/html); PrintWriter out = response.getWriter(); String docType = !DOCTYPE HTML PUBLIC \-//W3C//DTD HTML 4.0 + Transitional//EN\\n; out.println(docType + HTML\n + HEADTITLEHello/TITLE/HEAD\n + BODY BGCOLOR=\#FDF5E6\\n + H1Hello/H1\n + /BODY/HTML); } } _ Instant message in style with MSN Messenger 6.0. Download it now FREE! http://msnmessenger-download.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] _ Frustrated with dial-up? Get high-speed for as low as $29.95/month (depending on the local service providers in your area). https://broadband.msn.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: Problem Compiling JSP Servlet
You can set the classpath variable in the system environment. Settings-Control Panel - System - Advance(tab) - Environment Variables I don't think you need to reboot for this to take effect. Billy Aplin wrote: Windows 2000. Thanks Billy _ Share your photos without swamping your Inbox. Get Hotmail Extra Storage today! http://join.msn.com/?PAGE=features/es - 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: DBCP API reference
Here: http://jakarta.apache.org/commons/dbcp/apidocs/index.html It's from the link on the left navigation bar. Or you can just download the nightly release and generate the docs on your own. Josh G wrote: Can somebody point me to a mirror of the DBCP API javadocs? All I get when looking through the jakarta site are links to a 404 :( - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: innocuous Servlet kills Tomcat
Hard to tell from a small snippet like that , but if I had to guess, it doesn't appear to meet the dtd specified by the web.xml. Try sending us the entire web.xml in your email. Paul Wallace wrote: Hi All, After implementing my simple Servlet under Tomcat thus: servlet servlet-nameOpenResource/servlet-name servlet-classcom.ia.mapping.servlets.OpenResource/servlet-class /servlet where the Servlet OpenResource has been compiled in the correct directory, containing no functionality (below), I start up Tomcat and get the less-than-pleasant error message in the console: Starting service Tomcat-Standalone Apache Tomcat/4.0.4 PARSE error at line 19 column 11 org.xml.sax.SAXParseException: The content of element type web-app must match (icon?,display-name?,description?,distributable?,context-param*,filter* ,filter-mapping*,listener*,servlet*,servlet-mapping*,session-config?, mime-mapping*,welcome-file-list?,error-page*,taglib*,resource-env-ref*,r esource-ref*, security-constraint*,login-config?,security-role*,env-entry*,ejb-ref*,ej b-local-ref*). Starting service Tomcat-Apache Apache Tomcat/4.0.4 This error message immediately suggests that web.xml is not fully formed. It is. When the OpenResource entry is removed, TC starts up fine, suggesting the Servlet is at fault. But on inspection, there is no source present to cause such a problem (it is a bare-bones Servlet). I have looked and looked, but cant see what's at fault. (Tomcat although appearing to have started does not serve anything (404)). Thanks for any help or insight into this error message. Paul. - 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: innocuous Servlet kills Tomcat
The digester error actually provides you more info than you think : org.xml.sax.SAXParseException: The content of element type web-app must match (icon?,display-name?,description?,distributable?,context-param*,filter*, filter-mapping*,listener*,servlet*,servlet-mapping*,session-config?,mime-mapping*, welcome-file-list?,error-page*,taglib*,resource-env-ref*,resource-ref*, security-constraint*,login-config?,security-role*,env-entry*,ejb-ref*,ejb-local-ref*). See , servlet definitions come first. Define them first, then the associated mapping if needed. The order in which you define the servlets themselves do not matter, what matters is that servlet defiinitions come first before the mapping. You can have a look at the full dtd here : http://java.sun.com/dtd/web-app_2_3.dtd Paul Wallace wrote: Hi, I located the problem. I was mapping a different Servlet before the OpenResource Servlet was defined in web.xml (error): web-app servlet servlet-nameLoginServlet/servlet-name servlet-classcom.ia.mapping.servlets.LoginServlet/servlet-class /servlet servlet-mapping servlet-nameLoginServlet/servlet-name url-pattern/LoginServlet/url-pattern /servlet-mapping servlet servlet-nameOpenResource/servlet-name servlet-classcom.ia.mapping.servlets.OpenResource/servlet-class /servlet /web-app It now runs, with the mapping after any Servlet declaration. This would seem logical but for the fact that the mapped Servlet preceded the Servlet mapping? I suppose this means that no matter how many Servlet entries there are, mappings MUST proceed ALL Servlet declarations thus: servlet servlet-name/servlet-name servlet-class/servlet-class /servlet servlet servlet-name/servlet-name servlet-class/servlet-class /servlet servlet servlet-name/servlet-name servlet-class/servlet-class /servlet servlet-mapping servlet-name/servlet-name url-pattern/url-pattern /servlet-mapping servlet-mapping servlet-name/servlet-name url-pattern/url-pattern /servlet-mapping irrespective to the Servlet they map to? Thanks Paul. Hard to tell from a small snippet like that , but if I had to guess, it doesn't appear to meet the dtd specified by the web.xml. Try sending us the entire web.xml in your email. Paul Wallace wrote: Hi All, After implementing my simple Servlet under Tomcat thus: servlet servlet-nameOpenResource/servlet-name servlet-classcom.ia.mapping.servlets.OpenResource/servlet-class /servlet where the Servlet OpenResource has been compiled in the correct directory, containing no functionality (below), I start up Tomcat and get the less-than-pleasant error message in the console: Starting service Tomcat-Standalone Apache Tomcat/4.0.4 PARSE error at line 19 column 11 org.xml.sax.SAXParseException: The content of element type web-app must match (icon?,display-name?,description?,distributable?,context-param*,filter * ,filter-mapping*,listener*,servlet*,servlet-mapping*,session-config?, mime-mapping*,welcome-file-list?,error-page*,taglib*,resource-env-ref*, r esource-ref*, security-constraint*,login-config?,security-role*,env-entry*,ejb-ref*,e j b-local-ref*). Starting service Tomcat-Apache Apache Tomcat/4.0.4 This error message immediately suggests that web.xml is not fully formed. It is. When the OpenResource entry is removed, TC starts up fine, suggesting the Servlet is at fault. But on inspection, there is no source present to cause such a problem (it is a bare-bones Servlet). I have looked and looked, but cant see what's at fault. (Tomcat although appearing to have started does not serve anything (404)). Thanks for any help or insight into this error message. Paul. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Fwd: Delivery problems: Catalina.stop: java.net.ConnectException: Connection refused
It's not complaining about you, just about some address registered on the list. It looks like the tomcat list tried to forward a email to a user at chiinc.com but was unable to do so for the reason listed below. I get that from time to time as well. Ilja wrote: Why do I always get this message when I send an email to this list? 1) I subscribed to the list and confirmed it as well, even got a confirmation from the mailinglist deamon 2) the messages still do seem to arrive 3) I've send an email to the emailadres in this email, but nothing has changed yet... On 21 Sep 2003 15:53:57 -0400, MAILER-DAEMON [EMAIL PROTECTED] said: This is an unknown user on this system. Please check the address. If you think there is a problem on our end, please send a message to [EMAIL PROTECTED] Please include the email address. Thank You. Warning, delivery failure! This is a status message indicating that a message could not be delivered to 1 or more recipients. Original message subject: Catalina.stop: java.net.ConnectException: Connection refused Date received: 21-Sep-2003 15:53:50 -0400 Recipients and delivery history [EMAIL PROTECTED] Transcript of session follows --- 21-Sep-2003 15:53:49 -0400 Received via SMTP from ASG.CHIINC.COM 21-Sep-2003 15:53:57 -0400 [EMAIL PROTECTED] is unknown Subject: Catalina.stop: java.net.ConnectException: Connection refused From: Ilja [EMAIL PROTECTED] Date: Sun, 21 Sep 2003 21:53:30 +0200 To: [EMAIL PROTECTED] Tomcat suddenly stopped working without any obvious reason... Config: Tomcat 5.09 Mac OSX 10.2.6 error: Catalina.stop: java.net.ConnectException: Connection refused java.net.ConnectException: Connection refused at java.net.PlainSocketImpl.socketConnect(Native Method) at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:305) at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:171) at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:158) at java.net.Socket.connect(Socket.java:426) at java.net.Socket.connect(Socket.java:376) at java.net.Socket.init(Socket.java:291) at java.net.Socket.init(Socket.java:119) at org.apache.catalina.startup.Catalina.stop(Catalina.java:581) at org.apache.catalina.startup.Catalina.execute(Catalina.java:402) 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) Anyone? - 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: ClassPath with Tomcat 4.1
Classes for your webapp are looked for in either : WEB-INF/lib; as a jar file or WEB-INF/classes; non jar files So for example if you have a jar file that you want to use in your web app, put them in your webapp's WEB-INF/lib. You should be able to use them. David LAFAY wrote: Hello, Tomcat 3.x have a wrapper.properties file. Where is it on tomcat 4.1.x release. I don't know how to configure classpath for my webApp Thanks, David [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]
[OT]Re: Mobile phone on serial port - Howto send sms?
Another option is available to you John-Paul, specifically, http://www.kannel.org which is a wap and sms gateway. This gateway is based on linux although you can use cygwin to compile and run it, far from ideal but it does work and is usable enough for testing. The gateway does support most GSM modems and supports other major protocols like SMPP, CIMD... for connecting to telcos. Once you set it up you can send sms through it's http interface. So from your servlet or business logic class, just make a http call to the gateway with the correct parameters and your sms will be sent of. A library like commons http-client will be quite useful in this case. FYI : kannel is open source. Sai Sivanesan wrote: we have an affilliate company that has a product comming on the market that uses a Nokia 30 or Nokia 31 GSM modem(phone without a headset and with a rs232 port) and does exactly that. we have a client server version comming out - i will ask how its done - can't be too difficult as the app is mostly a vb piece. as long as i am not going to give away anything to proprietary i'll share it - why do you want to use a serial conection - do you need to receive sms msgs as well as send? cause if all you need to do is send, why don't you just dispatch it as an email? Sai. On Wed, 10 Sep 2003 23:34:51 -0100 (GMT+1), john-paul delaney wrote Hello List... this is a tricky one I believe, Serial port-connected mobile phone - I'd like to find out how to send sms messages using tomcat on linux. Anyone got any leads? I'd appreciate any help. thanks, /j-p. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Open WebMail Project (http://openwebmail.org) - 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: HeadlessException: The chickens come home to roost!
Perhaps this might also ease the pain: http://cewolf.sourceforge.net/ Bill Barker wrote: Running headless means using awt-light. In particular, one of the things you are forbidden from doing is creating heavy-weight components like Frames. If you want to run headless, you will need to re-structure your servlet to only use light-wieght components (that, in particular, don't care that there isn't a mouse). Simon Brooke [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] -BEGIN PGP SIGNED MESSAGE- Long, long ago I spent a lot of time writing a Servlet which allowed drill-through graphs and charts to be built on the fly, server side. I was very proud of it, but getting it working on an X11 platform was such a bloody swine that I actually documented how to do it here: URL:http://www.weft.co.uk/library/jacquard/documentation/uk/co/weft/htform/ Graphic.html Now I need to use this functionality in a new project, and can I get it to work? No, I **%$ can't. And the problem is a new one: java.awt.HeadlessException I get this whether or not I have CATALINA_OPTS=-Djava.awt.headless=true defined in /etc/default/tomcat4, and whether or not I have Xvfb running, with the DISPLAY environment variable pointing in the right place, and all X security off. Specifically I get: java.awt.HeadlessException at java.awt.GraphicsEnvironment.checkHeadless(GraphicsEnvironment.java:121) at java.awt.Window.(Window.java:266) at java.awt.Frame.(Frame.java:398) at java.awt.Frame.(Frame.java:363) at uk.co.weft.htform.MappedImage.(MappedImage.java:156) at uk.co.weft.htform.ExampleMappedImage.(ExampleMappedImageServlet.java:28) which is to say when I first try to create a java.awt.Frame I'm using tomcat 4.0.4 as packaged in Debian package tomcat4_4.0.4-4 on Debian 3.0 with Sun Java 1.4.0 and Sun Java 1.4.1; I also have, and could try if people think it would help, IBM Java 1.3.0 The last time this issue was discussed on this list was on 20th March this year; I've tried all the proposed solutions which were discussed at that time, including the eTeks PJA toolkit, which sounds a very clever solution but which unfortunately failed with a NullPointerException java.lang.NullPointerException at com.eteks.awt.servlet.PJARedirectServlet.servicePJA(PJARedirectServlet.java: 195) 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 com.eteks.awt.servlet.PJAServlet.HttpMethodInvoke(PJAServlet.java:793) at com.eteks.awt.servlet.PJAServlet.service(PJAServlet.java:775) Any further suggestions gratefully received. Simon - -- [EMAIL PROTECTED] (Simon Brooke) http://www.jasmine.org.uk/~simon/ ;; MS Windows: A thirty-two bit extension ... to a sixteen bit ;; patch to an eight bit operating system originally coded for a ;; four bit microprocessor and sold by a two-bit company that ;; can't stand one bit of competition -- anonymous -BEGIN PGP SIGNATURE- Version: 2.6.3ia Charset: noconv iQCVAwUBP1zdAHr1UrYJMbiJAQHSUAP/RoR0DwfzilZ3EySyin3kXFzPkLQopTM9 l1yHrFdLnFFW6MV9rIuoKxNS2U1vPJ9zlqfeJt8hJszKKYO3b5WII6IJ0sz3fOIL YaItN0wTGmgpDtOMSFHsv4hXrzHBVdzNXYuQaJ6Fo/alKcRMGdfKliYzNAR3PaeH zlgRCXecWio= =z/Pq -END PGP SIGNATURE- - 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: Connetion between Tomcat MySQL
Any JDBC driver for mysql (that works for you) will do. Amy Cheung wrote: so what kind of connection is best? using the J/Connector or the OCBC one? --- Bill Barker [EMAIL PROTECTED] wrote: Assuming that you aren't using JDBCRealm, then it should be enough to put the jar file in $TOMCAT_HOME/lib/apps. If you are using JDBCRealm, then place it in $TOMCAT_HOME/lib/common. Setting the CLASSPATH is evil ;-). Amy Cheung [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Hi, I am using Tomcat 3.3.1 and MySQL 4.0 in Window XP. MySQL engine is running. When I run my jsp, it stated the error that import com.mysql.Driver not found. Anyone know how to install the driver properly? I read something about setting the class path. But where to set? I don't know much about the MSDOS command and specify the envirnomental variables in Window XP. I download both the J/Connector OCBC driver from MySQL. Where should be the exact location to store? Thanks, Amy Cheung __ Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software http://sitebuilder.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] __ Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software http://sitebuilder.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: How to cache the user's input in a jsp page?
In the servlet or jsp you could do : String text = request.getParameter(subject) ; Then do whatever you want with it. engp0510 wrote: Thanks I know maybe I should use session, but when I choose select box, the jsp page will be reloaded. How do I save the value of INPUT tabIndex=1 maxLength=100 size=40 name=subject into session, that after reloaded the value should be the same as user input previously? - Original Message - From: Duncan Strang [EMAIL PROTECTED] To: Tomcat Users List [EMAIL PROTECTED] Sent: Thursday, September 04, 2003 4:15 PM Subject: RE: How to cache the user's input in a jsp page? Check out JSP's implicit object collection For example, if you are using user sessions you can put any Object onto the session, this will then be available whenever the user accesses the page. To use the session object simply use session.setAttribute(identifier, Object); So to save an Integer (Objects only, not primitives) for example Integer foo = new integer(10); session.setAttribute(fooint foo); To retrieve it next request use Integer foo2 = (Integer)session.getAttribute(fooint); There are other implicit Objects including application (the jsp view of the Servlet context) but this is globally visible so shouldn't be use to store session type variables (IMHO) Or you could write your own cache :) Cheers Duncan -Original Message- From: engp0510 [mailto:[EMAIL PROTECTED] Sent: 04 September 2003 09:00 To: [EMAIL PROTECTED]; [EMAIL PROTECTED] Subject: How to cache the user's input in a jsp page? Hi How to cache the user's input in a jsp page? The following is some code of my JSP: % int item_num = 5; int row_num = 1; if(request.getParameter(row_num)!=null){ String rowstr = (request.getParameter(row_num)); try{ row_num = Integer.parseInt(rowstr); } catch(NumberFormatException ne){} } % ... ... TR class=LGREY TD class=L align=right width=25% Subjectnbsp; : /TD TD class=L width=75% nbsp; INPUT tabIndex=1 maxLength=100 size=40 name=subject /TD /TR .. select size=1 name=item_num ONCHANGE=location=this.options[this.selectedIndex].value; %for(int i=1;i=5;i++){% option value=\AddQuotation.jsp?actionfrom=%=request_from%row_num=%=i%%i f(row_num==i){out.print(SELECTED);}% -%=i%-/option %}% /select ... %for(int ii=0;iirow_num;ii++){% tr td width=25% align=center %=ii+1%/td td width=25% align=center nbsp;INPUT tabIndex=2 maxLength=100 size=25 name=project_detail_%=ii+1%/td td width=25% align=center nbsp;INPUT tabIndex=2 maxLength=20 size=10 name=quantity_%=ii+1%/td td width=25% align=center nbsp;INPUT tabIndex=2 maxLength=20 size=10 name=unit_price_%=ii+1%/td /tr %}% The choosing of select will refresh this jsp and create the rows as many as choosed. But how to cache the input of Subject? email: INPUT NAME=email onChange=checkEmail(this.value)BR Can I do this without using javascript? This email has been scanned for all viruses by the MessageLabs Email Security System. For more information on a proactive email security service working around the clock, around the globe, visit http://www.messagelabs.com This email has been scanned for all viruses by the MessageLabs Email Security System. For more information on a proactive email security service working around the clock, around the globe, visit http://www.messagelabs.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] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: dbtags and tomcat 4.1
If you poke around in the mailling list for the taglib project you will find a mail or two about this, if I remember correctly had something to do with the tag not confrming to the taglib specification that tomcat provides. You could use jstl instead, but from my experience SQL in the jsp is more trouble then it is worth and causes imense headaches when you want to do something complicated. Just a suggestion but it could be a good time for you to have a look at migrating to Struts or some other framework which suits your needs :D Mickael Cappozzo wrote: Hello, We wanted to migrate from tomcat 4.0 to tomcat 4.1.24, but we encoutered the following problem: When a query return nothing, the query's body is displayed on the JSP page if the page contains another query returning something. example: In the table Users, we don't have user with username toto and with have a user with username test if we write the following in a jsp page: sql:statement id=getUserTest conn=myConn %-- THIS QUERY RETURNS THE UserID --% sql:query SELECT UserID FROM Users WHERE username = 'test' /sql:query sql:resultSet id=getUserIDTest sql:getNumber position=1 to=userIDTest/ /sql:resultSet /sql:statement sql:statement id=getUserToto conn=myConn %-- THIS QUERY IS EMPTY --% sql:query SELECT UserID FROM Users WHERE username = 'toto' /sql:query sql:resultSet id=getUserIDToto sql:getNumber position=1 to=userIDToto/ /sql:resultSet /sql:statement On the page we saw: SELECT UserID FROM Users WHERE username = 'toto' We noticed the following: if we add an attribute: loop, scope or another existing attribute in the resultSet tag in the empty query, the query is not displayed on the JSP page. However if we add this attribute to each resultSet tag, the query is displayed... Any idea??? - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: How to get reference of MBeanServer in Tomcat
Have a look a the source code for the Admin Webapp for tomcat. It uses JMX. s p wrote: I am using JMX technology to get information of Tomcat server. I am unable to get the reference of the MBeanServer in Tomcat. Has any one worked on this before. I am able get the information for other application servers like weblogic and webshere. But I did not find suitable APIs for Tomcat. Any help in this direction will be appreciated. Regards, Santosh __ Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software http://sitebuilder.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: Folder Permissions taken over by Tomcat 4
Is there a specific need to make that directory a smb share directory ? Hertenstein Alain wrote: Hello, We have a Red Hat Linux 7.2 Server with Tomcat v4.0.3 installed, and a web application configured, let's say myApps. In this webapps/myApps folder, there are folders which we have shared through SMB so that Windows users can access them, and we have also changed the folder's permissions, so that these users can modify their contents. Everything works fine. The problem here is when we have to restart Tomcat 4, all permissions under that webapps/myApps folder are restored this way - User : Tomcat 4, Group : Tomcat 4. So this means that all our permissions settings are cleared ! And we have to set them back again each time we restart Tomcat 4 (in case of a server reboot, or major application change, etc), which is quite annoying. Is there a way to avoid this ? Thank you very much Alain ** This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. ** - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Tomcat 4.1 DefaultContext Bug?
Specifically what problems do you have when running the app as a war file ? Peter Harrison wrote: I have spent the last three days trying everything to move from 4.0 to 4.1. The problem is with the datasources. When the resource is in a specific Context everything works, but when its in the DefaultContext I am getting a java.sql.SQLException: Cannot load JDBC driver class 'null' The server.xml has a resource defined: Resource name=jdbc/foo auth=Container type=javax.sql.DataSource/ ResourceParams name=jdbc/foo parameternameuser/namevaluefoo/value/parameter parameternamepassword/namevaluebar/value/parameter parameternamedriverClassName/name valueorg.postgresql.Driver/value/parameter parameternameurl/name valuejdbc:postgresql://localhost/foo/value/parameter /ResourceParams My web.xml now has: resource-ref descriptionFoo Database/description res-ref-namejdbc/foo/res-ref-name res-typejavax.sql.DataSource/res-type res-authContainer/res-auth /resource-ref The driver is there - since I it works when the Context is specific. The problem however is that a Context that is specified will block unpacking of a war. There are some issues with using the war directly without unpacking - so I need to define the datasource in the DefaultContext. However this isn't working. Simply changing from DefaultContext to Context solves the problem - proving that it is the DefaultContext which doesn't appear to work. Help :) Peter - 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: maxProcessors problem
If I may ask how much physical memory do you have in the first place ? Do you really have that much to give to the for the max heap size ? Mike Cherichetti (Renegade Internet) wrote: I've set CATALINA_OPTS to use -Xmx896m and -Xms384m. That works fine with maxProcessors set to 384. Problem is, if I set -Xmx higher or maxProcessors higher, I get he OutOfMemoryError. Thanks, Mike -Original Message- From: Shapira, Yoav [mailto:[EMAIL PROTECTED] Sent: Tuesday, August 19, 2003 9:12 AM To: Tomcat Users List; [EMAIL PROTECTED] Subject: RE: maxProcessors problem Howdy, What's your -Xmx setting to the JVM? Yoav Shapira Millennium ChemInformatics -Original Message- From: Mike Cherichetti (Renegade Internet) [mailto:[EMAIL PROTECTED] Sent: Monday, August 18, 2003 4:42 PM To: Tomcat Users Subject: maxProcessors problem First off, I'm using RedHat Linux 7.3, IBM JDK 1.4.1, and Tomcat 4.1.24 on an IBM xSeries with Dual Xeon 2 GHz processors, 2 GB RAM, and SCSI disks. I'm trying to get Tomcat to handle a lot of traffic (4-5 million hits per day) and bumping up against a problem I for life of me can't figure out. So, I'm hoping someone else on this list has run into this problem and can help me out! Basically, I can't set maxProcessors higher than 384. If I do, Tomcat ends up choking (it doesn't crash, it just stops creating more request processors) and I get the following in catalina.out: Aug 18, 2003 5:05:02 AM org.apache.coyote.http11.Http11Protocol start INFO: Starting Coyote HTTP/1.1 on port 80 Aug 18, 2003 5:05:05 AM org.apache.tomcat.util.threads.ThreadPool$ControlRunnable run SEVERE: Caught exception executing [EMAIL PROTECTED], terminating thread java.lang.OutOfMemoryError: JVMCI015:OutOfMemoryError, cannot create anymore threads due to memory or resource constraints at java.lang.Thread.start(Native Method) at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.init(Thread Pool . java:582) at org.apache.tomcat.util.threads.ThreadPool.openThreads(ThreadPool.java:4 60) at org.apache.tomcat.util.threads.ThreadPool.runIt(ThreadPool.java:293) at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:5 36) at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPoo l.ja v a:619) at java.lang.Thread.run(Thread.java:568) Now, I know that the JVM has plenty of memory left that it can be allocated and the system has plenty of free memory, so I'm not sure it's really a memory issue. As I said, Tomcat still runs and the memory allocated to the JVM increases, it just doesn't have nearly enough request processors created at the point this error happens to deal with all of the traffic. I've tried playing around with ulimit settings, but those didn't have any impact. I've also tried the Sun JVM and it did the same thing. Has anyone run into this problem or something like it before? Any help would be greatly appreciated! Thanks, Mike - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] This e-mail, including any attachments, is a confidential business communication, and may contain information that is confidential, proprietary and/or privileged. This e-mail is intended only for the individual(s) to whom it is addressed, and may not be saved, copied, printed, disclosed or used by anyone else. If you are not the(an) intended recipient, please immediately delete this e-mail from your computer system and notify the sender. Thank you. - 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: Cannot Solve jdbc is not bound is this Context problem
If you copy the DB2 driver into $CATALINA_HOME/common/lib , then it should be a jar rather than a zip or a tar file. I think you should also change driverName to url. Alan Nesbitt wrote: We have been trying for over a week to solve this problem. It doesn't help that we haven't used tomcat before, but our application works fine on WebSphere. So I guess that it some configuration that we are missing. We are trying to configure tomcat (4.1.24) to do a jndi lookup of a DataSource which is a db2 jdbc app driver. The Tomcat server.xml had a sample jdbc configuration which was modified to the following... Resource name=jdbc/SURESWIT auth=Container type=javax.sql.DataSource/ ResourceParams name=jdbc/SURESWIT parameternameuser/namevalue/value/parameter parameternamepassword/namevalue/value/parameter parameternamedriverClassName/name valueCOM.ibm.db2.jdbc.app.DB2Driver/value/parameter parameternamedriverName/name valuejdbc:db2:SWPPDB2/value/parameter /ResourceParams The web.xml includes resource-ref res-ref-namejdbc/SURESWIT/res-ref-name res-typejavax.sql.DataSource/res-type res-authContainer/res-auth /resource-ref The Java code performs the following :- if (ds == null) { try { Context ctx = new InitialContext(); ds = (javax.sql.DataSource) ctx.lookup((jdbc/SURESWIT); ctx.close(); } catch (Exception e) { logger.text( IRecordType.TYPE_ERROR_EXC, className, init(ServletConfig), Naming service exception: + e.toString()); } } When the above code runs it throws the following exception init(ServletConfig) Naming service exception:javax.naming.NameNotFoundException: Name jdbc is not bound in this Context I have copied the DB2 jdbc driver file to $CATALINA_HOME/common/lib (I copied it both as .zip and .tar as some web resources suggested tomcat would only recognise it as .tar) ANY and I mean ANY help would be greatly appreciated. Even if it's to say it doesn't work with tomcat. Many thanks Alan - 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: Run Windows' command in Java method
Beware of the pitfalls that can come from using Runtime.exec() Have a look at this article first : http://www.javaworld.com/javaworld/jw-12-2000/jw-1229-traps.html Cui Xiaojing-a13339 wrote: Hello, Thanks so much for the help. Now I only want to execute a SQL Server's import/export utility in Java method. The utility could be executed using below command line in Windows Command prompt window: C: BCP flex.dbo.CF_load in e:\Flex\file\inbound.txt /f e:\Flex\prog\bcp.fmt /S flex /U /P Does the utility could be executed in Java method? If I could use below method to run it? Runtime r=Runtime.getRuntime(); try{ r.exec(BCP flex.dbo.CF_load in e:\Flex\file\inbound.txt /f e:\Flex\prog\bcp.fmt /S flex /U /P ); }catch(IOException e){} ThanksRegards, Xiaojing -Original Message- From: engp0510 [mailto:[EMAIL PROTECTED] Sent: 2003815 13:07 To: Tomcat Users List Subject: Re: Run Windows' command in Java method http://java.sun.com/docs/books/tutorial/native1.1/ - Original Message - From: Cui Xiaojing-a13339 [EMAIL PROTECTED] To: Tomcat Users List [EMAIL PROTECTED] Sent: Friday, August 15, 2003 11:41 AM Subject: Run Windows' command in Java method Hello All, Do you know if windows' command could be executed in Java method? If yes, which API class method can be used to do it? Thanks a lot. Regards, Xiaojing - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Tomcat Conn Pooling in 4.0.4 - Last queston...!
I think it has to be javax.sql.DataSource Andoni wrote: One last question: Do you all use: Resource name=jdbc/animo auth=Container type=javax.sql.DataSource/ Or do you call a different type. Such as javax.sql.PooledDataSource Andoni. - Original Message - From: Shapira, Yoav [EMAIL PROTECTED] To: Tomcat Users List [EMAIL PROTECTED] Sent: Wednesday, August 06, 2003 7:28 PM Subject: RE: Tomcat Conn Pooling in 4.0.4 - Very Slow? Howdy, doh Sorry about that, I was assuming tomcat 4.1. Maybe you can use DBCP with 4.0.x. Yoav Shapira Millennium ChemInformatics -Original Message- From: Andoni [mailto:[EMAIL PROTECTED] Sent: Wednesday, August 06, 2003 1:51 PM To: Tomcat Users List Subject: Re: Tomcat Conn Pooling in 4.0.4 - Very Slow? I am afraid Tomcat 4.0.4 does not have DBCP. It uses Tyrex instead. I have found from: http://tyrex.sourceforge.com/tomcat.html that I should be using: tyrex.resource.jdbc.xa.EnabledDataSource But my .jar file for Tyrex only seems to have: tyrex.jdbc.xa.EnabledDataSource so I am using this instead. I also have a class in my oracle driver's .jar archive called: oracle/jdbc/pool/OracleDataSource.class and another called: oracle/jdbc/pool/OracleConnectionPoolDataSource.class So I might try these also. I think I have a pdf manual for that Oracle JDBC driver somewhere I'll look that up. Have you any thoughts? Should I install commons DBCP? Andoni. - Original Message - From: Shapira, Yoav [EMAIL PROTECTED] To: Tomcat Users List [EMAIL PROTECTED] Sent: Wednesday, August 06, 2003 6:27 PM Subject: RE: Tomcat Conn Pooling in 4.0.4 - Very Slow? Howdy, Factory? What is a factory? What does it look like? It's a class implementing the GoF Factory pattern. I thought what I had below WAS a factory? is having DataSource there not good enough? No. What's below is exactly what my Tomcat book has!! Your book could be out of date or incorrect. Can you please help? Add this parameter to your server.xml: parameter namefactory/name valueorg.apache.commons.dbcp.BasicDataSourceFactory/value /parameter And read the JNDI DataSource HOW-TO in the tomcat docs. Yoav Shapira This e-mail, including any attachments, is a confidential business communication, and may contain information that is confidential, proprietary and/or privileged. This e-mail is intended only for the individual(s) to whom it is addressed, and may not be saved, copied, printed, disclosed or used by anyone else. If you are not the(an) intended recipient, please immediately delete this e-mail from your computer system and notify the sender. Thank you. - 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] This e-mail, including any attachments, is a confidential business communication, and may contain information that is confidential, proprietary and/or privileged. This e-mail is intended only for the individual(s) to whom it is addressed, and may not be saved, copied, printed, disclosed or used by anyone else. If you are not the(an) intended recipient, please immediately delete this e-mail from your computer system and notify the sender. Thank you. - 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: [OT] Some one executing windows commands in Tomcat 4.1.18.
It's in the intranet right ? Should be easy to track down :) Antony paul wrote: Hello, I have Tomcat standalone running on a local Intranet. The server is windows 2000 SP2. Today while checking the access log files I found the following lines xx.xx.xx.xx - - [11/Aug/2003:09:47:38 5050] GET /scripts/root.exe?/c+dir HTTP/1.0 404 716 xx.xx.xx.xx - - [11/Aug/2003:09:47:43 5050] GET /MSADC/root.exe?/c+dir HTTP/1.0 404 710 What does this mean ? Is there any vulnerability in Tomcat or this combination ?. I have uncommented the invoker servlet in web.xml. Is it creating the problem ?. regards Antony Paul - 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: security hole on windows tomcat?
Can't replicate your problem, tried both linux and win2k Version of tomcat is the same as yours. Paul Sundling(Webdaddy) wrote: I came across what appears to be a security hole when running tomcat. I'm not sure how widespread it is, but my linux server is safe, yet my windows XP, tomcat 4.1.24 is vulnerable. I found that if you append %20 to a jsp page it shows the source code instead of displaying the page: http://192.168.1.54:8080/index.jsp shows page as expected http://192.168.1.54:8080/index.jsp%20 shows source code of index.jsp So how widespread is this? Paul Sundling - 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: Configuration Error?
Pedro, unjar-ed classes go under WEB-INF/classes/{SOME PACKAGENAME}, jar files go under WEB-INF/lib Your java beans will never be found if they just reside under WEB-INF . Pedro Silva wrote: I am really having a bad time using Apache Tomcat for the first time... But I won't give up... Just need help... I have a JSP page that works with a javabean (a simple test page), just look at the code: %@ page contentType=text/html; charset=iso-8859-1 language=java import=java.sql.* errorPage= % html head jsp:useBean class=mybeans.lineBean id=bean= scope=page / titleUsing JavaBeans/title meta http-equiv=Content-Type content=text/html; charset=iso-8859-1 /head body %= bean0.stars(20) % Welcome to JavaBeans! %= bean0.doubleLine(30) % /body /html When I try this page I get the following error: type Exception report message Internal Server Error description The server encountered an internal error (Internal Server Error) that prevented it from fulfilling this request. exception org.apache.jasper.JasperException: Unsupported encoding: at org.apache.jasper.compiler.ParserController.getReader(ParserController.j ava:440) at org.apache.jasper.compiler.ParserController.parse(ParserController.java: 209) at org.apache.jasper.compiler.Compiler.compile(Compiler.java:210) at org.apache.jasper.servlet.JspServlet.loadJSP(JspServlet.java:548) at org.apache.jasper.servlet.JspServlet$JspServletWrapper.loadIfNecessary(J spServlet.java:176) at org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServle t.java:188) at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:381) at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:473) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Applica tionFilterChain.java:247) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilt erChain.java:193) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValv e.java:243) at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.ja va:566) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:4 72) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValv e.java:190) at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.ja va:566) at org.apache.catalina.valves.CertificatesValve.invoke(CertificatesValve.ja va:246) at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.ja va:564) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:4 72) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943) at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:234 7) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java :180) at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.ja va:566) at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherVa lve.java:170) at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.ja va:564) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java :170) at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.ja va:564) at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:468 ) at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.ja va:564) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:4 72) 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.ja va:566) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:4 72) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943) at org.apache.catalina.connector.http.HttpProcessor.process(HttpProcessor.j ava:1027) at org.apache.catalina.connector.http.HttpProcessor.run(HttpProcessor.java: 1125) at java.lang.Thread.run(Thread.java:536) I have this page on Tomcat/ROOT/ directory and the class at Tomcat/ROOT/WEB-INF/mybeans. Do I have anything misconfigured? I'm busting my head off since yesterday over this... Can anyone help me? Thankx! Pedro Honório Silva [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Configuration Error?
Also did you import your classes in the @page import directive ? I only see a java.lang, could be the source of the problem. Sekhmet wrote: Yes, but they are in WEB-INF/classes/mybeans (MYBEANS is the package name) and I still get the same error... Pedro Honório Silva [EMAIL PROTECTED] -Original Message- From: Kwok Peng Tuck [mailto:[EMAIL PROTECTED] Sent: segunda-feira, 4 de Agosto de 2003 8:15 To: Tomcat Users List Subject: Re: Configuration Error? Pedro, unjar-ed classes go under WEB-INF/classes/{SOME PACKAGENAME}, jar files go under WEB-INF/lib Your java beans will never be found if they just reside under WEB-INF . Pedro Silva wrote: I am really having a bad time using Apache Tomcat for the first time... But I won't give up... Just need help... I have a JSP page that works with a javabean (a simple test page), just look at the code: %@ page contentType=text/html; charset=iso-8859-1 language=java import=java.sql.* errorPage= % html head jsp:useBean class=mybeans.lineBean id=bean= scope=page / titleUsing JavaBeans/title meta http-equiv=Content-Type content=text/html; charset=iso-8859-1 /head body %= bean0.stars(20) % Welcome to JavaBeans! %= bean0.doubleLine(30) % /body /html When I try this page I get the following error: type Exception report message Internal Server Error description The server encountered an internal error (Internal Server Error) that prevented it from fulfilling this request. exception org.apache.jasper.JasperException: Unsupported encoding: at org.apache.jasper.compiler.ParserController.getReader(ParserController. j ava:440) at org.apache.jasper.compiler.ParserController.parse(ParserController.java : 209) at org.apache.jasper.compiler.Compiler.compile(Compiler.java:210) at org.apache.jasper.servlet.JspServlet.loadJSP(JspServlet.java:548) at org.apache.jasper.servlet.JspServlet$JspServletWrapper.loadIfNecessary( J spServlet.java:176) at org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServl e t.java:188) at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:381 ) at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:473) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Applic a tionFilterChain.java:247) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFil t erChain.java:193) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperVal v e.java:243) at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.j a va:566) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java: 4 72) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextVal v e.java:190) at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.j a va:566) at org.apache.catalina.valves.CertificatesValve.invoke(CertificatesValve.j a va:246) at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.j a va:564) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java: 4 72) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943) at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:23 4 7) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.jav a :180) at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.j a va:566) at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherV a lve.java:170) at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.j a va:564) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.jav a :170) at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.j a va:564) at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:46 8 ) at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.j a va:564) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java: 4 72) 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.j a va:566) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java: 4 72) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943) at org.apache.catalina.connector.http.HttpProcessor.process(HttpProcessor. j ava:1027) at org.apache.catalina.connector.http.HttpProcessor.run(HttpProcessor.java : 1125) at java.lang.Thread.run(Thread.java:536) I have this page on Tomcat/ROOT/ directory and the class at Tomcat/ROOT/WEB
Re: Checking for invalidated session
How about: if(session.getAttribute(myattrib)==null) { } Tim Davidson wrote: But surely theres a better way? Whould I be better off replacing session.invalidate() with session = null? -Original Message- From: Justin Ruthenbeck [mailto:[EMAIL PROTECTED] Sent: Thursday, July 31, 2003 6:44 PM To: Tomcat Users List Subject: Re: Checking for invalidated session At 08:31 AM 7/31/2003, you wrote: How can you check to see if a session has already been validated? i.e. if( !session.isInvalidated()) -- what should go here? { session.invalidate(); } to prevent the following exception: org.apache.jasper.JasperException: invalidate: Session already invalidated If you don't want to just catch and ignore the JasperException, then use something like this: try { session.getAttributeNames(); } catch (java.lang.IllegalStateException isse) { // Session is already invalid } justin Justin Ruthenbeck Software Engineer, NextEngine Inc. justinr - AT - nextengine DOT com Confidential See http://www.nextengine.com/confidentiality.php - 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: [Q] Is it safe to create threads in Tomcat web-apps?
jcrontab works ok, it is modeled after the unix crontab entries. Best bet is to try it and see if it meets ones needs :) Anton Tagunov wrote: So, what John is speaking about - spending less effort on thread coding and using an existing solution (native Unix crontab) may also be pushing you to using it Java analog - jcrontab. That being said I have not even read a page on the jcrontab site, so I do not know if it's workable or buggy. -Anton - 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: [newbie] Executing class files
You don't map class files to your folder in tomcat. You should pack everything into your own webapp directory and deploy it into the $TOMCAT_HOME/webapps directory. Here's a short article that might help you out : http://jakarta.apache.org/tomcat/tomcat-4.1-doc/appdev/index.html For more info the servlet specification you can get that at http://java.sun.com Olivier Marie wrote: I tried several configurations modifying server.xml and tomcat.conf to map my .class files folder. Tomcat never found them (404). I have difficulties to understand all subtilities of Tomcat configuration... Could anyone tell me what modification i have to do in conf files ? Many thanks Olivier - 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: [Q] Is it safe to create threads in Tomcat web-apps?
Hello Riaan, you might want to check out jcrontab. http://jcrontab.sourceforge.net Riaan Oberholzer wrote: Well, that was part of my question if I cannot/don't implement daemon threads to do e.g. automatic daily tasks, what else? E.g, at the end of the day send an e-mail to a (real life) manager with a summary of the day's transactions something like that. Does Tomcat provide some sort of ActionEvent which you can configure to be fired every x milliseconds? --- Tim Funk [EMAIL PROTECTED] wrote: You can create threads all day in tomcat, but here are the importnatn things to consider: - WHY! Are threads really the correct solution? - If you create threads - what are their scope? Daemon, non-daemon? - If you create non-daemon threads - be prepared for the consequences such as the JVM not going away on tomcat shutdown unless you have taken the needed precautions. - If you create dameon only threads, be prepared for when tomcat shuts down and your daemon still has work to do because the JVM could exit before your thread is ready to complete its unit of work - WHY! Are threads really the correct solution? - And last but not least: WHY! Are threads really the correct solution? -Tim Riaan Oberholzer wrote: I've mainly worked in BEA WebLogic before and from colleagues and other sources I have heard it is not recommended (and sometimes not allowed, some even said) to create threads in your application. Indeed, when the application went live in a multi-server clustered environment, we got very inconsistent results because of the threads, so we had to remove them. Question is, how safe is it to create threads in a Tomcat web-app? I would assume worker threads are ok, i.e. threads you create to do a specific task and then it terminates. When you are guaranteed the thread will terminate either because of an error or because the assigned task has been completed. But what about monitor threads, i.e. threads that does a Thread.sleep(x) for an hour, check some condition and goes back to sleep... some mechanism you implement to e.g. do a task on a hourly/daily/weekly base. You'd create the thread (and keep a handle to it) in either an InitServlet.init() and then Thread.interrupt() in the InitServlet.destroy(), or you can do it in an ApplicationListener (something like that) class which I think you can define in the web.xml. How else can you implement that (monitoring) in Tomcat? - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] __ Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software http://sitebuilder.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: Production server tuning
I'm no expert in load balancing and stuff like that, but shouldn't you load balance tomcat as well ? Antonio Fiol Bonnín wrote: Hello, We have already gone live, and we actually spend too much time dead. I hope some of you can help me a bit about the problems we have. Architecture: 3 Apache web servers (1.3.23) behind a replicated load balancer in DMZ 1 Tomcat server (4.1.9) behind firewall, in secure zone. 1 Firewall in between. Some facts I observed: - Under high load, server sometimes hangs from the user's point of view (connection not refused, but nothing comes out of them. - Under low load, I netstat and I still see lots of ESTABLISHED connections between the web servers and the Tomcat server. For the first case, I reckon I might have found the cause: Apache MaxClients is set to 200, and Tomcat maxProcessors was set to something about 150. Taking into account that there are 3 Apache, that means 200 x 3 = 600 clients -- tomcat chokes. Just raised maxProcessors to 601 ;-) For the second one, I have really no clue: Apache MaxSpareServers is set to 10. I see more than 30 ESTABLISHED connections even with extremely load. Could someone point me to either - a solution (or part thereof, or hints, or ...) - a good tomcat tuning resource ? I hope I can find a solution for this soon... The Directors are starting to think that buying WebLogic is the solution to our nightmares. They think they only need to throw money at the problem. Please help me show them they are wrong before they spend the money. Thank you very much. Antonio Fiol - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: configuring an ODBC database with JNDI
It's up to the database vendor to provide a JDBC driver, not tomcat. You will have to figure out if inicio has a JDBC driver, and what kind of JDBC support provided by that driver, whether it is Type 1, 2, 3 or 4. dein_metzger wrote: hi. I was thinking that tomcat comes with a native jdbc driver... where I can get one for winxp? how can I get certified if there is one compatible driver? thanks in advance, inaciow -Original Message- From: Sudhir Movva [mailto:[EMAIL PROTECTED] Sent: quinta-feira, 24 de julho de 2003 22:03 To: 'Tomcat Users List' Subject: RE: configuring an ODBC database with JNDI First of all you need a jdbc driver to connect to your database (inicio) using Java. If there is one... Check this out http://jakarta.apache.org/tomcat/tomcat-4.1-doc/jndi-datasource-examples -how to.html -Original Message- From: dein_metzger [mailto:[EMAIL PROTECTED] Sent: Thursday, July 24, 2003 8:44 PM To: [EMAIL PROTECTED] Subject: configuring an ODBC database with JNDI I am new to the list. and to JSP and JavaBeans I would like to know how i configure an ODBC database called inicio to work with JNDI, and how I use it in my JSP / Javabean. (I am using tomcat 4.1 on windows xp) --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.502 / Virus Database: 300 - Release Date: 18/7/2003 - 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] --- Incoming mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.502 / Virus Database: 300 - Release Date: 18/7/2003 --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.502 / Virus Database: 300 - Release Date: 18/7/2003 - 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: Scheduling within Tomcat
How about this : http://jcrontab.sourceforge.net ? Works for me. Tim Shaw wrote: Linux RH8, TC 4.1.24 I have an app I want to run regularly, so I've exposed the URI, and used wget to trigger it from a cron job. I also want to run this (or sub-set) at a particular point in time (e.g. 3:27mins in the future). If I provide an app that uses the java...Timer, can I just use it or are there any restrictions on thread control etc in TC. (I'd create the Timer in the init and use the post/get to schedule/deschedule commands). If I want to move to JBoss with TC serving ...? I guess I would use a Timer MBean in TC 5? Thoughts? and thanks tim - 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]
Using JMX in a webapp
If I wish to use JMX in my own webapp, is it necessary for me to write my own implementation of ServerLifecycleListener in the webapp's Context ? Say for example : Context .. Listener classname=com.company.mbean.ServerLifeCycleListener debug=0 descriptor=some package name /Context So if this is the case does my mbeans descriptor go into my webapp's WEB-INF/lib ? TIA. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [OFF-TOPIC] possible virus No Valid Command Found
Are you using mozilla ? Works for me. Thomas, Kevin wrote: Yip. I can't even get them to filter. -Original Message- From: Tim Davidson [mailto:[EMAIL PROTECTED] Sent: 11 July 2003 09:22 To: [EMAIL PROTECTED] Subject: [OFF-TOPIC] possible virus No Valid Command Found Has anyone else recieved about 30 emails from [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: [OFF-TOPIC] possible virus No Valid Command Found
Takes the Bayesian filter a while to figure out it's junk, eventually Mozilla Mail prevailed :D Thomas, Kevin wrote: Nah, I'm reading them through Outlook. It's looks as though they've stopped coming through though, I deleted about 20-30 of them this morning! -Original Message- From: Kwok Peng Tuck [mailto:[EMAIL PROTECTED] Sent: 11 July 2003 11:01 To: Tomcat Users List Subject: Re: [OFF-TOPIC] possible virus No Valid Command Found Are you using mozilla ? Works for me. Thomas, Kevin wrote: Yip. I can't even get them to filter. -Original Message- From: Tim Davidson [mailto:[EMAIL PROTECTED] Sent: 11 July 2003 09:22 To: [EMAIL PROTECTED] Subject: [OFF-TOPIC] possible virus No Valid Command Found Has anyone else recieved about 30 emails from [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] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Log Rotation (4.1.24)
Why not use logrotate ? Tim Funk wrote: Nope - you need an external script. Here is a quick possible one in perl that might do the trick (just wrote, never tested - may be totally wrong due to type) === #!perl use strict; my @files; my $oldest; readdir(DIR, $TOMCAT_HOME/logs); @files = grep(/^localhost_access_log/, readdir(DIR)); closedir(DIR); while ($#file10) { # Get the oldest file $oldest = getOldest(@files); unlink $TOMCAT_HOME/logs/$files[$oldest]; splice(@files, $oldest, 1); } exit(0); sub getOldest { my @f = @_; my $oldest = 0; my $oldestDate = -s $TOMCAT_HOME/logs/$f[0]; for($i=1; $i;$#f; $i++) { if ($oldestDate -s $TOMCAT_HOME/logs/$f[0]) { $oldest = $i; $oldestDate = -s $TOMCAT_HOME/logs/$f[0]; } } return $oldest; } === -Tim news.basebeans.com wrote: I would like to limit the number of log files retained by Apache Tomcat/4.1.24. For example: server.xml Valve className=org.apache.catalina.valves.AccessLogValve directory=logs prefix=localhost_access_log. suffix=.txt pattern=common resolveHosts=false/ results (windowsXP) localhost_access_log.2003-07-08.txt localhost_access_log.2003-07-09.txt etc. desired results To limit the number of daily copies to say ... ten. Configurable log rotation is a capability within a WebLogic console and am wondering if Tomcat has the functionality (without invoking an external script). Any ideas? Marvin Toll - 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 create servlet?
.java is the source file, the one you use to compose your program. It is like any other text file, you can use any text editor to create a .java source file. The .class file is a compiled version of the .java file, ready for execution by the servlet container. For your second question, you only need to define the servlet name, as you have already earlier declared the servlet name like this: servlet servlet-name SomeName/servlet-name servlet-classcom.company.name.Servlet/servlet-name /servlet So when you do the servlet mapping you use the servlet name instead. Your servlets should be located in $CATALINA_HOME/webapps/$WEBAPP/WEB-INF/lib/$JARFILE if you pack them up as a jar or in $CATALINA_HOME/webapps/$WEBAPP/WEB-INF/classes if you did not pack them up in a jar file. kitty winslet wrote: In WEB-INF\classes\ I always find 2 kind of file SendMailServlet.java and SendMailServlet.class, what is the difference btw *.java and *.class ? In the servlet mapping fields, why it only shows the name of the servlet, not the full path to where it located for example c:\tomcat\webapps\examples\WEB-INF\classes\SendMailServlet? Robert Wray [EMAIL PROTECTED] wrote: The SendMailServlet code should be located in tomcat_installation_directory\webapps\examples\WEB-INF\classes\SendMailServlet.javaThe web.xml file in the WEB-INF directory should have a tags: servlet servlet-nameSendMailServlet/servlet-name servlet-classSendMailServlet/servlet-class /servletand servlet-mapping servlet-nameSendMailServlet/servlet-name url-pattern/SendMailServlet/url-pattern /servlet-mappingwhich tell tomcat where to find the servlet when you request http://localhost:/examples/SendMailServletAt 07:07 AM 09/07/2003 -0400, you wrote:To create/use servlets, you just need to folow Sun's Servlet Specification.http://java.sun.com/webservices/docs/1.1/tutorial/doc/http://servlets.com/index.teahttp://moreservlets.com/-Tim - Yahoo! Mobile - Check compose your email via SMS on your Telstra or Vodafone mobile. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Anonymous posting
Sounds like you are after some sort of filter. harsh wrote: Can i restrict domains of the forms posting to my form handling scripts.i.e only all the html or jsps inside http://www.mysite.com/ can post to my jsps,and noone writes his own HTML forms and post to my site .. i hope i m clear in what i m asking. regards harsh -- harsh http://www.cse.iitb.ac.in/~harsh -- - 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: Number of Processes
Try 'ps -elfm' ; the 'm' will show the other threads. You can also achieve the same thing with top by using the 'H' command. Shannon Scott wrote: Hello, I have noticed that tomcat uses only one process on my new redhat 8.0 machine. ( ps -elf | grep tomcat ) There is an interesting explanation here. http://marc.theaimsgroup.com/?l=tomcat-userm=103762836306068w=2 So I wrote a short test_process.jsp page ( below ) that I thought would force another process, but I still only show one when I try to open the page with multiple browsers. Does anyone have a way to force another process to begin? Could something in my configuration not allow other processes? I have set the minProcessors=5 in my server.xml Connector. Linux RedHat 8.0 Apache 2.0.43 ( mod_jk ) Tomcat 4.1.24 Any help is greatly appreciated. Thank You. Shannon test_process.jsp: %@ page session=false % % Thread.sleep(1); out.print( Done... ); % - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: persistent problem
I think it is fairly self-explanatory: http://[your ip]:8080/manager/ If you have installed the rpm copy of tomcat then you may need to download another file to get the manager webapp. The windows installer has it by default. The document which describes this is over here : http://jakarta.apache.org/tomcat/tomcat-4.1-doc/html-manager-howto.html Paul Wallace wrote: Hi, I thought I described what I meant..yes, the page was visible regardless of numerous actions, even going to the lengths of physically removing the class! Can you please extrapolate what on 'Webapp mangaer'? Thanks Paul. What do you mean by persisting? Session issue? Or is it the case where you changed the code in your servlet and the changes are not showing up ? If it is then just use the webapp manager to reload the context the servlet resides in. Paul Wallace wrote: Hello, Can someone please tell me how to configure (I am assuming it is a configuration issue) TC such that my servlets do not insist on persisting. Even when I clear IE history, delete temporary Internet files, cookies, delete the class its self! I literally removed the servlet class and it was still running and outputting to the browser! I eventually had to restart the server each time this happened. Obviously not an acceptable way to develop. Is it an entry in conf/server.xml? Many thanks Paul. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: persistent problem
What do you mean by persisting? Session issue? Or is it the case where you changed the code in your servlet and the changes are not showing up ? If it is then just use the webapp manager to reload the context the servlet resides in. Paul Wallace wrote: Hello, Can someone please tell me how to configure (I am assuming it is a configuration issue) TC such that my servlets do not insist on persisting. Even when I clear IE history, delete temporary Internet files, cookies, delete the class its self! I literally removed the servlet class and it was still running and outputting to the browser! I eventually had to restart the server each time this happened. Obviously not an acceptable way to develop. Is it an entry in conf/server.xml? Many thanks Paul. - 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 I can slove this problem??
For the connector you can specify a new attribute : |'disableUploadTimeout=true' which apparently allows the servlet container to use a different longer connection timeout while a servlet is being executed (well that's what the docs say). I'm not sure where we can actually specify the 'different' timeout, but try this and see. Anybody have ideas where to set the timeout? The page for this is here : http://jakarta.apache.org/tomcat/tomcat-4.1-doc/config/coyote.html Look under the heading 'Standard Implementation'. | Bikash Paul wrote: Hi all friends, I am using tomcat4.1.24 for my uploading software(swing for client interface and servlet).Iam facing problem with connection broken,During uploading of file if connection between local computer and remote computer broken then my software will give a message to user through pop up dialog box,but that dialog box appears after 3 or 4 minitues of connection broken that means as per my idea that Tomcat realease the connection after 3 or 4 minitues of connection broken .I have tried to rectify by configuring Connector element of server.xml file but couldn't slove my problem.Can any plz guide me am I correct that the delay in appearing of dialog box in case of connection broken due to below configuration of Tomcat in server.xml file or it may be due to any other reason. Connector className=org.apache.catalina.connector.http.HttpConnectorport=8080 minProcessors=5 maxProcessors=75 enableLookups=true redirectPort=8443 debug=0 connectionTimeout=0/ Regards Bikash __ Do you Yahoo!? SBC Yahoo! DSL - Now only $29.95 per month! http://sbc.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: TomCat Daemon on Linux
The rpm installation of tomcat includes a start up script that is placed in /etc/rc.d/init.d/ which allows tomcat to be started up on reboot. However, the service is not added by default. Tomcat can be made to start up by using chkconfig It's possible to write your own script, if you want to have a look at the script I can send you a copy of the script that the rpm installs. K.J.L. wrote: I currently develop on a Win2K box where I simply run Tomcat in its own dos box. But I want to deploy on a linux Box, and following on from Yoav's advice that Tomcat can do everything I want, I don't need to worry about Apache. What I'm not sure on is how to start Tomcat as a daemon/service on the linux box. To be honest, I haven't tried to research it yet, it just popped into my head now and thought I'd ask. But from what I remember from when I was first reading up on it, I don't recall there being anything stating howto. Is it just a case of I start it up and have to devote a whole virtual terminal to it? Or can I run it in the background with ''? Or is there actually a way to make a service/daemon of it? A simple pointer to documentation would be greatly appreciated. MTiA K.L. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Tomcat and javascript files
If you tried src=/$WEB-APP/Hestia/coolmenus.js does it work ? MARTIN Franck wrote: Hi all, I am using Tomcat 3.2.1 and i have created a sub-directory in the webapps directory. It is named Hestia. In this sub-directory i placed my home page with the following source code. html head titleALTA - Page d'Accueil/title /head body bgcolor=blue SCRIPT language=JavaScript src=coolmenus.js/SCRIPT SCRIPT language=JavaScript src=menu.inc/SCRIPT /body /html The files named coolmenu.js and menu.inc are also located in the Hestia sub-directory. They only contain javascript instructions and functions. When i browse the page at http://localhost:8080/Hestia/PageAccueil.htm i only get a blue page with no menu. The following errors are displayed in the console : 2003-06-17 09:01:03 - Ctx( /Hestia ): IOException in: R( /Hestia + /coolmenus.js + null) Connection aborted by peer: socket write error 2003-06-17 09:01:03 - Ctx( /Hestia ): 404 R( /Hestia + /menu.inc + null) null Does anyone have an idea? Thanks in advance Franck - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Tomcat classpath not set at boot
It's something about running tomcat headless I think. http://sourceforge.net/forum/forum.php?thread_id=859094forum_id=192228 Try adding this to the tomcat startup scripts : -Djava.awt.headless=true (which you can only do with JDK1.4 or higher) . Tim Funk wrote: Ouch! wacky issues between java and X. The archives have talked about similar items and I am sure there are google links talking about use X with java. Otherwise - I am pretty clueless on the topic. -Tim Chad Lemmen wrote: I've done some more testing and it doesn't have anything to do with starting Tomcat at boot as I first thought. The problem is that my servlet tries to connect to the X server when run. I have no idea why it needs to connect to the X server (It's a servlet that EspressReport wrote to connect to a database and generate a report.), but anyway this seems to be the problem. In order to get my servlet to work I need to do 'xhost + localhost' before Tomcat is started. I'm starting Tomcat as root and root is not allowed to connect to screen :0 by default since my user name owns it. I think if I started Tomcat with my user name and not root it would work, however, for some reason I can't start Tomcat this way. When I start Tomcat as a normal user it starts fine and ps -ef shows the java processes started by Tomcat, but after about 3 seconds all the processes quit and Tomcat is no longer running. Anyone have any idea why this would happen? As root Tomcat continues to run. On Sat, 14 Jun 2003, Tim Funk wrote: Is it just your servlet that doesn't work, or all servlets? (and jsps) Are you using different userids when run from boot time vs command line? What happens if your startup command is moved to inittab? (Or other wacky equivalent) -Tim Chad Lemmen wrote: It's not a system CLASSPATH I have set. I put the jar files I want in the CLASSPATH in $CATALINA_HOME/shared/lib. Tomcat does recognize these if I start Tomcat manually, but not if I have Tomcat staring at boot time with the script in /etc/rc.d/init.d On Fri, 13 Jun 2003, Tim Funk wrote: Tomcat ignores system CLASSPATH at startup and creates its own. http://jakarta.apache.org/tomcat/tomcat-4.1-doc/class-loader-howto.html -Tim Chad Lemmen wrote: I've got Tomcat 4.1.24 starting at boot on my Linux box with a script in /etc/rc.d/init.d. The script looks like this #!/bin/sh JAVA_HOME=/usr/java export JAVA_HOME /opt/jakarta-tomcat-4.1.24/bin/startup.sh Tomcat is starting at boot and seems to work fine http://localhost:8080 brings up the default Tomcat home page. The only thing that doesn't seem to be working is my classpaths that I set in the catalina.sh file are not being set. If I start Tomcat from the command line my classpaths are being read and my servlet works, but when starting Tomcat at boot my classpaths don't seem to be set because when I try to run my servlet I get java.lang.NoClassDefFoundError I don't get this error when Tomcat is started from the command line. Why would starting it at boot time not use my user set classpaths? Here is the portion of catalina.sh that I added my classpath to. # Add on extra jar files to CLASSPATH if [ -n $JSSE_HOME ]; then CLASSPATH=$CLASSPATH:$JSSE_HOME/lib/jcert.jar:$JSSE_HOME/lib/jnet.jar: $JSSE_HOME/lib/jsse.jar fi CLASSPATH=$CLASSPATH:$CATALINA_HOME/bin/bootstrap.jar: /opt/EspressReport/lib/ReportAPIWithChart.jar: /opt/EspressReport/lib/ExportLib.jar I also tried adding the two jar files ReportAPIWithChart.jar and ExportLib.jar to CATALINA_HOME/shared/lib Both methods work and my classpaths are set and my servlet works, but only if Tomcat is started from the command line CATALINA_HOME/bin/startup.sh. Why doesn't this work when starting at boot? - 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] - 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: stalling servlets/jsps with wait/notify?
Why would the client stall in the first place ? If you can figure out that problem, the webapp could probably scale higher than 5 clients. Richard Heintze wrote: I had an interview with a prospective client today who has problems with a current web application (written in lotus notes?). He knows from his present implementation that he can have no more than 5 simultaneous web clients accessing a certain resource that resides on a machine different from his tomcat server. Any additional clients must stall until the others are done. Hmmm Well on page 40 of Jason Hunter's Servlet programming book it explains that static variables are shared among multiple servlet instances. Hmmm... well JSPs are servlets, I wonder if I could create a static variable in a scriptlet (just for testing, of course) and use wait and notify to stall web client #6 until one of the other finish. Does anyone know if this would work? Siegfried __ Do you Yahoo!? Yahoo! Calendar - Free online calendar with sync to Outlook(TM). http://calendar.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: DataSource configuration in web.xml instead of server.xml
You can have a context for your application defined in a seperate xml file but not in the web.xml. If you read the dtd for the web.xml you'll see that this is not allowed. Simply copy your context that works and paste into a new xml file, which has the same name as your webapp. So if you had your app as test.war, then create test.xml. Put these two in the webapps directory, it should autodeploy properly without much hassle. It should work. If it doesn't then restart tomcat. [EMAIL PROTECTED] wrote: hi all, I 've configured my DataSource configuration within a DefaultContext in the server.xml file in tomcat(4.1). Everything works fine. Now I would like to move this configuration in the web.xml file. The datasource section in the documentation explains that is's possible. I use DBCP api. here is an extract of my server.xml datasource configuration. DefaultContext Resource name=jdbc/raise auth=Container type=javax.sql.DataSource/ ResourceParams name=jdbc/raise parameternameusername/namevalueraisepartner/value/parameter parameternamepassword/namevaluepwd4rpd/value/parameter parameternamedriverClassName/name valuecom.sybase.jdbc2.jdbc.SybDriver/value/parameter parameternameurl/name valuejdbc:sybase:Tds:s198000WEBD:4100/raise_partner/value/parameter /ResourceParams /DefaultContext I guess, I must put those line below in the web.xml file web-app resource-ref res-ref-namejdbc/raise/res-ref-name res-typejavax.sql.DataSource/res-type res-authContainer/res-auth /resource-ref how must I specify the other parameters(username,password ...). any help would appreciated. Meissa L'integrite de ce message n'etant pas assuree sur internet, Natexis Banques Populaires ne peut etre tenu responsable de son contenu. Toute utilisation ou diffusion non autorisee est interdite. Si vous n'etes pas destinataire de ce message, merci de le detruire et d'avertir l'expediteur. The integrity of this message cannot be guaranteed on the Internet. Natexis Banques Populaires can not therefore be considered responsible for the contents.Any unauthorized use or dissemination is prohibited. If you are not the intended recipient of this message, then please delete it and notify the sender. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Counting Threads
how many threads did your app launch? Billy Ng wrote: Hi folks, Would anybody tell me how to monitor the count of the exisitng threads in my java app because I get the All Threads are busy, waiting error from tomcat. Billy Ng - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Need help w. Tomcat
Any other stuff get printed besides that ? Steve Burrus wrote: Hello all, I need help with not using the Tomcat server, but with actually getting it set up correctly. Every single time that I try to run it, it seems to be going good for a while, but then I always get a Fatal Parse Error, and it indicates a problem in the org.apache.commons.digester file with the web-app tag. Anyone have any ideas as to what could be wrong? - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Need help w. Tomcat
) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces sorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:324) at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:203) Jun 2, 2003 9:44:50 PM org.apache.coyote.http11.Http11Protocol start INFO: Starting Coyote HTTP/1.1 on port 8080 Jun 2, 2003 9:44:51 PM org.apache.jk.common.ChannelSocket init INFO: JK2: ajp13 listening on /0.0.0.0:8009 Jun 2, 2003 9:44:51 PM org.apache.jk.server.JkMain start INFO: Jk running ID=0 time=20/801 config=C:\jakarta-tomcat-4.1.24\bin\..\conf\j k2.properties And notice in particular this section of the error please SEVERE: Parse Error at line 312 column 11: The content of element type web-app must match (icon?,display-name?,description?,distributable?,context-param*,fil ter*,filter-mapping*,listener*,servlet*,servlet-mapping*,session-config?,mime-ma pping*,welcome-file-list?,error-page*,taglib*,resource-env-ref*,resource-ref*,se curity-constraint*,login-config?,security-role*,env-entry*,ejb-ref*,ejb-local-re f*). What could be wrong anyway? Kwok Peng Tuck wrote: Any other stuff get printed besides that ? Steve Burrus wrote: Hello all, I need help with not using the Tomcat server, but with actually getting it set up correctly. Every single time that I try to run it, it seems to be going good for a while, but then I always get a Fatal Parse Error, and it indicates a problem in the org.apache.commons.digester file with the web-app tag. Anyone have any ideas as to what could be wrong? - 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: IOException: failed to communicate with MySQL
Write a dbkeep-alive, schedule it to run say every 15 minutes. Works for me. I use jcrontab.sourceforge.net to schedule this. I think DBCP also does something like this, you might want to look at their docs as well. Mindaugas Genutis wrote: a couple of days ago a post went by talking about MySQL default timeout being set to 8 hrs for connections... betting this might be your problem... Thanks for pointing this out. I've read the thread Tomcat problems every morning. However, no solution was suggested in that thread. One can assume the solution implicitly: increase default MySQL timeout from 8 hours to say 48 hours. However, if my application stays idle for 48 hours during holidays, it will disconnect after that. Does anyone else have a suggestion on how to improve on this? Hello, My JSP application very often after night, in the morning stops communicating with MySQL database. I get an exception each morning (the exception body goes below). The application starts to work again after I restart it from the Tomcat Manager. Maybe someone else also had this same problem? My server configuration: Linux Redhat, Tomcat 4.1.24, Java 1.4.1. My assumptions where the problem might be: the MySQL connections are eaten by another application or they are eaten by my application somewhere inside and never closed. Or maybe during the night when no one is working with my application it somehow frozes? Can anyone give me a clue how to start debugging these early morning crashes? Another clue: Connections to the database are made through an SQLManager which is a class written by another programmer. The class is a singleton. Could it be that I have to reset it more often? - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Database setup? - SOLVED
Yes it does have to be in order :) . Check the dtd that it references. Terje Hopsø wrote: Thanks!! It was out of order. Now it start without errors. I was not aware of that it had to be in a spesific order. - Terje -Original Message- From: Brian Buchanan [mailto:[EMAIL PROTECTED] Sent: 29. mai 2003 14:15 To: Tomcat Users List Subject: RE: Database setup? The order of the elements in the web.xml file must be in a specific order. As the error message states, they must appear in this order: (icon?,display-name?,description?,distributable?,context-param*,filter*,fil ter-mapping*,listener*,servlet*,servlet-mapping*,session-config?,mime-mappin g*,welcome-file-list?,error-page*,taglib*,resource-env-ref*,resource-ref*,se curity-constraint*,login-config?,security-role*,env-entry*,ejb-ref*,ejb-loca l-ref You probably just have your nested elements out of order. Perhaps you have a servlet or servlet-mapping before your context-param which is invalid. If you want to know more about the format of the web.xml file, you can download the servlet specification from Sun here: http://java.sun.com/products/servlet/download.html Here's a link to the 2.3 specification http://www.jcp.org/aboutJava/communityprocess/final/jsr053/ and refer to chapter 13 - Deployment Descriptor Once you have that sorted out you can see what next falls out. I would also recommend that you learn on the latest version of Tomcat available which is 4.1.24 right now. http://jakarta.apache.org/tomcat/ http://jakarta.apache.org/builds/jakarta-tomcat-4.0/release/v4.1.24/ FYI, If you happen to be using Windows I'd also like to offer this advice: I used to download the .exe version and install it, but I would now recommend the .ZIP version as it doesn't fiddle with your configuration. Sure, getting it to run as a service is a bit trickier, but for development the less fiddling the better. As a zip file I start tomcat from the command line with SET JAVA_HOME=(whichever jvm I want to use) SET CATALINA_HOME=(Whever I unzipped tomcat to) %CATALINA_HOME%\bin\startup.bat Example: SET JAVA_HOME=C:\j2sdk1.4.1_02 SET CATALINA_HOME=C:\jakarta-tomcat-4.1.24 %CATALINA_HOME%\bin\startup.bat This way you can also try different JVM's and different tomcat installs easily. Good luck. ._. Brian Buchanan -Original Message- From: Terje Hopsø [mailto:[EMAIL PROTECTED] Sent: Thursday, May 29, 2003 7:45 AM To: 'Tomcat Users List' Subject: Database setup? Hi, I am trying to setup Tomcat according to the book JavaServer Pages page 157. But all I get when starting up tomcat is errors. I also tried JNDI but that was less understandable so I will first try this simple setup, which I cant understand why failes. Anyone got a hint on what I have to to? I have a standard Tomcat 4.1.18 and JSTL installed. - Terje Here is my setup in web.xml: - context-param param-name javax.servlet.jsp.jstl.sql.DataSource /param-name param-value jdbc:mysql://db.server.no:3306/myuser,com.mysql.jdbc.Driver,myusername,mypas sword /param-value /context-param - The error when starting tomcat is: Starting service Tomcat-Standalone Apache Tomcat/4.1.18 29.mai.2003 13:28:37 org.apache.commons.digester.Digester error SEVERE: Parse Error at line 28 column 11: The content of element type web-app must match (icon?,display-name?,description?,distributable?,context-param*,filter*,fil ter-mapping*,listener*,servlet*,servlet-mapping*,session-config?,mime-mappin g*,welcome-file-list?,error-page*,taglib*,resource-env-ref*,resource-ref*,se curity-constraint*,login-config?,security-role*,env-entry*,ejb-ref*,ejb-loca l-ref *). org.xml.sax.SAXParseException: The content of element type web-app must match (icon?,display-name?,description?,distributable?,context-param*,filter*,fil ter-mapping*,listener*,servlet*,servlet-mapping*,session-config?,mime-mappin g*,welcome-file-list?,error-page*,taglib*,resource-env-ref*,resource-ref*,se curity-constraint*,login-config?,security-role*,env-entry*,ejb-ref*,ejb-loca l-ref*). at org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException(ErrorHand lerWrapper.java:232) 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:37 1) -- In my jsp-file this works fine but I want to put the datasource parameters into web.xml instead of each jsp-file where I access a database. --- sql:setDataSource var=ex scope=application driver=com.mysql.jdbc.Driver url=jdbc:mysql://db.server.no:3306/myuser user=myusername password=mypassword / sql:query var=init dataSource=${ex} sql=select name from adress / c:forEach items=${init.rows} var=row c:out value=${row.name} /br /c:forEach ---
Re: faulty fix for (javax.servlet does not exist)
That's because it's javac -classpath. Jonathan Michael Nowacki wrote: I'm compiling with root, $ javac -cp /var/tomcat4/common/lib/servlet.jar MultiServlet.java javac: invalid flag: -cp Usage: javac options source files and if I change my classpath to: $ echo $CLASSPATH /var/tomcat4/common/lib/servlet.jar I still get the same error $ javac MultiServlet.java MultiServlet.java:1: package javax.servlet does not exist import javax.servlet.*; ^ MultiServlet.java:2: package javax.servlet.http does not exist import javax.servlet.http.*; ^ Weird isn't it. On Mon, 2 Jun 2003, Jason Bainbridge wrote: Simplify things... Firstly that extensive CLASSPATH you have created could be causing more problems than it is solving, so try removing it. Then just try: javac -cp /var/tomcat4/common/lib/servlet.jar MultiServlet.java Does that work? If not does the user you are compiling with have rights to access /var/tomcat4/common/lib/servlet.jar ? Regards, Jason On Mon, 2 Jun 2003 00:00, Jonathan Michael Nowacki wrote: This website http://www.sitepoint.com/article/509/3 says all I have to do is put servlet.jar in my classpath to solve my problems. Unfortunitally, it doesn't seem to work. This is my error -- --- $ javac MultiServlet.java MultiServlet.java:1: package javax.servlet does not exist import javax.servlet.*; ^ MultiServlet.java:2: package javax.servlet.http does not exist import javax.servlet.http.*; ^ -- - THis is my path $ echo $CLASSPATH /var/tomcat4/common/lib/commons-dbcp.jar:/var/tomcat4/common/lib/naming-res ources.jar:/var/tomcat4/common/lib/jdbc2_0-stdext.jar:/var/tomcat4/ common/lib/commons-collections.jar:/var/tomcat4/common/lib/naming-factory.j ar:/var/tomcat4/common/lib/jasper-runtime.jar:/var/tomcat4/common/l ib/ant.jar:/var/tomcat4/common/lib/naming-common.jar:/var/tomcat4/common/li b/jasper-compiler.jar:/var/tomcat4/common/lib/activation.jar:/var/t omcat4/common/lib/jndi.jar:/var/tomcat4/common/lib/servlet.jar:/var/tomcat4 /common/lib/commons-logging-api.jar:/var/tomcat4/common/lib/jta.jar :/var/tomcat4/common/lib/commons-pool.jar:/var/tomcat4/common/lib/mailapi.j :ar:/var/tomcat4/server/lib/servlets-common.jar:/var/tomcat4/server/ lib/commons-fileupload.jar:/var/tomcat4/server/lib/tomcat-http11.jar:/var/t omcat4/server/lib/servlets-cgi.renametojar:/var/tomcat4/server/lib/ commons-digester.jar:/var/tomcat4/server/lib/tomcat-coyote.jar:/var/tomcat4 /server/lib/mx4j.license:/var/tomcat4/server/lib/commons-beanutils. jar:/var/tomcat4/server/lib/servlets-webdav.jar:/var/tomcat4/server/lib/mx4 j-jmx.jar:/var/tomcat4/server/lib/catalina.jar:/var/tomcat4/server/ lib/servlets-ssi.renametojar:/var/tomcat4/server/lib/jakarta-regexp-1.2.jar :/var/tomcat4/server/lib/catalina-ant.jar:/var/tomcat4/server/lib/t omcat-jk2.jar:/var/tomcat4/server/lib/commons-logging.jar:/var/tomcat4/serv er/lib/commons-modeler.jar:/var/tomcat4/server/lib/jaas.jar:/var/to mcat4/server/lib/servlets-default.jar:/var/tomcat4/server/lib/servlets-invo ker.jar:/var/tomcat4/server/lib/servlets-manager.jar:/var/tomcat4/s erver/lib/tomcat-jk.jar:/var/tomcat4/server/lib/tomcat-util.jar:/var/tomcat 4/server/lib/tomcat-warp.jar:/usr/java/j2sdk1.4.1_02/lib/dt.jar:/us r/java/j2sdk1.4.1_02/lib/j2ee.jar:/usr/java/j2sdk1.4.1_02/lib/j2eetools.jar :/usr/java/j2sdk1.4.1_02/lib/tools.jar:/usr/java/j2sdk1.4.1_02/lib/ htmlconverter.jar:/usr/java/j2sdk1.4.1_02/lib/j2ee-ri-svc.jar:/usr/java/j2s dk1.4.1_02/lib/jhall.jar:/usr/java/j2sdkee1.4/lib/j2ee.jar:/usr/jav a/j2sdkee1.4/lib/j2ee-ri-svc.jar:/usr/java/j2sdkee1.4/lib/j2eetools.jar:/us r/java/j2sdkee1.4/lib/jhall.jar The actual code is CLASSPATH=/var/tomcat4/common/lib/commons-dbcp.jar:/var/tomcat4/common/lib/ naming-resources.jar:/va r/tomcat4/common/lib/jdbc2_0-stdext.jar:/var/tomcat4/common/lib/commons-col lections.jar:/var/tomcat 4/common/lib/naming-factory.jar:/var/tomcat4/common/lib/jasper-runtime.jar: /var/tomcat4/common/lib/ ant.jar:/var/tomcat4/common/lib/naming-common.jar:/var/tomcat4/common/lib/j asper-compiler.jar:/var/ tomcat4/common/lib/activation.jar:/var/tomcat4/common/lib/jndi.jar:/var/tom cat4/common/lib/servlet. jar:/var/tomcat4/common/lib/commons-logging-api.jar:/var/tomcat4/common/lib /jta.jar:/var/tomcat4/co mmon/lib/commons-pool.jar:/var/tomcat4/common/lib/mailapi.jar:/var/tomcat4/ server/lib/servlets-comm on.jar:/var/tomcat4/server/lib/commons-fileupload.jar:/var/tomcat4/server/l ib/tomcat-http11.jar:/va r/tomcat4/server/lib/servlets-cgi.renametojar:/var/tomcat4/server/lib/commo ns-digester.jar:/var/tom cat4/server/lib/tomcat-coyote.jar:/var/tomcat4/server/lib/mx4j.license:/var /tomcat4/server/lib/comm ons-beanutils.jar:/var/tomcat4/server/lib/servlets-webdav.jar:/var/tomcat4/ server/lib/mx4j-jmx.jar:
Re: faulty fix for (javax.servlet does not exist)
Actually setting the $CLASSPATH should work. I prefer the 'javac -classpath' method, as you can specify the jars that you want instead of a bunch of directories in the $CLASSPATH variable. Try combining that with a shell script, saves you from typing too many times. Better yet, use ant. Jonathan Michael Nowacki wrote: Holy cow!!! It worked. Thank you very much Kwok Peng Tuck It's still puzzles me why javac -classpath /var/tomcat4/common/lib/servlet.jar MultiServlet.java works yet javac doesn't when I set my class path variable. $ echo $CLASSPATH /var/tomcat4/common/lib/servlet.jar $ javac MultiServlet.java MultiServlet.java:1: package javax.servlet does not exist import javax.servlet.*; ^ MultiServlet.java:2: package javax.servlet.http does not exist import javax.servlet.http.*; ^ the $CLASSPATH variable is the same as whats after -classpath, why does one work and the other doesn't. - 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: /admin
No. You may use it even if it is connected to apache or some other webserver Dominic Parry wrote: Hi I'm I right to assume that the /admin app is only needed to configure the Tomcat if it is used as a standalone web server. Thanks Dom - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Session Replication/Clustering 4.1.x JDK NIO Bug fixes
Just curious Filip, but is any of this going to make it's way into a future version of Tomcat as a standard feature (the clustering and session replication, not the bugs.) ? Filip Hanik wrote: hey ya'all, Running today on Solaris I discovered a bug in the way java.nio is implemented on Solaris 8(Intel) JDK 1.4.1. This problem could exist in other JDK versions as well. The problem is that when a thread reading from a socket channel calls selector.wakeup(); the selector doesn't wakeup from its sleeping state. Hence the replication works exactly once only. I have added in a sleep timeout for the selector (in server.xml the property tcpSelectorTimeout has been added). Play around with this timeout, setting it to small means CPU times goes to waking up the thread. Setting it to high means you can get some delay in your replication. I have defaulted it to 100ms. The new version including updated documentation can be found at http://www.filip.net/tomcat-clustering.html. The same fix has been applied to the Tomcat 5 CVS branch Best regards. Filip - 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: DriverManager.getConnection(jdbc:jtds:sqlserver://127.0.0.1:1443/Services.....Failured... Please, help me!
Check and see if the password and username is correct for the database you setup. Victor Gonzalez wrote: The message is... java.sql.SQLException: Connection refused: connect at net.sourceforge.jtds.jdbc.TdsConnection.allocateTds(Unknown Source) at net.sourceforge.jtds.jdbc.TdsConnection.init(Unknown Source) at net.sourceforge.jtds.jdbc.Driver.connect(Unknown Source) at java.sql.DriverManager.getConnection(DriverManager.java:512) at java.sql.DriverManager.getConnection(DriverManager.java:171) at foo.Arteli.init(Arteli.java:25) at org.apache.jsp.Arteli_jsp._jspService(Arteli_jsp.java:52) at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:137) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) Somebody why?? The files is: Empresa.java public class Empresa { String foo = Not Connected; int bar = -1; Connection conn; public void init() { try{ conn = null; Class.forName(net.sourceforge.jtds.jdbc.Driver); Connection conn = DriverManager.getConnection(jdbc:jtds:sqlserver://127.0.0.1:1443/Servic es,sa,); Statement stmt = conn.createStatement(); ResultSet rst = stmt.executeQuery(SELECT * FROM consecutivos); if(rst.next()){ foo=rst.getString(1); bar=rst.getInt(2); } conn.close(); } catch(Exception e){ e.printStackTrace(); } } public String getFoo() { return foo; } public int getBar() { return bar;} } - 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: jtds and connection examples.
Fortunately there is documentation for what you want and it is in the link listed below. http://jakarta.apache.org/tomcat/tomcat-4.1-doc/jndi-datasource-examples-howto.html Included are sample configurations and a small class example. What's jtds by the way ? Hope it helps you out. Victor Gonzalez wrote: Hi all, I'm really very newbie, I saw (in the list) many descriptions about the database in the web.xml, and similar comments, well, I need to know, how can I make it, ok, more specific, I have a tomcat and I want connect with SQL Server, well, I download the jtds 0.5.1 and put it in the c:\tomcat4.1.18\common\lib and put the jar in the classpath I think I'm ok, I check the documentation (???) and it isn't exist! Well, I want (please, and I will be very thankful with you) a concise explication how-to create a connection a my database (SQL Server, of course), create database in the web.xml and how I can recovery (with jtds, of course) from database with combinations with other requirements Well and syntax form... 1. Example and explication of web.xml with sql server database declarations. 2. Example and explication of file.class (or more simple, into a jsp file) to realize the connection with jtds. 3. The recovery, well, I think check it in the javadoc, Really is more important the two first points (it is necessary like a base) Tnks, so much!! Regards, Victor Gonzalez *** - 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: win 98 :displaying a simple servlet
For servlet development you don't need the whole package, you can just make do with a servlet/jsp container. Tomcat fits the bill perfectly. To compile the servlet, get yourself a java jdk (1.2 or higher) and compile the source servlet with javac. I *think* there is a tutorial on Sun's website which tells you how to build your first servlet and how to install your jdk. Check it out. Jon Schachter wrote: can someone please tell me how in win98 to display a simple servlet for which i have the source code? there apparently is no J2EE version for win98, so i'm hoping that tomcat can compile the servlet and produce a class file. but perhaps i have to upgrade my windows version and install j2ee? Jonathan Schachter [EMAIL PROTECTED] cell: 917 912-1079 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: win 98 :displaying a simple servlet
servlet.jar comes with tomcat which contains the servlet api. You can use this if you wish to compile with your servlet. Jon Schachter wrote: thanks. i have jdk 1.4.but apparently since i downloaded J2SE, and not J2EE, i didn't get javax.servlet and javax.servlet.http. i see where you can just download those from sun. i think that will fix my problem. Jonathan Schachter [EMAIL PROTECTED] cell: 917 912-1079 - Original Message - From: Kwok Peng Tuck [EMAIL PROTECTED] To: Tomcat Users List [EMAIL PROTECTED] Sent: Monday, March 31, 2003 Subject: Re: win 98 :displaying a simple servlet For servlet development you don't need the whole package, you can just make do with a servlet/jsp container. Tomcat fits the bill perfectly. To compile the servlet, get yourself a java jdk (1.2 or higher) and compile the source servlet with javac. I *think* there is a tutorial on Sun's website which tells you how to build your first servlet and how to install your jdk. Check it out. Jon Schachter wrote: can someone please tell me how in win98 to display a simple servlet for which i have the source code? there apparently is no J2EE version for win98, so i'm hoping that tomcat can compile the servlet and produce a class file. but perhaps i have to upgrade my windows version and install j2ee? Jonathan Schachter [EMAIL PROTECTED] cell: 917 912-1079 - 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: ?? Trying Again: Newbie Question about Root Context ??
Send a copy of your server.xml file, I don't see that commented out in mine. I'm pretty sure it isn't though. Tony LaPaso wrote: Hi all, I posted this question over the weekend but nobody really seemed to know the answer. Several people speculated but nobody knew. Altough I'm sincerely hoping for an answer, please, if you don't know for sure, don't guess. :) I just installed TC v4.1.24 on Win 2k. The installation worked right out of the box. I didn't have to make any changes to the server.xml. TC is up and running just fine but I'm seeing something strange I was hoping someone could explain: Here's a quote from the TC documentation: ...you MUST define a Context with a context path equal to a zero-length string. This Context becomes the default web application for this virtual host, and is used to process all requests that do not match any other Context's context path. Okay, that's fine, but when I look at conf/server.xml I see this: !-- Tomcat Root Context -- !-- Context path= docBase=ROOT debug=0/ -- Why is this commented out? According to the documentation cited above there must be a context path equal to a zero-length string. The quote I cited seems to contradict what I'm seeing in server.xml. As I said, even though this is commented out everything seems to work fine. In other words, if I browse to localhost:8080 TC does indeed serve up webapps/ROOT/index.jsp. Is the docBase named ROOT the default? If so, then the documentation seems out of date. I believe in past versions of TC it was definitely necessary to have a context path equal to a zero-length string. If anybody knows (for sure), I would really appreciate an explanation. Thanks very much, Tony - 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: status 404 when migrating from 4.0.4 to 4.1.24
If you put this : servlet-mapping servlet-nameinvoker/servlet-name url-pattern/servlet/*/url-pattern /servlet-mapping in your web.xml then you can use this to load your own servlets without defining them. If remember correctly ; then the class that would be loaded in this example : http://localhost/myapp/servlet/stuff would be stuff.class. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: status 404 when migrating from 4.0.4 to 4.1.24
The servlet invoker lets you call your servlet in the webapp without actually mapping one in the web.xml So you can do this in the browser: http://localhost/myapp/servlet/stuff You're not really missing much. Don't know if the other containers do that. Sven Köhler wrote: servlet-mapping servlet-nameinvoker/servlet-name url-pattern/servlet/*/url-pattern /servlet-mapping one stupid question, what does the invoker-servlet do? i always write my own servlets without using it, and my mapping them directly using web.xml. i wonder, if i'm missing a great feature. is the invoker servlet supported by all servlet containers? - 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: MYSQL and TOMCAT
java.sql.SQLException: Update failed, possible duplicate entry Let's see you have a table info with one field and that field is a primary key right? If I remember correctly, primary keys in a table have to be unique, so maybe you are calling your method with the same data again and again ? - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]