Jasper tag class usage: bug?
Hi! I'm trying to optimize my tag library, especially for the case where tags are used inside of iterating tags. Example: x:iterate x:dostuff foo="bar"/ /x:iterate -- In the above case I want only one instance of the dostuff tag to be created, since I am doing things with the foo attribute whose value never changes (i.e. I compute things once in dostuff.setFoo() and want to skip it for all other iterations). According to the JSP spec this should work great. However, when I look in the generated JSP code (Tomcat 3.2 BTW), the dostuff tag is instantiated for each iteration! This means that I cannot do the above optimization. This adds a significant (and unnecessary) performance penalty! Are there any plans to fix this? Is this fixed in Tomcat 4.0? (I tried to check this, but it seems Tomcat 4.0 cannot handle tags in JAR's so I never got any generated JSP classes) I would be VERY happy if this was fixed! If this is indeed a bug, and not yet covered, let me know and I'll add it to BugZilla. Thanks, Rickard -- Rickard Öberg Email: [EMAIL PROTECTED]
BugRat Report #585 has been filed.
Bug report #585 has just been filed. You can view the report at the following URL: http://znutar.cortexity.com/BugRatViewer/ShowReport/585 REPORT #585 Details. Project: Tomcat Category: Bug Report SubCategory: New Bug Report Class: swbug State: received Priority: medium Severity: serious Confidence: public Environment: Release: 3.2 JVM Release: 1.2.2 Operating System: NT OS Release: 4.0 Platform: NT Synopsis: jsp:getProperty does not work on lUzzz field (lowercase-UPPERCASE) eg pNBR Description: Problem In Tomcat 3.2.1 jsp:getPropety bean="bean" property=lUxxx / on a field with first letter lowercase and second letter Uppercase generate error when trying to compile the JSP generated JAVA code. What even is more strange is that if I comment the line, still it does not compile. If I remove the line then it copile (ouf!) Solution Use %= bean.getLUxxx() % instead. Remark I should have looked in the code myself. Blame on me. Vincent. Title: BugRat Report # 585 BugRat Report # 585 Project: Tomcat Release: 3.2 Category: Bug Report SubCategory: New Bug Report Class: swbug State: received Priority: medium Severity: serious Confidence: public Submitter: Vincent Harcq ([EMAIL PROTECTED]) Date Submitted: Dec 13 2000, 04:46:06 CST Responsible: Z_Tomcat Alias ([EMAIL PROTECTED]) Synopsis: jsp:getProperty does not work on lUzzz field (lowercase-UPPERCASE) eg pNBR Environment: (jvm, os, osrel, platform) 1.2.2, NT, 4.0, NT Additional Environment Description: Report Description: Problem In Tomcat 3.2.1 on a field with first letter lowercase and second letter Uppercase generate error when trying to compile the JSP generated JAVA code. What even is more strange is that if I comment the line, still it does not compile. If I remove the line then it copile (ouf!) Solution Use <%= bean.getLUxxx() %> instead. Remark I should have looked in the code myself. Blame on me. Vincent. View this report online...
[PATCH]: Check for null in tag setter generation
When the Jasper code gets the setter method for tag properties, it doesn't check to see whether the m variable is null until after attempting to use its getParameterTypes() method, which throws an uninformative NullPointerException. I simply moved the null check immediately after the variable m is set. --- TagBeginGenerator.java.orig Wed Dec 13 12:18:12 2000 +++ TagBeginGenerator.java Wed Dec 13 12:18:16 2000 @@ -193,6 +193,11 @@ if (attrValue != null) { String attrName = attributes[i].getName(); Method m = tc.getSetterMethod(attrName); + if (m == null) + throw new CompileException + (start, Constants.getString +("jsp.error.unable.to_find_method", + new Object[] { attrName })); Class c[] = m.getParameterTypes(); // assert(c.length 0) @@ -203,13 +208,6 @@ attrValue = convertString(c[0], attrValue, writer, attrName); } else attrValue = convertString(c[0], attrValue, writer, attrName); - - - if (m == null) - throw new CompileException - (start, Constants.getString -("jsp.error.unable.to_find_method", - new Object[] { attrName })); writer.println(thVarName+"."+m.getName()+"("+attrValue+");"); } --- bitBull makes the Internet bite: http://www.bitBull.com/demos/
Re: Jasper tag class usage: bug?
Rickard Öberg wrote: Hi! I'm trying to optimize my tag library, especially for the case where tags are used inside of iterating tags. Example: x:iterate x:dostuff foo="bar"/ /x:iterate -- In the above case I want only one instance of the dostuff tag to be created, since I am doing things with the foo attribute whose value never changes (i.e. I compute things once in dostuff.setFoo() and want to skip it for all other iterations). According to the JSP spec this should work great. However, when I look in the generated JSP code (Tomcat 3.2 BTW), the dostuff tag is instantiated for each iteration! This means that I cannot do the above optimization. This adds a significant (and unnecessary) performance penalty! According to to the spec, when a custom tag is closed out it falls out of scope and the object instantiated for its tag class can be recycled. But you can design your tags to do what you want. There are two ways you could do this. Split your x:dostuff tag into to tags like this: %-- The initstuff tag stores state information for the dostuff tag --% x:initstuff x:iterate %-- The dostuff tag uses findAncestorWithClass() to get the parent xinitstuff object --% x:dostuff/ /x:iterate /x:initstuff Another way is the following x:iterate %-- the dostuff tag stores its state information as a PAGE_CONTEXT attribute named "this" the first time through the loop. On the remaining iterations it gets the state information from the PAGE_CONTEXT attribute named "this". --% x:dostuff id="this"/ /x:iterate -- Glenn Nielsen [EMAIL PROTECTED] | /* Spelin donut madder| MOREnet System Programming | * if iz ina coment. | Missouri Research and Education Network | */ | --
Réf. : RE: X509 client certificate
Hi Stefan I try to extract certicate to my request like you say in your mail but I have an exception because object return by request.getAttribute( javax.servlet.request.X509Certificate ) method wasn't type of java.security.cert.X509Certificate but [Ljava.security.cert.X509Certificate; log file : 2000-12-13 16:21:10 StandardWrapperValve[org.apache.catalina.INVOKER.SnoopServlet]: Servlet.service() for servlet org.apache.catalina.INVOKER.SnoopServlet threw exception java.lang.ClassCastException: [Ljava.security.cert.X509Certificate; at SnoopServlet.doGet(SnoopServlet.java:65) at javax.servlet.http.HttpServlet.service(HttpServlet.java:740) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at org.apache.catalina.core.ApplicationFilterWrapper.doFilter(ApplicationFilterWrapper.java:159) at filters.ExampleFilter.doFilter(ExampleFilter.java:136) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:258) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:936) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:160) at org.apache.catalina.valves.ValveBase.invokeNext(ValveBase.java:242) at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:311) at org.apache.catalina.valves.ValveBase.invokeNext(ValveBase.java:242) at org.apache.catalina.valves.CertificatesValve.invoke(CertificatesValve.java:152) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:934) at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:1674) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:161) at org.apache.catalina.valves.ValveBase.invokeNext(ValveBase.java:242) at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:343) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:934) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:159) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:936) at org.apache.catalina.connector.http.HttpProcessor.process(HttpProcessor.java:787) at org.apache.catalina.connector.http.HttpProcessor.run(HttpProcessor.java:904) at java.lang.Thread.run(Thread.java:484) Very strange but are you an idea about my problem? Config : Apache Tomcat (v4.0-m1) Jérôme Stefán F. Stefánsson [EMAIL PROTECTED] 04/12/00 10:53 Veuillez répondre à tomcat-dev Pour :[EMAIL PROTECTED] cc : Objet :RE: X509 client certificate Hi Alexandre. I'm not sure I fully understand your question but let me see if I can help you at all. The addSecureEndpoint method of EmbededTomcat used to be just like the one you described below. I added the addSecureEndpoint(int port, InetAddress addr, String hostname, String keyfile, String keypass, boolean clientAuth) to be able to force the client to show a certificate for logging in. I want to answer you in a few steps, so please bear with me. 1. Now, first of all I think you're going a little bit too long of a way using the addSecureEndpoint. Wouldn't it be easier for you to call the method I described above (the addSecureEndpoint(int, InetAddress, String, String, String, boolean)) instead of calling the original one (the addSecureEndpoint(int, InetAddress, String, String, String)) and changing the code in that? The modifications to the original addSecureEndpoint were for backwards compatability. In other words, the original method, addSecureEndpoint added an endpoint with no client authentication. I added a method that provides means for getting client authentication by the means of client certificates, and modified the original call to call my method with client authentication == false. Hence, maintaining backwards compatability. I would say you should much rather change the code in tomcat to what it was before and call addSecureEndpoint(int, InetAddress, String, String, String, boolean) in EmbededTomcat directly instead. That way you won't have to recompile Tomcat every time you change your mind about requiring a client certificate in your application. 2. Now for your problem at hand ;o). I don't know exactly how the getUserPrincipal method in HttpServletRequest class is supposed to work but what I got from JavaDoc was: Returns a java.security.Principal object containing the name of the current authenticated user. If the user has not been authenticated, the method returns null. And from the JavaDoc for java.security.Principal, I got: This interface represents the abstract notion of a principal, which can be used to represent any entity, such as an individual, a corporation, and a login id. Now. You would think that Tomcat should serve up the DN of the client certificate when a user calls request.getUserPrincipal but according to you, it doesn't. I don't know if there are any reasons for that although I doubt it. I
source directory for tomcat 3.2 (final)
Hi, I'm writing a short how-to for tomcat. It was quite simple to describe the build process for tomcat 3.2b6 because you only have to setup your Java-SDK environment, unpack the sources and run the build scripts. Since 3.2b8 (or b7??) the source directories are named jakarta-tomcat-3.2-src/ jakarta-servletapi-3.2-src/ but README and all build scripts address jakarta-tomcat/ and jakarta-servletapi/. I think there are a few ways to handle this, but I don't know wich one would be recommended? - unpack in jakarta-servletapi/ or rename the directory - change the path to servletapi in tomcat's build.sh? You can't set SERVLETAPI_HOME because only build.bat use it?! build.sh uses ../jakarta-servletapi/lib/servlet.jar even if SERVLETAPI_HOME is defined?! - change servletapi-path in build.xml? - use ANT_OPTS to overwrite the path to servletapi ??? or am I completely wrong and there is no problem at all? Thanks for any hint, Krister
Re: Réf. : RE: X509 client certificate
You need to upgrade to at least jakarta-tomcat-4.0-m4 for this to work -- earlier versions returned the JSSE internal object for a certificate, rather than converting it to java.security.cert.X509Certificate as the spec requires. This has been fixed. Craig McClanahan [EMAIL PROTECTED] wrote: Hi Stefan I try to extract certicate to my request like you say in your mail but I have an exception because object return by request.getAttribute( "javax.servlet.request.X509Certificate" ) method wasn't type of java.security.cert.X509Certificate but [Ljava.security.cert.X509Certificate; log file : 2000-12-13 16:21:10 StandardWrapperValve[org.apache.catalina.INVOKER.SnoopServlet]: Servlet.service() for servlet org.apache.catalina.INVOKER.SnoopServlet threw exception java.lang.ClassCastException: [Ljava.security.cert.X509Certificate; at SnoopServlet.doGet(SnoopServlet.java:65) at javax.servlet.http.HttpServlet.service(HttpServlet.java:740) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at org.apache.catalina.core.ApplicationFilterWrapper.doFilter(ApplicationFilterWrapper.java:159) at filters.ExampleFilter.doFilter(ExampleFilter.java:136) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:258) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:936) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:160) at org.apache.catalina.valves.ValveBase.invokeNext(ValveBase.java:242) at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:311) at org.apache.catalina.valves.ValveBase.invokeNext(ValveBase.java:242) at org.apache.catalina.valves.CertificatesValve.invoke(CertificatesValve.java:152) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:934) at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:1674) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:161) at org.apache.catalina.valves.ValveBase.invokeNext(ValveBase.java:242) at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:343) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:934) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:159) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:936) at org.apache.catalina.connector.http.HttpProcessor.process(HttpProcessor.java:787) at org.apache.catalina.connector.http.HttpProcessor.run(HttpProcessor.java:904) at java.lang.Thread.run(Thread.java:484) Very strange but are you an idea about my problem? Config : Apache Tomcat (v4.0-m1) Jrme Stefn F. Stefnsson [EMAIL PROTECTED]> 04/12/00 10:53 Veuillez rpondre tomcat-dev Pour : [EMAIL PROTECTED]> cc : Objet : RE: X509 client certificate Hi Alexandre. I'm not sure I fully understand your question but let me see if I can help you at all. The addSecureEndpoint method of EmbededTomcat used to be just like the one you described below. I added the addSecureEndpoint(int port, InetAddress addr, String hostname, String keyfile, String keypass, boolean clientAuth) to be able to force the client to show a certificate for logging in. I want to answer you in a few steps, so please bear with me. 1. Now, first of all I think you're going a little bit too long of a way using the addSecureEndpoint. Wouldn't it be easier for you to call the method I described above (the addSecureEndpoint(int, InetAddress, String, String, String, boolean)) instead of calling the original one (the addSecureEndpoint(int, InetAddress, String, String, String)) and changing the code in that? The modifications to the original addSecureEndpoint were for backwards compatability. In other words, the original method, addSecureEndpoint added an endpoint with no client authentication. I added a method that provides means for getting client authentication by the means of client certificates, and modified the original call to call my method with client authentication == false. Hence, maintaining backwards compatability. I would say you should much rather change the code in tomcat to what it was before and call addSecureEndpoint(int, InetAddress, String, String, String, boolean) in EmbededTomcat directly instead. That way you won't have to recompile Tomcat every time you change your mind about requiring a client certificate in your application. 2. Now for your problem at hand ;o). I don't know exactly how the getUserPrincipal method in HttpServletRequest class is supposed to work but what I got from JavaDoc was: Returns a java.security.Principal object containing the name of the current authenticated user. If the user has not been authenticated, the method returns null. And from the JavaDoc for java.security.Principal, I got: This interface represents the abstract notion of a principal, which can be used to represent any entity, such as an individual, a corporation, and a login id. Now. You would think that Tomcat should
Re: [C2] C2 and Tomcat 4.0 CVS (Class javax/servlet/http/HttpServletRequest violates loader constraints)
"Schmitt, Christian" wrote: Hi all, I had Cocoon 2 and Tomcat 4 (CVS) working for a couple of days, but since yesterday I'm getting a strange error (see subject), and frankly I don't know what's causing it. Anyway, here's the offending XSP page: ?xml version="1.0" encoding="ISO-8859-1"? xsp:page language="java" xmlns:xsp="http://apache.org/xsp" page xsp:expr request.getSession(true) /xsp:expr /page /xsp:page The error message says: Error creating the resource: Class javax/servlet/http/HttpServletRequest violates loader constraints I'm not sure what is causing this either, and the stack trace starts pretty deep inside the Cocoon processing hierarchy. A couple of notes that might help investigate: * This particular error message appears to be generated by Cocoon, not Tomcat. I cannot find such an error message text in Tomcat's message files (or Strings in the code). * One thing guaranteed to cause problems would be an attempt to load a "javax.servlet.http.HttpServletRequest" class from a JAR file underneath WEB-INF/lib (or from an unpacked class under WEB-INF/classes). Tomcat disallows such an attempt to override one of the standard API classes. Craig McClanahan
Re: Jasper tag class usage: bug?
Hi! Pierre Delisle wrote: The current implementation of Jasper (in all versions of tomcat) does not "reuse" tag handlers. Not a bug, just a not-so-efficient implementation. No-one has had/volunteered the time to look into it so far. We're just about done with the new JSP 1.2 features, and efficiency should become a priority in the near future. Ok, I see. I am using tags so much, that it would be great if this feature could be added eventually. Glenn has suggested some cool ideas that can help you in the short term. Unfortunately neither of them works well in my case. :-( And if you really care about efficiency and open source products, we'd all be very happy to see you contribute ideas, patches, etc... to get this done asap. I understand. Unfortunately I'm too busy working on JBoss and a ton of other OpenSource projects (one of which is a web app framework similar to Struts, hence the reason I'm looking into tag usage efficiency). regards, Rickard -- Rickard Öberg Email: [EMAIL PROTECTED]
About bug #558
Is any solution or work around for the bug number #558? Thanks in advance. Octavi Palau TarradasDept. Comerç Electrònic[EMAIL PROTECTED]
tomcat 3.2 or 3.2.1 problem
Anyone experience this with 3.2 or 3.2.1? Tomcat seem to stop communicating. It is stil running but it's just stop communicating via port 8080 or through apache. When I first start tomcat, I can invoke my servlet. After about 2 or more invocations, I cannot communicate with tomcat anymore via apache or port 8080. I have to restart it. I also noticed a lot of TIME_WAIT connections between 127.0.0.1.8007 and 127.0.0.1.51677 ^ this can be any non - reserved port number How can I debug tomcat to see why this is happening? Actually how can I even tell if Tomcat is still trying to accept connections? Oh yeah the same happens when I just go through the examples. After about 2 or 3 invocations of some servlets , the above happens. I'm not solaris 7. I've tried both jdk 1.1.7 and 1.2.2 And I've tried binaries and building tomcat myself. -- Freddie Mendoza [EMAIL PROTECTED] Search Engine for Cheap Books http://satori.com/cheapbooks
RE: tomcat 3.2 or 3.2.1 problem
Do you have the problem of having to call tomcat stop or shutdown multiple times before 3.2 or 3.2.1 shutdowns too? Boon Hian Tek Associate Consultant One World Trade Center (11th Floor) 121 SW Salmon St. Portland, OR 97204 Direct: 503-471-1478 Cell: 317-513-6545 -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: Wednesday, December 13, 2000 10:33 AM To: [EMAIL PROTECTED] Subject: tomcat 3.2 or 3.2.1 problem Anyone experience this with 3.2 or 3.2.1? Tomcat seem to stop communicating. It is stil running but it's just stop communicating via port 8080 or through apache. When I first start tomcat, I can invoke my servlet. After about 2 or more invocations, I cannot communicate with tomcat anymore via apache or port 8080. I have to restart it. I also noticed a lot of TIME_WAIT connections between 127.0.0.1.8007 and 127.0.0.1.51677 ^ this can be any non - reserved port number How can I debug tomcat to see why this is happening? Actually how can I even tell if Tomcat is still trying to accept connections? Oh yeah the same happens when I just go through the examples. After about 2 or 3 invocations of some servlets , the above happens. I'm not solaris 7. I've tried both jdk 1.1.7 and 1.2.2 And I've tried binaries and building tomcat myself. -- Freddie Mendoza [EMAIL PROTECTED] Search Engine for Cheap Books http://satori.com/cheapbooks
cvs commit: jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/startup Embedded.java
craigmcc00/12/13 09:10:41 Modified:catalina/src/share/org/apache/catalina/startup Embedded.java Log: Correct the log output generated by addConnector() if debugging is on. Submitted by: Christian Mallwitz [EMAIL PROTECTED] Revision ChangesPath 1.5 +5 -5 jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/startup/Embedded.java Index: Embedded.java === RCS file: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/startup/Embedded.java,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- Embedded.java 2000/11/02 06:14:11 1.4 +++ Embedded.java 2000/12/13 17:10:39 1.5 @@ -1,7 +1,7 @@ /* - * $Header: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/startup/Embedded.java,v 1.4 2000/11/02 06:14:11 remm Exp $ - * $Revision: 1.4 $ - * $Date: 2000/11/02 06:14:11 $ + * $Header: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/startup/Embedded.java,v 1.5 2000/12/13 17:10:39 craigmcc Exp $ + * $Revision: 1.5 $ + * $Date: 2000/12/13 17:10:39 $ * * * @@ -145,7 +145,7 @@ * /pre * * @author Craig R. McClanahan - * @version $Revision: 1.4 $ $Date: 2000/11/02 06:14:11 $ + * @version $Revision: 1.5 $ $Date: 2000/12/13 17:10:39 $ */ public class Embedded implements Lifecycle { @@ -405,7 +405,7 @@ if (connector instanceof HttpConnector) { HttpConnector hc = (HttpConnector) connector; logger.log("Adding connector for address '" + - ((hc.getAddress() != null) ? "ALL" : hc.getAddress()) + ((hc.getAddress() == null) ? "ALL" : hc.getAddress()) + "' port='" + hc.getPort() + "'"); } else { logger.log("Adding connector (" + connector.getInfo() + ")");
Re: WML Generation from JSP broken!!!!
It seems to me there are a couple solutions: 1) look for jsp:root 2) use DOCTYPE 3) based it on file extension I don't like 1 because it adds overhead to the translation process, and you have to deal with cases like: %-- jsp:root --% I don't like 2 because if your JSP page is generating XML and you want to output a DOCTYPE then you have a collision. So that leaves 3 which I like the best. A good standard default would be "jspx". Of course most app servers allow this to be customized. I also like this because then different filters can be assigned to JSP pages written in XML and plain old JSP pages. Hans Bergsten [EMAIL PROTECTED] writes: Danno Ferrin wrote: I am sorry to start this thread here, but I believe that jasper-4.0's behavior is in error. The behavior I think the spec calls for in determining if a page is a JSP Document (xml jsp) or an XMl document with JSP markup is the presence or absence of a jsp:root element. [...] I agree. JSP 1.1 says that everything that's not a JSP element is treated as template text, and that any type of markup (text) language can be used as template text. This means that a pure XML document, with an ?xml version="1.0? element at the top, is a valid JSP page using the JSP 1.1 syntax. The best (only?) way to identify a page that uses the JSP 1.2 XML syntax is what you suggest: look for a jsp:root element. This should be clarified in the JSP 1.2 spec. Hans -- Hans Bergsten [EMAIL PROTECTED] Gefion Software http://www.gefionsoftware.com -- Tom Reilly Allaire Corp. http://www.allaire.com
BugRat Report #561 was closed (apparently by: Craig R. McClanahan)
Report #561 was closed by Person #0 Synopsis: SIGSEGV 11* segmentation violation (logged in as: Craig R. McClanahan)
Error when trying to start Tomcat on apache
I am trying to setup Tomcat3.2 on a Solaris Sparc running Apache. I'm using jdk1.3. I receive the following error when I run startup.sh: fatal: libCrun.so.1: open failed: No such file or directory I have both the TOMCAT_HOME and JAVA_HOME env variables set correctly and do not believe they are related to the problem. Has anyone had this error before and perhaps know a fix? Any help would be appreciated. Cheers, Lee ___ Do You Yahoo!? Get your free @yahoo.ca address at http://mail.yahoo.ca
BugRat Report #565 was closed (apparently by: Craig R. McClanahan)
Report #565 was closed by Person #0 Synopsis: Security prob: WEB-INF directory is viewable (logged in as: Craig R. McClanahan)
BugRat Report #563 was closed (apparently by: Craig R. McClanahan)
Report #563 was closed by Person #0 Synopsis: Make JDBCRealm not a final class (logged in as: Craig R. McClanahan)
BugRat Report #588 was closed (apparently by: Craig R. McClanahan)
Report #588 was closed by Person #0 Synopsis: request.getParameter(), request.getQueryString() does not work properly (logged in as: Craig R. McClanahan)
cvs commit: jakarta-tomcat/src/tests/webpages/jsp params.jsp
costin 00/12/13 11:58:04 Modified:src/facade22/org/apache/tomcat/facade ServletHandler.java ServletInfo.java WebXmlReader.java src/facade22/org/apache/tomcat/modules/facade22 JspInterceptor.java src/share/org/apache/tomcat/context AutoSetup.java ErrorHandler.java src/share/org/apache/tomcat/core BaseInterceptor.java Context.java Handler.java src/share/org/apache/tomcat/modules/session SessionId.java src/share/org/apache/tomcat/request AccessInterceptor.java AccountingInterceptor.java InvokerInterceptor.java Jdk12Interceptor.java StaticInterceptor.java src/tests/webpages/WEB-INF web.xml Added: src/tests/webpages/jsp params.jsp Log: One more step in Handler refactoring. We are very close, I think Handler starts to be simple enough and ServletWrapper is now at least readable ( that was one of the most complex parts of tomcat3). In the process I also fixed a number of bugs ( it's amazing what you find when the code is simpler ) and added few improvements on the JspInterceptor ( now the main target for refactoring ) - added get/setModule - the handler is associated with an interceptor the same way as in apache, etc. The interceptor creates the handler and sets it ( properties, debug ) - Servlet22Interceptor and JspInterceptor are doing this for servlets/jsps - many fixes in JspInterceptor - the error handling had few problems, same for reloading. - changed JspInterceptor to use the same mechanism for reloading with servlets - now expire checks are done periodically, not for each request. - started to simplify and better organize JspInterceptor - fixed bugs related with jsps declared in web.xml - added a small test for jsp declarations - use a prefix for the names declared by JspInterceptor, to avoid conflicts with web.xml names - changed the Context logger to report the context path - removed accounting from Handler - a better mechanism is needed, and it's not a priority. - that simplifies a lot the Handler, and make it possible and easy to pass options using server.xml - removed "origin" from handler - it's implied by Module - removed Context from handler - it's used only in ServletHandler. - Small hack in ServletInfo so that servlets declared by WebXmlReader will have Servlet22Interceptor as "owner". Revision ChangesPath 1.3 +16 -2 jakarta-tomcat/src/facade22/org/apache/tomcat/facade/ServletHandler.java Index: ServletHandler.java === RCS file: /home/cvs/jakarta-tomcat/src/facade22/org/apache/tomcat/facade/ServletHandler.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- ServletHandler.java 2000/12/12 22:32:54 1.2 +++ ServletHandler.java 2000/12/13 19:57:58 1.3 @@ -110,6 +110,7 @@ private String path; protected Class servletClass; protected Servlet servlet; +protected Context context; // If init() fails, Handler.errorException will hold the reason. // In the case of an UnavailableException, this field will hold @@ -121,7 +122,7 @@ } public String toString() { - return "ServletHandler " + name + "(" + sw + ")"; + return "ServletH " + name + "(" + sw + ")"; } public void setServletInfo( ServletInfo sw ) { @@ -137,6 +138,19 @@ return sw; } +/** + */ +public void setContext( Context context) { +this.context = context; +} + +/** Return the context associated with the handler + */ +public Context getContext() { + return context; +} + + public void setServletClassName( String servletClassName) { servlet=null; // reset the servlet, if it was set servletClass=null; @@ -394,7 +408,7 @@ if( state!= STATE_DISABLED ) { init(); } - if( state== STATE_DISABLED ) { + if( state== STATE_DISABLED || state==STATE_DELAYED_INIT ) { // the init failed because of an exception Exception ex=getErrorException(); // save error state on request and response 1.2 +19 -3 jakarta-tomcat/src/facade22/org/apache/tomcat/facade/ServletInfo.java Index: ServletInfo.java === RCS file: /home/cvs/jakarta-tomcat/src/facade22/org/apache/tomcat/facade/ServletInfo.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- ServletInfo.java 2000/12/12 20:21:24 1.1 +++ ServletInfo.java 2000/12/13 19:57:58
BugRat Report #590 has been filed.
Bug report #590 has just been filed. You can view the report at the following URL: http://znutar.cortexity.com/BugRatViewer/ShowReport/590 REPORT #590 Details. Project: Tomcat Category: Bug Report SubCategory: New Bug Report Class: support State: received Priority: high Severity: critical Confidence: public Environment: Release: jakarta-tomcat-4.0-m4 JVM Release: JDK-1.2.2_005 Operating System: Solaris OS Release: 2.7 Platform: Sun Ultra Synopsis: java.lang.NullPointerException with jakarta-tomcat-4.0-m4 Description: I am using a third party software package by a company called Tom Sawyer. It is a topology engine, and can be used in a servlet environment. It works in the following way. You create a graph that represents a network, which is composed of nodes (such as servers and storage devices) and edges (connections between the nodes). You can then apply different layouts to the graph, such as circular or hierarchical. I installed and configured jakarta-tomcat-3.2, as well as the Tom Sawyer software on my system, and it works correctly. However, when I try it with jakarta-tomcat-4.0-m4, I get get several errors, as shown below in the output from catalina.out, localhost_log.2000-12-12.txt, and from the Tom Sawyer program as well, which is called Tomahawk. I made sure that environment for both the 3.2 and 4.0 was set up correctly, as shown under Additional Environment Description. The reason we want to use 4.0 is because it has struts, while 3.2 does not. If you have any ideas on how to solve this problem, or when 4.1 might be available, please let me know. Thanks Eric Jamison [EMAIL PROTECTED] output from catalina.out: -- wiseguy 331 =!328 cat catalina.out Apache Tomcat/4.0-dev java.lang.NullPointerException at java.io.ObjectInputStream.read(ObjectInputStream.java, Compiled Code) at java.io.DataInputStream.readShort(DataInputStream.java, Compiled Code) at java.io.ObjectInputStream.readShort(ObjectInputStream.java, Compiled Code) at java.io.ObjectInputStream.readStreamHeader(ObjectInputStream.java, Compiled Code) at java.io.ObjectInputStream.init(ObjectInputStream.java, Compiled Code) at tomsawyer.layout.TSServletHelper.fetchGraphData(Unknown Source) at tomsawyer.layout.TSServletHelper.run(Unknown Source) at tomsawyer.layout.TSServletLayoutServer.doPost(Unknown Source) at javax.servlet.http.HttpServlet.service(HttpServlet.java, Compiled Code) at javax.servlet.http.HttpServlet.service(HttpServlet.java, Compiled Code) at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java , Compiled Code) at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.jav a, Compiled Code) at org.apache.catalina.servlets.InvokerServlet.serveRequest(InvokerServlet.java, Compiled Code) at org.apache.catalina.servlets.InvokerServlet.doPost(InvokerServlet.java, Compiled Code) at javax.servlet.http.HttpServlet.service(HttpServlet.java, Compiled Code) at javax.servlet.http.HttpServlet.service(HttpServlet.java, Compiled Code) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain. java, Compiled Code) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java, Compiled Code) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java, Compiled Code) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java, Compiled Code) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java, Compiled Code) at org.apache.catalina.core.StandardContext.invoke(StandardContext.java, Compiled Code) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java, Compiled Code) at org.apache.catalina.valves.ValveBase.invokeNext(ValveBase.java, Compiled Code) at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java, Compiled Code) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java, Compiled Code) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java, Compiled Code) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java, Compiled Code) at org.apache.catalina.connector.http.HttpProcessor.process(HttpProcessor.java, Compiled Code) at org.apache.catalina.connector.http.HttpProcessor.run(HttpProcessor.java, Compiled Code) at java.lang.Thread.run(Thread.java, Compiled Code) output from localhost_access_log.2000-12-12.txt: wiseguy 333 =!325 cat localhost_access_log.2000-12-12.txt wiseguy - - [12/Dec/2000:12:21:41 -0800] "POST /getj/servlet/LayoutServer HTTP/1.0" 200 - output from localhost_log.2000-12-12.txt: -
(very) minor dist. problem
The build.sh file in the source download of the servletapi is not marked as executable. No biggie, just thought I'd pass it along ...
Re: [ANNOUNCEMENT] Security Related Updates - Tomcat 3.1.1 and Tomcat 3.2.1
het Craig - sorry to be dense - but what are the "appropriate contents" that should be replaced by 3.2.1? Is this just the various jar's in /lib? -- Wishing you an "OOBA OOBA" Y2K Horace...once known as "Kicker" :-) Horace Vallas hav.Software http://www.hav.com/ P.O. Box 354 [EMAIL PROTECTED] Richmond, Tx. 77406-0354 voice: 281-341-5035 USAfax: 281-341-5087 Thawte Web Of Trust Notary in SW Houston, Tx. http://www.hav.com/?content=/thawteWOTnotary.htm ...drop by and chat if I'm online http://www.hav.com/chat/ === === === === === === === === === === What is a Vet? ... He is the barroom loudmouth, dumber than five wooden planks, whose overgrown frat-boy behavior is outweighed a hundred times in the cosmic scales by four hours of exquisite bravery near the 38th parallel. ... - Unknown http://www.hav.com/vet.htm TOMCAT 3.2 USERS * There are two identified vulnerabilities that are documented in the Release Notes for Tomcat 3.2.1 (file "doc/readme" in the distribution). These vulnerabilities have been fixed in Tomcat 3.2.1. * You can download this security maintenance release at: http://jakarta.apache.org/builds/tomcat/release/v3.2.1/bin/ * You are ***strongly*** encouraged to download and install this update as quickly as possible. * This release fixes ***only*** the identified security vulnerabilities. It does not address any of the other bugs, or feature requests, related to Tomcat 3.2 final. These issues will be dealt with in future maintenance releases of Tomcat 3.2 as appropriate. * The corrective action is to download the binary distribution, and replace the appropriate contents in the $TOMCAT_HOME directory. There is no need to modify any of the binary components (such as the mod_jserv component used to connect Tomcat to Apache). S/MIME Cryptographic Signature
cvs commit: jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/connector ResponseWriter.java ResponseBase.java ResponseStream.java
craigmcc00/12/13 15:45:39 Modified:catalina/src/share/org/apache/catalina/connector ResponseBase.java ResponseStream.java Added: catalina/src/share/org/apache/catalina/connector ResponseWriter.java Log: Fix a buffering issue that was causing one Watchdog-4.0 test failure (SetBufferSize_1Test), and also could cause grief for applications as well. The issue: Several methods on ServletResponse are required to throw an IllegalStateException if any output has been written to the output stream or writer, even if the response has not been committed to the client yet. The original implementation simply returned a PrintWriter that wrapped an OutputStreamWriter -- to do the character encoding conversions -- around the ServletOutputStream implementation that writes directly to the response buffer. The problem: The java.io.OutputStreamWriter implementation includes a non-configurable buffer (8kb per instance in the Sun JDK!!!). When you "print" output to this buffer, the ServletResponse does not know it has happened, and you get incorrect results from calls like setBufferSize(). The solution: Create a customized PrintWriter, to be returned when you call response.getWriter(). This version causes the OutputStreamWriter to be "flushed" to the underlying ServletOutputStream, which simply writes directly to the response buffer, on every write() or print(). Now, the response is aware of what bytes have *really* been written. In addition, response.reset() and response.resetBuffer() can now work correctly even when using a writer. The performance impact of this change is certainly worth being concerned about, but correct functionality has to come first -- now we can optimize. Revision ChangesPath 1.8 +7 -5 jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/connector/ResponseBase.java Index: ResponseBase.java === RCS file: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/connector/ResponseBase.java,v retrieving revision 1.7 retrieving revision 1.8 diff -u -r1.7 -r1.8 --- ResponseBase.java 2000/12/01 02:11:21 1.7 +++ ResponseBase.java 2000/12/13 23:45:37 1.8 @@ -1,7 +1,7 @@ /* - * $Header: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/connector/ResponseBase.java,v 1.7 2000/12/01 02:11:21 craigmcc Exp $ - * $Revision: 1.7 $ - * $Date: 2000/12/01 02:11:21 $ + * $Header: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/connector/ResponseBase.java,v 1.8 2000/12/13 23:45:37 craigmcc Exp $ + * $Revision: 1.8 $ + * $Date: 2000/12/13 23:45:37 $ * * * @@ -88,7 +88,7 @@ * the connector-specific methods need to be implemented. * * @author Craig R. McClanahan - * @version $Revision: 1.7 $ $Date: 2000/12/01 02:11:21 $ + * @version $Revision: 1.8 $ $Date: 2000/12/13 23:45:37 $ */ public abstract class ResponseBase @@ -596,6 +596,7 @@ if (stream == null) stream = createOutputStream(); +((ResponseStream) stream).setCommit(true); return (stream); } @@ -628,9 +629,10 @@ (sm.getString("responseBase.getWriter.ise")); stream = createOutputStream(); +((ResponseStream) stream).setCommit(false); OutputStreamWriter osr = new OutputStreamWriter(stream, getCharacterEncoding()); - writer = new PrintWriter(osr); + writer = new ResponseWriter(osr, (ResponseStream) stream); return (writer); } 1.2 +38 -5 jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/connector/ResponseStream.java Index: ResponseStream.java === RCS file: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/connector/ResponseStream.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- ResponseStream.java 2000/08/11 22:40:19 1.1 +++ ResponseStream.java 2000/12/13 23:45:37 1.2 @@ -1,7 +1,7 @@ /* - * $Header: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/connector/ResponseStream.java,v 1.1 2000/08/11 22:40:19 craigmcc Exp $ - * $Revision: 1.1 $ - * $Date: 2000/08/11 22:40:19 $ + * $Header: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/connector/ResponseStream.java,v 1.2 2000/12/13 23:45:37 craigmcc Exp $ + * $Revision: 1.2 $ + * $Date: 2000/12/13 23:45:37 $ * * * @@ -79,7 +79,7 @@ * enforce not writing more than that many bytes on the underlying stream. * * @author Craig R. McClanahan
[TC 3.2.1] error in FAQ
Hi, This is a part of $TOMCAT_HOME/doc/faq Q: Where are the classes for JSPs and Servlets? A: webserver.jar -- class files for Servlet Engine. .. .. That should be changed to Q: Where are the classes for JSPs and Servlets? A: lib/webserver.jar -- class files for Servlet Engine. .. .. Thanks, Kim
Help! Who know's the whole architecture?
I want to distribute to this project. But without a document that tells me the whole architecture, I find it is difficult for me to read so many source code clearly. Can anyone help me? _ Get more from the Web. FREE MSN Explorer download : http://explorer.msn.com
precompile jsp with Tomcat 3.2
Hi all, I've been trying to use jspc to precompile the jsp pages into java classes. Below is the steps I've taken: 1. run jspc and generate the java code and web.xml 2. insert the web.xml generated in step1 into my web.xml. 3. compile the java files into class files. Now I have problem with where to put the class files. Should they be under the web-inf\classes or the work\ directory? I put them under web-inf\classes. And I have the classes preserve the package/directory structure. 4. restart Tomcat. Result: the jsp pages under the first level directory are not re-compiled by Tomcat, but those under the 2nd level directory are re-compiled. For example, suppose I have the following directory structure: webapps + registration + enroll + web-inf + classes The jsps under registration/ are not recompiled, but those under registration/enroll are re-compiled by Tomcat, as I can see the java/class files in the work/ directory. How can I make it work? Do I have to put the classes files under work/ and name them the same way Tomcat names them? Thanks for any help. Joan
Nightly Build Link broken ?
Hi, I am trying to download Tomcat 3.2.1 B. Is it the same as the release version of Tomcat 3.2.1 ? In any case, the Nightly Build Link for downloading the source code of Tomcat seems to be broken. Thanks Shahed.
cvs commit: jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/connector/warp WarpHost.java WarpEngine.java WarpConnectionHandler.java
pier00/12/13 17:25:58 Modified:catalina/src/share/org/apache/catalina/connector/warp WarpHost.java WarpEngine.java WarpConnectionHandler.java Log: Start WarpHost container if WarpEngine has already been started. Revision ChangesPath 1.4 +8 -1 jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/connector/warp/WarpHost.java Index: WarpHost.java === RCS file: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/connector/warp/WarpHost.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- WarpHost.java 2000/12/08 15:33:42 1.3 +++ WarpHost.java 2000/12/14 01:25:57 1.4 @@ -73,7 +73,7 @@ * @author a href="mailto:[EMAIL PROTECTED]"Pier Fumagalli/a * @author Copyright copy; 1999, 2000 a href="http://www.apache.org"The * Apache Software Foundation. - * @version CVS $Id: WarpHost.java,v 1.3 2000/12/08 15:33:42 pier Exp $ + * @version CVS $Id: WarpHost.java,v 1.4 2000/12/14 01:25:57 pier Exp $ */ public class WarpHost extends StandardHost { @@ -162,6 +162,13 @@ protected void setHostID(int id) { if (DEBUG) this.debug("Setting HostID for "+super.getName()+" to "+id); this.id=id; +} + +/** + * Check if the start() method has already been called. + */ +public boolean isStarted() { +return(super.started); } // -- DEBUGGING METHODS 1.7 +29 -2 jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/connector/warp/WarpEngine.java Index: WarpEngine.java === RCS file: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/connector/warp/WarpEngine.java,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- WarpEngine.java 2000/12/08 15:33:43 1.6 +++ WarpEngine.java 2000/12/14 01:25:57 1.7 @@ -75,7 +75,7 @@ * @author a href="mailto:[EMAIL PROTECTED]"Pier Fumagalli/a * @author Copyright copy; 1999, 2000 a href="http://www.apache.org"The * Apache Software Foundation. - * @version CVS $Id: WarpEngine.java,v 1.6 2000/12/08 15:33:43 pier Exp $ + * @version CVS $Id: WarpEngine.java,v 1.7 2000/12/14 01:25:57 pier Exp $ */ public class WarpEngine extends StandardEngine { @@ -164,6 +164,17 @@ host.setHostID(this.hostid++); host.setAppBase(this.appbase); this.addChild(host); +try { +if (DEBUG) this.debug("Manually starting host"); +if (super.started) { +if (!host.isStarted()) { +host.start(); +} +} +} catch (LifecycleException e) { +this.log(e); +return(null); +} } return(host); } @@ -215,8 +226,24 @@ String old=this.appbase; this.appbase=appbase; } + +// -- LOGGING AND DEBUGGING METHODS + +/** + * Dump a log message. + */ +public void log(String msg) { +// FIXME: Log thru catalina +WarpDebug.debug(this,msg); +} -// -- DEBUGGING METHODS +/** + * Dump information for an Exception. + */ +public void log(Exception exc) { +// FIXME: Log thru catalina +WarpDebug.debug(this,exc); +} /** * Dump a debug message. 1.9 +9 -2 jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/connector/warp/WarpConnectionHandler.java Index: WarpConnectionHandler.java === RCS file: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/connector/warp/WarpConnectionHandler.java,v retrieving revision 1.8 retrieving revision 1.9 diff -u -r1.8 -r1.9 --- WarpConnectionHandler.java2000/12/08 15:33:44 1.8 +++ WarpConnectionHandler.java2000/12/14 01:25:57 1.9 @@ -64,7 +64,7 @@ * @author a href="mailto:[EMAIL PROTECTED]"Pier Fumagalli/a * @author Copyright copy; 1999, 2000 a href="http://www.apache.org"The * Apache Software Foundation. - * @version CVS $Id: WarpConnectionHandler.java,v 1.8 2000/12/08 15:33:44 pier Exp $ + * @version CVS $Id: WarpConnectionHandler.java,v 1.9 2000/12/14 01:25:57 pier Exp $ */ public class WarpConnectionHandler extends WarpHandler { /** The WarpReader associated with this WarpConnectionHandler. */ @@ -102,7 +102,14 @@
BugRat Report #227 was closed (apparently by: Pierre Delisle)
Report #227 was closed by Person #0 Synopsis: Overflow where JSP tag embedded in HTML tag (logged in as: Pierre Delisle)
Re: cvs commit: jakarta-tomcat-4.0/connectors/apache-1.3mod_webapp.c
on 12/13/2000 7:47 PM, "[EMAIL PROTECTED]" [EMAIL PROTECTED] wrote: +char *t=""; if (r==NULL) return(FALSE); +if (t!=NULL) t=ap_pstrdup(r-pool,type); My C is a bit rusty, but why is there a check to see if t!=NULL given that it has been initialized to "" right above it? +char *n=""; +char *v=""; if (r==NULL) return(FALSE); - -ap_table_add(r-headers_out, name, value); + +if (n!=NULL) n=ap_pstrdup(r-pool,name); +if (v!=NULL) v=ap_pstrdup(r-pool,value); + same here as well. -jon
BugRat Report #442 was closed (apparently by: Pierre Delisle)
Report #442 was closed by Person #0 Synopsis: failure with jsp:setProperty name="ivb" property="*"/ (logged in as: Pierre Delisle)
Tomcat / Apache jserv automatic startup
Hi y'all Tomcat development team, I've been a long time advocate of starting Tomcat from Apache automatically. In fact I've been doing this since pre-3.0 days. It's worked flawlessly for me until 3.2. I assume this is because this is a low priority for everyone. Anyway I think slowly the protocol that starts/monitors Tomcat from ap_jserv is slowly going away. As an example the JSERV_PING does not seem to work anymore. It leaves a connection open to Tomcat and slowly eats away the socket file descriptors until the system runs out. But I found a workaround for now by modifying code in the mod_jserv. This way it seem to work again for 3.2. Shortly I will be updating my HOWTO for 3.2. So I guess the question(s) are : 1. Will automatic startup of Tomcat be included in a plan sometime in the future even for mod_jk? 2. Maybe someone can point me to the module in Tomcat where the Apj_xx protocol is handled and I probably can help drop something in there. Or may even be something pluggable. There's been a few users who have been asking for this for a while but all I can say is that the code is changing so much that it's hard to keep up with. One day my howto works the next day it doesn't. One of the big advantages of having this is that its nice to just have one startup procedure for Apache and Tomcat. It's also nice to be able to do something like "apachectl restart" or "apachectl start/stop" to restart/stop/start both Apache and Tomcat. thanks, -- Freddie Mendoza [EMAIL PROTECTED] Search Engine for Cheap Books http://satori.com/cheapbooks
BugRat Report #443 was closed (apparently by: Pierre Delisle)
Report #443 was closed by Person #0 Synopsis: failure with jsp:setProperty name="ivb" property="*"/ (logged in as: Pierre Delisle)
BugRat Report #444 was closed (apparently by: Pierre Delisle)
Report #444 was closed by Person #0 Synopsis: failure with jsp:setProperty name="ivb" property="*"/ (logged in as: Pierre Delisle)
Re: [tomcat-4.0] building is hard
on 12/13/2000 9:11 PM, "Craig R. McClanahan" [EMAIL PROTECTED] wrote: One issue to keep in mind when you look at the build scripts is that there are two goals that sometimes compete: * Build Tomcat itself (i.e. make the right JARs available to the right javac tasks) * Build a binary distribution that includes all the JARs that can be legally redistributed (i.e. not JSSE). I'm fine with improvements that accomplish both goals, but -1 on changes that do not. All I'm doing is simply making it so that people can setup a directory structure to have relative paths to their .jar files instead of having to specify these things in environment variables. it will first look for the relative path and if it doesn't exist or isn't valid, it will use an env variable. -jon -- Honk if you love peace and quiet.
cvs commit: jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/connector/warp WarpEngine.java
pier00/12/13 19:37:12 Modified:catalina/src/share/org/apache/catalina/connector/warp WarpEngine.java Log: Set the port in the host when this one is constructed. Revision ChangesPath 1.8 +3 -2 jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/connector/warp/WarpEngine.java Index: WarpEngine.java === RCS file: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/connector/warp/WarpEngine.java,v retrieving revision 1.7 retrieving revision 1.8 diff -u -r1.7 -r1.8 --- WarpEngine.java 2000/12/14 01:25:57 1.7 +++ WarpEngine.java 2000/12/14 03:37:11 1.8 @@ -75,7 +75,7 @@ * @author a href="mailto:[EMAIL PROTECTED]"Pier Fumagalli/a * @author Copyright copy; 1999, 2000 a href="http://www.apache.org"The * Apache Software Foundation. - * @version CVS $Id: WarpEngine.java,v 1.7 2000/12/14 01:25:57 pier Exp $ + * @version CVS $Id: WarpEngine.java,v 1.8 2000/12/14 03:37:11 pier Exp $ */ public class WarpEngine extends StandardEngine { @@ -155,12 +155,13 @@ * Create a new WarpHost with the specified host name, setup the appropriate * values and add it to the list of children. */ -public synchronized WarpHost setupChild(String name) { +public synchronized WarpHost setupChild(String name, int port) { WarpHost host=(WarpHost)this.findChild(name); if (host==null) { this.debug("Creating new host "+name); host=new WarpHost(); host.setName(name); +host.setPort(port); host.setHostID(this.hostid++); host.setAppBase(this.appbase); this.addChild(host);
cvs commit: jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/connector/warp WarpContext.java
pier00/12/13 19:37:50 Modified:catalina/src/share/org/apache/catalina/connector/warp WarpContext.java Log: Set the appropriate context when invoking for a request. Revision ChangesPath 1.3 +3 -2 jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/connector/warp/WarpContext.java Index: WarpContext.java === RCS file: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/connector/warp/WarpContext.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- WarpContext.java 2000/12/08 15:33:43 1.2 +++ WarpContext.java 2000/12/14 03:37:49 1.3 @@ -69,7 +69,7 @@ * @author a href="mailto:[EMAIL PROTECTED]"Pier Fumagalli/a * @author Copyright copy; 1999, 2000 a href="http://www.apache.org"The * Apache Software Foundation. - * @version CVS $Id: WarpContext.java,v 1.2 2000/12/08 15:33:43 pier Exp $ + * @version CVS $Id: WarpContext.java,v 1.3 2000/12/14 03:37:49 pier Exp $ */ public class WarpContext extends StandardContext { @@ -95,7 +95,8 @@ public void invoke(Request req, Response res) throws ServletException, IOException { -if (DEBUG) this.debug("Invoked (available="+this.getAvailable()+")"); +if (DEBUG) this.debug("Invoking (available="+this.getAvailable()+")"); +if (req.getContext()==null) req.setContext(this); super.invoke(req,res); }
cvs commit: jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/connector/warp WarpConnectionHandler.java
pier00/12/13 19:38:40 Modified:catalina/src/share/org/apache/catalina/connector/warp WarpConnectionHandler.java Log: Construct the host with appropriate host and port information. Revision ChangesPath 1.10 +5 -3 jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/connector/warp/WarpConnectionHandler.java Index: WarpConnectionHandler.java === RCS file: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/connector/warp/WarpConnectionHandler.java,v retrieving revision 1.9 retrieving revision 1.10 diff -u -r1.9 -r1.10 --- WarpConnectionHandler.java2000/12/14 01:25:57 1.9 +++ WarpConnectionHandler.java2000/12/14 03:38:40 1.10 @@ -64,7 +64,7 @@ * @author a href="mailto:[EMAIL PROTECTED]"Pier Fumagalli/a * @author Copyright copy; 1999, 2000 a href="http://www.apache.org"The * Apache Software Foundation. - * @version CVS $Id: WarpConnectionHandler.java,v 1.9 2000/12/14 01:25:57 pier Exp $ + * @version CVS $Id: WarpConnectionHandler.java,v 1.10 2000/12/14 03:38:40 pier Exp $ */ public class WarpConnectionHandler extends WarpHandler { /** The WarpReader associated with this WarpConnectionHandler. */ @@ -99,10 +99,11 @@ try { switch (type) { case WarpConstants.TYP_CONINIT_HST: { -String name=reader.readString()+"."+reader.readShort(); +String name=reader.readString(); +int port=reader.readShort(); // Retrieve this host id -WarpHost host=engine.setupChild(name); +WarpHost host=engine.setupChild(name,port); if (host==null) { this.log("Cannot retrieve host instance"); this.send(WarpConstants.TYP_CONINIT_ERR,this.packet); @@ -188,6 +189,7 @@ h.request.setRequestedApplicationID(aid); h.request.setWarpRequestHandler(h); h.response.setWarpRequestHandler(h); +h.request.setScheme("http"); // Start the request handler try {
cvs commit: jakarta-tomcat-4.0/connectors/webapplib wa_provider_warp.c
pier00/12/13 19:51:49 Modified:connectors/webapplib wa_provider_warp.c Log: Fixed bug wich prevented long responses to get back to the client. Revision ChangesPath 1.8 +7 -4 jakarta-tomcat-4.0/connectors/webapplib/wa_provider_warp.c Index: wa_provider_warp.c === RCS file: /home/cvs/jakarta-tomcat-4.0/connectors/webapplib/wa_provider_warp.c,v retrieving revision 1.7 retrieving revision 1.8 diff -u -r1.7 -r1.8 --- wa_provider_warp.c2000/12/08 15:34:11 1.7 +++ wa_provider_warp.c2000/12/14 03:51:49 1.8 @@ -55,7 +55,7 @@ * * * = */ -// CVS $Id: wa_provider_warp.c,v 1.7 2000/12/08 15:34:11 pier Exp $ +// CVS $Id: wa_provider_warp.c,v 1.8 2000/12/14 03:51:49 pier Exp $ // Author: Pier Fumagalli mailto:[EMAIL PROTECTED] #include wa.h @@ -279,9 +279,11 @@ // Read from the socket and fill the packet buffer while(TRUE) { p-len+=recv(c-sock,p-buf+p-len,(siz-p-len),0); -if (p-lensiz) fprintf(stderr,"SHORT len=%d siz=%d\n",p-len,siz); -if (p-lensiz) fprintf(stderr,"INCONSIST len=%d siz=%d\n",p-len,siz); -else { +if (p-lensiz) { +fprintf(stderr,"SHORT len=%d siz=%d\n",p-len,siz); +} else if (p-lensiz) { +fprintf(stderr,"INCONSIST len=%d siz=%d\n",p-len,siz); +} else { p-len=0; return(p); } @@ -901,6 +903,7 @@ buf1[x]='\0'; x=wa_warp_packet_get_string(in,buf2,8192); buf2[x]='\0'; +fprintf(stderr,"HEADER \"%s: %s\"\n",buf1,buf2); if (strcasecmp("Connection",buf1)!=0) { wa_callback_setheader(req,buf1,buf2); }
Re: cvs commit: jakarta-tomcat-4.0/connectors/apache-1.3mod_webapp.c
Jon Stevens [EMAIL PROTECTED] wrote: on 12/13/2000 7:47 PM, "[EMAIL PROTECTED]" [EMAIL PROTECTED] wrote: +char *t=""; if (r==NULL) return(FALSE); +if (t!=NULL) t=ap_pstrdup(r-pool,type); My C is a bit rusty, but why is there a check to see if t!=NULL given that it has been initialized to "" right above it? +char *n=""; +char *v=""; if (r==NULL) return(FALSE); - -ap_table_add(r-headers_out, name, value); + +if (n!=NULL) n=ap_pstrdup(r-pool,name); +if (v!=NULL) v=ap_pstrdup(r-pool,value); + same here as well. Whops.. Thanks. Wrong variable tested :) Pier -- Pier Fumagalli http://www.betaversion.org/ mailto:[EMAIL PROTECTED]
cvs commit: jakarta-tomcat-4.0/connectors/apache-1.3 mod_webapp.c
pier00/12/13 21:31:09 Modified:connectors/apache-1.3 mod_webapp.c Log: Thanks Jon for pointing those two out... Revision ChangesPath 1.7 +4 -4 jakarta-tomcat-4.0/connectors/apache-1.3/mod_webapp.c Index: mod_webapp.c === RCS file: /home/cvs/jakarta-tomcat-4.0/connectors/apache-1.3/mod_webapp.c,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- mod_webapp.c 2000/12/14 03:47:07 1.6 +++ mod_webapp.c 2000/12/14 05:31:09 1.7 @@ -55,7 +55,7 @@ * * * = */ -// CVS $Id: mod_webapp.c,v 1.6 2000/12/14 03:47:07 pier Exp $ +// CVS $Id: mod_webapp.c,v 1.7 2000/12/14 05:31:09 pier Exp $ // Author: Pier Fumagalli mailto:[EMAIL PROTECTED] #include httpd.h @@ -415,7 +415,7 @@ char *t=""; if (r==NULL) return(FALSE); -if (t!=NULL) t=ap_pstrdup(r-pool,type); +if (type!=NULL) t=ap_pstrdup(r-pool,type); r-content_type=t; ap_table_add(r-headers_out, "Content-Type", t); @@ -438,8 +438,8 @@ if (r==NULL) return(FALSE); -if (n!=NULL) n=ap_pstrdup(r-pool,name); -if (v!=NULL) v=ap_pstrdup(r-pool,value); +if (name!=NULL) n=ap_pstrdup(r-pool,name); +if (value!=NULL) v=ap_pstrdup(r-pool,value); ap_table_add(r-headers_out,n,v); return(TRUE);
Ajp13 Patches for Tomcat 3.2
All, I took some of the Ajp13 work I've been doing on the 3.3 branch and applied it to the 3.2 sources. The two attached files contain a fix for the file upload bug. As with the 3.3 version, there are some changes to the mod_jk.so source files, so to get the full effect, you'll need to rebuild mod_jk.so and hook it up to apache again. Possibly, you'll get some benefit from just the java files, but I'm not certain how that will work out. WARNING: I have not had a chance to thoroughly test this fix. I do not think it is ready for inclusion in the "stable" 3.2 builds. I'm offering it here so that 3.2 users who have a great need for the ajp13 / file upload combination can give it a shot. Enjoy, -Dan -- Dan Milstein // [EMAIL PROTECTED] Index: jk_ajp13_worker.c === RCS file: /home/cvspublic/jakarta-tomcat/src/native/jk/Attic/jk_ajp13_worker.c,v retrieving revision 1.3.2.1 diff -u -r1.3.2.1 jk_ajp13_worker.c --- jk_ajp13_worker.c 2000/09/13 23:06:25 1.3.2.1 +++ jk_ajp13_worker.c 2000/12/14 05:27:50 @@ -267,7 +267,7 @@ read_buf += 4; /* leave some space for the buffer headers */ read_buf += 2; /* leave some space for the read length */ -if(read_fully_from_server(r, read_buf, len) = 0) { +if(read_fully_from_server(r, read_buf, len) 0) { jk_log(l, JK_LOG_ERROR, "read_into_msg_buff: Error - read_fully_from_server failed\n"); return JK_FALSE; @@ -331,23 +331,25 @@ case JK_AJP13_GET_BODY_CHUNK: { - unsigned len = (unsigned)jk_b_get_int(msg); + unsigned len = (unsigned)jk_b_get_int(msg); if(len MAX_SEND_BODY_SZ) { len = MAX_SEND_BODY_SZ; } if(len ep-left_bytes_to_send) { len = ep-left_bytes_to_send; -} -if(len 0) { -if(read_into_msg_buff(ep, r, msg, l, len)) { -return JK_AJP13_HAS_RESPONSE; -} - -jk_log(l, JK_LOG_ERROR, - "Error ajp13_process_callback - read_into_msg_buff failed\n"); -return JK_INTERNAL_ERROR; } + if(len 0) { + len = 0; + } + + if(read_into_msg_buff(ep, r, msg, l, len)) { + return JK_AJP13_HAS_RESPONSE; + } + + jk_log(l, JK_LOG_ERROR, + "Error ajp13_process_callback - read_into_msg_buff failed\n"); + return JK_INTERNAL_ERROR; } break; Index: Ajp13ConnectorRequest.java === RCS file: /home/cvspublic/jakarta-tomcat/src/share/org/apache/tomcat/service/connector/Attic/Ajp13ConnectorRequest.java,v retrieving revision 1.5.2.2 diff -u -r1.5.2.2 Ajp13ConnectorRequest.java --- Ajp13ConnectorRequest.java 2000/12/12 09:41:43 1.5.2.2 +++ Ajp13ConnectorRequest.java 2000/12/14 05:20:40 @@ -250,24 +250,43 @@ public int doRead() throws IOException { if(pos = blen) { -refeelReadBuffer(); -} + if( ! refillReadBuffer()) { + return -1; + } + } return bodyBuff[pos++]; } public int doRead(byte[] b, int off, int len) throws IOException { -// XX Stupid, but the whole thing must be rewriten ( see super()! ) -for(int i = off ; i (len + off) ; i++) { -int a = doRead(); -if(-1 == a) { -System.out.println("Y"); -return i-off; -} -b[i] = (byte)a; -} - -return len; + if(pos = blen) { + if( ! refillReadBuffer()) { + return -1; + } + } + + int toCopy = len; + while(toCopy 0) { + int bytesRemaining = blen - pos; + if(bytesRemaining 0) + bytesRemaining = 0; + int c = bytesRemaining toCopy ? bytesRemaining : toCopy; + + System.arraycopy(bodyBuff, pos, b, off, c); + + toCopy-= c; + + off += c; + pos += c; // In case we exactly consume the buffer + + if(toCopy 0) { + if( ! refillReadBuffer()) { // Resets blen and pos + break; + } + } + } + + return len - toCopy; } public void recycle() @@ -283,7 +302,7 @@ this.in = new BufferedServletInputStream(this); } -public void refeelReadBuffer() throws IOException +public boolean refillReadBuffer() throws IOException { MsgBuffer msg = con.getMsgBuffer();
Re: cvs commit: jakarta-tomcat-4.0 RELEASE-NOTES-4.0-M5.txt
Jon Stevens [EMAIL PROTECTED] wrote: on 12/13/2000 9:48 PM, "[EMAIL PROTECTED]" [EMAIL PROTECTED] wrote: == KNOWN PROBLEMS IN THIS RELEASE: == * It is a bitch to build it from CVS unless you have an open door to Craig's mind. :-) And I would add: * Jon, one of my best friends, is a real pain in the b*** sometimes :) :) :) Pier -- Pier Fumagalli http://www.betaversion.org/ mailto:[EMAIL PROTECTED]
Re: cvs commit: jakarta-tomcat-4.0 RELEASE-NOTES-4.0-M5.txt
on 12/13/2000 10:38 PM, "Craig R. McClanahan" [EMAIL PROTECTED] wrote: Ah, but once you get it built, 'tis a thing of beauty ... :-) Agreed. I can't wait to put it into Scarab's cvs tree as a sandbox env so that development will continue on top of Tomcat 4.0. p.s. I hope that slow classloader issue is also resolved. :-) -jon
cvs commit: jakarta-tomcat/src/share/org/apache/tomcat/util JavaGeneratorTool.java
costin 00/12/13 23:10:58 Modified:src/facade22/org/apache/tomcat/facade Servlet22Interceptor.java ServletHandler.java ServletInfo.java WebXmlReader.java src/facade22/org/apache/tomcat/modules/facade22 JspInterceptor.java LoadOnStartupInterceptor.java src/share/org/apache/tomcat/core Handler.java Added: src/share/org/apache/tomcat/util JavaGeneratorTool.java Log: Major rewrite of JspInterceptor. IMHO what used to be ServletWrapper and all related classes are now in a much better shape. That should be the last big change - we should start building the first milestone for 3.3 soon. ( I want to do yet-another review of the core and remove everything that is not used or can be simplified before that ) The new code removes few optimizations ( for simplicity ) - most of them were part of the initial loading or compilation of JSPs, where the compiler is taking most of the time. There is yet another simplification we can do ( separate the ServletHandler and add a JspHanlder ), but so far ServletHandler doesn't seem too complex and handling jsps is a very small overhead ( far away from what it used to be). Revision ChangesPath 1.9 +8 -6 jakarta-tomcat/src/facade22/org/apache/tomcat/facade/Servlet22Interceptor.java Index: Servlet22Interceptor.java === RCS file: /home/cvs/jakarta-tomcat/src/facade22/org/apache/tomcat/facade/Servlet22Interceptor.java,v retrieving revision 1.8 retrieving revision 1.9 diff -u -r1.8 -r1.9 --- Servlet22Interceptor.java 2000/12/12 22:32:54 1.8 +++ Servlet22Interceptor.java 2000/12/14 07:10:56 1.9 @@ -143,15 +143,17 @@ if( ct.getHandler() == null ) { // we have a container with a valid handler name but without // a Handler. Create a ServletWrapper - ServletInfo sw=new ServletInfo(); - sw.setServletName( hN ); - sw.setContext( ct.getContext() ); + ServletHandler handler=new ServletHandler(); + handler.setServletClassName( hN ); + handler.setName( hN ); + handler.setContext( ct.getContext() ); // *.jsp - jsp is a legacy default mapping - if( ! "jsp".equals(hN) ) { + if(debug0 ! "jsp".equals(hN) ) { log( "Create handler " + hN); } - ct.setHandler(sw.getHandler()); - ct.getContext().addServlet( sw.getHandler() ); + handler.setModule( this ); + ct.setHandler(handler); + ct.getContext().addServlet( handler ); } } 1.4 +10 -9 jakarta-tomcat/src/facade22/org/apache/tomcat/facade/ServletHandler.java Index: ServletHandler.java === RCS file: /home/cvs/jakarta-tomcat/src/facade22/org/apache/tomcat/facade/ServletHandler.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- ServletHandler.java 2000/12/13 19:57:58 1.3 +++ ServletHandler.java 2000/12/14 07:10:56 1.4 @@ -107,7 +107,6 @@ private ServletInfo sw; private String servletClassName; -private String path; protected Class servletClass; protected Servlet servlet; protected Context context; @@ -155,8 +154,8 @@ servlet=null; // reset the servlet, if it was set servletClass=null; this.servletClassName=servletClassName; - if( debug0 sw.getPath()!=null) - log( "setServletClassName for " + sw.getPath() + + if( debug0 sw.getJspFile()!=null) + log( "setServletClassName for " + sw.getJspFile() + ": " + servletClassName); } @@ -362,7 +361,8 @@ protected void preInit() throws Exception { if( debug 0 ) - log( "preInit " + servlet + " " + path + " " + servletClassName); + log( "preInit " + servlet + " " + sw.getJspFile() + " " + + servletClassName); // Deal with Unavailable errors if( ! checkAvailable() ) { @@ -432,14 +432,15 @@ throws Exception { // servletjsp-file case - if( path!=null ) { - if( path.startsWith("/")) + String jspFile=sw.getJspFile(); + if( jspFile!=null ) { + if( jspFile.startsWith("/")) req.setAttribute( "javax.servlet.include.request_uri", - req.getContext().getPath() + path ); + req.getContext().getPath() + jspFile ); else req.setAttribute( "javax.servlet.include.request_uri", - req.getContext().getPath() + "/" + path ); - req.setAttribute(
SimpleMapper ClassNotFoundException
Hello, Yesterday(13th Dec 2000) I downloaded jakarta-tomcat-3.2.1.tar.gz file (GZIP compressed file - release version) from your site and installed it in Solaris server. When I was trying to start that, it was giving me an error saying SimpleMapper : ClassNotFoundException (org.apache.tomcat.request.SimpleMapper) I checked the webserver.jar file in the lib directory. There was no class file called SimpleMapper.class and I found only SimpleMapper1.class. Can you please check this and respond to my mail. Thanks in advance. Thanks, Sivakumar S.
Loading beans
Hi All Can anyone help me to resolve this When i created more contexts in server.xml and added them to uriworkers.properties, but when i use beans, i'm not able to access to be clear: i have created a contex by name tests path d:/tests subfolders d:/tests/web-inf/classes i place my bean classes in web-inf/classes and refer them in my tests/*.jsp files, but tomcat is not reading them if i place the beans in %tomcat_home%/webapps/examples/WEB-INF/classes , it works how do i tell tomcat to look at my /tests/web-inf/classes/*.class files - I tried physically setting classpath to the bean classes - but does not work Thank you in advance Venkat