You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by Matt Koss <m....@open.ac.uk> on 2002/06/27 15:03:55 UTC

JspcC task classpath problem

I get the following message when running jspc task :

[jspc] Compiling 28 source files 
/home/mk666/src/Artemis/ClockworkTool/tools/work/Standalone/localhost/ClockworkTool

[java] Exception in thread "main" java.lang.NoClassDefFoundError: 
		org/apache/jasper/JspC


my ant lib directory does contains jasper-compiler.jar, jasper-runtime.jar and 
optional.jar, so I don't know what's wrong.

I have looked at the process list and there are all these jar files in the 
classpath.

Running Ant 1.5 Beta3 on Linux with Tomcat 4.0.4 libs ( jasper ).


Cheers

Matt

-- 
Matt Koss
Knowledge Media Institute
Open University
e-mail: m.koss@open.ac.uk

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: JspcC task classpath problem

Posted by Steve Loughran <st...@iseran.com>.
what does an ant -verbose run look like?


----- Original Message -----
From: "Matt Koss" <m....@open.ac.uk>
To: <an...@jakarta.apache.org>
Sent: Thursday, June 27, 2002 6:03 AM
Subject: JspcC task classpath problem



I get the following message when running jspc task :

[jspc] Compiling 28 source files
/home/mk666/src/Artemis/ClockworkTool/tools/work/Standalone/localhost/Clockw
orkTool

[java] Exception in thread "main" java.lang.NoClassDefFoundError:
org/apache/jasper/JspC


my ant lib directory does contains jasper-compiler.jar, jasper-runtime.jar
and
optional.jar, so I don't know what's wrong.

I have looked at the process list and there are all these jar files in the
classpath.

Running Ant 1.5 Beta3 on Linux with Tomcat 4.0.4 libs ( jasper ).


Cheers

Matt

--
Matt Koss
Knowledge Media Institute
Open University
e-mail: m.koss@open.ac.uk

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>




--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: JspcC task classpath problem

Posted by Matt Koss <m....@open.ac.uk>.
I got it working.
There must have been a problem with how I set the classpath.

First I managed to get working this :

<java classname="org.apache.jasper.JspC" 
classpath="${basedir}/tools/common/lib/servlet.jar;${basedir}/tools/lib/jasper-runtime.jar;${basedir}/tools/lib/jasper-compiler.jar" 
fork="true" dir="${deploy.home}">
      <arg line="-d ${workdir} -webapp web"/>
 </java>

And then I tried a similar thing with jspc :

<jspc srcdir="${deploy.home}/web" destdir="${work.dir}" 
classpath="${toollib.dir}/jasper-runtime.jar;${toollib.dir}/jasper-compiler.jar;${servletlib.dir}/servlet.jar">
      <include name="**/*.jsp"/>
</jspc>

which also works fine.


I have noticed that jspc has a nested webapp tag, but I didn't get it working. 
E.g. I cannot specify it alone, I have to keep "include" tag as well, which 
is somehow strange.

Another problem is with using javac to compile generated *.java files :

<javac srcdir="${work.dir}" destdir="${work.dir}" 
classpath="${basedir}/classes:${toollib.dir}/Apollo.jar:${toollib.dir}/jdom.jar:${toollib.dir}/jspsmartupload.jar:${toollib.dir}/ant.jar:${toollib.dir}/velocity.jar:${toollib.dir}/commons-collections.jar:${servletlib.dir}/servlet.jar" 
debug="on" />

It looks like tomcat ignores the compiled files, i.e. it doesn't load them 
faster.
Seems like tomcat somehow recompiles them again, and for some reason it 
creates more *.class files then when I compiled them with javac.
Anybody knows what does it mean ?


Thanks for the help

Cheers

Matt



 

