jakarta-cactus-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Fred Loney" <lo...@spiritedsw.com>
Subject NoClassDefFoundError when package changes
Date Thu, 15 Nov 2001 23:35:51 GMT
I've encountered about the oddest problem I've seen in years. The
trivial test class attached below runs fine. But when I move the file to
sudirectory "ejb" and change the package from
test.sx.enterprise.persistence to test.sx.enterprise.persistence.ejb the
test fails with message:

java.lang.NoClassDefFoundError:
org/apache/commons/cactus/ServletTestCase

The test is run by a simple junit ant task which works well otherwise.
It fails with another simple test class in the same ejb subdirectory.
After several hours of isolation, I can reproduce the problem: move the
class up and it works, move it back down it fails.

Others have reported a VAJ VM introspection failure, but I'm using the
good ol' Sun 1.3 jdk. It is very odd that:

1) ServletTestCaller can't find ServletTestCase
2) package makes a difference

Using v. 1.1. Test servlet build packaging is automated and verified.

Any ideas/workarounds? Please cc me in response.

Thanks.

Class
-----
package test.sx.enterprise.persistence;
import org.apache.commons.cactus.ServletTestCase;

public class DummyTest extends ServletTestCase
{
 /**
  * Creates a test case.
  * @param name name of test case
  */
 public DummyTest(String name)
 {
  super(name);
 }

 /** Tests create. */
 public void testCreate() throws Exception
 {}

Report
-------
java.lang.NoClassDefFoundError:
org/apache/commons/cactus/ServletTestCase
 at java.lang.ClassLoader.defineClass0(Native Method)
 at java.lang.ClassLoader.defineClass(Unknown Source)
 at java.security.SecureClassLoader.defineClass(Unknown Source)
 at java.net.URLClassLoader.defineClass(Unknown Source)
 at java.net.URLClassLoader.access$100(Unknown Source)
 at java.net.URLClassLoader$1.run(Unknown Source)
 at java.security.AccessController.doPrivileged(Native Method)
 at java.net.URLClassLoader.findClass(Unknown Source)
 at java.lang.ClassLoader.loadClass(Unknown Source)
 at java.lang.ClassLoader.loadClass(Unknown Source)
 at com.mortbay.HTTP.ContextLoader.loadClass(ContextLoader.java:160)
 at java.lang.ClassLoader.loadClass(Unknown Source)
 at java.lang.ClassLoader.loadClassInternal(Unknown Source)
 at java.lang.Class.forName0(Native Method)
 at java.lang.Class.forName(Unknown Source)
 at
org.apache.commons.cactus.server.ServletTestCaller.callTestMethod(Servle
tTestCaller.java:94)
 at
org.apache.commons.cactus.server.ServletTestCaller.doTest(ServletTestCal
ler.java:193)
 at
org.apache.commons.cactus.server.ServletTestRedirector.doPost(ServletTes
tRedirector.java:116)
 at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)


Fred Loney
Spirited Software, Inc.
www.spiritedsw.com




--
To unsubscribe, e-mail:   <mailto:cactus-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:cactus-user-help@jakarta.apache.org>


Mime
View raw message