Solved

jsp compile using ant

Posted on 2010-09-16
8
883 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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

[Webinar] Learn How Hackers Steal Your Credentials

Do You Know How Hackers Steal Your Credentials? Join us and Skyport Systems to learn how hackers steal your credentials and why Active Directory must be secure to stop them. Thursday, July 13, 2017 10:00 A.M. PDT

Question has a verified solution.

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

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.
How to install Selenium IDE and loops for quick automated testing. Get Selenium IDE from http://seleniumhq.org Go to that link and select download selenium in the right hand column That will then direct you to their download page. From that p…
THe viewer will learn how to use NetBeans IDE 8.0 for Windows to perform CRUD operations on a MySql database.
The viewer will learn how to use and create keystrokes in Netbeans IDE 8.0 for Windows.

724 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