RE: Grrrrr... java.lang.ClassNotFoundException

2005-10-17 Thread Carpentier, Nelson
I FOUND IT!!!

Here's the problem statement I had in my previous post:
"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:

... and the error comes back with the fully-qualified path name. (I.e.
com.icat.blah.AllTestsCactus...)"

While the batchtest was able to find the test Class in that directory, I
hadn't included that directory in my classpath.  So, contrary to my
assumptions, the error was on the CLIENT side!

Thanks to all who tried to help!

- Nelz

-Original Message-
From: Carpentier, Nelson 
Sent: Friday, October 14, 2005 4:17 PM
To: cactus-user@jakarta.apache.org
Subject: Gr... java.lang.ClassNotFoundException

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  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:

... 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  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:








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
[EMAIL PROTECTED] 

 

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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


 

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

RE: Grrrrr... java.lang.ClassNotFoundException

2005-10-14 Thread Rod Macpherson
Personally I never use Ant's war or ear tasks in general and that goes
for cactification. The convenience of those methods is somewhere between
diddly and squat, IMO. 

I create a jar using the Ant jar task that just has my tests: test.jar. 


 
 
 
 
 


Then I update my EAR, which is already build, with my tests:









Now, your problem is probably that you cannot "see" the test.jar from
the WAR. IMO WEB-INF and APP-INF are problematic. Instead, I create a
precise chain of dependencies using manifests. So, to see my test.jar
from my war, create the war with this manifest:

Manifest-Version: 1.0
Class-Path: test.jar ... other stuff the war sees ...


I have never, ever, use WEB-INF/classes or WEB-INF/lib and I never have
more than one copy of a given jar anywhere in my deployed application.
Using the manifest gives me total control. 

-Original Message-
From: Carpentier, Nelson [mailto:[EMAIL PROTECTED] 
Sent: Friday, October 14, 2005 3:17 PM
To: cactus-user@jakarta.apache.org
Subject: Gr... java.lang.ClassNotFoundException

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  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:

... 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  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:








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
[EMAIL PROTECTED] 

 

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: [EMAIL PROTECTED]
For additional commands, e-m

Re: Grrrrr... java.lang.ClassNotFoundException

2005-10-14 Thread Chris Allen
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 <[EMAIL PROTECTED]> 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  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:
> 
> ... 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  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:
> 
> 
> 
> 
> 
> 
> 
>
> 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
> [EMAIL PROTECTED]
>
>
>
> 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: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]