http://ofbiz.116.s1.nabble.com/binnding-RMIDispatcher-to-client-tp140489p140498.html
From: A. Zeneski [mailto:
Appears that the stubs don't match the implementations. Try a recompile.
> Hi Andrew
> When I am connecting to ofbiz service via rmi client , I update
> latest
> ofbiz-service-rmi.jar in the client side .but I got
> InvalidClassException
> Here I listed log file content
>
>
>
>
>
> java.rmi.UnmarshalException: error unmarshalling return; nested
> exception
> is:
> java.io.InvalidClassException: org.ofbiz.entity.GenericEntity; local
> class incompatible: stream classdesc serialVersionUID =
> -8060388945356960605, local class serialVersionUID =
> 2101858786673435162
> at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:164)
> at org.ofbiz.service.rmi.RemoteDispatcherImpl_Stub.runSync(Unknown
> Source)
> at
> src.ExampleRemoteClient.runTestService(ExampleRemoteClient.java:69)
> at src.ExampleRemoteClient.main(ExampleRemoteClient.java:77)
> Caused by: java.io.InvalidClassException:
> org.ofbiz.entity.GenericEntity;
> local class incompatible: stream classdesc serialVersionUID =
> -8060388945356960605, local class serialVersionUID =
> 2101858786673435162
> at
> java.io.ObjectStreamClass.initNonProxy(ObjectStreamClass.java:463)
> at
> java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:
> 1521)
> at
> java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1435)
> at
> java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:
> 1521)
> at
> java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1435)
> at
> java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:
> 1626)
> at
> java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1274)
> at java.io.ObjectInputStream.readObject(ObjectInputStream.java:324)
> at javolution.util.FastMap.readObject(Unknown Source)
> 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
> java.io.ObjectStreamClass.invokeReadObject(ObjectStreamClass.java:838)
> at
> java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1746)
> at
> java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:
> 1646)
> at
> java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1274)
> at java.io.ObjectInputStream.readObject(ObjectInputStream.java:324)
> at sun.rmi.server.UnicastRef.unmarshalValue(UnicastRef.java:297)
> at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:146)
> ... 3 more
> Exception in thread "main"
>
>
> -----Original Message-----
> From: Andrew Sykes [mailto:
[hidden email]]
> Sent: Thursday, July 06, 2006 8:50 PM
> To:
[hidden email]
> Subject: Re: binnding RMIDispatcher to client
>
> Raj, Brett,
>
> This is the way I would approach this too.
>
> This makes security quite a lot easier to manage.
>
> - Andrew
>
> On Thu, 2006-07-06 at 08:43 -0600, Brett Palmer wrote:
>> Raj,
>>
>> I don't think anyone else has done this before, but as I've said, is
>> it theoretically possible to do this. I don't think there are any
>> established best practices though.
>>
>> My recommendation if you are going to do this is to determine what
>> ofbiz services you want to call and then create a "facade" service to
>> wrap around these various ofbiz services. This way you don't have to
>> modify the existing services and you can adapt to any specific RMI
>> features/limitations that you need. This approach is similar to what
>> you would do in an EJB environment.
>>
>> On the design side you could choose to have a facade interface for
>> every service call or combine service calls into a common facade
>> interface (my recommendation).
>>
>> If anyone else has recommendations on this subject please chime in.
>>
>>
>> Brett
>>
>> On 7/5/06, Raj <
[hidden email]> wrote:
>>> Yes Andrew ,
>>>
>>> I have few question with this
>>>
>>> basically if we wants to control ofbiz from outside (other than the
> ofbiz
>>> web application ).what are the things needs to be consider,is
>>> there any
> best
>>> practice approach for this type situation ?.
>>>
>>> -----Original Message-----
>>> From: Andrew Sykes [mailto:
[hidden email]]
>>> Sent: Thursday, July 06, 2006 2:31 PM
>>> To:
[hidden email]
>>> Subject: Re: binnding RMIDispatcher to client
>>>
>>> Brett, Raj,
>>>
>>> As I understand it, Raj wanted to query the security services.
>>> RMI would
>>> seem like a good choice for this.
>>>
>>> Would you agree Brett?
>>>
>>> - Andrew
>>>
>>> On Thu, 2006-07-06 at 00:17 -0600, Brett Palmer wrote:
>>>> Raj,
>>>>
>>>> Yes, in theory you should be able to access ofbiz as a backend
>>>> service
>>>> provider from any Java client that can make an RMI call via the
>>>> RMIDispatcher. We use the RMIDispatcher to run our tests and
>>>> utilities.
>>>>
>>>> That said you would have to consider a few things.
>>>>
>>>> 1. All services would have to be set as export="true"
>>>>
>>>> 2. Most ofbiz services require authentication which it gets by
>>>> reading
>>>> session variables in the container. If you use RMI those sessions
>>>> will not be created. You would have to pass this information in
>>>> with
>>>> the call using the "userLogin" parameter.
>>>>
>>>> 3. Some objects don't serialize correctly from client to
>>>> server. For
>>>> example, you can pass a GenericValue between an RMI client and
>>>> server
>>>> but if a method in the object refers to the entity engine
>>>> configuration the object will fail on the client. For these
>>>> types of
>>>> problems we usually just pass simple data types that just contain
>>>> data.
>>>>
>>>> 4. RMI protocols are usually only support within an Intranet type
> network.
>>>>
>>>> Hope that helps.
>>>>
>>>> Brett
>>>>
>>>>
>>>> On 7/5/06, Raj <
[hidden email]> wrote:
>>>>> Yes Brett,I also did it ,how to solve this problem ,and one more
> thing
>>> Brett
>>>>> If I get dispatcher from RMI Client .is it possible to bring ofbiz
> as a
>>>>> backend for any external application
>>>>>
>>>>> -----Original Message-----
>>>>> From: Brett Palmer [mailto:
[hidden email]]
>>>>> Sent: Thursday, July 06, 2006 10:55 AM
>>>>> To:
[hidden email]; ponnusamy.raj@tenth-
>>>>> planet.com
>>>>> Subject: Re: binnding RMIDispatcher to client
>>>>>
>>>>> Raj,
>>>>>
>>>>> You will also get this error if you have compiled the server and
>>>>> client differently.
>>>>>
>>>>> For example, if I build ofbiz with ant and startup the server as
>>>>> normal and then try to connect to server via RMI from a client
> running
>>>>> in Eclipse I will get this error.
>>>>>
>>>>>
>>>>> Brett
>>>>>
>>>>> On 7/5/06, Raj <
[hidden email]> wrote:
>>>>>> Hi all
>>>>>>
>>>>>> I invoke the ofbiz RMIDispatcher from client to ofbiz server .I
> also
>>>>> change
>>>>>> latest ofbiz-service-rmi.jar from server to client.but I can't
>>>>>> get
>>> through
>>>>>> it ,please any body help me.here I listed log file
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>> java.rmi.UnmarshalException: error unmarshalling return; nested
>>> exception
>>>>>> is:
>>>>>>
>>>>>> java.io.InvalidClassException:
>>>>>> org.ofbiz.service.rmi.socket.zip.CompressionClientSocketFactory;
> local
>>>>> class
>>>>>> incompatible: stream classdesc serialVersionUID =
>>> -7751495693367440749,
>>>>>> local class serialVersionUID = 830610525710844423
>>>>>>
>>>>>> at sun.rmi.registry.RegistryImpl_Stub.lookup(Unknown
>>>>>> Source)
>>>>>>
>>>>>> at java.rmi.Naming.lookup(Naming.java:84)
>>>>>>
>>>>>> at
> src.ExampleRemoteClient.<init>(ExampleRemoteClient.java:36)
>>>>>>
>>>>>> at src.ExampleRemoteClient.main(ExampleRemoteClient.java:
>>>>>> 55)
>>>>>>
>>>>>> Caused by: java.io.InvalidClassException:
>>>>>> org.ofbiz.service.rmi.socket.zip.CompressionClientSocketFactory;
> local
>>>>> class
>>>>>> incompatible: stream classdesc serialVersionUID =
>>> -7751495693367440749,
>>>>>> local class serialVersionUID = 830610525710844423
>>>>>>
>>>>>> at
>>>>> java.io.ObjectStreamClass.initNonProxy(ObjectStreamClass.java:463)
>>>>>>
>>>>>> at
>>>>>>
>>> java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:
>>> 1521)
>>>>>>
>>>>>> at
>>>>>>
> java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1435)
>>>>>>
>>>>>> at
>>>>>>
>>>
> java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:
> 1626)
>>>>>>
>>>>>> at
>>>>> java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1274)
>>>>>>
>>>>>> at
>>> java.io.ObjectInputStream.readObject(ObjectInputStream.java:324)
>>>>>>
>>>>>> at
> sun.rmi.transport.tcp.TCPEndpoint.read(TCPEndpoint.java:504)
>>>>>>
>>>>>> at sun.rmi.transport.LiveRef.read(LiveRef.java:254)
>>>>>>
>>>>>> at
> sun.rmi.server.UnicastRef2.readExternal(UnicastRef2.java:54)
>>>>>>
>>>>>> at
>>> java.rmi.server.RemoteObject.readObject(RemoteObject.java:420)
>>>>>>
>>>>>> 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
>>>>>>
> java.io.ObjectStreamClass.invokeReadObject(ObjectStreamClass.java:838)
>>>>>>
>>>>>> at
>>>>>>
> java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1746)
>>>>>>
>>>>>> at
>>>>>>
>>>
> java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:
> 1646)
>>>>>>
>>>>>> at
>>>>> java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1274)
>>>>>>
>>>>>> at
>>> java.io.ObjectInputStream.readObject(ObjectInputStream.java:324)
>>>>>>
>>>>>> ... 4 more
>>>>>>
>>>>>>
>>>>>>
>>>>>> Regards
>>>>>>
>>>>>> P.Raj
>>>>>>
>>>>>>
>>>>>>
>>>>>
>>>>>
>>> --
>>> Kind Regards
>>> Andrew Sykes <
[hidden email]>
>>> Sykes Development Ltd
>>>
http://www.sykesdevelopment.com>>>
>>>
>>>
> --
> Kind Regards
> Andrew Sykes <
[hidden email]>
> Sykes Development Ltd
>
http://www.sykesdevelopment.com>
>