jakarta-cactus-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Brian Preston <brifo...@yahoo.com>
Subject RE: ant cactus not finding j2ee.jar or servlet.jar at runtime?
Date Thu, 02 Sep 2004 14:25:24 GMT
Thanks for the idea (good idea) but it didn't help. I
added the pathelement for the tools.jar in the
classpath for the taskdef for cactus. Here it is:

<!-- Define the Cactus tasks -->
<taskdef resource="cactus.tasks">
    <classpath>
        <pathelement location="${cactus.jar}"/>
        <pathelement
location="${ext_libdir}/cactus-ant-1.6.1.jar"/>
      	<pathelement
location="c:\j2sdk1.4.2_04\lib\tools.jar"/>
        <path refid="cactusdeps"/>
    </classpath>
</taskdef>

But I noticed 2 other interesting things in the error
output. One is that the error is in the
ContainerRunner. Does this mean that however the
ContainerRunner works, it is a separate classpath for
the server that is not finding the tools.jar?

Here's the error excerpt:

[cactus] Couldn't find tools.jar (needed for JSP
compilation)
[cactus] You must either set location or path on
<pathelement>
.
.
.
[cactus] at
org.apache.cactus.integration.ant.container.ContainerRunner$1.run(ContainerRunner.java:140)

Here's my test target:

<target name="test" depends="test.prepare">
	<cactus
warfile="${builddir}/${distfilename}-test.war"
fork="yes">
		<classpath>
			<path refid="test.build.classpath" />        
			<path refid="cactusdeps"/>
		</classpath>
		<containerset timeout="100000">
			<tomcat4x if="cactus.home.tomcat4x"
				dir="${cactus.home.tomcat4x}"
				output="${testlogdir}/tomcat4x/tomcat4x.out"
				todir="${testlogdir}/tomcat4x"
				port="${cactus.port}"/>
		</containerset>
		<formatter type="brief" usefile="false"/>
		<formatter type="plain"/>
		<formatter type="xml"/>
		<test name="${package}.AllTests"
todir="${testlogdir}"/>
	</cactus>
</target>

'cactus.home.tomcat4x' is defined earlier as
cactus.home.tomcat4x=C:/jakarta-tomcat-4.1.30

What looks weird to me is that it's resolving the
container directory into a Win2000 local user
directory. So I get the above error with the not
finding the tools.jar, then it times out waiting for
the container to start. Is that normal? It seems like
when I run it from the command line, it finds the
tomcat install and starts it just fine.

--- Pedro Nevado <pnevado@javato.com> wrote:

> Hi there,
> 
> I am using now IntelliJ, but I have used too
> Eclipse. Both work similarly
> with Ant. I think the best way is to control your
> class dependencies inside
> your build script, instead of putting the required
> libraries in ant/lib or
> as libraries of the Eclipse project (which is the
> case if you build the
> project without Ant).
> 
> So my advise is to define some paths in the build
> script (java.path,
> junit.path, cactus.client.path,
> cactus.server.path)and use them as necessary
> in the classpath of your run programs targets.
> Acting this way it is
> irrelevant where you put your libraries, the only
> thing you have to do is
> referencing them in the build script with
> property(name/location) tasks.
> 
> Regards,
> 
> Pedro Nevado
> 
> -----Mensaje original-----
> De: Brian Preston [mailto:briforge@yahoo.com]
> Enviado el: miercoles, 01 de septiembre de 2004
> 21:27
> Para: cactus-user@jakarta.apache.org
> Asunto: ant cactus not finding j2ee.jar or
> servlet.jar at runtime?
> 
> 
> I'm stuck on the Eclipse-Ant-Cactus problem where it
> can't find tools.jar when running from within
> Eclipse,
> so I'm trying to run my ant script from the command
> line.
> 
> I get past the tools.jar problem this way, but ran
> into a new problem : NoClassDefFoundError for
> javax/servlet/jsp/tagext/BodyTagSupport when running
> the first test. I'm assuming it's a runtime
> classpath
> issue because it compiled the tests just fine.
> 
> I've added the j2ee.jar and servlet.jar to my
> ant/lib
> directory and thought that would do it but it
> didn't.
> I don't have much ant experience so am I
> misunderstanding where to put jars for ant's runtime
> classpath?
> 
> Any ideas?
> 
> 
> 
> __________________________________
> Do you Yahoo!?
> Yahoo! Mail is new and improved - Check it out!
> http://promotions.yahoo.com/new_mail
> 
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> cactus-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail:
> cactus-user-help@jakarta.apache.org
> 
> 
> 
> 
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> cactus-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail:
> cactus-user-help@jakarta.apache.org
> 
> 



	
		
__________________________________
Do you Yahoo!?
New and Improved Yahoo! Mail - 100MB free storage!
http://promotions.yahoo.com/new_mail 

Mime
View raw message