jakarta-cactus-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Evan Jehu" <e...@codepit.ca>
Subject Strange error when using helper methods
Date Mon, 22 Jul 2002 21:52:37 GMT
Hi All,

I am trying to execute some tests against EJB's deployed using
jboss3.0.1RC1, the deployment executes as expected.  I am using netbeans as
my IDE and running the unit tests from within it.  I have mounted the .jar
files as described in the documentation etc.  My problem is that the
following test executes as expected and passes:

public void testCreateSalutation() throws Exception {
InitialContext ctx = new InitialContext() ;
Object home = ctx.lookup("salutation") ;
SalutationHome sHome = (SalutationHome)PortableRemoteObject.narrow(home,
SalutationHome.class) ;
assertNotNull( sHome ) ;
}


however if I change the code to read:

public void testCreateSalutation() throws Exception {
SalutationHome sHome = getSalutationHome() ;
assertNotNull( sHome ) ;
}

public SalutationHome getSalutationHome() throws Exception {
InitialContext ctx = new InitialContext() ;
Object home = ctx.lookup("salutation") ;
return (SalutationHome)PortableRemoteObject.narrow(home,
SalutationHome.class) ;
}

I get the following stack trace:

Exception in thread "main" java.lang.NoClassDefFoundError:
com/chryxus/cms/ejb/salutation/SalutationHome
at java.lang.Class.getDeclaredMethods0(Native Method)
at java.lang.Class.privateGetDeclaredMethods(Class.java:1627)
at java.lang.Class.privateGetPublicMethods(Class.java:1655)
at java.lang.Class.getMethod0(Class.java:1744)
at java.lang.Class.getMethod(Class.java:963)
at junit.runner.BaseTestRunner.getTest(BaseTestRunner.java:72)
at junit.awtui.TestRunner.runSuite(TestRunner.java:404)
at junit.awtui.TestRunner.start(TestRunner.java:485)
at junit.ui.TestRunner.main(TestRunner.java:11)
at com.chryxus.cms.test.SalutationTest.main(SalutationTest.java:41)


I have checked the classpath and my EJB's are on it (as they would have to
be for it to compile and execute the first test code).  This error occures
before the test calls the server.

I have been stuck on this all day and would love some suggestions :-)

Evan


------

Evan Jehu
Software Developer

Tel./Fax: (416) 222-6931

"After three days without programming, life becomes meaningless."
          The Tao of Programming - Book 2
          http://misspiggy.gsfc.nasa.gov/tao.html





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