On Thursday 27 June 2002 6:13 pm, Dave Gibbs wrote:
> I had to pile absolutely everything in to the jspc classpath attribute as
> follows, that got me past the NoClassDefFoundError. Crank the verbosity of
> Ant up (-verbose) and you will see the command that the task tries to
> execute.
>
> I'll try using the -webapp form as you have done.
>
> 	<jspc srcdir="../${site}"
> 	      destdir="${build}/generated"
> 	      package="com.***.***.jsp"
>
> classpath="../../lib/servlet.jar;../../lib/ant.jar;../../lib/jasper-compile
>r
> .jar;../../lib/jasper-runtime.jar;../../lib/xmlParserAPIs.jar;../../lib/xer
>c esImpl.jar;${base.classpath}"
> 	      uriroot="${site}"
> 	      verbose="9">
> 	  <include name="**/*.jsp" />
> 	</jspc>
>
> Dave
>
> -----Original Message-----
> From: Matt Koss [mailto:m.koss@open.ac.uk]
> Sent: 27 June 2002 17:26
> To: Ant Users List
> Subject: Re: JspcC task classpath problem
>
>
>
> Hello,
>
> I am running JDK 1.4.0 so xerces is already there.
> I can run jspc from the command line as e.g. :
>
> java -cp
> "../lib/jasper-runtime.jar:../lib/jasper-compiler.jar:../lib/servlet.jar"
> org.apache.jasper.JspC -webapp outputdir
>
> So looks like only these 3 jar files are needed.
>
> However, no matter what I do, I can't run jspc task.
>
> I would really like to know how do people actually run this task ?
>
> Cheers
>
> Matt
>
> On Thursday 27 June 2002 3:15 pm, Dave Gibbs wrote> Have you included the
> xercesImpl.jar, xmlParserAPIs.jar in your classpath
>
> > as well ?
> > I have been striggling with this task as well.
> > See if you can run jasper from the command line sort of like this.
> > "..." of course represents an arbitrary path.
> >
> > Drive:\jdk1.3.1_03\jre\bin\java.exe
> > -classpath
>
> "C:\...\lib\servlet.jar;C:\...\lib\ant.jar;C:\...\lib\jasper-compiler.jar;C
>
>
> \...\lib\jasper-runtime.jar;C:\...\lib\xmlParserAPIs.jar;C:\...\lib\xercesI
>
> >m pl.jar;C:\...\lib\j2ee.jar;C:\...\lib\variouswhatever.jar;"
> > org.apache.jasper.JspC
> > -d "C:\...\build\generated"
> > -p com.fu.bar.jsp
> > -v9
> > -uriroot "C:\...\source\site"
> > -uribase "C:\...\source\site"
> > -die9
> > "C:\...\source\site\admin\error.jsp"
> >
> > I can run the task but end up with null pointer exceptions being thrown
> > from JspC.
> >
> > I am also running Ant 1.5 Beta3 on Linux with Tomcat 4.0.4 libs (
>
> jasper ).
>
> > Dave
> >
> > -----Original Message-----
> > From: Matt Koss [mailto:m.koss@open.ac.uk]
> > Sent: 27 June 2002 14:04
> > To: ant-user@jakarta.apache.org
> > Subject: JspcC task classpath problem
> >
> >
> >
> > I get the following message when running jspc task :
> >
> > [jspc] Compiling 28 source files
>
> /home/mk666/src/Artemis/ClockworkTool/tools/work/Standalone/localhost/Clock
>
> >w orkTool
> >
> > [java] Exception in thread "main" java.lang.NoClassDefFoundError:
> > 		org/apache/jasper/JspC
> >
> >
> > my ant lib directory does contains jasper-compiler.jar,
> > jasper-runtime.jar and
> > optional.jar, so I don't know what's wrong.
> >
> > I have looked at the process list and there are all these jar files in
> > the classpath.
> >
> > Running Ant 1.5 Beta3 on Linux with Tomcat 4.0.4 libs ( jasper ).
> >
> >
> > Cheers
> >
> > Matt

-- 
Matt Koss
Knowledge Media Institute
Open University
e-mail: m.koss@open.ac.uk

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


RE: JspcC task classpath problem

Posted by Dave Gibbs <dg...@agency.com>.
I had to pile absolutely everything in to the jspc classpath attribute as
follows, that got me past the NoClassDefFoundError. Crank the verbosity of
Ant up (-verbose) and you will see the command that the task tries to
execute.

I'll try using the -webapp form as you have done.

	<jspc srcdir="../${site}"
	      destdir="${build}/generated"
	      package="com.***.***.jsp"

