tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Kin-Man Chung <Kin-Man.Ch...@Eng.Sun.COM>
Subject Re: TC 4.1.3 jasper error
Date Fri, 07 Jun 2002 16:54:26 GMT
I already committed a fix for this problem a couple of days ago.

The problem is of course private instance variables are beening referenced
in a child class.  The 1.3 javac does not flag this as an error, and
1.4 javac gives misleading error messages!

> Date: Fri, 07 Jun 2002 11:32:02 -0400 (EDT)
> From: bob@jadn.com
> Subject: Re: TC 4.1.3 jasper error
> To: tomcat-dev@jakarta.apache.org
> MIME-version: 1.0
> Content-transfer-encoding: 7bit
> Delivered-to: mailing list tomcat-dev@jakarta.apache.org
> Mailing-List: contact tomcat-dev-help@jakarta.apache.org; run by ezmlm
> X-Antivirus: nagoya (v4198 created Apr 24 2002)
> X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N
> List-Post: <mailto:tomcat-dev@jakarta.apache.org>
> List-Subscribe: <mailto:tomcat-dev-subscribe@jakarta.apache.org>
> List-Unsubscribe: <mailto:tomcat-dev-unsubscribe@jakarta.apache.org>
> List-Help: <mailto:tomcat-dev-help@jakarta.apache.org>
> List-Id: "Tomcat Developers List" <tomcat-dev.jakarta.apache.org>
> 
> > 
> > My Eclipse IDE (with Sun JDK 1.3.1_03) give me the following error 
> > for Node.java
> 
> I had a hard time compiling Node.java in jasper2 until I made this
> change (which I believe doenst change the logic at all)
> 
> Index: 
jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/Node.java
> ===================================================================
> RCS file: 
/home/cvspublic/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compil
er/Node.java,v
> retrieving revision 1.9
> diff -u -r1.9 Node.java
> --- 
jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/Node.java     
 23 May 2002 21:29:38 -0000       1.9
> +++ 
jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/Node.java     
 7 Jun 2002 15:26:43 -0000
