Re: JSP Compilation Problem: Tomcat 4.1.12
if you're using jdk 1.4, you have to have package names for your classes. If you do not, it won't load the class correctly. have you tried giving your classes a package name and trying it again? peter Sexton, George wrote: I posted this several days ago on tomcat-user and haven't gotten any responses so I am reposting it here. I am running into a problem with JSP pages under 4.1.12. I looked through the release notes, and the documentation and I can't find anything that seems to apply. Given a Servlet with the line: %@ page import=WebApp, CalServlet % where WebApp and CalServlet are classes in my application WEB-INF/classes directory that compiles under 4.0.4, when I try to run the servlet under 4.1.12, it crashes on compile with the following message: /usr/local/jakarta-tomcat-4.1.12/work/Standalone/localhost/caldev/index_jsp. java:7: '.' expected import WebApp; I turned on debugging, and the classpath looks correct: [javac] index_jsp.java added as /usr/local/jakarta-tomcat-4.1.12/work/Standalone/localhost/caldev/index_jsp. class doesn't exist. [javac] Compiling 1 source file [javac] Using modern compiler [javac] Compilation arguments: [javac] '-classpath' [javac] '/usr/java/lib/tools.jar:/usr/local/jakarta-tomcat-4.1.12/bin/bootstrap.jar: /home/gsexton/cdaily/WEB-INF/classes:/home/gsexton/cdaily/WEB-INF/lib/PNGEnc oder.jar:/home/gsexton/cdaily/WEB-INF/lib/activation.jar:/home/gsexton/cdail y/WEB-INF/lib/cryptix32.jar:/home/gsexton/cdaily/WEB-INF/lib/jdbc7.1-1.2.jar :/home/gsexton/cdaily/WEB-INF/lib/mail.jar:/usr/local/jakarta-tomcat-4.1.12/ shared/classes:/usr/local/jakarta-tomcat-4.1.12/common/classes:/usr/local/ja karta-tomcat-4.1.12/common/endorsed/xmlParserAPIs.jar:/usr/local/jakarta-tom cat-4.1.12/common/endorsed/xercesImpl.jar:/usr/local/jakarta-tomcat-4.1.12/c ommon/lib/activation.jar:/usr/local/jakarta-tomcat-4.1.12/common/lib/jasper- runtime.jar:/usr/local/jakarta-tomcat-4.1.12/common/lib/jasper-compiler.jar: /usr/local/jakarta-tomcat-4.1.12/common/lib/naming-resources.jar:/usr/local/ jakarta-tomcat-4.1.12/common/lib/commons-collections.jar:/usr/local/jakarta- tomcat-4.1.12/common/lib/naming-common.jar:/usr/local/jakarta-tomcat-4.1.12/ common/lib/commons-logging-api.jar:/usr/local/jakarta-tomcat-4.1.12/common/l ib/ant.jar:/usr/local/jakarta-tomcat-4.1.12/common/lib/mail.jar:/usr/local/j akarta-tomcat-4.1.12/common/lib/commons-dbcp.jar:/usr/local/jakarta-tomcat-4 .1.12/common/lib/servlet.jar:/usr/local/jakarta-tomcat-4.1.12/common/lib/jdb c2_0-stdext.jar:/usr/local/jakarta-tomcat-4.1.12/common/lib/commons-pool.jar :/usr/local/jakarta-tomcat-4.1.12/common/lib/jndi.jar:/usr/local/jakarta-tom cat-4.1.12/common/lib/naming-factory.jar:/usr/local/jakarta-tomcat-4.1.12/co mmon/lib/jta.jar:/usr/local/jakarta-tomcat-4.1.12/common/lib/MHS.jar:/usr/lo cal/jakarta-tomcat-4.1.12/common/lib/jdbc7.1-1.2.jar:/usr/local/jakarta-tomc at-4.1.12/common/lib/jconn2.jar' [javac] '-sourcepath' [javac] '/usr/local/jakarta-tomcat-4.1.12/work/Standalone/localhost/caldev' [javac] '-encoding' [javac] 'ISO-8859-1' [javac] '-g' [javac] [javac] The ' characters around the executable and arguments are [javac] not part of the command. [javac] File to be compiled: [javac] /usr/local/jakarta-tomcat-4.1.12/work/Standalone/localhost/caldev/index_jsp. java I tried this with Tomcat running as root and got the same result. I am using: java version 1.4.1 Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.1-b21) Java HotSpot(TM) Client VM (build 1.4.1-b21, mixed mode) On RedHat 7.2 w/ all patches applied. Any ideas on this would be appreciated. George Sexton MH Software, Inc. Home of Connect Daily Web Calendar Software http://www.mhsoftware.com/connectdaily.htm Voice: 303 438 9585 -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: JSP Compilation Problem: Tomcat 4.1.12
I'm confused by the change in behavior. I can use JDK 1.4 w/ Tomcat 4.0.4 and it works. -Original Message- From: peter lin [mailto:[EMAIL PROTECTED]] Sent: 02 October, 2002 8:56 AM To: Tomcat Developers List Subject: Re: JSP Compilation Problem: Tomcat 4.1.12 if you're using jdk 1.4, you have to have package names for your classes. If you do not, it won't load the class correctly. have you tried giving your classes a package name and trying it again? peter Sexton, George wrote: I posted this several days ago on tomcat-user and haven't gotten any responses so I am reposting it here. I am running into a problem with JSP pages under 4.1.12. I looked through the release notes, and the documentation and I can't find anything that seems to apply. Given a Servlet with the line: %@ page import=WebApp, CalServlet % where WebApp and CalServlet are classes in my application WEB-INF/classes directory that compiles under 4.0.4, when I try to run the servlet under 4.1.12, it crashes on compile with the following message: /usr/local/jakarta-tomcat-4.1.12/work/Standalone/localhost/caldev/index_jsp. java:7: '.' expected import WebApp; I turned on debugging, and the classpath looks correct: -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: JSP Compilation Problem: Tomcat 4.1.12
Never mind. I found this described in Bug #10036. -Original Message- From: Sexton, George [mailto:[EMAIL PROTECTED]] Sent: 02 October, 2002 9:03 AM To: Tomcat Developers List Subject: RE: JSP Compilation Problem: Tomcat 4.1.12 I'm confused by the change in behavior. I can use JDK 1.4 w/ Tomcat 4.0.4 and it works. -Original Message- From: peter lin [mailto:[EMAIL PROTECTED]] Sent: 02 October, 2002 8:56 AM To: Tomcat Developers List Subject: Re: JSP Compilation Problem: Tomcat 4.1.12 if you're using jdk 1.4, you have to have package names for your classes. If you do not, it won't load the class correctly. have you tried giving your classes a package name and trying it again? peter Sexton, George wrote: I posted this several days ago on tomcat-user and haven't gotten any responses so I am reposting it here. I am running into a problem with JSP pages under 4.1.12. I looked through the release notes, and the documentation and I can't find anything that seems to apply. Given a Servlet with the line: %@ page import=WebApp, CalServlet % where WebApp and CalServlet are classes in my application WEB-INF/classes directory that compiles under 4.0.4, when I try to run the servlet under 4.1.12, it crashes on compile with the following message: /usr/local/jakarta-tomcat-4.1.12/work/Standalone/localhost/caldev/index_jsp. java:7: '.' expected import WebApp; I turned on debugging, and the classpath looks correct: -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: JSP Compilation Issues (Multiple Domains)
Can we get the sync changes in the 4.1.x releases as we also have problems with this and currently maintain our own jasper code base with the sync code in it. -Original Message- From: Kin-Man Chung [mailto:[EMAIL PROTECTED]] Sent: Monday, September 30, 2002 9:47 PM To: [EMAIL PROTECTED] Subject: Re: JSP Compilation Issues (Multiple Domains) If you are using JDK javac for compiling the servlet generated by the JSP compiler, then you probably ran into the problem that the javac not being thread-safe. In Tomcat 5 the javac compilation is synchronized, so that the compilation is serialized. Guess that fix is not ported to 4.1.5. :-( I always assume that JSP pages would be deployed precompiled, and simultaneous compilation under development mode is rare. Maybe my assumption is wrong? Date: Mon, 30 Sep 2002 18:30:48 -0700 From: Joseph Kiok [EMAIL PROTECTED] Subject: JSP Compilation Issues (Multiple Domains) To: [EMAIL PROTECTED] X-MIMEOLE: Produced By Microsoft MimeOLE V6.00.2600. X-Priority: 3 X-MSMail-priority: Normal Hi All, I'm currently running multiple domains (2 specifically) on top of Apache/Tomcat. It seems that when I hit both domains at the same time (using 2 browser windows), I get a JSP compilation error most (85%) of the time. However, when I reload the page with no JSP code change, it'll compile properly. (Some of the time like 10-15%, it won't recompile until I touch the file manually) Note: It doesn't happen when I only access one domain. PROBLEM SUMMARY: When loading JSPs on multiple domains (hosts) simultaneously, a JSP compile error is generated. SYSTEM COMPONENTS: - Solaris 2.8 - JDK 1.4.0_01 - Tomcat 4.1.12 - Apache 1.3.20 SOLUTIONS TRIED (FAILED): - Configured different workers for each domains (hosts) as recommended in the tomcat mod_jk document. - Downloaded the source of tomcat and recompiled everything on our environment. Any help would be appreciated. Thanks. Best regards, Joseph Kiok -- To unsubscribe, e-mail: mailto:tomcat-dev- [EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:tomcat-dev- [EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: JSP Compilation Issues (Multiple Domains)
Another way to fix this would be to install the external compiler jikes and configure Jasper 2 to use this. I would also like to see a servlet init parameter added to jasper that can enable or disable synchronized JSP compiles. This way those who know they have a thread safe way to compile JSP's don't get hit by the synchronize. Regards, Glenn John Trollinger wrote: Can we get the sync changes in the 4.1.x releases as we also have problems with this and currently maintain our own jasper code base with the sync code in it. -Original Message- From: Kin-Man Chung [mailto:[EMAIL PROTECTED]] Sent: Monday, September 30, 2002 9:47 PM To: [EMAIL PROTECTED] Subject: Re: JSP Compilation Issues (Multiple Domains) If you are using JDK javac for compiling the servlet generated by the JSP compiler, then you probably ran into the problem that the javac not being thread-safe. In Tomcat 5 the javac compilation is synchronized, so that the compilation is serialized. Guess that fix is not ported to 4.1.5. :-( I always assume that JSP pages would be deployed precompiled, and simultaneous compilation under development mode is rare. Maybe my assumption is wrong? Date: Mon, 30 Sep 2002 18:30:48 -0700 From: Joseph Kiok [EMAIL PROTECTED] Subject: JSP Compilation Issues (Multiple Domains) To: [EMAIL PROTECTED] X-MIMEOLE: Produced By Microsoft MimeOLE V6.00.2600. X-Priority: 3 X-MSMail-priority: Normal Hi All, I'm currently running multiple domains (2 specifically) on top of Apache/Tomcat. It seems that when I hit both domains at the same time (using 2 browser windows), I get a JSP compilation error most (85%) of the time. However, when I reload the page with no JSP code change, it'll compile properly. (Some of the time like 10-15%, it won't recompile until I touch the file manually) Note: It doesn't happen when I only access one domain. PROBLEM SUMMARY: When loading JSPs on multiple domains (hosts) simultaneously, a JSP compile error is generated. SYSTEM COMPONENTS: - Solaris 2.8 - JDK 1.4.0_01 - Tomcat 4.1.12 - Apache 1.3.20 SOLUTIONS TRIED (FAILED): - Configured different workers for each domains (hosts) as recommended in the tomcat mod_jk document. - Downloaded the source of tomcat and recompiled everything on our environment. Any help would be appreciated. Thanks. Best regards, Joseph Kiok -- To unsubscribe, e-mail: mailto:tomcat-dev- [EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:tomcat-dev- [EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: JSP Compilation Issues (Multiple Domains)
+1 to the sync option -Original Message- From: Glenn Nielsen [mailto:[EMAIL PROTECTED]] Sent: Tuesday, October 01, 2002 9:45 AM To: Tomcat Developers List Subject: Re: JSP Compilation Issues (Multiple Domains) Another way to fix this would be to install the external compiler jikes and configure Jasper 2 to use this. I would also like to see a servlet init parameter added to jasper that can enable or disable synchronized JSP compiles. This way those who know they have a thread safe way to compile JSP's don't get hit by the synchronize. Regards, Glenn John Trollinger wrote: Can we get the sync changes in the 4.1.x releases as we also have problems with this and currently maintain our own jasper code base with the sync code in it. -Original Message- From: Kin-Man Chung [mailto:[EMAIL PROTECTED]] Sent: Monday, September 30, 2002 9:47 PM To: [EMAIL PROTECTED] Subject: Re: JSP Compilation Issues (Multiple Domains) If you are using JDK javac for compiling the servlet generated by the JSP compiler, then you probably ran into the problem that the javac not being thread-safe. In Tomcat 5 the javac compilation is synchronized, so that the compilation is serialized. Guess that fix is not ported to 4.1.5. :-( I always assume that JSP pages would be deployed precompiled, and simultaneous compilation under development mode is rare. Maybe my assumption is wrong? Date: Mon, 30 Sep 2002 18:30:48 -0700 From: Joseph Kiok [EMAIL PROTECTED] Subject: JSP Compilation Issues (Multiple Domains) To: [EMAIL PROTECTED] X-MIMEOLE: Produced By Microsoft MimeOLE V6.00.2600. X-Priority: 3 X-MSMail-priority: Normal Hi All, I'm currently running multiple domains (2 specifically) on top of Apache/Tomcat. It seems that when I hit both domains at the same time (using 2 browser windows), I get a JSP compilation error most (85%) of the time. However, when I reload the page with no JSP code change, it'll compile properly. (Some of the time like 10-15%, it won't recompile until I touch the file manually) Note: It doesn't happen when I only access one domain. PROBLEM SUMMARY: When loading JSPs on multiple domains (hosts) simultaneously, a JSP compile error is generated. SYSTEM COMPONENTS: - Solaris 2.8 - JDK 1.4.0_01 - Tomcat 4.1.12 - Apache 1.3.20 SOLUTIONS TRIED (FAILED): - Configured different workers for each domains (hosts) as recommended in the tomcat mod_jk document. - Downloaded the source of tomcat and recompiled everything on our environment. Any help would be appreciated. Thanks. Best regards, Joseph Kiok -- To unsubscribe, e-mail: mailto:tomcat-dev- [EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:tomcat-dev- [EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:tomcat-dev- [EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:tomcat-dev- [EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: JSP Compilation Issues (Multiple Domains)
If you are using JDK javac for compiling the servlet generated by the JSP compiler, then you probably ran into the problem that the javac not being thread-safe. In Tomcat 5 the javac compilation is synchronized, so that the compilation is serialized. Guess that fix is not ported to 4.1.5. :-( I always assume that JSP pages would be deployed precompiled, and simultaneous compilation under development mode is rare. Maybe my assumption is wrong? Date: Mon, 30 Sep 2002 18:30:48 -0700 From: Joseph Kiok [EMAIL PROTECTED] Subject: JSP Compilation Issues (Multiple Domains) To: [EMAIL PROTECTED] X-MIMEOLE: Produced By Microsoft MimeOLE V6.00.2600. X-Priority: 3 X-MSMail-priority: Normal Hi All, I'm currently running multiple domains (2 specifically) on top of Apache/Tomcat. It seems that when I hit both domains at the same time (using 2 browser windows), I get a JSP compilation error most (85%) of the time. However, when I reload the page with no JSP code change, it'll compile properly. (Some of the time like 10-15%, it won't recompile until I touch the file manually) Note: It doesn't happen when I only access one domain. PROBLEM SUMMARY: When loading JSPs on multiple domains (hosts) simultaneously, a JSP compile error is generated. SYSTEM COMPONENTS: - Solaris 2.8 - JDK 1.4.0_01 - Tomcat 4.1.12 - Apache 1.3.20 SOLUTIONS TRIED (FAILED): - Configured different workers for each domains (hosts) as recommended in the tomcat mod_jk document. - Downloaded the source of tomcat and recompiled everything on our environment. Any help would be appreciated. Thanks. Best regards, Joseph Kiok -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: Jsp compilation of nested custom tags (porting from weblogic 6 to tomcat 4.0.3)
Thanks Kin-Man. I have filed a bug on Tomcat-Jasper component (BUG# 9699). I was able to duplicate the problem using the examples\foo simple tag example by just trying to nest the tag within itself (see code below). If you have pointers on where the generate java code might be, I might be able to try to look at it. Pete Gordon foo.jsp html !-- Copyright (c) 1999-2001 The Apache Software Foundation. All rights reserved. -- body %@ taglib uri=http://jakarta.apache.org/tomcat/examples-taglib; prefix=eg% Radio stations that rock: ul eg:foo att1=98.5 att2=92.3 att3=107.7 li%= member %/li eg:foo att1=11.1 att2=22.2 att3=33.3 This is the some more members. /eg:foo /eg:foo /ul eg:log Did you see me on the stderr window? /eg:log eg:log toBrowser=true Did you see me on the browser window as well? /eg:log /body /html -Original Message- From: Kin-Man Chung [mailto:[EMAIL PROTECTED]] Sent: Thursday, June 06, 2002 8:40 PM To: [EMAIL PROTECTED] Subject: Re: Jsp compilation of nested custom tags (porting from weblogic 6 to tomcat 4.0.3) I assume that lOffset is a scripting variable defined either in a variable element of a tld, or in a TagExtraInfo, and that its declaration (in the generated java file) is a result of the compiler trying to do its synchronization with the pagecontext attribute of the same name. If so, what is the scope of this variable? Is it NESTED or AT_BEGIN? I can see how the current Jasper implementation can be problematic, There are two problems here. First, if the scope is AT_BEGIN, then the scope of the variable should remain defined until the end of the page, and the current implementation actually make it unavailable after the end of the tag, which is wrong. Second, if the tags are nested, as is your case here, then redclaring it in the nested block would be illegal Java. Can you file a bug report in bugzilla for this? It would help if you can also include a small test case, so that fixes can be verified. Thanks. Date: Thu, 06 Jun 2002 18:54:11 -0400 From: Pete Gordon [EMAIL PROTECTED] Subject: Re: Jsp compilation of nested custom tags (porting from weblogic 6 to tomcat 4.0.3) To: Tag Libraries Developers List [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] MIME-version: 1.0 (Apple Message framework v481) Delivered-to: mailing list [EMAIL PROTECTED] Mailing-List: contact [EMAIL PROTECTED]; 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:[EMAIL PROTECTED] List-Subscribe: mailto:[EMAIL PROTECTED] List-Unsubscribe: mailto:[EMAIL PROTECTED] List-Help: mailto:[EMAIL PROTECTED] List-Id: Tomcat Developers List tomcat-dev.jakarta.apache.org Thanks, Shawn. Let me summarize for the tomcat-dev list. I have an existing application with custom tags that runs on weblogic 6, when porting it over to Tomcat I now am running into an error where the generated java from a jsp with self nested tags will not compile, the code generated from jspc simulates the HelloWorld sample below, which is not valid java code--it would be valid in C, but that's another story. The first htmlGlobalAttribSearch$jsp.java compile error is line 198, variable lOffset is already defined. There are several (19) more errors like this that are also outputed from trying to compile the $jsp.java file that I have attached. public class HelloWorld{ public static void main(String args[]){ do{ int i = 5; do{ int i=10; }while(false); }while(false); } } Tomorrow, I will try to create a minimal nested tag example and see if I can duplicate the problem. Unless someone is aware of this problem already, and can save me the effort. Thanks, Pete Gordon On Thursday, June 6, 2002, at 03:03 PM, Shawn Bayern wrote: Hi Pete, If this is a Tomcat bug, it would be better to mail tomcat-dev about it or to submit a Tomcat bug report in Apache's Bugzilla (http://nagoya.apache.org/bugzilla). I'd be happy to take a look at it myself, but it's difficult to identify the problem in a large compiled servlet. (I can't attempt to compile it myself since it depends on some custom classes not included.) If you could post the compilation error, that'd definitely help us determine whether it looks like a Tomcat bug or not. From: Pete Gordon [EMAIL PROTECTED] Date: Thu Jun 06, 2002 02:32:06 PM US/Eastern To: 'Tag Libraries Developers List' [EMAIL PROTECTED] Subject: Jsp compilation of nested custom tags (porting from weblogic 6 to tomcat 4.0.3) Reply-To: Tag Libraries Developers List taglibs- [EMAIL PROTECTED] There is a problem with compiling the genenerated java code (htmlGlobalAttribSearch$jsp.java) it tells me that variables have already been defined. I have
Re: Jsp compilation of nested custom tags (porting from weblogic 6 totomcat 4.0.3)
I assume that lOffset is a scripting variable defined either in a variable element of a tld, or in a TagExtraInfo, and that its declaration (in the generated java file) is a result of the compiler trying to do its synchronization with the pagecontext attribute of the same name. If so, what is the scope of this variable? Is it NESTED or AT_BEGIN? I can see how the current Jasper implementation can be problematic, There are two problems here. First, if the scope is AT_BEGIN, then the scope of the variable should remain defined until the end of the page, and the current implementation actually make it unavailable after the end of the tag, which is wrong. Second, if the tags are nested, as is your case here, then redclaring it in the nested block would be illegal Java. Can you file a bug report in bugzilla for this? It would help if you can also include a small test case, so that fixes can be verified. Thanks. Date: Thu, 06 Jun 2002 18:54:11 -0400 From: Pete Gordon [EMAIL PROTECTED] Subject: Re: Jsp compilation of nested custom tags (porting from weblogic 6 to tomcat 4.0.3) To: Tag Libraries Developers List [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] MIME-version: 1.0 (Apple Message framework v481) Delivered-to: mailing list [EMAIL PROTECTED] Mailing-List: contact [EMAIL PROTECTED]; 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:[EMAIL PROTECTED] List-Subscribe: mailto:[EMAIL PROTECTED] List-Unsubscribe: mailto:[EMAIL PROTECTED] List-Help: mailto:[EMAIL PROTECTED] List-Id: Tomcat Developers List tomcat-dev.jakarta.apache.org Thanks, Shawn. Let me summarize for the tomcat-dev list. I have an existing application with custom tags that runs on weblogic 6, when porting it over to Tomcat I now am running into an error where the generated java from a jsp with self nested tags will not compile, the code generated from jspc simulates the HelloWorld sample below, which is not valid java code--it would be valid in C, but that's another story. The first htmlGlobalAttribSearch$jsp.java compile error is line 198, variable lOffset is already defined. There are several (19) more errors like this that are also outputed from trying to compile the $jsp.java file that I have attached. public class HelloWorld{ public static void main(String args[]){ do{ int i = 5; do{ int i=10; }while(false); }while(false); } } Tomorrow, I will try to create a minimal nested tag example and see if I can duplicate the problem. Unless someone is aware of this problem already, and can save me the effort. Thanks, Pete Gordon On Thursday, June 6, 2002, at 03:03 PM, Shawn Bayern wrote: Hi Pete, If this is a Tomcat bug, it would be better to mail tomcat-dev about it or to submit a Tomcat bug report in Apache's Bugzilla (http://nagoya.apache.org/bugzilla). I'd be happy to take a look at it myself, but it's difficult to identify the problem in a large compiled servlet. (I can't attempt to compile it myself since it depends on some custom classes not included.) If you could post the compilation error, that'd definitely help us determine whether it looks like a Tomcat bug or not. From: Pete Gordon [EMAIL PROTECTED] Date: Thu Jun 06, 2002 02:32:06 PM US/Eastern To: 'Tag Libraries Developers List' [EMAIL PROTECTED] Subject: Jsp compilation of nested custom tags (porting from weblogic 6 to tomcat 4.0.3) Reply-To: Tag Libraries Developers List taglibs- [EMAIL PROTECTED] There is a problem with compiling the genenerated java code (htmlGlobalAttribSearch$jsp.java) it tells me that variables have already been defined. I have compiled the source file and even created a test HelloWorld.java to test it. It is correct variables have already been defined, which we found strange as far as the scope variables were accessible, see the code below public class HelloWorld{ public static void main(String args[]){ do{ int i = 5; do{ int i=10; }while(false); }while(false); } } The JSP page has several nested custom tags (the same tags) and this is working on weblogic 6. But the generated java file from tomcat/jasper does not compile. The problem is the fci:collection tag being nested a few times within itself. See the JSP below. I think this is a problem with the jspc generated java code. Am I way off base? Thanks, Pete Gordon %@ taglib uri=fciTagLib.tld prefix = fci % %@ page import=com.fci.arch.service.*% form action=fci:get resource=site/ method=GET id=form1 name=form1 input type=hidden name=action value=catalogActions.globalParametric
Re: JSP Compilation
on 4/12/01 3:46 AM, "Luise Massimo" IMCEAEX-_O=COMPUTER+20CENTER+20ORG_OU=COMPUTER+20CENTER+20SITE_CN=RECIPIENT [EMAIL PROTECTED] wrote: Hi all, i have a simple question for which i haven't found an answare by myself: why for the same JSP page tomcat generate a new java/class file in work dir for every modification ? http://jakarta.apache.org/velocity/ymtd/ymtd-generation.html -jon -- If you come from a Perl or PHP background, JSP is a way to take your pain to new levels. --Anonymous http://jakarta.apache.org/velocity/ymtd/ymtd.html
Re: JSP Compilation
On Thu, 12 Apr 2001, Luise Massimo wrote: Hi all, i have a simple question for which i haven't found an answare by myself: why for the same JSP page tomcat generate a new java/class file in work dir for every modification ? Reloading issues. "Normal" reloading ( that is used for regular servlets ) is implemented by replacing the ClassLoader ( after you load a class with a class loader, you just can't load a newer version ). This creates a number of problems - all other servlets and classes must be reloaded, session objects and attributes must also be reloaded ( class loaders define separate namespaces, objects loaded with sibling loaders can't communicate ). Jasper ( and any other system that generates servlets ) has another option - to generate a new class name and use the old loader. Given that JSPs are typically modified many times this saves a lot of overhead. This is not an absolute requirement - it's easy to change jasper to use the "servlet" reloading mechanism ( unfortunately you can't use versioning on regular servlets - since the class name is fixed ). Costin
Re: JSP Compilation
[EMAIL PROTECTED] wrote: On Thu, 12 Apr 2001, Luise Massimo wrote: Hi all, i have a simple question for which i haven't found an answare by myself: why for the same JSP page tomcat generate a new java/class file in work dir for every modification ? Reloading issues. "Normal" reloading ( that is used for regular servlets ) is implemented by replacing the ClassLoader ( after you load a class with a class loader, you just can't load a newer version ). This creates a number of problems - all other servlets and classes must be reloaded, session objects and attributes must also be reloaded ( class loaders define separate namespaces, objects loaded with sibling loaders can't communicate ). Jasper ( and any other system that generates servlets ) has another option - to generate a new class name and use the old loader. Given that JSPs are typically modified many times this saves a lot of overhead. This is not an absolute requirement - it's easy to change jasper to use the "servlet" reloading mechanism ( unfortunately you can't use versioning on regular servlets - since the class name is fixed ). Costin Reloading is not an issue in the Tomcat 4 version of Jasper. It no longer uses the .java/.class versioning system because it uses a URLClassLoader for each JSP page compiled into a servlet. That way if the page is recompiled the URLClassLoader for the JSP page itself can be dumped without affecting the rest of the Context. Regards, Glenn -- Glenn Nielsen [EMAIL PROTECTED] | /* Spelin donut madder| MOREnet System Programming | * if iz ina coment. | Missouri Research and Education Network | */ | --
Re: JSP Compilation
on 4/12/01 12:01 PM, "Glenn Nielsen" [EMAIL PROTECTED] wrote: Reloading is not an issue in the Tomcat 4 version of Jasper. It no longer uses the .java/.class versioning system because it uses a URLClassLoader for each JSP page compiled into a servlet. That way if the page is recompiled the URLClassLoader for the JSP page itself can be dumped without affecting the rest of the Context. Regards, Glenn YES! -jon
Re: JSP Compilation
On Thu, 12 Apr 2001, Glenn Nielsen wrote: Reloading is not an issue in the Tomcat 4 version of Jasper. It no longer uses the .java/.class versioning system because it uses a URLClassLoader for each JSP page compiled into a servlet. That way if the page is recompiled the URLClassLoader for the JSP page itself can be dumped without affecting the rest of the Context. It is a very good solution, I remember it was used ( long ago ) for servlets as well ( before tomcat ). ( messing with class loaders is something I try to avoid, that's why I prefer explicit versioning - but this should work in most cases as JSPs don't call each other directly and are not called directly from other components ). That's the whole point of refactoring jasper and separating the components - allow multiple schemes to coexist and be easily configured. So far there are 4 reloading mechansims jasper could use: - no name versioning, use the normal servlet reloading - no name versioning, one class loader per jsp - name versioning using a single .class file ( and special class loader) - name versioning and normal (URL)ClassLoader. There are also 3-4 name "mangling" schemes, etc. Flexibility and choice are good. Costin
Re: JSP Compilation
Jon Stevens wrote: on 4/12/01 12:01 PM, "Glenn Nielsen" [EMAIL PROTECTED] wrote: Reloading is not an issue in the Tomcat 4 version of Jasper. It no longer uses the .java/.class versioning system because it uses a URLClassLoader for each JSP page compiled into a servlet. That way if the page is recompiled the URLClassLoader for the JSP page itself can be dumped without affecting the rest of the Context. Regards, Glenn YES! -jon Are you feeling ok jon? Your resounding "YES!" above could be interpreted as support for JSP. ;-) Regards, Glenn -- Glenn Nielsen [EMAIL PROTECTED] | /* Spelin donut madder| MOREnet System Programming | * if iz ina coment. | Missouri Research and Education Network | */ | --
Re: JSP Compilation
on 4/12/01 1:25 PM, "Glenn Nielsen" [EMAIL PROTECTED] wrote: Are you feeling ok jon? Your resounding "YES!" above could be interpreted as support for JSP. ;-) Yea, I just feel bad for all the poor lusers out there that have to use JSP because Sun or someone else pushed it down their CTO's throat. :-) Here is my favorite quote today: On the Velocity list: I must say, Velocity has it ALL over JSP. I've converted several large, gnarly JSPs so far, and the Velocity code is so much cleaner and easy to follow. With a good "pull" context and Velocity macros, taglibs are passe IMO. :-) HTH. -scott :-) -jon