classpath="../../lib/servlet.jar;../../lib/ant.jar;../../lib/jasper-compiler
.jar;../../lib/jasper-runtime.jar;../../lib/xmlParserAPIs.jar;../../lib/xerc
esImpl.jar;${base.classpath}"
	      uriroot="${site}"
	      verbose="9">
	  <include name="**/*.jsp" />
	</jspc>

Dave

-----Original Message-----
From: Matt Koss [mailto:m.koss@open.ac.uk]
Sent: 27 June 2002 17:26
To: Ant Users List
Subject: Re: JspcC task classpath problem



Hello,

I am running JDK 1.4.0 so xerces is already there.
I can run jspc from the command line as e.g. :

java -cp
"../lib/jasper-runtime.jar:../lib/jasper-compiler.jar:../lib/servlet.jar"
org.apache.jasper.JspC -webapp outputdir

So looks like only these 3 jar files are needed.

However, no matter what I do, I can't run jspc task.

I would really like to know how do people actually run this task ?

Cheers

Matt

On Thursday 27 June 2002 3:15 pm, Dave Gibbs wrote> Have you included the
xercesImpl.jar, xmlParserAPIs.jar in your classpath
> as well ?
> I have been striggling with this task as well.
> See if you can run jasper from the command line sort of like this.
> "..." of course represents an arbitrary path.
>
> Drive:\jdk1.3.1_03\jre\bin\java.exe
> -classpath
>
"C:\...\lib\servlet.jar;C:\...\lib\ant.jar;C:\...\lib\jasper-compiler.jar;C
>:
>
\...\lib\jasper-runtime.jar;C:\...\lib\xmlParserAPIs.jar;C:\...\lib\xercesI
>m pl.jar;C:\...\lib\j2ee.jar;C:\...\lib\variouswhatever.jar;"
> org.apache.jasper.JspC
> -d "C:\...\build\generated"
> -p com.fu.bar.jsp
> -v9
> -uriroot "C:\...\source\site"
> -uribase "C:\...\source\site"
> -die9
> "C:\...\source\site\admin\error.jsp"
>
> I can run the task but end up with null pointer exceptions being thrown
> from JspC.
>
> I am also running Ant 1.5 Beta3 on Linux with Tomcat 4.0.4 libs (
jasper ).
>
> Dave
>
> -----Original Message-----
> From: Matt Koss [mailto:m.koss@open.ac.uk]
> Sent: 27 June 2002 14:04
> To: ant-user@jakarta.apache.org
> Subject: JspcC task classpath problem
>
>
>
> I get the following message when running jspc task :
>
> [jspc] Compiling 28 source files
>
/home/mk666/src/Artemis/ClockworkTool/tools/work/Standalone/localhost/Clock
>w orkTool
>
> [java] Exception in thread "main" java.lang.NoClassDefFoundError:
> 		org/apache/jasper/JspC
>
>
> my ant lib directory does contains jasper-compiler.jar, jasper-runtime.jar
> and
> optional.jar, so I don't know what's wrong.
>
> I have looked at the process list and there are all these jar files in the
> classpath.
>
> Running Ant 1.5 Beta3 on Linux with Tomcat 4.0.4 libs ( jasper ).
>
>
> Cheers
>
> Matt

--
Matt Koss
Knowledge Media Institute
Open University
e-mail: m.koss@open.ac.uk

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: JspcC task classpath problem

Posted by Matt Koss <m....@open.ac.uk>.
Hello,

I am running JDK 1.4.0 so xerces is already there.
I can run jspc from the command line as e.g. :

java -cp 
"../lib/jasper-runtime.jar:../lib/jasper-compiler.jar:../lib/servlet.jar" 
org.apache.jasper.JspC -webapp outputdir

So looks like only these 3 jar files are needed.

However, no matter what I do, I can't run jspc task.

I would really like to know how do people actually run this task ?

Cheers

Matt

