Bug 27923 - JspC fails to compile with Tomcat Jasper 5.0
Summary: JspC fails to compile with Tomcat Jasper 5.0
Status: RESOLVED DUPLICATE of bug 25345
Alias: None
Product: Ant
Classification: Unclassified
Component: Optional Tasks (show other bugs)
Version: 1.6.1
Hardware: PC All
: P3 major with 1 vote (vote)
Target Milestone: ---
Assignee: Ant Notifications List
URL:
Keywords:
: 28090 28223 28439 29513 (view as bug list)
Depends on:
Blocks:
 
Reported: 2004-03-24 22:49 UTC by Rick Wong
Modified: 2008-02-22 12:18 UTC (History)
4 users (show)



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Rick Wong 2004-03-24 22:49:40 UTC
Hi,

I am using JBoss 3.2.4RC1 that now uses Tomcat 5.0 as the default.  When I
precompile JSP using the Jasper JSP compiler that comes with Tomcat 5.0
(jasper-compile.jar, jasper-runtime.jar), I receive the following error about an
unrecognized switch.

jspc:
  [jspc] Compiling 12 source files to /output
  [jasperc] error:org.apache.jasper.JasperException: Unrecognized option: -v0. 
Use -help for help.
  [jasperc]     at org.apache.jasper.JspC.setArgs(JspC.java:307)
  [jasperc]     at org.apache.jasper.JspC.main(JspC.java:231)

Apparently, Jasper 5.0 does not accept -v0 as an argument (It does support -v,
however), and JspC sets '-v0' argument by default (and no way to turn it off). 
I tried setting 'compiler' to 'jasper50' but JspC does not seem to recognize it.

I can move back to compile my JSP using Jasper41, but the compiled servlet blows
up (method-not-found-exception) when running on Tomcat 5.0.

Thanks,
--
Rick
Comment 1 Steve Loughran 2004-03-24 23:36:33 UTC
The tomcat team now ship their own <jspc> task, and changed the command line
options at the same time, which is why the Ant bundled one breaks. 

I am afraid you are going to have to move to the version of jspc that ships with
tomcat5.0. It may be inconvenient migrating, but you then get the benefit of a
task that is in sync with all the dependent binaries in tomcat, maintainers who
understand jasperc, etc, etc. 

marking as wontfix, sorry.
Comment 2 peter reilly 2004-03-31 15:15:38 UTC
*** Bug 28090 has been marked as a duplicate of this bug. ***
Comment 3 peter reilly 2004-04-06 08:11:15 UTC
*** Bug 28223 has been marked as a duplicate of this bug. ***
Comment 4 jeff 2004-04-06 12:17:05 UTC
Go ahead and close.  LiteWebserver3 compiles JSP files on the fly without 
restarting the server and requires no special setup or complex build.xml 
files.  Does not require ANT.  IT JUST WORKS!  
Comment 5 Stefan Bodewig 2004-04-06 13:29:38 UTC
I fail to see how LiteWebserver3 solves a Tomcat 5 problem.

Jasper can certainly compile JSPs on the fly, that's not the point of this task.
Sometimes you will want to know that your JSP is broken before you deploy it,
sometimes you don't want to have the original JSPs on your production server at
all.  There are several reasons for a <jspc> task.
Comment 6 jeff 2004-04-06 15:15:13 UTC
I have spent countless hours trying to get Tomcat 5.0 to compile a JSP file.  
It does not compile or even attempt to compile.  No log errors generated.  Have 
gone through all TOMCAT/ANT Documentation to get tomcat to compile JSP's with 
no luck.  Have also found that many other developers have experienced the same 
problem.  Have contacte Tomcat forum and have received no response except 
RTFM.  Been there... Done that... got the T-Shirt!  

Besides I don't appreciate the nasty responses I receive from the forum.
Comment 7 Stefan Bodewig 2004-04-06 15:22:22 UTC
Jeff, I understand your frustration, even if my experience may be different.

I haven't used Tomcat-5 myself, all I can say is that neither Tomcat-3 nor Tomcat-4
ever needed any special configuration to compile JSPs, it simply worked.  I'm
not sure what may be different for you, but then again I'm not a Tomcat expert -
this is an Ant bug report, after all.

Comment 8 jeff 2004-04-06 15:28:00 UTC
I used Tomcat 4 and had no problem.  With Tomcat 5 you have to setup a complete 
build.xml file with each step to perform (JSPC then JAVAC) using ant and 
compile manually.  I've tried the startup option to compile jsp's when Tomcat 
starts with no luck.  I was unable to compile using ANT which has the -v0 
error.  I've tried JSPC but Tomcat doesn't ship with Jspc.exe or Jspc.bat so 
that doesn't work.  I've tried everything.  I've used Tomcat for years so I'm 
sorry to change.  
Comment 9 Steve Loughran 2004-04-06 15:44:29 UTC
Well, if we really want to keep Ant's JSPC task alive, all we currently need to
do is kill the -v0 option for less verbosity. But the tomcat developers have
hinted there may be some more surprises.

In that case, we could define a new adapter for TC5.x that does the right thing,
sharing as much code as we can from the 4.2 implementation. 
Comment 10 jeff 2004-04-06 16:54:13 UTC
This sounds good.  I would like to keep the ANT request open.  I still have 
hope for it.  
Comment 11 Stephoule 2004-04-16 18:39:24 UTC
*** Bug 28439 has been marked as a duplicate of this bug. ***
Comment 12 Stefan Bodewig 2004-06-14 11:32:29 UTC
*** Bug 29513 has been marked as a duplicate of this bug. ***
Comment 13 Stefan Bodewig 2004-06-28 08:21:46 UTC
I just discovered there is an even older bugrep about this.

*** This bug has been marked as a duplicate of 25345 ***