You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cactus-user@jakarta.apache.org by Chris Allen <mr...@gmail.com> on 2005/10/15 00:31:49 UTC

Re: Grrrrr... java.lang.ClassNotFoundException

Hi Nelson,

I'm not sure if it will help, but I had a class not found exception
when I was first attempting to run cactus on Tomcat.  It sounds like
your container can't find one or all of the cactus classes.  I fixed
my problem by putting the jar files that cactus needs in my
WEB-INF/lib directory.  Once I put them there, all was well.

The jar files that you need are:
# cactus-1.7.jar
# junit-3.8.1.jar
# aspectjrt-1.2.1.jar
# commons-logging-1.0.4.jar
# commons-httpclient-2.0.2.jar

I hope that at least points you in the right direction.

Good luck.

-Chris

On 10/14/05, Carpentier, Nelson <NC...@icat.com> wrote:
> Hey All...
>
> I've been beating my head against the Cactus wall for about 3 days
> now...  I think I've made a bunch of progress, however my headway seems
> to have stopped.  (Some of my previous trials include: using WebLogic
> 8.1, figuring out to use the <cactus> ant task with the generic
> container to use my pre-existing deploy tasks, losing 3/4 of a day to a
> typo, etc...)
>
> (Sorry for the blatant attempt at garnering sympathy, it's just I
> figured some on this list would feel my pain...)
>
> Now, on to my question:
> Where are my test classes supposed to be?
>
> I keep hitting the "java.lang.ClassNotFoundException".  (Full stack
> trace to be included at the end...)
>
> I am fairly certain my local (non-server-side) JVM is finding the class,
> 'cuz the only hint I give that I'm looking for my test class is the
> following in the batchtest:
> <include name="**/AllTestsCactus.*" />
> ... and the error comes back with the fully-qualified path name. (I.e.
> com.icat.blah.AllTestsCactus...)
>
> I'm also fairly certain the cactus.war file is deployed correctly,
> because the <cactus> task returns from the deploy in a timely manner,
> and when I hit it manually, I get a non-error, blank page back from
> "http://localhost:7001/cactus/ServletRedirector?RUN_TEST."
>
> So, I've gone thru 3 different ways of including the test classes in the
> EAR file, none of which rid me of the ClassNotFoundException:
>
> 1) In the EAR file, with the package structure directly at the top of
> the archive...  I.e. earfile.ear/com/icat/blah/AllTestsCactus.class ...
> (I figured out that this probably wouldn't work out for me at all...)
>
> 2) In the EAR file, under the /APP-INF/classes directory...  I.e.
> earfile.ear/APP-INF/classes/com/icat/blah/AllTestsCactus.class...
> (Where just about all the other classes seem to be...)
>
> 3) In the cactus war file, under the /WEB-INF/classes directory...  I.e.
> earfile.ear/cactus.war/WEB-INF/classes/com/icat/blah/AllTestsCactus.clas
> s...
>
> For #3 above, to get these classes in, I've been doing the following
> against a deployable ear:
> <cactifyear srcfile="${ear}" destfile="${ear.test}" >
>         <cactuswar context="/cactus" version="2.3">
>                 <classes dir="${test.classes.dir} ">
>                         <include name="**/*.class" />
>                 </classes>
>         </cactuswar>
> </cactifyear>
>
> Thanks for any help...  (Or a slap in the head, if I'm doing something
> stupid...)
>
> - Nelz
>
> PS.  Here's the promised stack trace:
>
> java.lang.ClassNotFoundException:
> com.icat.server.domain.inspection.AllTestsCactus
>         at java.net.URLClassLoader$1.run(URLClassLoader.java:199)
>         at java.security.AccessController.doPrivileged(Native Method)
>         at java.net.URLClassLoader.findClass(URLClassLoader.java:187)
>         at java.lang.ClassLoader.loadClass(ClassLoader.java:289)
>         at java.lang.ClassLoader.loadClass(ClassLoader.java:235)
>         at java.lang.ClassLoader.loadClass(ClassLoader.java:235)
>         at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:302)
>         at java.lang.Class.forName0(Native Method)
>         at java.lang.Class.forName(Class.java:219)
>         at
> org.apache.cactus.integration.ant.CactusTask.executeInContainer(CactusTa
> sk.java:458)
>         at
> org.apache.cactus.integration.ant.CactusTask.execute(CactusTask.java:208
> )
>
> Nelson Carpentier
> Software Developer
> ICAT Managers, LLC
> ncarpentier@icat.com
>
>
>
> Confidentiality Note: This message contains information that may be confidential and/or privileged. If you are not the intended recipient, you should not use, copy, disclose, distribute or take any action based on this message. If you have received this message in error, please advise the sender immediately by reply email and delete this message. Although ICAT Managers, LLC scans e-mail and attachments for viruses, it does not guarantee that either are virus-free and accepts no liability for any damage sustained as a result of viruses.  Thank you.
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: cactus-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: cactus-user-help@jakarta.apache.org
>
>