DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=21252>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=21252

JSP Compilation fails when command line args too long

           Summary: JSP Compilation fails when command line args too long
           Product: Tomcat 4
           Version: 4.1.25
          Platform: PC
        OS/Version: Windows NT/2K
            Status: NEW
          Severity: Normal
          Priority: Other
         Component: Jasper 2
        AssignedTo: [EMAIL PROTECTED]
        ReportedBy: [EMAIL PROTECTED]


When running Tomcat 4.1.24 on Windows NT/2000/XP, JSP compilation will fail for 
webapps that contains a large number of jars in "WEB-INF/lib".

The reason this happens is because the ANT javac task is being used with the 
fork option set to "true".  Windows NT/2000/XP places a 2048 character limit on 
the size of a command line.  With Tomcat installed in the default location 
("C:\Program Files\Apache Group\Tomcat 4.1") the sum of the length of the full 
path of all the libraries can quickly reach the 2048 character limit.

I'm not sure what the fix for this problem is, but a quick improvement would be 
to revert to the "no fork" option if the command line gets too long on 
Windows.  At the very least, Jasper could print a more helpful error.  As it 
stands, it fails with the very unintuitive error: "javac: invalid flag: 
C:\Program".

I spent literally 2 days trying to figure out why the combination of Batik, 
Torque, and Struts would cause JSP compilation to fail (which I thought was an 
odd side-effect).  All along I thought it was becuase each project requires you 
to use a mutually exclusive set of commons jars (which is another problem) and 
that was somehow causing weird classloader issues.  I tried virtually every 
permutation of "what if I remove this jar" to see if the problem went away.  It 
seemed totally random -- Luckily, I got to a certain point where I could remove 
any jar and fix the problem.  That's when it finally dawned on me what the 
problem is.


Below is a snippet of the error output:
------------------------------------------------------
org.apache.jasper.JasperException: Unable to compile class for JSP

An error occurred at line: -1 in the jsp file: null

Generated servlet error:
    [javac] Since fork is true, ignoring compiler setting.
    [javac] Compiling 1 source file
    [javac] Since fork is true, ignoring compiler setting.
    [javac] javac: invalid flag: C:\Program
    [javac] Usage: javac  
    [javac] where possible options include:
    [javac]   -g                        Generate all debugging info
    [javac]   -g:none                   Generate no debugging info
    [javac]   -g:{lines,vars,source}    Generate only some debugging info
    [javac]   -nowarn                   Generate no warnings
    [javac]   -verbose                  Output messages about what the compiler 
is doing
    [javac]   -deprecation              Output source locations where 
deprecated APIs are used
    [javac]   -classpath          Specify where to find user class files
    [javac]   -sourcepath         Specify where to find input source files
    [javac]   -bootclasspath      Override location of bootstrap class files
    [javac]   -extdirs            Override location of installed extensions
    [javac]   -d             Specify where to place generated class files
    [javac]   -encoding       Specify character encoding used by source files
    [javac]   -source          Provide source compatibility with specified 
release
    [javac]   -target          Generate class files for specific VM version
    [javac]   -help                     Print a synopsis of standard options




        at org.apache.jasper.compiler.DefaultErrorHandler.javacError
(DefaultErrorHandler.java:130)

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to