20021221 Saturday December 21, 2002

Ant's jspc task - doesn't work on Tomcat 4.1.18 I'm trying to use Ant's JSPC task to pre-compile my JSPs. I've used Erik Hatcher's example from Java Development with Ant. It works great when using a 4.0.x version of Tomcat, and the following jasper.classpath:

<path id="jasper.classpath">
    <fileset dir="${tomcat.home}/lib">
        <include name="jasper-*.jar"/>
    </fileset>
    <fileset dir="${tomcat.home}/common/lib">
        <include name="servlet.jar"/>
    </fileset>
</path>

However, it doesn't work on Tomcat 4.1.17. I had to change the jasper.classpath to find the appropriate jars (they're in different directories now), plus I had to include ant.jar or I got java.lang.NoClassDefFoundError: org/apache/tools/ant/AntClassLoader. Where everything works on the older Tomcat version, now it fails - what gives?

compile-jsp:
     [jspc] Compiling 8 source filesD:\source\appfuse\build\jspc\java
  [jasperc] 2002-12-21 11:15:51 - uriRoot implicitly set to 
            "D:\Tools\tomcat-4.1.17\webapps\appfuse"
  [jasperc] error:/common/footer.jsp(0,0) null
  [jasperc] 2002-12-21 11:15:53 - ERROR-the file '\common\footer.jsp' 
            generated the following general exception: org.apache.jasper.JasperException: 
            /common/footer.jsp(0,0) null

Posted in Java at Dec 21 2002, 05:23:49 PM MST 3 Comments

Comments:

My co-author, Steve, is the one who spent the most time with <jspc> and he often fields questions about it on the ant e-mail lists. I believe it boils down to the ever changing Tomcat API's and making a <jspc> task that can accomodate them all or at least be kept up-to-date needs to be tackled by the Jasper team. Personally, I don't use <jspc> because of such headaches - although I would like to use it.

Posted by Erik Hatcher on December 22, 2002 at 01:44 AM MST #

thanks for this, fixed my problem. by the way this "call back" to ant still exists in tomcat 4.1.18

Posted by rich on December 27, 2002 at 11:23 AM MST #

I received a comment on this issue from the ant-user mailing list: <code> 1. blame me for this example, not erik :) 2. blame me for committing the jspc task to ant cvs too. If I'd known how brittle it was going to be, I never would have. 3. I havent looked at tomcat 4.18 yet. Features and stability of jasper are always an ongoing issue. Personally I'd like the jasper team to do the back end of the ant task, so they can keep it in sync. Your problem implies they are using ant itself for javac compilation, though I'll have to go into the jasper source to see. One of those 'somebody needs to sit down and spend an evening looking at jasper' problems. -steve</code>

Posted by Matt Raible on December 29, 2002 at 04:54 AM MST #

Post a Comment:
  • HTML Syntax: Allowed
Click me to subscribe
Matt Raible is a Web Architect who enjoys developing applications with open source technologies. Contact me for rates.
« December 2008
SunMonTueWedThuFriSat
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
   
       
Today

Recent Entries

Tag Cloud