Do you have all your tomcat libs in your classpath? You must have these 3 ind your path: - ${tomcat.home}/bin - ${tomcat.home}/server/lib - ${tomcat.home}/common/lib I send you my buildfile this works fine!
<!-- do the precompilation --> <target name="jspc" depends="get-properties-stage" > <mkdir dir="${webapproot}/src"/> <!-- define the jasper task --> <taskdef classname="org.apache.jasper.JspC" name="jasper2" > <classpath id="jspc.classpath"> <pathelement location="${java.home}/../lib/tools.jar"/> <fileset dir="${tomcat.home}/bin"> <include name="*.jar"/> </fileset> <fileset dir="${tomcat.home}/server/lib"> <include name="*.jar"/> </fileset> <fileset dir="${tomcat.home}/common/lib"> <include name="*.jar"/> </fileset> <fileset dir="${webapproot}${webappname}/WEB-INF/lib"> <include name="*.jar"/> </fileset> </classpath> </taskdef> <!-- execute jasper, creates the servlet source files --> <jasper2 validateXml="false" uriroot="${webapproot}${webappname}" webXmlFragment="${webapproot}${webappname}/WEB-INF/generated_web.xml" outputDir="${webapproot}/src" /> <!-- compile the source files --> <javac destdir="${webapproot}${webappname}/WEB-INF/classes" optimize="off" debug="true" debuglevel="lines,vars,source" failonerror="false" srcdir="${webapproot}/src" excludes="**/*.smap"> <classpath> <pathelement location="${webapproot}${webappname}/WEB-INF/classes"/> <pathelement location="${tomcat.home}/common/classes"/> <pathelement location="${tomcat.home}/shared/classes"/> <fileset dir="${tomcat.home}/common/lib"> <include name="*.jar"/> </fileset> <fileset dir="${tomcat.home}/shared/lib"> <include name="*.jar"/> </fileset> <fileset dir="${tomcat.home}/bin"> <include name="*.jar"/> </fileset> <fileset dir="${webapproot}${webappname}/WEB-INF/lib"> <include name="*.jar"/> </fileset> </classpath> <include name="**" /> <exclude name="tags/**" /> </javac> <!-- Load your precompiled snippet into a property --> <loadfile property="precompiled" srcFile="${webapproot}${webappname}/WEB-INF/generated_web.xml" encoding="ISO-8859-1"/> <!-- Now replace the web.xml with a predifined snippet --> <replace file="${webapproot}${webappname}/WEB-INF/web.xml" value="${precompiled}"> <replacetoken><![CDATA[<!-- precompile include -->]]></replacetoken> </replace> </target> > -----Ursprüngliche Nachricht----- > Von: Linseisen Herbert [mailto:[EMAIL PROTECTED] > Gesendet: Freitag, 16. Dezember 2005 10:59 > An: users@tomcat.apache.org > Betreff: WG: Noclassdeffound when using jspc ant task > > > > All I get when i try to run the jspc task of tomcat is --- in any > combination tomcat 4 to 5.5 -- what am i doing wrong? > > I just took the example build file of the tomcat documentation and > added my pathnames > > > Apache Ant version 1.6.2 compiled on July 16 2004 > Buildfile: jspc2.ant > Detected Java version: 1.4 in: C:\jdk1.4.2\jre > Detected OS: Windows 2003 > parsing buildfile C:\apache\Tomcat\bin\jspc2.ant with URI = > file:///C:/apache/Tomcat/bin/jspc2.ant > Project base dir set to: C:\apache\Tomcat\bin > Build sequence for target `all' is [jspc, compile, all] > Complete build sequence is [jspc, compile, all, ] > > jspc: > [jasper2] Error in class org.apache.jasper.JspC > > C:\apache\Tomcat\bin\jspc2.ant:24: java.lang.NoClassDefFoundError: > javax/servlet/jsp/JspFactory > at > org.apache.tools.ant.TaskAdapter.execute(TaskAdapter.java:131) > at > org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:275) > at org.apache.tools.ant.Task.perform(Task.java:364) > at org.apache.tools.ant.Target.execute(Target.java:341) > at org.apache.tools.ant.Target.performTasks(Target.java:369) > at > org.apache.tools.ant.Project.executeTarget(Project.java:1214) > at > org.apache.tools.ant.Project.executeTargets(Project.java:1062) > at org.apache.tools.ant.Main.runBuild(Main.java:673) > at org.apache.tools.ant.Main.startAnt(Main.java:188) > at org.apache.tools.ant.launch.Launcher.run(Launcher.java:196) > at org.apache.tools.ant.launch.Launcher.main(Launcher.java:55) > Caused by: java.lang.NoClassDefFoundError: > javax/servlet/jsp/JspFactory > at org.apache.jasper.JspC.initServletContext(JspC.java:1005) > at org.apache.jasper.JspC.execute(JspC.java:870) > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > at > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccess > orImpl.jav > a:39) > at > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMeth > odAccessor > Impl.java:25) > at java.lang.reflect.Method.invoke(Method.java:324) > at > org.apache.tools.ant.TaskAdapter.execute(TaskAdapter.java:123) > ... 10 more > --- Nested Exception --- > java.lang.NoClassDefFoundError: javax/servlet/jsp/JspFactory > at org.apache.jasper.JspC.initServletContext(JspC.java:1005) > at org.apache.jasper.JspC.execute(JspC.java:870) > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > at > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccess > orImpl.jav > a:39) > at > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMeth > odAccessor > Impl.java:25) > at java.lang.reflect.Method.invoke(Method.java:324) > at > org.apache.tools.ant.TaskAdapter.execute(TaskAdapter.java:123) > at > org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:275) > at org.apache.tools.ant.Task.perform(Task.java:364) > at org.apache.tools.ant.Target.execute(Target.java:341) > at org.apache.tools.ant.Target.performTasks(Target.java:369) > at > org.apache.tools.ant.Project.executeTarget(Project.java:1214) > at > org.apache.tools.ant.Project.executeTargets(Project.java:1062) > at org.apache.tools.ant.Main.runBuild(Main.java:673) > at org.apache.tools.ant.Main.startAnt(Main.java:188) > at org.apache.tools.ant.launch.Launcher.run(Launcher.java:196) > at org.apache.tools.ant.launch.Launcher.main(Launcher.java:55) > --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]