[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 898
  • Last Modified:

jsp compile using ant

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
wasman
Asked:
wasman
  • 4
  • 4
1 Solution
 
ioantonCommented:
I suppose you have to close the line

 verbose="9"

with a <
0
 
ioantonCommented:
sorry, the required sign is > :)
0
 
wasmanAuthor Commented:
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
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
ioantonCommented:
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
 
wasmanAuthor Commented:
i didn't got your suggestion,

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

0
 
wasmanAuthor Commented:
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
 
ioantonCommented:
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
 
wasmanAuthor Commented:
no use
0

Featured Post

Industry Leaders: 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!

  • 4
  • 4
Tackle projects and never again get stuck behind a technical roadblock.
Join Now