Precompiling JSPs using ANT in Linux

S

swift

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.
 
N

none

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
 
S

Swift

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?
Does it give you any information of the file that failed to compile?

Tim
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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,015
Latest member
AmbrosePal

Latest Threads

Top