Re: a question about rmi sample

Jon Tirsén <[email protected]> Mon, 2 Jun 2003 17:36:09 +0200 (CEST)
Newsgroups gmane.comp.java.nanning.devel
Message-ID <[email protected]>
I am currently in London and using an internet cafe to
answer. Therefor I don't have access to the code and
can't verify this. But...

I think you haven't compiled the attributes or haven't
included them in the classpath or haven't added it to
the search-path with Attributes.addSearchPath.
Basically the framework doesn't know that it should
marshal this object as a client stub and therefor the
object is incorrect on the client side.

If the error persists please answer back and I will
try to have a closer look at this when I get back from
London.

Btw, if any of you guys are in London tomorrow evening
come by XTC. I will be there and might give an
improvised speach on Nanning. See www.xpdeveloper.com

Tip: If you execute Nanning with assertions enabled
(using java -ea) better error-messages will appear.

tang jie

 --- yiming wang <[email protected]> skrev: > 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
> _______________________________________________
> Nanning-developer mailing list
> [email protected]
>
https://lists.sourceforge.net/lists/listinfo/nanning-developer 

_____________________________________________________
Gå före i kön och få din sajt värderad på nolltid med Yahoo! Express
Se mer på: http://se.docs.yahoo.com/info/express/help/index.html


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