Re: a question about rmi sample

Jon Tirsén <[email protected]> Wed, 4 Jun 2003 16:23:01 +0200 (CEST)
Newsgroups gmane.comp.java.nanning.devel
Message-ID <[email protected]>
Ni hao!

Try to make sure that the attributes really are
loaded, for example do:
assertTrue(Attributes.hasAttribute(MyObject.class,
"remote"));

Also try to execute java with asserts enabled, ie:
"java -ea". You may get a different more helpful
error-message.

If this doesn't help you either I need to look deeper
into the problem. I can to that later this weekend.

 --- yiming wang <[email protected]> skrev: >
&#21776;&#26480;&#65306;
>     &#20320;&#22909;&#65281;
>     Firstly, i wish your speach on Nanning will get
> successful.
> 
>     I am sure the attributes are correct, because
> the 
> other test cases can pass with no problem.
> 
>     As your said:
>     "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."
> 
>     I guess that it is usage of aspect instance in 
> client side, may be not a bug. so, how to declare 
> "MyObject.java" then it can be marshal as a client
> stub?
> 
>     i have been add @remote and @service tag to
> "MyObject.java", but not work.
> 
> &#29579;&#20134;&#26126;
> 2003.6.3
> 
> --- Jon Tirsén <[email protected]> wrote:
> > 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
> > _______________________________________________
> > Nanning-developer mailing list
> > [email protected]
> >
>
https://lists.sourceforge.net/lists/listinfo/nanning-developer
> 
> 
> __________________________________
> 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:  Etnus, makers of TotalView, The best
thread debugger on the planet. Designed with thread debugging features
you've never dreamed of, try TotalView 6 free at www.etnus.com.