Solved

jsp compile using ant

Posted on 2010-09-16
8
853 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
Comment Utility
I suppose you have to close the line

 verbose="9"

with a <
0
 
LVL 9

Expert Comment

by:ioanton
Comment Utility
sorry, the required sign is > :)
0
 

Author Comment

by:wasman
Comment Utility
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
 
LVL 9

Expert Comment

by:ioanton
Comment Utility
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
What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

 

Author Comment

by:wasman
Comment Utility
i didn't got your suggestion,

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

0
 

Author Comment

by:wasman
Comment Utility
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
Comment Utility
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
Comment Utility
no use
0

Featured Post

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

Update (December 2011): Since this article was published, the things have changed for good for Android native developers. The Sequoyah Project (http://www.eclipse.org/sequoyah/) automates most of the tasks discussed in this article. You can even fin…
Here is a helpful source code for C++ Builder programmers that allows you to manage and manipulate HTML content from C++ code, while also handling HTML events like onclick, onmouseover, ... Some objects defined and used in this source include: …
The viewer will learn how to use NetBeans IDE 8.0 for Windows to connect to a MySQL database. Open Services Panel: Create a new connection using New Connection Wizard: Create a test database called eetutorial: Create a new test tabel called ee…
The viewer will learn how to use and create keystrokes in Netbeans IDE 8.0 for Windows.

772 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now