Re: Tomcat process management using ps (Thanks)
Hi Craig, Thanks for the info. I had a hunch something like this was happening, it's nice to get some feedback that I can take to my boss supporting my argument. Cheers Mark Koscak - Original Message - From: Craig R. McClanahan To: [EMAIL PROTECTED] Sent: Tuesday, January 09, 2001 10:58 AM Subject: Re: Tomcat process management using ps Mark Koscak wrote: Hello everyone,I am running Jakarta-Tomcat 3.2When I have a look at my system processes (ps -aux) after starting tomcat, there are eighteen (18) separate process id's the associated command being /usr/locak/jdk1.3 Each process apparently consuming 15.4% of memory. 18 * 15.4% = 277.2%How can this be?Also (ok I'm being lazy on this one) when starting tomcat can I prune the instances of the command /usr/local/jdk1.3 to say 8-10 instead of having 18.Thanks for any input.RegardsMarkThe Linux "ps" command lies to you. It makes individual threads look like they are separate processes. There is only one process (assuming you started only one), all sharing the same memory. Craig McClanahan
Re: Starting Apache
There is a Working with mod_jk help document and a Tomcat Workers How To. These are very good documents and provide much more indepth dicussion than the steps I will outline below. Basically for tomcat 3.2 I did the following NOTE: I already had a binary distribution of tomcat up and running as a distinct server. 1. Download the source Tomcat distribution. IMPORTANT you need the distribution with .src.tar.gz in it!! ( This was a second version of tomcat that I downloaded only for the purpose of creating mod_jk.so ) 2. Untar this into a temp directory 3. Build the mod_jk.so object by typing (for LINUX) apxs -0 mod_jk.so -I../jk -I/usr/local/[jdkFolderName]/include -I/usr/local/[jdkFold erName]/include/linux -c *.c ../jk/*.c 4. Run gcc -shared -o mod_jk.so *.o if your mod_jk.so object has not been built. 5.Copy mod_jk.so to Apache's libexec directory. (My system was /usr/lib/apache) NOW EDIT httpd.conf add the following lines 1. LoadModule jk_module libexec/mod_jk.so 2. AddModule mod_jk.c 3. JkWorkersFile/usr/local/jakarta-tomcat/conf/workers.properties 4. JkLogFile/usr/local/apache/logs/mod_jk.log 5. JkLogLevelwarn Add servlet processing capability (NOTE: This worked for me, the How To discusses ajp13 which is faster etc.. etc..) 1. JkMount/*.jspajp12 2. JkMount/servlet/*ajp12 3. JkMount/myServletWorkspace/servlet/*ajp12 4. JkMount/anotherServletWorkspace/servlet/*ajp12 5. JkMount/otherworker/*.jspremoteworker You will also need to modify your /usr/local/jakarta-tomcat/conf/workers.properties file 1. workers.tomcat_home=/usr/local/jakarta-tomcat 2. workers.java_home/usr/local/jdk1.3 3. ps=/ You should now be in a position to test if everything is ok so restart Apache kill -s SIGHUP `cat /var/run/httpd.pid` do a ps to see if apache is up and running. Test to see that it is still serving your normal pages. Restart tomcat. If everything has gone according to plan *big grin* you can place servlet calls direct in your html code WITHOUT having to reference the servlet with a complete url. For example prior to my conversion I had to call servlets in HTML documents using action="http://xxx.xxx.xxx.xxx:8080/marktest/servlet/HelloWorld" NOW I can call servlets using action="/marktest/servlet/HelloWorld" and apache knows how to resolve the rest :) Best of Luck. P.S. The HowTo documentation is much better than my explanation. - Original Message - From: Andrew Burrows [EMAIL PROTECTED] To: Tomcat User [EMAIL PROTECTED] Sent: Monday, January 08, 2001 10:59 AM Subject: Starting Apache Hi All, Whenever I add the Include line into my Apache httpd.conf file Apache won't start, could someone point me in the right direction. Andrew [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, email: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, email: [EMAIL PROTECTED]
Re: Linux mod_jk + Apache help
See my post Re:Starting Apache I think it may help. Regards Mark - Original Message - From: W J La Cholter [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Friday, January 05, 2001 12:42 PM Subject: Linux mod_jk + Apache help I'm trying to get a servlet invoked by Apache using mod_jk. Is there any magic involved? I got the RPMs and installed them on Mandrake Linux 7.0 (i586). The auto-generated mod_jk.conf refers to the default examples directory, so it should just work. However, when I try to access a servlet through http://localhost/examples/servlet/HelloWorldExample it fails but http://localhost:8080/examples/servlet/HelloWorldExample works. I turned up the logging level to see if mod_jk gets called, and the log indicates it does: [jk_uri_worker_map.c (344)]: Into jk_uri_worker_map_t::map_uri_to_worker [jk_uri_worker_map.c (406)]: jk_uri_worker_map_t::map_uri_to_worker, Found a match ajp12 Here are the versions: tomcat-3.2.1-1 tomcat-mod-3.2.1 apache-1.3.14-2mdk Sun JDK 1.3 I read the FAQ and the HOWTOs. I also tried Ajp13 for grins, but that didn't help. Any help would be most appreciated. TIA, William La Cholter __ FREE Personalized Email at Mail.com Sign up at http://www.mail.com/?sr=signup - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, email: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, email: [EMAIL PROTECTED]
Re: Unsubscribing
I believe you have to respond to the confirmation of unsubscription. - Original Message - From: [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Sunday, December 31, 2000 10:09 AM Subject: Unsubscribing Twice now I have sent a message to unsubscribe to the digest. Each time I have received a confirmation message that I have been "unsubscribed". I am still receiving the digest. What do I do? - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, email: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, email: [EMAIL PROTECTED]
Re: mm JDBC driver
On my system I added the classpath to my mm.mysql installation directory or /usr/local/mm.mysql.jdbc-1.2c This was enough to give me access to my database. Here is some sample code that you can modify to retrive data from your database. import java.sql.*; import java.io.*; public class newjavadb { public static void main( String [ ] args ) { String username = "avaliduser"; String password = "avalidpwd"; String url = "jdbc:mysql://domain.com.au/databasename"; String queryString = "SELECT ves_ref FROM lbs_web_ves_sched"; int count = 0; // Load the driver try { Class.forName("org.gjt.mm.mysql.Driver").newInstance(); System.out.println("Success Driver Loaded" ); } catch(java.lang.ClassNotFoundException e) { System.err.print("ClassNotFoundException: "); System.err.println( e.getMessage() ); } catch( Exception e ) { System.err.print("Exception : " + e ); } try { System.out.println("Inside Connection Try block" ); Connection con; Statement stmt; System.out.println("url is :" + url ); // Establish connection to the database con = DriverManager.getConnection(url, username, password); System.out.println("Ok, connection to the DB worked."); System.out.println("Let's see can retrieve something with : " + queryString ); // Create a Statement object stmt = con.createStatement(); // Send the query and bind the result to a set ResultSet rs = stmt.executeQuery(queryString); while( rs.next() ) { count++; String s = rs.getString("ves_ref"); System.out.println( s + "is the FIELD value. Count is:" + count ); } // Close resources stmt.close(); con.close(); }// end try block catch( SQLException ex) { System.err.println("== SQLException: "); while(ex != null) { System.out.println("Message: " + ex.getMessage() ); System.out.println("SQLState: " + ex.getSQLState() ); System.out.println("ErrorCode: " + ex.getErrorCode() ); ex = ex.getNextException(); System.out.println(" "); } }// end catch block }// end main }// end class newjavadb - Original Message - From: Shailaja Someshwar [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, December 28, 2000 10:27 PM Subject: mm JDBC driver Hello Where do I need to place the mm.jdbc driver for MySQL in tomcat directory so that its available system wide and all of the Apache virtual hosts. Also can someone direct me to a sample application to test my JDBC connection is working or not, as I do not know much about Java. Thanks in advance. Regards, Shailaja __ Do You Yahoo!? Yahoo! Photos - Share your holiday photos online! http://photos.yahoo.com/
Re: Best JDK for tomcat 3.2
Nope. /usr/local/jdk1.3/lib/tools.jar is in the classpath (on both systems) - Original Message - From: Ralph Einfeldt [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, December 21, 2000 9:23 PM Subject: AW: Best JDK for tomcat 3.2 lib/tools.jar from the jdk 1.3 is missing in the classpath. -Ursprüngliche Nachricht- Von: Mark Koscak [mailto:[EMAIL PROTECTED]] Gesendet: Donnerstag, 21. Dezember 2000 05:09 An: tomcat Betreff: Best JDK for tomcat 3.2 snip/ I get the following error Exception in thread "main" java.lang.NoClassDefFoundError: VesEnqServlet_b/j ava snip/
Re: Does unsubscribe really work?
Yes. You must wait for the confirmation e-mail and respond to that. - Original Message - From: Duane Morse [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Friday, December 22, 2000 4:04 AM Subject: Does "unsubscribe" really work? I've tried 3 times over the last 3 days to remove my subscription to this mailing list by sending mail to mailto:[EMAIL PROTECTED], but I continue to get tomcat-related mail. I'm using the same e-mail address I used to start my subscription. What am I doing wrong? Duane Morse, Eldorado Computing Inc., Phoenix Arizona
Re: Building output page by page.
Hello again, I know someone responded to this message, I was unable to respond and the original message was deleted. My apologies. (Don't asklong story...) At present it takes around 13sec to build a page of 1300 rows over 10MB Lan. I am pushing HTML output in a display method using out.println(...); right after my database table queries. My aim is to reduce the time it takes to display an initial page to the end user, by breaking up the output into smaller chunks. There is also a good chance that I will merge the two tables into one to reduce the databaseconnection requirements. Thanks Again. Mark / * PREVOIUS MESSAGE / Hello everyone, I have build a Servlet application thatcreates a single HTML page with up to 1300 rows in a table. Can anyone give me some links or advice on how I can break this output into HTML pages with say 100 rows per table, with a corresponding selection bar at the bottom of each screen, giving the user access to anypage they click on? Thanks in advance. Mark
Re: Building output page by page.
Thanks for the input Dave, I have a HTML form that sends a POST request to a Servlet class. The servlet class interacts with another Java class that I use to access a MySQL database, and display the results. Browser(FORM)--Servlet--JavaDBAccessdisplay--Browser(HTML Display) When accessing the database on the first instance a result set is returned. ResultSet rs = stmt.executeQuery(queryString); Now that I have my first aggregation of data I enter a while loop while( rs.next() ) { /* Perform my second query using fields from my earlier query /* Now that I have all my data I output my table row using the visibility /* I have to my PrintWriter object. Passed earlier from my Servlet class. }//end while /* close any open connectionsand files /* and exit the method. What I'm really after is similar functionality to say when the Google search engine returns a result set. For example say 100 results are returned. There are ten results per page with each page footer having 1 2 3 4 5 6 7 8 9 10. Each number being a link to a group of ten records. - Original Message - From: Dave Smith To: [EMAIL PROTECTED] Sent: Sunday, November 19, 2000 11:35 AM Subject: Re: Building output page by page. Hi Mark, I'll repeat whatI said in my earlier response. You are not giving much information about what you are doing. You do mention making "database queries". Lets assume you are accessing a DB with sequel. In that case you can perform the following type of query: select * from some_table where primaryKey min and primaryKey = max; Where min and max are limits you set. This would return a range of records between min and max, including max. Translating into servlets: A design that comes easily to mind would use a controller servlet and a JSP page. The controller is going to receive a POST from a webpage... The controller doesn't do anything, just redirects output and passes on parameters. form -- params( min, max) -- controller. The controller redirects output to a JSP: controller -- sendRedirect("/some.jsp?min=101max=200"); The webpage is going to be produced as output from a JSP called some.jsp: JSP --(current data, 101 through 200) and new form with code for next set of data. ... current data ... form action="/servlet/Controller" method="POST" input type="hidden" name="min" value="%=min%" input type="hidden" name="max" value="%=max%" input type="submit" value="Get next one hundred entries" /form If this doesn't make any sense you might want to read up on the technology before going much farther. A good start would be Java Servlet Programming by Hunter and Crawford. Dave - Original Message - From: Mark Koscak To: tomcat Sent: Monday, December 18, 2000 5:39 PM Subject: Re: Building output page by page. Hello again, I know someone responded to this message, I was unable to respond and the original message was deleted. My apologies. (Don't asklong story...) At present it takes around 13sec to build a page of 1300 rows over 10MB Lan. I am pushing HTML output in a display method using out.println(...); right after my database table queries. My aim is to reduce the time it takes to display an initial page to the end user, by breaking up the output into smaller chunks. There is also a good chance that I will merge the two tables into one to reduce the databaseconnection requirements. Thanks Again. Mark / * PREVOIUS MESSAGE / Hello everyone, I have build a Servlet application thatcreates a single HTML page with up to 1300 rows in a table. Can anyone give me some links or advice on how I can break this output into HTML pages with say 100 rows per table, with a corresponding selection bar at the bottom of each screen, giving the user access to anypage they click on? Thanks in advance. Mark
Re: NullPointerException
This sounds to me like your program is attempting to reference an array element that is out of bounds. It would be worth the effort to track the problem down. Mark. - Original Message - From: William Au [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, December 12, 2000 2:34 AM Subject: NullPointerException I am getting the following with Tomcat 3.2 but things seem to work. Should I worry? java.lang.NullPointerException at java.lang.Throwable.fillInStackTrace(Native Method) at java.lang.Throwable.fillInStackTrace(Compiled Code) at java.lang.Throwable.init(Compiled Code) at java.lang.Exception.init(Compiled Code) at java.lang.RuntimeException.init(Compiled Code) at java.lang.NullPointerException.init(Compiled Code) at java.util.Hashtable.put(Compiled Code) at org.apache.jasper.runtime.PageContextImpl.setAttribute(Compiled Code) at org.apache.jasper.runtime.PageContextImpl._initialize(Compiled Code) at org.apache.jasper.runtime.PageContextImpl.initialize(Compiled Code) at org.apache.jasper.runtime.JspFactoryImpl.getPageContext(Compiled Code) at _0002f_00031_00030k_0002ejsp10k_jsp_0._jspService(Compiled Code) at org.apache.jasper.runtime.HttpJspBase.service(Compiled Code) at javax.servlet.http.HttpServlet.service(Compiled Code) at org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(Compiled Code) at org.apache.jasper.servlet.JspServlet.serviceJspFile(Compiled Code) at org.apache.jasper.servlet.JspServlet.service(Compiled Code) at javax.servlet.http.HttpServlet.service(Compiled Code) at org.apache.tomcat.core.ServletWrapper.doService(Compiled Code) at org.apache.tomcat.core.Handler.service(Compiled Code) at org.apache.tomcat.core.ServletWrapper.service(Compiled Code) at org.apache.tomcat.core.ContextManager.internalService(Compiled Code) at org.apache.tomcat.core.ContextManager.service(Compiled Code) at org.apache.tomcat.service.http.HttpConnectionHandler.processConnection(Compi led Code) at org.apache.tomcat.service.TcpWorkerThread.runIt(Compiled Code) at org.apache.tomcat.util.ThreadPool$ControlRunnable.run(Compiled Code) at java.lang.Thread.run(Compiled Code) Bill
Re: build script is unable to find lang object?
Hi Steve, Thanks for the reply. Yes, unfortunately :(, I think I'm going to go down the path of a different jdk and complete reinstall of Tomcat. It's the only thing I can think of as to why a previous installation (on my other machine) would work and the current one does not. Cheers Mark - Original Message - From: Steve Weiss [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, December 06, 2000 3:22 AM Subject: Re: build script is unable to find lang object? Do you have $JAVA_HOME/lib/tools.jar in your classpath somewhere? -S Mark Koscak wrote: Hi everyone, Following on from my earlier discussion. I have installed Tomcat3.2 and am running jdk1.3. I can run the example Servlets and JSP's provided. With thanks to Setve Weiss, I have managed to compile my individual java class Hello.java provided as a part of the sample application. However now when I attempt to use the build script I get the following error message. (The build.xml script has been modified for the current project). I read once that Tomcat does not work well with jdk1.3 could this be my problem? [root@netdev vesselenq]# ./build Couldn't find or load essential class `java/lang/Object' java.lang.NoClassDefFou ndError java/lang/Object ./btest: line 13: 4828 Aborted (core dumped) java -classpath $C P:$CLASSPATH org.apache.tools.ant.Main \ -Dtomcat.home=$TOMCAT_HOME "$@" Here are some of my settings... I have set the CLASSPATH to include /usr/local/jdk1.3 /usr/local/jakarta-tomcat/src /usr/local/jakarta-tomcat/lib/servlet.jar /usr/local/jdk1.3/lib /usr/local/jdk1.3/lib/tools.jar The build script... #!/bin/sh # Identify the custom class path components we need CP=$TOMCAT_HOME/classes:$TOMCAT_HOME/lib/ant.jar:$TOMCAT_HOME/lib/xml.jar CP=$CP:$TOMCAT_HOME/lib/jasper.jar:$TOMCAT_HOME/lib/servlet.jar CP=$CP:$TOMCAT_HOME/lib/webserver.jar # Execute ANT to perform the requested build target java -classpath $CP:$CLASSPATH org.apache.tools.ant.Main \ -Dtomcat.home=$TOMCAT _HOME "$@" #java -classpath $CP:$CLASSPATH org.apache.tools.ant.Main If you need any more information on any other system settings, let me know and I shall provide the information. Many thanks Mark -- "If you watch TV news, you know less about the world than if you just drank gin straight from the bottle." - Garrison Keillor
Reasons why executing build won't find java.lang.Object?
Hi everyone, First this is NOT urgent.( I'm taking a break and cutting some servlet code onmy machine that works. ) Having said that I am absolutely baffeled, with my second install of Tomcat. If anyone knows any off beat reasons as to why running a project build will not locate java.lang.Object please let me know. I do have the JDKtools.jar as a part of my CLASSPATH. I have re-installed Tomcattwice. I have tarred the working Tomcat installation, ftp'ed it, untarred it... no joy. I have tried with jdk1.3 and jdk1.2.2 Regards Mark
Problems Setting up new Tomcat3.2 installation with jdk1.3
I have encountered some problems setting up Tomcat on adevelopment Linux system. If anyone could throw up some suggestions I would be most appreciative. I have installed Tomcat3.2 and I can run the sample servlets and jsp applications after I have started the tomcat server. My problem is that I can't compile the simple Hello.java application in the sample directory e.g. [mark@netdev src]$ javac Hello.java Hello.java:98: Can''t find method "setContentType(java.lang.String)" [mark@netdev src]$ Also the interfaces and other code defined in /usr/local/jakarta-tomcat/src/javax have NO associated class objects? Yet on the other machine with the same configuration I can run the sample applications and compile new servlets. The machine that doesallow me to compile apps now runs jdk1.3, but was previously running jdk1.1.7, also this machine has class objects in the /usr/local/jakarta-tomcat/src/javax directory. If you need it here are some of the steps I have taken and my system settings, related to the installation of tomcat. Here are the steps I have taken. Downloaded the latest stable version of Tomcat -- jakarta-tomcat.tar.gz I have run tar and extracted tomcat to /usr/local The resultant directory structure is C:\jakarta-tomcat\bin \conf \doc \lib \logs \src \webapps \work I have set JAVA_HOME to /usr/local/jdk1.3 //-- Root directory of java installation I have set the PATH to include /usr/local/jdk1.3/bin //-- The directory that holds executables for //-- javac, java, javadoc etc /usr/local/jdk1.3 //-- Root directory of java installation /usr/local/jdk1.3/lib //-- The location of tools.jar /usr/local/jakarta-tomcat //-- Root directory of tomcat installation /usr/local/jakarta-tomcat/bin //-- Tomcat executables I have set the CLASSPATH to include /usr/local/jdk1.3 /usr/local/jakarta-tomcat/src /usr/local/jdk1.3/lib I have set TOMCAT_HOME to /usr/local/jakarta-tomcat //-- The root installation directory Many thanks. Mark
Re: Unsubscribe Help
Wait for the e-mail confirming your unsubscription. Respond to that and you will be unsubscribed. Good luck. - Original Message - From: Cory C. Omand [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Friday, December 01, 2000 11:02 AM Subject: Unsubscribe Help After many attempts to unsubscribe, I have still not been unsubscribed from this list. Can someone point me to the correct person to remove me? I've already sent mail to tomcat-user-unsubscribe and tomcat-user-help with no result. Thanks, c.
Re: DANG! Do I really need 3.2??
Well that explains it, I was searching archives and online documentation, my understanding was that rebuilding Apache with mod_so would do the trick. i.e. ./configure --enable-so Regards Mark - Original Message - From: Jim Richards [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Monday, November 20, 2000 3:06 PM Subject: Re: Where is jakarta-tomcat/src/native/apache1.3 You need to run a Tomcat 3.2 build. It's not in Tomcat 3.1. I would like to build mod_jk.so from the source distribution (Tomcat 3.1). After I downloaded the source distribution, I could not find the directory jakarta-tomcat/src/native/apache1.3 (or apache 2.0), which is mentioned in the document (Working with mod_jk). How should I build mod_jk.so for this version? You don't. Considering 3.2 has more features and les sbugs (in theory) you'd be better off running a 3.2 beta for now. 3.2 final should be out soon if its for a production environment, and that makes your PHB fell better. p.s. in the source distribution of Tomcat 3.2b7, I do find the directory.
Problems with the most Basic Hello servlet and jsp.
I have encountered some problems setting up Tomcat on my Windows98 system. If anyone could throw up some suggestions I would be most appreciative. Here are the steps I have taken. Downloaded the latest stable version of Tomcat -- jakarta-tomcat.zip 2.26MB (2,372,384 bytes). I have run WinZip and extracted tomcat to C:\ The resultant directory structure is C:\jakarta-tomcat \bin \conf \doc \lib \src \webapps I have set JAVA_HOME to C:\jdk1.3 Root directory of java installation I have set the PATH to include C:\jdk1.3\bin The directory that holds executables for javac, java, javadoc etc I have set TOMCAT_HOME to C:\jakarta-tomcat The root installation directory This is the result attempting to start tomcat. C:\jakarta-tomcat\binTOMCAT.BAT start Out of environment space Out of environment space Out of environment space Out of environment space Out of environment space Starting tomcat in new window Using classpath: C:\jakarta-tomcat\classes C:\jakarta-tomcat\bin Here is the result attempting to run tomcat. C:\jakarta-tomcat\binTOMCAT.BAT run Out of environment space Out of environment space Out of environment space Out of environment space Out of environment space Using classpath: C:\jakarta-tomcat\classes Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/tomcat/sta rtup/Tomcat C:\jakarta-tomcat\bin When I use my browser IE5.0 to open the simple test example located at C:\jakarta-tomcat\doc\appdev\sample\web\index.html My browser opens this html page ok, howerver when running the jsp I manage to retrieve some html output and gif image back to my browser window but values for the following text labels all come back blank/null/empty. Context Path: Path Information: Query String: Request Method: Servlet Path: Also from C:\jakarta-tomcat\doc\appdev\sample\web\index.html If I choose to run the servlet, IE explorer comes back with a standard error page saying that the page could not be found. Thank-you for your consideration and any suggestions you may have. Regards Mark Koscak = The morality of an action stems from the motive from which we act. __ Do You Yahoo!? Thousands of Stores. Millions of Products. All in one Place. http://shopping.yahoo.com/