Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / October 2006

Tip: Looking for answers? Try searching our database.

Precompiling JSPs using ANT in Linux

Thread view: 
swift - 09 Oct 2006 06:25 GMT
Hi,

I'm trying to precompile the JSPs in my application using the JspC
class in Jboss. Following is the ANT script that I'm using to compile
the JSPs -

<target name="webapp_precompilation">
     <echo>executing webapp_precompilation...</echo>
     <taskdef classname="org.apache.jasper.JspC" name="jasper2" >
     <classpath refid="classpath"/>
     <classpath id="jspc.classpath" >
       <pathelement location="${java.home}/lib/tools.jar"/>
       <fileset dir="${jboss.deploy.dir}/jbossweb-tomcat50.sar"
includes="*.jar"/>
     </classpath>
     <classpath id="webapp classses">
             <fileset dir="${build}" includes="*.jar"/>
     </classpath>
   </taskdef>
    <mkdir dir="${build}/WEB-INF/src"/>
    <jasper2
             compile="false"
            validateXml="false"
            package="com.apache.jsps"
            uriroot="${webresources}"
            webXmlFragment="${build}/WEB-INF/src/generated_web.xml"
            outputDir="${build}/WEB-INF/src"/>

</target>

As soon as I execute this target, I get the following warning in
Windows -

[jasper2] - Unknown element (info) in attribute

BUILD SUCCESSFUL

and the following error while executing in Linux -

BUILD FAILED
build.xml:399: The following error occurred while executing this line:
build.xml:262: java.lang.NoSuchFieldError: functions

I'm using jboss-3.2.6 and ant-1.6.2 currently. I'd appreciate any tips
on what to investigate or
how I might track this down and resolve it.
none - 09 Oct 2006 18:35 GMT
At a guess, this might be due to the jspc using different versions of a
jar than you expect it to?
Does it give you any information of the file that failed to compile?

Tim

> Hi,
>
[quoted text clipped - 42 lines]
> on what to investigate or
> how I might track this down and resolve it.
Swift - 10 Oct 2006 06:09 GMT
Thanks a lot for replying, Tim..
Yes, by using the verbose option of the jasper2 task, I'm able to get a
list of files that compile successfully and the ones which dont. I've
checked the files but there doesnt seem to be anything wrong with them.
And also, they compile successfully (but with warnings) on a Windows
System. And If I skip this precompilation of JSPs, the project works
absolutely fine. Should I consider upgrading the JBoss server version?

> At a guess, this might be due to the jspc using different versions of a
> jar than you expect it to?
[quoted text clipped - 48 lines]
> > on what to investigate or
> > how I might track this down and resolve it.


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.