Re: precompile jsp
Hi Hans, your problem is a version conflict. ant simply uses the wrong version of org.apache.jasper.JspC. I had a version of j2ee-1.3.jar in my classpath, which contains JspC also. I removed it and the problem was gone. regards, Reinhard Am Sonntag, 14. Dezember 2003 18:03 schrieb Hans Steinraht: hi all, just a question, I'm trying to precompile my jsp with the ant build script from the apache site ( jasper-howto). I don.t now what is going wrong but when I execute it with: ant -Dtomcat.home=/opt/jakarta-tomcat-4.1.24 -Dwebapp.path=/opt/jakarta-tomcat-4.1.24/webapps/mywebapp the message I receive is: jspc: No public no-arg constructor in class org.apache.jasper.JspC BUILD FAILED file:/jspc/build.xml:11: No public no-arg constructor in class org.apache.jasper.JspC Ant idea what I'm doing wrong? Maybe interesting, I get the same error when I try to precompile with the script from: http://cvs.apache.org/~fhanik/precompile.html Any help is apreciated Hans - 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: Fetching protected URL in Tomcat
Hi, how about getRequestURI()? Shouldn't it give the uri of the original request? (BTW: Tomcat has to store the original uri somewhere, otherwise it couldn't redirect later. Maybe a request attribute?) Hope that helps, Reinhard Am Donnerstag, 14. August 2003 16:30 schrieb Shapira, Yoav: Howdy, How do I, in login.jsp code, fetch information about the URL the user was trying to go to, when we was sent to login.jsp. Using WebLogic you can read the j_target_url attribute from session scope, but how do you do it on (JBoss/)Tomcat?? I believe the j_target_url was a proprietary add-on attribute WebLogic added, not part of the servlet spec, and that there's no equivalent in tomcat at this time. I could be wrong, however ;) Even if I'm right, adding this attribute wouldn't be a big deal I imagine: want to contribute a patch? ;) 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]
Re: Tomcat 4.0.6 in HPUX
Hi, hopefully I understand you right, otherwise please be clearer about what you want to do. normally, there is no hard work in porting an application from tomcat 4.0.6 to 4.1.24. So why not use the newer version? I would suggest to setup tomcat 4.1.24 on the linux box and thoroughly test the app and use the 4.1.24 depot on HP happily. If you do development on tomcat, you are bound to test your apps with new stable tomcat releases from time to time. 4.1.24 _is_ a stable release. That's why HP is using it. Maybe we can help to fix problems with the port. regards, Reinhard Am Dienstag, 19. August 2003 09:35 schrieb Indra Gunawan: Hi all, I am using Tomcat 4.0.6 in my Linux box and up until now it is okay . But when I wanted to install it on HPUX machine , I couldn't find the installation depot required , so I took shortcut ;) I just copied the source from my Linux box into the HPUX and automagically it ran successfully . I want some opinion about this situation from you guys ... HP doesn't provide installation depot for Tomcat 4.0.6 but it does provide installation depot for Tomcat 4.1.24 . Should I continue as long no errors found or uninstall it ? My clients insist me to uninstall in case there will be troubles and just use Tomcat 4.1.24 from HP ... well, that will cost me a lot of hard works and I will avoid it .. if there is still chance :) Thx in advance Indra Gunawan - 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: Error when I start Jakarta-tomcat
Hello, seems like /bin/sh does not exist. I saw the same problem in another mail today. Please check if /bin/sh exists and is executable. It really should! regards, Reinhard Am Dienstag, 19. August 2003 11:05 schrieb Luong Phan: Hi all, I am having problem starting TOMCAT, I installed j2sdk1.4.2 and jakarta-tomcat-3.2.4 on the Redhat Linux 7.3. Those two directories are located at the /usr/java. I set the envoroment variables in the /.bash_profile as the following: JAVA_HOME=/usr/java/j2sdk1.4.2 TOMCAT_HOME=/usr/java/jakarta-tomcat-3.2.4 CLASSPATH=$JAVA_HOME/lib/tools.jar:$TOMCAT_HOME/lib/servlet.jar export JAVA_HOME TOMECAT_HOME CLASSPATH Every time I try [EMAIL PROTECTED] root]# $TOMCAT_HOME/bin/startup.sh I get the massage: bash:/usr/java/jakarta-tomcat-3.2.4/bin/startup.sh:/bin/sh bad interpreter: Permision denied Please help me! LuongPhan __ Do you Yahoo!? The New Yahoo! Search - Faster. Easier. Bingo. http://search.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: costumize manager
Hello, you don't have to customize the manager to achieve this: Simply include a Realm definition for each manager of each host. Like this: Host myhost1 Context cookies=true crossContext=false debug=0 displayName=Manager docBase=/opt/tomcat/server/webapps/manager path=/manager privileged=true reloadable=false swallowOutput=false useNaming=true Realm className=org.apache.catalina.realm.MemoryRealm debug=1 pathname=/www/host1/tomcat/app-users.xml / /Context /Host This way each host has a different User Database. If you want to disable some features of the manager, a simple patch to the HtmlManagerServlet would do also. Otherwise you could do subclassing by filtering all requests through another servlet. How about this? Regards, Reinhard Am Dienstag, 17. Juni 2003 16:04 schrieb Maxime Colas des Francs: Hello I use tomcat with multiple virtual host. I want to open access to Tomcat Manager for all virtual host independently only for list/start/stop their web applications from an html page. My first idea was to extends the org.apache.catalina.servlets.ManagerServlet and insert it in manager application. In this case, i have to fight with a lot of security contraints ? Is there a better solution, documentation ? thks ! - 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]
Bug with absolute Paths? errorPage=/error.jsp
Hello List, when using absolute Paths in JSPs errorPage-Directive, I get unexpected behavior: A path /error.jsp should go to this page: http://myserver.com/error.jsp At least I did expect this. Instead, it forwards all errors to: http://myserver.com/context/error.jsp This means: An absolute Path in errorPage is context-relative! Is this correct? The behavior seems consistent with context.getDispatcher(/error.jsp).forward(req, resp); I would be very grateful for clarifications. regards, Reinhard - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
How to compare tc4.1 and tc3.3. Was: Tomcat 4.1 slower than Tomcat 3.3
Hi, Am Mittwoch, 2. April 2003 18:30 schrieb Chris Agmen-Smith: Is Tomcat 4 slower than Tomcat 3? For me, it is faster, see below. I've recently tried to port my Tomcat 3.3 webapp to Tomcat 4.1. It's the same webapp, the config files are as similar as I can make them, we're using the same connector to Apache. However, Tomcat 4.1 chews up CPU like you wouldn't believe. Example: at peak load, one of our Tomcat 3.3 servers served 20,000 page impressions in an hour, at an average %usr CPU of 60%. Using Tomcat 4.1, we can only serve about 7,000 pages if we down-weight it so that it is at 60%. 7,000 per hour is only 2 per second! This is very bad performance. The old value of 20,000/h = 6 / second = 160 ms per request is still pretty heavy. This is a hint not to look in the container but in your application. My experience is: To compare the performance of a container ( JVM), its best to start with a minimal servlet or JSP. You can measure the overhead for the whole request process. With tc4.1.24 and JDK 1.4.1 I have 1.3 ms per request on my 1.6G P4 for a minimal servlet. (=750 req/second) With apache and mod_jk it's a little bit more. This value is very good. Even compared to PHP4, which achieves only the value of tc+apache, but not the pure tc performance. You can measure this easily with 'ab' or 'ab2' which comes with apache. You can even provide session ids to simulate real requests. You will find tc 4 is faster than 3.3 here. I have used tomcat for 3 years now and I found the JVM has had more influence to performance than the improvements of tc. (The old Sun Java2 JRE's had catastrophic performance, compared to IBMs JRE or the new 1.4 from Sun) Old setup: Apache 1.3.x - AJP 1.3 - Tomcat 3.3.x - webapp (uses Velocity 1.2 Turbine 2.1) New setup: Apache 1.3.x - AJP 1.3 - Tomcat 4.1.x - webapp (uses Velocity 1.2 Turbine 2.1) Next you should compare the data throughput. This can be done by serving big static pages or big JSPs without any intelligence. (I would like to hear about the result) We have tried profiling the app using hprof and these are the results: Method Tomcat 3Tomcat 4 java.net.URLEncoder.encode 33.62% 22.60% java.net.SocketInputStream.read14.15% 18.77% java.net.SocketOutputStream.write 1.87% 3.47% The encode method is used by Velocity and Turbine to generate URL links. For this particular test, T4.1 used about 1.5 times the CPU that T3.3 used. Given that the same number of pages therefore links are being generated, I think this shows that T4.1 is spending significantly more time in SocketInputStream.read that T3.3. You really should go to a more powerful profiler. This information is not enough to take action. How about testing a another JVM? I have tried to following tuning options, even though they weren't needed in T3.3: - Removed servlet filters (no effect; not used in T3.3) - Reduced logging to bare minimum (no effect) - Experimented with numerous JVM settings: -server -d64 -Xmn256mb -Xmx384mb -Xconcurrentio (no effect) - Tried latest Solaris patches (no effect) - Tried 64-bit java (no effect) - Changed maxProcessor (# of threads) from default to 20 to 50 to 100 etc (no effect) - Changed Java/Solaris threading libraries (no effect) I don't have any more ideas how to fix it; instead I am clutching at straws All these tests should better be done with a minimal servlet. You have to test it without your specific implementation. :o) Some of those straws include: - Tuning/hacking/fixing Turbine, in case it is incompatible with the Servlet 2.3 spec. - Trying even more JVM setting permutations, in the hope that I come across the magic combination. - Disabling socket keepalive in Apache. Until we can fix this, we are sticking with Tomcat 3.3, which has so far been stable, fast and robust (except for allowing sessions between https and http). My advice: Take your time and test thourougly, find an optimal solution. Then switch. Maybe it's a good time to check out where your application 'spends it's time'. There could be a lot optimization possible, considering your long request times. For new apps I found it useful to test out every new servlet or jsp with 'ab' and then document the performance. So you have later a means of finding performance regressions easily. (BTW: and you find multithreading flaws by simulation concurrent requests.) Comments? Kind regards, Reinhard Chris Agmen-Smith - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: not serving jsps without query string
Hi, looks like a cache problem. Try delete temp internet files and insert resonse.setHeader(expires,0); in all your JSPs Also check setting of IE for caching (should be automatic) regards Reinhard Am Donnerstag, 3. April 2003 15:09 schrieb Warren Sweetman: runing tomcat 4.1.18 isapi_redirector2.dll IIS 5.x (IP address is only visible locally) when at the server the following will serve the JSP http://127.0.0.1/index.jsp http://localhost/index.jsp this url works from any location (internally) http://10.20.2.190/index.jsp? but when requesting http://10.20.2.190/index.jsp url, IIS tries to download the file. No entries for this request appear in the jk log file if requesting http://10.20.2.190/ url, IIS serves the code (this is set in IIS console). The default behaviour configured should be to load the index.jsp page. The jk log shows that the filter is checking the '/' uri to see if there is a mapping Any views on behaviour and methods to resolve so that all the url list will serve the appropriate jsp page? kind regards, Warren Sweetman Principal Web Developer Web Development ISD Legal Services Commission tel. 020 77590122 ext no 2122 tag no 011370 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: How can I get better logs from tomcat4.1.x?
Hi, in default server.xml coming with tomcat you will find lines like that: Logger className=org.apache.catalina.logger.FileLogger debug=0 directory=logs prefix=localhost_admin_log. suffix=.txt timestamp=true verbosity=1/ You can embed these Loggers at different levels to control logging. The parameters timestamp and debug may be interesting to you. The admin-Application also supports editing those. I recommend you should add a seperate Logger to each Webapp. Especially in production envs. And give it a good name with prefix=.. kind regards, Reinhard Am Mittwoch, 11. Dezember 2002 23:16 schrieb Brandon Cruz: We recently upgraded from tomcat 3.2.4. By default, all logs to System.out went to logs/tomcat.log. In 4.1.x, I didn't see that file, so I added these two loggers to the Engine... Logger className=org.apache.catalina.logger.SystemOutLogger/ Logger className=org.apache.catalina.logger.SystemErrLogger/ That creates logs that don't have much useful info, host and timestamp to be exact and puts everything to logs/catalina.out. Example below... StandardWrapperValve[jsp]: Servlet.service() for servlet jsp threw exception org.apache.jasper.JasperException: Array index out of range: 0 With Tomcat 3.2.4, the logs showed which host generated the error or message, as well as the timestamp. This is probably because in 3.2.4, each host was actually it's own context, but the logging was much nicer. The reason we need this info is because we want a central location to monitor errors and be able to track them down to specific virtual hosts and know when they happened. Does anyone know if this is possible or would we have to monitor each host separately now that we have upgraded? Any information is greatly appreciated! Brandon Cruz -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: [OT] Re: Java method equal to perl crypt()?
Hi, this program may show you how to use perl's function from inside java: === Test.java: import java.io.*; public class Test { public static void main(String args[]) { String crypt_cmdary[] = { /usr/bin/perl, -e, print crypt($ARGV[0],$ARGV[1]);, testpass, xy}; try { Process p = Runtime.getRuntime().exec( crypt_cmdary ); // Print process' stdout InputStreamReader ir = new InputStreamReader(p.getInputStream()); LineNumberReader liner = new LineNumberReader(ir); String erg; while ((erg = liner.readLine()) != null) System.out.println(Stdout: + erg); // Print process' stderr ir = new InputStreamReader(p.getErrorStream()); liner = new LineNumberReader(ir); while ((erg = liner.readLine()) != null) System.out.println(Stderr: + erg); } catch(IOException e) { System.out.println(e.getMessage()); } } }; == O.K. this is not the best method if you think about performance. But sometimes there is no other way but this way. (except JNI, maybe) Hope, this helps, kind regards, Reinhard Am Donnerstag, 28. November 2002 18:37 schrieb AAron nAAs: Although off topic, the standard unix crypt algorithm has been written/ported to many languages (I've even seen source code in books.. Applied Cryptography I think). I know versions exist for Java, or you could just convert a basic, C, C++ or Pascal version to Java. Seek with Google, -AAron From: Galbayar Dorjgotov [EMAIL PROTECTED] Reply-To: Tomcat Users List [EMAIL PROTECTED] To: TomCat Users [EMAIL PROTECTED] Subject: Java method equal to perl crypt()? Date: Thu, 28 Nov 2002 17:33:45 +0800 Ok, I have an existing MySQL database that has user's passwords stored that were encrypted using the Perl crypt() function. I was wondering what the best way to re-use this database using JSP. I know enough Java to get most functionality working, and I can already connect to and read/write to MySQL. The only problem I have is if I migrate to JSP, how can I compare passwords that are supplied in the JSP page to the password in the DB that was stored via the Perl crypt() function? -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] _ The new MSN 8: smart spam protection and 2 months FREE* http://join.msn.com/?page=features/junkmail -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: upgrading to REAL cert -- help??
Hi Kat, find information about cert handling on this URL: (now also in english) http://www.m1b.de/content/know/security/x509/cert_openssl.html#english regards, Reinhard Am Donnerstag, 17. Oktober 2002 03:36 schrieb kathee: Hi, I posted a question a week ago about trying to load two certs for tomcat on a single server since we use one URL and one CNAME record to the same. I have gotten 0 answers and still am having problems. No luck in doing this. As a side, if I have a self-signed certificate currently installed, how can I put in a REAL cert? I can't get any of the keytool commands to work. No matter what I try I get errors. Is there anything more specific somewhere -- the docs are pretty limited. I am desperate and am having no success in getting help... Help, please... cheers Kat -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: upgrading to REAL cert -- help??
Hi Kat, here are some infos about handling certificates with java keytool: http://m1b.de/content/know/security/x509/cert_openssl.html With Linux, you have another powerful tool for managing certificates: openssl. In the above document, I try to compare the usage of both tools. It is also about importing and exporting from both programs. Maybe it can help you. Unfortunately, it is in german. But I would translate it, please send me a mail. If not, please give more info about your Cert-Files you got from your trustcenter. (filenames in particular) regards, Reinhard Am Donnerstag, 17. Oktober 2002 03:36 schrieb kathee: Hi, I posted a question a week ago about trying to load two certs for tomcat on a single server since we use one URL and one CNAME record to the same. I have gotten 0 answers and still am having problems. No luck in doing this. As a side, if I have a self-signed certificate currently installed, how can I put in a REAL cert? I can't get any of the keytool commands to work. No matter what I try I get errors. Is there anything more specific somewhere -- the docs are pretty limited. I am desperate and am having no success in getting help... Help, please... cheers Kat -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]