You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Lukas Bradley <lu...@somnia.com> on 2004/10/15 21:22:53 UTC

JspC on Tomcat5 vs Tomcat4 - Java Source Generation

On old Tomcat 4 projects, the Manager used Ant to generate Java source 
from my JSPs, which could then be compiled directly with my other Java 
source, and all was good.  The Manager saw that it was good, and it was 
good.

In the great migration to Tomcat 5, the Ant script proclaimed:

"this task doesn't support Tomcat 5.x properly, please use the Tomcat 
provided jspc task instead"

And there was much scurrying.

The Manager defined a new task, one for Tomcat 5.x using 
org.apache.jasper.JspC, for Tomcat 5 begat Jasper2.  (Actually, it was 
earlier, but that's neither here nor there...)

The Manager was pleased that the task looked about the same, and he saw 
that it was good, and it was good.

Until he freaking tried to run it, and it didn't work.

Because it appears as if the task is attempting to generate AND compile 
from JSP to classes, which isn't what I want.  I would really like for 
my Java source to be generated, so I can compile it along-side my 
regular source later.

When trying to compile, it's looking for dependencies in my code that is 
right beside it, but uncompiled.  Maybe I'm a little off, and it needs 
those binary dependant classes for source generation, but my tingling 
geeky sense tells me otherwise.

What setting am I missing to do this?

Here is the setup:

    <target name="jsp-to-java" depends="prepare">
       <echoproperties>
       </echoproperties>
       <taskdef classname="org.apache.jasper.JspC" name="jasper2">
          <classpath id="jspc.classpath">
             <pathelement location="${java.home}/lib/tools.jar" />
             <fileset dir="${catalina.home}/bin">
                <include name="*.jar" />
             </fileset>
             <fileset dir="${catalina.home}/server/lib">
                <include name="*.jar" />
             </fileset>
             <fileset dir="${catalina.home}/common/lib">
                <include name="*.jar" />
             </fileset>
             <fileset dir="${catalina.home}/shared/lib">
                <include name="*.jar" />
             </fileset>
          </classpath>
       </taskdef>

       <jasper2 verbose="9"
          package="p2p.ui.jsp"
          validateXml="false" webxml="${build.web-inf.dir}/web.xml" 
uriroot="${build.web.dir}" webXmlFragment="${temp}/webinc.xml" 
outputDir="${build.java.source.dir}" />
    </target>

And the "You suck, I can't find your dependant classes" error:

jsp-to-java:
   [jasper2] log4j:WARN No appenders could be found for logger 
(org.apache.jasper.compiler.Compiler).
   [jasper2] log4j:WARN Please initialize the log4j system properly.
   [jasper2] Oct 15, 2004 3:07:39 PM org.apache.jasper.JspC processFile
   [jasper2] INFO: Built File: \Error.jsp
   [jasper2] Oct 15, 2004 3:07:39 PM org.apache.jasper.JspC processFile
   [jasper2] INFO: Built File: \SecurityException.jsp
BUILD FAILED: C:\dev\games\conf\build\build.xml:146: 
org.apache.jasper.JasperException: 
file:C:/dev/games/build/web/user/Login.jsp(4,0) Unable to load tag 
handler class "p2p.ui.tags.form.ErrorsTag" for tag "form:errors"

I've started compiled my classes before the JSPs, then including that in 
the JspC path, but I'm just all flustered now that my previous build 
order has been changed, and expectations are all off.  And I don't want 
to continue pouting.

Inform me, please.

Lukas






---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org