a question about rmi sample
yiming wang <[email protected]> Sun, 1 Jun 2003 19:24:51 -0700 (PDT)
| Newsgroups | gmane.comp.java.nanning.devel |
|---|---|
| Message-ID | <[email protected]> |
hi jon,
In MyStatelessService.java, add following codes:
public MyObject getMyObject();
then, in MyStatelessServiceImpl.java:
public MyObject getMyObject() {
return
((MySystem)CurrentPrevayler.getSystem()).getMyObject();
}
finally, in RemoteCallServerTest.java, add following
test codes:
MyObject myObject = myService.getMyObject();
String value = myObject.getValue();
when i run the test case, throws the following
exception:
java.lang.ClassCastException
at
com.tirsen.nanning.samples.rmi.RemoteAspect.invoke(RemoteAspect.java:21)
at
com.tirsen.nanning.MixinInstance$InvocationImpl.invokeNext(MixinInstance.java:96)
at
com.tirsen.nanning.MixinInstance.invokeMethod(MixinInstance.java:164)
at
com.tirsen.nanning.AspectInstance.invoke(AspectInstance.java:96)
at $Proxy2.getValue(Unknown Source)
at
com.tirsen.nanning.samples.rmi.RemoteCallServerTest.testStatelessRemoteCall(RemoteCallServerTest.java:77)
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:324)
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)
......
how to resolve such problem?
i have two scenarios:
1. at client, i only use MyObject to get Data, not to
perform any update operations.
2. at client, i will use MyObject to do any update,
they should be result in server side.
thanks!
wang yiming
2003.6.2
__________________________________
Do you Yahoo!?
Yahoo! Calendar - Free online calendar with sync to Outlook(TM).
http://calendar.yahoo.com
-------------------------------------------------------
This SF.net email is sponsored by: eBay
Get office equipment for less on eBay!
http://adfarm.mediaplex.com/ad/ck/711-11697-6916-5