On 7/8/21 10:47 AM, Christopher Schultz wrote:
Mark,

On 7/8/21 05:50, Mark Thomas wrote:
On 08/07/2021 04:37, Builder Lynx Demo wrote:
Hi,

I have a large java jsp and servlet web application.  Started about 20 years ago and still going strong.  It uses an ant build process. One of the ant tasks is to compile all the .jsp files.  This is done using the following task:

    <jasper validateXml="false"
            uriroot="cc"
            addWebXmlMappings="true"
webXmlFragment="CCjaspercompiler/WEB-INF/web.xml.generated"
            strictQuoteEscaping="false"
            classpath="${classpath}"
            outputDir="${jspOutput}" />

This used to work on a tomcat 7.  A while ago, we upgraded to 8.5.15 and I think at that stage, the above ant task stopped working.

When running the ant task, I get the following error:
    [jasper] Jul 07, 2021 11:22:32 PM org.apache.tomcat.util.scan.StandardJarScanner scan     [jasper] WARNING: Failed to scan [file:/home/alex/cc/lib/activation.jar;/usr/java/ant/lib/ant.jar;lib/antlr-2.7.7.jar;lib/avalon-framework-4.1.4.jar;lib/axiom-api.jar;lib/axiom-dom.jar;lib/axiom-impl.jar;lib/axis2-adb-codegen.jar;lib/axis2-adb.jar;lib/axis2-corb......BIG LONG CLASS PATH....
    [jasper] java.util.zip.ZipException: zip file name too long
    [jasper]     at java.util.zip.ZipFile.open(Native Method)
    [jasper]     at java.util.zip.ZipFile.<init>(ZipFile.java:219)
    [jasper]     at java.util.zip.ZipFile.<init>(ZipFile.java:149)
    [jasper]     at java.util.jar.JarFile.<init>(JarFile.java:166)
    [jasper]     at java.util.jar.JarFile.<init>(JarFile.java:130)
    [jasper]     at org.apache.tomcat.util.scan.JarFileUrlJar.<init>(JarFileUrlJar.java:60)     [jasper]     at org.apache.tomcat.util.scan.JarFactory.newInstance(JarFactory.java:49)     [jasper]     at org.apache.tomcat.util.scan.StandardJarScanner.process(StandardJarScanner.java:338)
    [jasper]    ...[MORE STACK TRACE]

It seems like the ant task is trying to scan the full classpath as a single "file:" specification.  Or something like that.  When I output (echo in ant) the ${classpath}, it does not include the "file:" part at the start.  However within the jasper task, that gets added to the classpath attribute on the jasper ant task.  I'm not sure if this is relevant or if there is some other underlying issue.

I realize this is maybe sort of an ant question and not tomcat, but I think the issue arose when upgrading tomcat, so I'm posting to this list as a starting point.

Any suggestions you have would be greatly appreciated.

It looks like the Windows path separator ";" is being used rather than the Linux path separator ":". Try changing those semicolons to colons.

Or, better yet, have ant compute the "classpath" value for you by building a path-like structure, like this:

     <jasper validateXml="false"
             uriroot="cc"
             addWebXmlMappings="true"
 webXmlFragment="CCjaspercompiler/WEB-INF/web.xml.generated"
             strictQuoteEscaping="false"
             outputDir="${jspOutput}">
       <classpath>
         <pathelement location="${webapp.path}/WEB-INF/classes"/>
         <fileset dir="${webapp.path}/WEB-INF/lib">
           <include name="*.jar"/>
         </fileset>
       </classpath>
    </jasper>

Then you can port it between systems and not worry about the separator.

Hi Chris, Mark,

Thank you for pointing that out.  I never would have guessed that. Updating the separator addresses that issue.  However now the jasper task throws an exception:

BUILD FAILED
/home/alex/cc/build.xml:534: The following error occurred while executing this line: /home/alex/cc/build.xml:397: The following error occurred while executing this line: /home/alex/cc/build.xml:430: The following error occurred while executing this line: /home/alex/cc/build.xml:457: The following error occurred while executing this line: /home/alex/cc/build.xml:511: java.lang.NoClassDefFoundError: javax/servlet/jsp/tagext/TagLibraryValidator
    at java.lang.ClassLoader.defineClass1(Native Method)
    at java.lang.ClassLoader.defineClass(ClassLoader.java:763)
    at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
    at java.net.URLClassLoader.defineClass(URLClassLoader.java:467)
    at java.net.URLClassLoader.access$100(URLClassLoader.java:73)
....

The class "javax/servlet/jsp/tagext/TagLibraryValidator" is in the file {$TOMCAT_HOME}/lib/jsp-api.jar I have verified that the jar is in the ant's <jasper classpath="..."> value.  For reference the full classpath variable is below.

It seems the not found class is not the "TagLibraryValidator" (I'm pretty sure that is on the classpath).  Maybe it is some other class that "TagLibraryValidator" references?  Any idea how to determine exactly which class can not be found?

Thanks
Alex.



     [echo] classpath: lib/activation.jar:/usr/java/ant/lib/ant.jar:lib/antlr.jar:lib/avalon-framework-4.1.4.jar:lib/axiom-api.jar:lib/axiom-dom.jar:lib/axiom-impl.jar:lib/axis2-adb-codegen.jar:lib/axis2-adb.jar:lib/axis2-corba.jar:lib/axis2-fastinfoset.jar:lib/axis2-java2wsdl.jar:lib/axis2-jaxbri.jar:lib/axis2-jaxws.jar:lib/axis2-json.jar:lib/axis2-kernel.jar:lib/axis2-metadata.jar:lib/axis2-mtompolicy.jar:lib/axis2-saaj.jar:lib/axis2-spring.jar:lib/axis2-transport-http.jar:lib/axis2-transport-local.jar:lib/axis2-xmlbeans.jar:lib/bcel.jar:lib/bsh.jar:/usr/java/tomcat/lib/catalina.jar:cc/WEB-INF/classes/:lib/c-jdbc-driver.jar:lib/commons-lang3.jar:lib/commons-beanutils-core.jar:lib/commons-beanutils.jar:lib/commons-beanutils-bean-collections.jar:lib/commons-codec.jar:lib/commons-collections.jar:lib/commons-compiler.jar:lib/commons-dbcp.jar:lib/commons-digester.jar:lib/commons-email.jar:lib/commons-fileupload.jar:lib/commons-httpclient.jar:lib/commons-io.jar:lib/commons-javaflow.jar:lib/commons-logging-api.jar:lib/commons-logging.jar:lib/commons-pool.jar:lib/consyntools.jar:corp/WEB-INF/classes/:lib/derby.jar:lib/derbytools.jar:lib/dnsjava.jar:lib/dom4j.jar:lib/fdsapi.jar:lib/fonts.jar:lib/gson.jar:lib/gnu-regexp-1.1.4.jar:lib/gnujaxp.jar:lib/groovy-all.jar:lib/hibernate3.jar:lib/homebuildingimages.jar:lib/hsqldb.jar:lib/httpclient.jar:lib/httpcore.jar:lib/jsoup.jar:lib/httpunit.jar:lib/ical4j.jar:lib/icu4j_2_6_1.jar:lib/itext.jar:lib/itext-pdfa.jar:lib/j2ssh-core-0.2.6.jar:lib/jakarta-bcel.jar:lib/jakarta-oro.jar:lib/jakarta-poi.jar:lib/jakarta-poi-ooxml.jar:lib/jakarta-poi-ooxml-schemas.jar:lib/jakarta-regexp-1.2.jar:lib/JAMon.jar:lib/janino.jar:{ecj}:/usr/java/tomcat/lib/el-api.jar:/usr/java/tomcat/lib/jasper.jar:/usr/java/tomcat/lib/jasper-el.jar:/usr/java/tomcat/lib/jaspic-api.jar:lib/jasperreports.jar:lib/jasperreports-fonts.jar:lib/jasperreports-javaflow.jar:lib/jaxb-api.jar:lib/jaxb-impl.jar:lib/jaxb-xjc.jar:lib/jaxen.jar:lib/jdom.jar:lib/jdt-compiler.jar:lib/jettison.jar:lib/jfreechart-common.jar:lib/jfreechart-demo.jar:lib/jfreechart.jar:lib/jibx-bind.jar:lib/jibx-run.jar:lib/jlfgr-1_0.jar:lib/jpa.jar:lib/jrobin.jar:lib/json.jar:lib/jspdoc20030306.jar:lib/junit.jar:lib/jxl.jar:lib/krysalis-barcode.jar:lib/log4j.jar:lib/mail.jar:lib/maxmindgeoip.jar:lib/mex-impl.jar:lib/mondrian.jar:lib/mpxj.jar:lib/mysql-connector-java-bin.jar:lib/pvjdbc2.jar:lib/neethi.jar:lib/packtag.jar:lib/PDFBox.jar:lib/PDFRenderer.jar:lib/png-encoder.jar:lib/proguard.jar:lib/QBXMLBeans.jar:lib/DynamicsSLXMLBeans.jar:lib/RmiJdbc.jar:lib/saaj-api.jar:/usr/java/tomcat/lib/servlet-api.jar:/usr/java/tomcat/lib/el-api.jar:/usr/java/tomcat/lib/jsp-api.jar:/usr/java/tomcat/lib/jasper.jar:/usr/java/tomcat/lib/tomcat-api.jar:lib/soapmonitor.jar:lib/tc.jar:lib/sqlite-jdbc.jar:lib/turbine-connpool.jar:lib/wsdl4j.jar:lib/xalan.jar:lib/xbean_xpath.jar:lib/xbean.jar:lib/xercesImpl.jar:lib/xml-apis.jar:lib/xml-resolver.jar:lib/xmlbeans.jar:lib/xmlParserAPIs.jar:lib/xmlpublic.jar:lib/XSS.jar:lib/TarionFormDataBeans.jar:lib/SigPlus.jar:lib/SigPlus.RXTXcomm.jar:lib/barbecue.jar:lib/batik-anim.jar:lib/batik-awt-util.jar:lib/batik-bridge.jar:lib/batik-css.jar:lib/batik-dom.jar:lib/batik-ext.jar:lib/batik-gvt.jar:lib/batik-parser.jar:lib/batik-script.jar:lib/batik-svg-dom.jar:lib/batik-svggen.jar:lib/batik-util.jar:lib/batik-xml.jar:lib/castor.jar:lib/castor-core-1.3.3.jar:lib/core.jar:lib/ecj.jar:lib/jackson-annotations.jar:lib/jackson-core.jar:lib/jackson-databind.jar:lib/olap4j.jar:lib/rhino.jar:lib/serializer.jar:lib/spring-beans.jar:lib/spring-core.jar:lib/velocity.jar:lib/xml-apis-ext.jar:lib/jtidy.jar:lib/jackcess.jar:lib/jackcess-encrypt.jar:lib/cobertura.jar:lib/bcprov-jdk15on.jar:lib/slf4j-api.jar:lib/slf4j-simple.jar:lib/logging-interceptor.jar:lib/okhttp.jar:lib/okio.jar:lib/swagger-annotations.jar:lib/swagger-core.jar:lib/threetenbp.jar:lib/aopalliance-repackaged.jar:lib/hk2-api.jar:lib/hk2-locator.jar:lib/hk2-utils.jar:lib/javassist.jar:lib/jakarta.inject.jar:lib/jersey-client.jar:lib/jersey-common.jar:lib/jersey-container-servlet.jar:lib/jersey-container-servlet-core.jar:lib/jersey-media-jaxb.jar:lib/jersey-server.jar:lib/org.osgi.core.jar:lib/osgi-resource-locator.jar:lib/zxing.jar:lib/pqScan.BarcodeReader.jar:lib/aspose-barcode-20.8-jdk17.jar:lib/BuzzBuzzXMLBeans.jar:lib/tomcat-juli.jar:/usr/java/tomcat/lib/websocket-api.jar:lib/commons-imaging.jar:lib/apache-mime4j-core.jar:lib/axis2-clustering.jar:lib/axis2-transport-base.jar:lib/axis2-transport-http.jar:lib/axis2-transport-jms.jar:lib/axis2-transport-local.jar:lib/axis2-transport-mail.jar:lib/axis2-transport-tcp.jar:lib/axis2-transport-udp.jar:lib/axis2-transport-xmpp.jar:lib/commons-cli.jar:lib/jalopy.jar:lib/jaxws-tools.jar:lib/juli.jar:lib/regexp.jar:lib/stax2-api.jar:lib/tribes.jar:lib/woden-core.jar:lib/axiom-jaxb.jar:lib/commons-logging.jar



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org

Reply via email to