tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Nicholas Cottrell <niccottr...@me.com>
Subject Problem with ClassNotFoundException: org.apache.tomcat.util.buf.UriUtil
Date Sun, 01 Oct 2017 19:30:25 GMT
Hi!

I have the following in my pom.xml

<properties>
...
  <tomcat.version>7.0.78</tomcat.version>
</properties>

<!-- Tomcat taglib dependencies, etc. -->
<dependency>
  <groupId>org.apache.tomcat</groupId>
  <artifactId>tomcat-catalina</artifactId>
  <version>${tomcat.version}</version>
</dependency>
<dependency>
  <groupId>org.apache.tomcat</groupId>
  <artifactId>tomcat-jasper</artifactId>
  <version>${tomcat.version}</version>
</dependency>
<!-- For compiling JSP etc. -->
<dependency>
  <groupId>org.apache.tomcat</groupId>
  <artifactId>tomcat-util</artifactId>
  <version>${tomcat.version}</version>
</dependency>
And my Ant build.xml has:

<taskdef classname="org.apache.jasper.JspC" name="jasper2">
  <classpath refid="classpath.common"/>
</taskdef>

However I can't compile my JSPs, since I get:

/Users/nic/git/sprawk/etc/build.xml:493: java.lang.NoClassDefFoundError: org/apache/tomcat/util/buf/UriUtil
	at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:116)
	at org.apache.tools.ant.Task.perform(Task.java:348)
	at org.apache.tools.ant.Target.execute(Target.java:435)
	at org.apache.tools.ant.Target.performTasks(Target.java:456)
	at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1393)
	at org.apache.tools.ant.Project.executeTarget(Project.java:1364)
	at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
	at org.apache.tools.ant.Project.executeTargets(Project.java:1248)
	at org.apache.tools.ant.Main.runBuild(Main.java:851)
	at org.apache.tools.ant.Main.startAnt(Main.java:235)
	at org.apache.tools.ant.Main.start(Main.java:198)
	at org.apache.tools.ant.Main.main(Main.java:286)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at com.intellij.rt.ant.execution.AntMain2.main(AntMain2.java:30)
Caused by: java.lang.NoClassDefFoundError: org/apache/tomcat/util/buf/UriUtil
	at org.apache.tomcat.util.scan.StandardJarScanner.process(StandardJarScanner.java:258)
	at org.apache.tomcat.util.scan.StandardJarScanner.scan(StandardJarScanner.java:178)
	at org.apache.jasper.compiler.TldLocationsCache.init(TldLocationsCache.java:247)
	at org.apache.jasper.compiler.TldLocationsCache.getLocation(TldLocationsCache.java:208)
	at org.apache.jasper.JspCompilationContext.getTldLocation(JspCompilationContext.java:623)
	at org.apache.jasper.compiler.Parser.parseTaglibDirective(Parser.java:418)
	at org.apache.jasper.compiler.Parser.parseDirective(Parser.java:484)
	at org.apache.jasper.compiler.Parser.parseElements(Parser.java:1421)
	at org.apache.jasper.compiler.Parser.parse(Parser.java:138)
	at org.apache.jasper.compiler.ParserController.doParse(ParserController.java:242)
	at org.apache.jasper.compiler.ParserController.parse(ParserController.java:102)
	at org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:199)
	at org.apache.jasper.compiler.Compiler.compile(Compiler.java:374)
	at org.apache.jasper.JspC.processFile(JspC.java:1260)
	at org.apache.jasper.JspC.execute(JspC.java:1411)
	at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:292)
	at sun.reflect.GeneratedMethodAccessor6.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
	... 16 more
Caused by: java.lang.ClassNotFoundException: org.apache.tomcat.util.buf.UriUtil
	at org.apache.tools.ant.AntClassLoader.findClassInComponents(AntClassLoader.java:1374)
	at org.apache.tools.ant.AntClassLoader.findClass(AntClassLoader.java:1323)
	at org.apache.tools.ant.AntClassLoader.loadClass(AntClassLoader.java:1076)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
	... 36 more

I've confirmed that the jars downloaded by maven do not include this class. Should it be there?
If not, how do I get it? I see the .java file in sources in this version of Tomcat so maybe
it's skipped in the packaging for some reason?

My build.xml worked find with Tomcat 6.x but I just can't get it working now. 

Thanks in advance,
Nic.







Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message