Solved

jsp compile using ant

Posted on 2010-09-16
8
871 Views
Last Modified: 2013-11-10
I have this piece of code, which gives error as below



<jspc srcdir="${apps}/Stores.war"
      destdir="${apps2}/Stores.war"
      package="com.oracle.fast.*"
      compiler="jasper41"
      verbose="9"
      <include name="**/*.jsp" />
      <classpath refid="libs.classpath" />
</jspc>



BUILD FAILED
/opt/build/build.xml:20: Element type "jspc" must be followed by either attribute specifications, ">" or "/>".

not sure what is causing the issue
0
Comment
Question by:wasman
  • 4
  • 4
8 Comments
 
LVL 9

Expert Comment

by:ioanton
ID: 33695012
I suppose you have to close the line

 verbose="9"

with a <
0
 
LVL 9

Expert Comment

by:ioanton
ID: 33695025
sorry, the required sign is > :)
0
 

Author Comment

by:wasman
ID: 33695404
That helped  and now i get this

$ ant jsp
Buildfile: build.xml

init:
     [echo] +---------------------------------------------------------+
     [echo] +               Project Initiation                        +
     [echo] +---------------------------------------------------------+

classpth:

jsp:
     [jspc] Compiling 1830 source files to /voice/front.war/
this task doesn't support Tomcat 5.x properly, please use the Tomcat provided jspc task instead
  [jasperc] Exception in thread "main" java.lang.NoClassDefFoundError: javax/servlet/ServletContext

BUILD FAILED
/opt/build/build.xml:18: Java returned: 1

Total time: 41 seconds
$

I am using ant jsp compiler (jasper) to compile jsp's which are deployed on WebSphere 6.0 server and it's using websphere JDK 1.4.2 and i downloaded and copied to ant installed lib directory (jasper-compiler-5.5.9.jar and jasper-runtime-5.5.23.jar)
0
Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

 
LVL 9

Expert Comment

by:ioanton
ID: 33695610
Here is one thing (from Ant manual) to consider before trying to go on:

jspc (deprecated)
Deprecated if you use this task with Tomcat's Jasper JSP compiler, you should seriously consider using the task shipping with Tomcat instead. This task is only tested against Tomcat 4.x. There are known problems with Tomcat 5.x that won't get fixed in Ant, please use Tomcat's jspc task instead.
Instead of relying on container specific JSP-compilers we suggest deploying the raw files (*.jsp) and use the container build-in functions: after deploying run a test suite (e.g. with Cactus or HttpUnit) against the deployed web application. So you'll get the test result and the compiled JSPs.
0
 

Author Comment

by:wasman
ID: 33695899
i didn't got your suggestion,

you mean to say don't use ant jspc compiler ?

0
 

Author Comment

by:wasman
ID: 33696029
ok....tell me what is the Best way to pre-compile the JSP's which are deployed on my WebSphere application server 6.0, we have build-in container jsp batch compiler, but it takes lot of time and i see ant does more quicker then mine.

0
 
LVL 9

Accepted Solution

by:
ioanton earned 500 total points
ID: 33699382
As the Ant manual suggests, I would deploy the raw jsp files and then run a HttpUnit test which makes the jsp container to compile the files.
0
 

Author Closing Comment

by:wasman
ID: 33745385
no use
0

Featured Post

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Programmer's Notepad is, one of the best free text editing tools available, simply because the developers appear to have second-guessed every weird problem or issue a programmer is likely to run into. One of these problems is selecting and deletiā€¦
Jaspersoft Studio is a plugin for Eclipse that lets you create reports from a datasource.  In this article, we'll go over creating a report from a default template and setting up a datasource that connects to your database.
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.
The viewer will learn how to use and create keystrokes in Netbeans IDE 8.0 for Windows.

773 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question