> @@ -370,13 +370,13 @@
>          * @return The text string
>          */
>         public char[] getText() {
> -           char[] ret = text;
> -           if ((ret == null) && (body != null)) {
> +           char[] ret = super.getText();
> +           if ((ret == null) && (getBody() != null)) {
>                 CharArrayWriter chars = new CharArrayWriter();
> -               int size = body.size();
> +               int size = getBody().size();
>                 for (int i=0; i<size; i++) {
> -                   chars.write(body.getNode(i).getText(), 0,
> -                               body.getNode(i).getText().length);
> +                   chars.write(getBody().getNode(i).getText(), 0,
> +                               getBody().getNode(i).getText().length);
>                 }
>                 ret = chars.toCharArray();
>             }
> 
> 
> Cheers,
> -bob
> 
> 
> > in :
> > 
> > 	/**
> > 	 * When this node was created from a JSP page in JSP syntax, its text
> > 	 * was stored as a String in the "text" field, whereas when this node
> > 	 * was created from a JSP document, its text was stored as one or more
> > 	 * TemplateText nodes in its body. This method handles either case.
> > 	 * @return The text string
> > 	 */
> > 	public char[] getText() {
> > 	    char[] ret = text;
> > 	    if ((ret == null) && (body != null)) {
> > 		CharArrayWriter chars = new CharArrayWriter();
> > 		int size = body.size();
> > 		for (int i=0; i<size; i++) {
> > 		    chars.write(body.getNode(i).getText(), 0,
> > 				body.getNode(i).getText().length);
> > 		}
> > 		ret = chars.toCharArray();
> > 	    }
> > 	    return ret;
> > 	}
> >     }
> > 
> > jakarta-tomcat-4.1.3-b1/org/apache/jasper/compiler/Node.java
> > 
> > Cannot make a static reference to the non-static field text
> > 
> > line 373 in Node.ScriptingElement.getText()
> > line 374 in Node.ScriptingElement.getText()
> > line 376 in Node.ScriptingElement.getText()
> > line 378 in Node.ScriptingElement.getText()
> > line 379 in Node.ScriptingElement.getText()
> > 
> > Did someone else get this error ?
> > 
> > 
> > -
> > Henri Gomez                 ___[_]____
> > EMAIL : hgomez@slib.fr        (. .)                     
> > PGP KEY : 697ECEDD    ...oOOo..(_)..oOOo...
> > PGP Fingerprint : 9DF8 1EA8 ED53 2F39 DC9B 904A 364F 80E6 
> > 
> > 
> > 
> > >-----Original Message-----
> > >From: Jean-Francois Nadeau [mailto:jfnadeau@irg.ca]
> > >Sent: Friday, June 07, 2002 3:41 PM
> > >To: Tomcat Developers List
> > >Subject: RE: mod_jk 4.03 deadlock
> > >
> > >
> > >Hi.
> > >
> > >I found something very interesting this morning in catalina.out file.
> > >Here it is:
> > >
> > >java.lang.IllegalStateException: Current state = FLUSHED, new state =
> > >CODING_END
> > >        at
> > >java.nio.charset.CharsetEncoder.throwIllegalStateException(Char
> > >setEncoder.java:933)
> > >        at
> > >java.nio.charset.CharsetEncoder.encode(CharsetEncoder.java:529)
> > >        at
> > >sun.nio.cs.StreamEncoder$CharsetSE.flushLeftoverChar(StreamEnco
> > >der.java:356)
> > >        at
> > >sun.nio.cs.StreamEncoder$CharsetSE.implClose(StreamEncoder.java:413)
> > >        at sun.nio.cs.StreamEncoder.close(StreamEncoder.java:158)
> > >        at 
> > >java.io.OutputStreamWriter.close(OutputStreamWriter.java:222)
> > >        at java.io.PrintWriter.close(PrintWriter.java:137)
> > >        at
> > >org.apache.catalina.connector.ResponseBase.finishResponse(Respo
> > >nseBase.java:482)
> > >        at
> > >org.apache.catalina.connector.HttpResponseBase.finishResponse(H
> > >ttpResponseBase.java:236)
> > >        at
> > >org.apache.ajp.tomcat4.Ajp13Response.finishResponse(Ajp13Respon
> > >se.java:190)
> > >        at
> > >org.apache.ajp.tomcat4.Ajp13Processor.process(Ajp13Processor.java:435)
> > >        at
> > >org.apache.ajp.tomcat4.Ajp13Processor.run(Ajp13Processor.java:495)
> > >        at java.lang.Thread.run(Thread.java:536)
> > >
> > >I looked at the AJP13 code (connectors, branch 4.02) in Tomcat 
> > >CVS and I
> > >found that there is no finally block to close socket 
> > >connections in case
> > >of failure... Because IllegalStateException is an unchecked 
> > >exception, I
> > >run out of file descriptors after a short amount of time. Also, because
> > >mod_jk doesn't get the END, Apache deadlocks without my select patch 
> > >
> > >I use JDK 1.4. It seems to be a NIO bug...
> > >
> > >Do you have any idea how to fix that?
> > >
> > >Thanks,
> > >
> > >jeff
> > >
> > >On Fri, 2002-06-07 at 04:30, GOMEZ Henri wrote:
> > >> >The real issue is why tomcat doesn't send the data. Could you try 
> > >> >with tomcat4.1 ( or the new coyote-based ajp connector ) ? Is it 
> > >> >really a deadlock ( tomcat and mod_jk both waiting for input,
> > >> >i.e. locked in read ) ? Or it is that tomcat for some reasons
> > >> >doesn't send the 'END' message ? 
> > >> 
> > >> Hum, it recall me some problems which may have been solved in post
> > >> 4.0.3 or in recent jtc (related to thread problem)
> > >>  
> > >> >Of course, there is the issue of detecting timeouts - but that's
> > >> >extremely tricky, as some requests may take a long time to process,
> > >> >and waiting 3 seconds ( or any other timeout ) is not a 
> > >good solution. 
> > >> >It is the java side who should send the END message when the
> > >> >requests ends.
> > >> 
> > >> Hum, I never liked too much the select, at least on Unix boxes
> > >> a good blocking read make OS wake up your task/thread as soon as
> > >> there is something to do.
> > >>  
> > >> >Can you try more debugging, also on the java side ? Maybe the
> > >> >etherreal AJP pluging can help :-) 
> > >> >
> > >> >BTW, even if you solved the deadlock you may run into other 
> > >problems,
> > >> >as requests longer than 3 secs will fail.
> > >> 
> > >> Yep, select is not the solution.
> > >> 
> > >> You could :
> > >> 
> > >> Keep tomcat 4.0.3 and add debugging code
> > >> Use tomcat 4.0.4b2
> > >> Or better switch to tomcat 4.1.3
> > >> 
> > >> --
> > >> To unsubscribe, e-mail:   
> > <mailto:tomcat-dev-unsubscribe@jakarta.apache.org>
> > > For additional commands, e-mail: 
<mailto:tomcat-dev-help@jakarta.apache.org>
> > > 
> > > 
> > 
> > 
> > 
> > --
> > To unsubscribe, e-mail:   <mailto:tomcat-dev-unsubscribe@jakarta.apache.org>
> > For additional commands, e-mail: <mailto:tomcat-dev-help@jakarta.apache.org>
> > 
> > 
> > --
> > To unsubscribe, e-mail:   <mailto:tomcat-dev-unsubscribe@jakarta.apache.org>
> > For additional commands, e-mail: <mailto:tomcat-dev-help@jakarta.apache.org>
> > 
> 
> Cheers,
> -bob
> 
> --
> To unsubscribe, e-mail:   <mailto:tomcat-dev-unsubscribe@jakarta.apache.org>
> For additional commands, e-mail: <mailto:tomcat-dev-help@jakarta.apache.org>
> 


--
To unsubscribe, e-mail:   <mailto:tomcat-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:tomcat-dev-help@jakarta.apache.org>


Mime
View raw message