On Thursday 27 June 2002 3:15 pm, Dave Gibbs wrote> Have you included the 
xercesImpl.jar, xmlParserAPIs.jar in your classpath
> as well ?
> I have been striggling with this task as well.
> See if you can run jasper from the command line sort of like this.
> "..." of course represents an arbitrary path.
>
> Drive:\jdk1.3.1_03\jre\bin\java.exe
> -classpath
> "C:\...\lib\servlet.jar;C:\...\lib\ant.jar;C:\...\lib\jasper-compiler.jar;C
>:
> \...\lib\jasper-runtime.jar;C:\...\lib\xmlParserAPIs.jar;C:\...\lib\xercesI
>m pl.jar;C:\...\lib\j2ee.jar;C:\...\lib\variouswhatever.jar;"
> org.apache.jasper.JspC
> -d "C:\...\build\generated"
> -p com.fu.bar.jsp
> -v9
> -uriroot "C:\...\source\site"
> -uribase "C:\...\source\site"
> -die9
> "C:\...\source\site\admin\error.jsp"
>
> I can run the task but end up with null pointer exceptions being thrown
> from JspC.
>
> I am also running Ant 1.5 Beta3 on Linux with Tomcat 4.0.4 libs ( jasper ).
>
> Dave
>
> -----Original Message-----
> From: Matt Koss [mailto:m.koss@open.ac.uk]
> Sent: 27 June 2002 14:04
> To: ant-user@jakarta.apache.org
> Subject: JspcC task classpath problem
>
>
>
> I get the following message when running jspc task :
>
> [jspc] Compiling 28 source files
> /home/mk666/src/Artemis/ClockworkTool/tools/work/Standalone/localhost/Clock
>w orkTool
>
> [java] Exception in thread "main" java.lang.NoClassDefFoundError:
> 		org/apache/jasper/JspC
>
>
> my ant lib directory does contains jasper-compiler.jar, jasper-runtime.jar
> and
> optional.jar, so I don't know what's wrong.
>
> I have looked at the process list and there are all these jar files in the
> classpath.
>
> Running Ant 1.5 Beta3 on Linux with Tomcat 4.0.4 libs ( jasper ).
>
>
> Cheers
>
> Matt

-- 
Matt Koss
Knowledge Media Institute
Open University
e-mail: m.koss@open.ac.uk

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


RE: JspcC task classpath problem

Posted by Dave Gibbs <dg...@agency.com>.
Have you included the xercesImpl.jar, xmlParserAPIs.jar in your classpath as
well ?
I have been striggling with this task as well.
See if you can run jasper from the command line sort of like this.
"..." of course represents an arbitrary path.

Drive:\jdk1.3.1_03\jre\bin\java.exe
-classpath
"C:\...\lib\servlet.jar;C:\...\lib\ant.jar;C:\...\lib\jasper-compiler.jar;C:
\...\lib\jasper-runtime.jar;C:\...\lib\xmlParserAPIs.jar;C:\...\lib\xercesIm
pl.jar;C:\...\lib\j2ee.jar;C:\...\lib\variouswhatever.jar;"
org.apache.jasper.JspC
-d "C:\...\build\generated"
-p com.fu.bar.jsp
-v9
-uriroot "C:\...\source\site"
-uribase "C:\...\source\site"
-die9
"C:\...\source\site\admin\error.jsp"

I can run the task but end up with null pointer exceptions being thrown from
JspC.

I am also running Ant 1.5 Beta3 on Linux with Tomcat 4.0.4 libs ( jasper ).

Dave

-----Original Message-----
From: Matt Koss [mailto:m.koss@open.ac.uk]
Sent: 27 June 2002 14:04
To: ant-user@jakarta.apache.org
Subject: JspcC task classpath problem



I get the following message when running jspc task :

[jspc] Compiling 28 source files
/home/mk666/src/Artemis/ClockworkTool/tools/work/Standalone/localhost/Clockw
orkTool

[java] Exception in thread "main" java.lang.NoClassDefFoundError:
		org/apache/jasper/JspC


my ant lib directory does contains jasper-compiler.jar, jasper-runtime.jar
and
optional.jar, so I don't know what's wrong.

I have looked at the process list and there are all these jar files in the
classpath.

Running Ant 1.5 Beta3 on Linux with Tomcat 4.0.4 libs ( jasper ).


Cheers

Matt

--
Matt Koss
Knowledge Media Institute
Open University
e-mail: m.koss@open.ac.uk

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>