-
1. Re: Unable to pre-compile JSP using ANT task with JBoss 4.2.
erasmomarciano Apr 24, 2008 3:30 AM (in response to depryf)I think that should be a problem of classpth
I not see in your classpath the jar for parser the xml
example xerces -
2. Re: Unable to pre-compile JSP using ANT task with JBoss 4.2.
erasmomarciano Apr 24, 2008 3:37 AM (in response to depryf)try adding in your classpath
the following jar
xercesImpl.jar
xalan.jar
serializer.jar
you can find in this path
jboss-XXXXlib/endorsed -
3. Re: Unable to pre-compile JSP using ANT task with JBoss 4.2.
depryf Apr 24, 2008 10:22 AM (in response to depryf)That was a pretty good suggestion; I did add those jars but the result was the same. I actually solved my problem; it turned out that our TLD files had <DOCTYPE...> headers in them; and the XML parser didn't like that at all.
I removed the <DOCTYPE...> line and the task executed successfully (note that some of the TLD files had schema information instead of a DOCTYPE, but that seems to fine...
For anybody having the same problem, here is my final pre-compiling task:<path id="cp.jasper2"> <pathelement location="${java.home}/../lib/tools.jar" /> <pathelement location="${deploy.dir}/jboss-web.deployer/jbossweb.jar" /> <pathelement location="${deploy.dir}/../../../lib/jboss-common.jar" /> <pathelement location="${deploy.dir}/../../../lib/commons-logging.jar" /> <pathelement location="${lib.dir}/eclipse/javaee.jar" /> <pathelement location="${deploy.dir}/../../../lib/endorsed/xercesImpl.jar" /> <pathelement location="${deploy.dir}/../../../lib/endorsed/xalan.jar" /> <pathelement location="${deploy.dir}/../../../lib/endorsed/serializer.jar" /> <fileset dir="${lib.dir}/web" /> <pathelement path="${registry.build.dir}/classes" /> <path refid="cp.lib"/> </path>
<target name="jspc" description="Pre-compile are JSP files." depends="copy-metadata, compile" if="jsp.precompile"> <echo message="Compiling JSPs..." /> <taskdef classname="org.apache.jasper.JspC" name="jasper2" classpathref="cp.jasper2" /> <!-- this will generate the java files for each JSP file --> <jasper2 compile="false" validateXml="false" uriroot="${build.war.files.dir}" webXmlFragment="${registry.build.dir}/generated_web.xml" package="${package.web}" outputDir="${registry.build.dir}/jsp-src" /> <!-- compile the java files generated in the previous step --> <javac srcdir="${registry.build.dir}/jsp-src" destdir="${registry.build.dir}/classes" listfiles="${compile.listfiles}" failonerror="${compile.failonerror}" debug="${compile.debug}" debuglevel="${compile.debuglevel}" optimize="${compile.optimize}" deprecation="${compile.deprecation}" classpathref="cp.jasper2" /> </target>
Thanks for the help! -
4. Re: Unable to pre-compile JSP using ANT task with JBoss 4.2.
erasmomarciano Apr 28, 2008 10:01 AM (in response to depryf)Try to removed
<!DOCTYPE taglib PUBLIC "-//Sun Microsystems, Inc.//DTD JSP Tag Library 1.1//EN" "http://java.sun.com/j2ee/dtds/web-jsptaglibrary_1_1.dtd">
This string code it just needs for to validation XML -
5. Re: Unable to pre-compile JSP using ANT task with JBoss 4.2.
ronanker Jul 4, 2008 8:19 AM (in response to depryf)Hi all,
We got the same problem. With JBoss 4.0.2, precompiling JSP is working fine but not with JBoss 4.2.1.
The ant task failed with the "Unable to initialize TldLocationsCache" message.
Removing all the doctype is working but is not an option: We have several TLD files provided by several jars. We don't want to update manually those jars.
There must be a right way to make precompilation successful without editing the TLD files. No ?
Is this the awaited behavior of the JSP compiler or is it a bug ?
Thanks for any help.