Hi Friends
I am stuck in this typical
Junit problem for a copule of days but still not able to find any solution for it.The problem is as below.
I have written Junit
test case for 1 method that has been added in the session bean. the code is as below.
public void testfindResponses() {
ClientManager cMgr = null;
Collection retvalue= new ArrayList();
try {
System.out.println("Before");
cMgr = EJBHomeUtilities.getClientManagerHome().create();
System.out.println("After" + cMgr.toString());
// retvalue=cMgr.findSurveyResponses(clientPk,startTime,endTime);
}catch (RemoteException e) {
//logger.error(e.getMessage());
throw new EJBException(e.getMessage());
} catch (CreateException e) {
// logger.error(e.getMessage());
throw new EJBException(e.getMessage());
} finally {
EJBHomeUtilities.removeSessionBean(cMgr);
}
//return retvalue;
when i run this using the Junit consol;e on the eclipse i am getting
java.lang.NoClassDefFoundError
at sun.reflect.GeneratedSerializationConstructorAccessor35.newInstance(Unknown Source)
at java.lang.reflect.Constructor.newInstance(Constructor.java:494)
at java.io.ObjectStreamClass.newInstance(ObjectStreamClass.java:869)
at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1698)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1299)
at java.io.ObjectInputStream.readObject(ObjectInputStream.java:339)
at java.rmi.MarshalledObject.get(MarshalledObject.java:135)
at org.jboss.invocation.jrmp.interfaces.JRMPInvokerProxy.invoke(JRMPInvokerProxy.java:120)
at org.jboss.invocation.InvokerInterceptor.invokeInvoker(InvokerInterceptor.java:227)
at org.jboss.invocation.MarshallingInvokerInterceptor.invoke(MarshallingInvokerInterceptor.java:37)
at org.jboss.proxy.TransactionInterceptor.invoke(TransactionInterceptor.java:46)
at org.jboss.proxy.SecurityInterceptor.invoke(SecurityInterceptor.java:55)
at org.jboss.proxy.ejb.HomeInterceptor.invoke(HomeInterceptor.java:169)
at org.jboss.proxy.ClientContainer.invoke(ClientContainer.java:86)
at $Proxy0.create(Unknown Source)
at com.march.hth.test.client.ClientManagerBeanTest.testfindSurveyResponses(ClientManagerBeanTest.java:3918)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at junit.framework.TestCase.runTest(TestCase.java:154)
at junit.framework.TestCase.runBare(TestCase.java:127)
at junit.framework.TestResult$1.protect(TestResult.java:106)
at junit.framework.TestResult.runProtected(TestResult.java:124)
at junit.framework.TestResult.run(TestResult.java:109)
at junit.framework.TestCase.run(TestCase.java:118)
at junit.framework.TestSuite.runTest(TestSuite.java:208)
at junit.framework.TestSuite.run(TestSuite.java:203)
at org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestReference.run(JUnit3TestReference.java:128)
at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:460)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196)
The remote reference that i get seems to not work atall.i tried to put debug statements to see if i am getting the remote reference,but the control seems to not go there itself.
The same method if i write for another session bean it is working fine without any errors.
Please let me know whats wrong here as i am stuck up with this issue for a long time .waiting for positive replies from your side.
Thanks & Regards
Vikram K