You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ofbiz.apache.org by Raj <po...@tenth-planet.com> on 2006/07/05 19:08:37 UTC

binnding RMIDispatcher to client

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


Re: binnding RMIDispatcher to client

Posted by BJ Freeman <bj...@free-man.net>.
it is best when you change things from what the SVN is, that you include 
the changes as an attachment.

Raj sent the following on 7/5/2006 10:08 AM:
> 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
> 
> 

Re: binding RMIDispatcher to client

Posted by Wojciech Gdela <el...@poczta.onet.pl>.
Hello,

http://java.sun.com/j2se/1.5.0/docs/api/java/io/Serializable.html

"However, it is _strongly_recommended_ that all serializable classes
explicitly declare serialVersionUID values, since the default
serialVersionUID computation is highly sensitive to class details that
may vary depending on compiler implementations, and can thus result in
unexpected InvalidClassExceptions during deserialization."

See also:
http://www.javapractices.com/Topic45.cjp

-- 
Best regards,
Wojciech Gdela

> One trick with this: it is a good temporary fix, but not something I
> think we'll do in the project because it is tough to remember to
> manually change it each time the fields (or the data structure in
> general of the class) change.
> 
> -David
> 
> 
> On Aug 8, 2006, at 3:36 PM, Brett Palmer wrote:
> 
>> FYI,
>>
>> Another quick fix to the RMI serialization problem is to explicitly
>> define the serialization constant, serialVersionUI.  Then it doesn't
>> matter if the code was compiled outside of eclipse (i.e. Ant for
>> ofbiz) or inside eclipse for your RMI test client.
>>
>> For example:
>>
>>  private static final long serialVersionUID = -6978458356505526156L;
>>
>> This may be impractical to do for every serializable class in ofbiz
>> but it does work on a case by case basis.
>>
>>
>>
>> Brett
> 
> 


Re: binding RMIDispatcher to client

Posted by "David E. Jones" <jo...@undersunconsulting.com>.
One trick with this: it is a good temporary fix, but not something I  
think we'll do in the project because it is tough to remember to  
manually change it each time the fields (or the data structure in  
general of the class) change.

-David


On Aug 8, 2006, at 3:36 PM, Brett Palmer wrote:

> FYI,
>
> Another quick fix to the RMI serialization problem is to explicitly
> define the serialization constant, serialVersionUI.  Then it doesn't
> matter if the code was compiled outside of eclipse (i.e. Ant for
> ofbiz) or inside eclipse for your RMI test client.
>
> For example:
>
>  private static final long serialVersionUID = -6978458356505526156L;
>
> This may be impractical to do for every serializable class in ofbiz
> but it does work on a case by case basis.
>
>
>
> Brett


Re: binding RMIDispatcher to client

Posted by Brett Palmer <br...@gmail.com>.
FYI,

Another quick fix to the RMI serialization problem is to explicitly
define the serialization constant, serialVersionUI.  Then it doesn't
matter if the code was compiled outside of eclipse (i.e. Ant for
ofbiz) or inside eclipse for your RMI test client.

For example:

  private static final long serialVersionUID = -6978458356505526156L;

This may be impractical to do for every serializable class in ofbiz
but it does work on a case by case basis.



Brett

Re: binding RMIDispatcher to client

Posted by Jacques Le Roux <ja...@les7arts.com>.
For that in Eclipse you may use Windows/Preferences/General/Workspace : "refresh automatically"

Jacques

From: "BJ Freeman" <bj...@free-man.net>
> if you put the library paths in the project you need to do a refresh 
> after a build. this is to resolve unsatisfied links in the project paths.
> 
>   like the simple method of inserting debug info code when I want to see 
> something.
> 
> 
> Brett Palmer sent the following on 8/4/2006 5:10 PM:
> > That would be nice to include an eclipse project to do this.  One
> > problem with item 2 is if you depend on the build/lib/*.jar files
> > these will be continually deleted by Ant.  This will give you errors
> > in eclipse.  And in some cases you want be able to run an Ant clean
> > while eclipse is loaded since it will have a handle on those libraries
> > and the ant clean target will ffail.
> > 
> > To do it right, you probably need to copy the build libraries into an
> > independent directory specfically for RMI client stuff (and then be
> > aware of dependencies when the code changes).
> > 
> > 
> > Brett
> > 
> > On 8/4/06, Daniel Kunkel <Da...@biowaves.com> wrote:
> >> Hi
> >>
> >> I wonder if we can, and if we should do step 2 at a project level to
> >> avoid this problem in the future...
> >>
> >>
> >>
> >>
> >> On Fri, 2006-08-04 at 17:24 -0600, Brett Palmer wrote:
> >> > John,
> >> >
> >> > Yes this is a problem with trying to run the RMI client in the Eclipse
> >> > debugger.  I believe the problem occurs because ofbiz is compiled
> >> > using Ant and is not being compiled by Eclipse.  Then when you run the
> >> > RMI client within eclipse you get an incompatibility because the RMI
> >> > client is using all  the ofibz code that is in eclipse.  Does this
> >> > make any sense?  Running Ant within eclipse won't help either because
> >> > I believe the is still compiling outside of eclipse.
> >> >
> >> > There are a couple ways to work around this problem.  The first one is
> >> > the easiest and the second is more tedious.
> >> >
> >> >
> >> > 1. Create a simple script that executes the RMI client application.  I
> >> > am assuming that you are really trying to debug an ofbiz service and
> >> > not the RMI client itself.  Then with Eclipse create a remote debug
> >> > session with the server and set your break points in the server code
> >> > you want to debug.  When the RMI client request hits the server the
> >> > debugger will stop at your break point.
> >> >
> >> > Your script will need to include all the necessary Jar files to work.
> >> > I will include a sample at the bottom of this E-mail.  You usually
> >> > have to tweak the classpaths a little but once everything is working
> >> > you can easily debug server side code using RMI.
> >> >
> >> > 2. Another approach would be to create an eclipse project that
> >> > contained all the ofbiz built Jar files that were necessary for RMI
> >> > communication.  Then server libraries would match with the client
> >> > libraries.
> >> >
> >> > Does anyone else have an easier solution?
> >> >
> >> >
> >> > Brett
> >> >
> >> > /******************** Sample batch file for executing an RMI Client
> >> > ***********************/
> >> >
> >> >
> >> > set OFBIZ_HOME=../../../../ofbiz
> >> >
> >> > set OFBIZ_BASE=%OFBIZ_HOME%/framework/base
> >> > set OFBIZ_FRAMEWORK=%OFBIZ_HOME%/framework
> >> > set OFBIZ_APPLICATIONS=%OFBIZ_HOME%/applications
> >> > set LOCAL_LIB=../../build/lib
> >> >
> >> >
> >> > set OFBIZ_CP=%OFBIZ_BASE%/lib/junit.jar
> >> >
> >> > set OFBIZ_CP=%OFBIZ_CP%;%OFBIZ_BASE%/build/lib/ofbiz-base.jar
> >> > set OFBIZ_CP=%OFBIZ_CP%;%OFBIZ_BASE%/build/lib/ofbiz.jar
> >> > set OFBIZ_CP=%OFBIZ_CP%;%OFBIZ_BASE%/lib/freemarker.jar
> >> > set OFBIZ_CP=%OFBIZ_CP%;%OFBIZ_BASE%/lib/xml-apis.jar
> >> > set OFBIZ_CP=%OFBIZ_CP%;%OFBIZ_BASE%/lib/xerces.jar
> >> > set OFBIZ_CP=%OFBIZ_CP%;%OFBIZ_BASE%/lib/xercesImpl.jar
> >> > set OFBIZ_CP=%OFBIZ_CP%;%OFBIZ_BASE%/lib/servlet.jar
> >> > set OFBIZ_CP=%OFBIZ_CP%;%OFBIZ_BASE%/lib/activate.jar
> >> > set OFBIZ_CP=%OFBIZ_CP%;%OFBIZ_BASE%/lib/log4j.jar
> >> > set OFBIZ_CP=%OFBIZ_CP%;%OFBIZ_BASE%/lib/jdbm.jar
> >> > set OFBIZ_CP=%OFBIZ_CP%;%OFBIZ_BASE%/lib/javolution.jar
> >> >
> >> > set 
> >> OFBIZ_CP=%OFBIZ_CP%;%OFBIZ_BASE%/lib/avalon-util-exception-1.0.0.jar
> >> > set OFBIZ_CP=%OFBIZ_CP%;%OFBIZ_BASE%/lib/commons/commons-logging.jar
> >> > set 
> >> OFBIZ_CP=%OFBIZ_CP%;%OFBIZ_BASE%/lib/commons/commons-collections.jar
> >> > set OFBIZ_CP=%OFBIZ_CP%;%OFBIZ_BASE%/lib/scripting/bsh.jar
> >> > set OFBIZ_CP=%OFBIZ_CP%;%OFBIZ_BASE%/lib/scripting/bsf.jar
> >> > set OFBIZ_CP=%OFBIZ_CP%;%OFBIZ_BASE%/lib/scripting/js.jar
> >> > set OFBIZ_CP=%OFBIZ_CP%;%OFBIZ_BASE%/lib/scripting/oro.jar
> >> >
> >> > set OFBIZ_CP=%OFBIZ_CP%;%OFBIZ_BASE%/config
> >> >
> >> > set OFBIZ_CP=%OFBIZ_CP%;%OFBIZ_FRAMEWORK%/entity/dtd
> >> > set OFBIZ_CP=%OFBIZ_CP%;%OFBIZ_FRAMEWORK%/entity/config
> >> > set 
> >> OFBIZ_CP=%OFBIZ_CP%;%OFBIZ_FRAMEWORK%/entity/build/lib/ofbiz-entity.jar
> >> > set 
> >> OFBIZ_CP=%OFBIZ_CP%;%OFBIZ_FRAMEWORK%/entityext/build/lib/ofbiz-entityext.jar 
> >>
> >> > set OFBIZ_CP=%OFBIZ_CP%;%OFBIZ_FRAMEWORK%/entityext/dtd
> >> > set 
> >> OFBIZ_CP=%OFBIZ_CP%;%OFBIZ_FRAMEWORK%/entity/lib/jdbc/mm.mysql-2.0.14-bin.jar 
> >>
> >> > set 
> >> OFBIZ_CP=%OFBIZ_CP%;%OFBIZ_FRAMEWORK%/entity/lib/jdbc/postgresql.jar
> >> > set OFBIZ_CP=%OFBIZ_CP%;%OFBIZ_FRAMEWORK%/entity/lib/jotm/jotm.jar
> >> > set 
> >> OFBIZ_CP=%OFBIZ_CP%;%OFBIZ_FRAMEWORK%/entity/lib/jotm/jotm_iiop_stubs.jar
> >> > set 
> >> OFBIZ_CP=%OFBIZ_CP%;%OFBIZ_FRAMEWORK%/entity/lib/jotm/jotm_jrmp_stubs.jar
> >> > set 
> >> OFBIZ_CP=%OFBIZ_CP%;%OFBIZ_FRAMEWORK%/entity/lib/dbcp/commons-pool.jar
> >> > set 
> >> OFBIZ_CP=%OFBIZ_CP%;%OFBIZ_FRAMEWORK%/entity/lib/dbcp/commons-dbcp.jar
> >> > set 
> >> OFBIZ_CP=%OFBIZ_CP%;%OFBIZ_FRAMEWORK%/content/build/lib/ofbiz-content.jar
> >> > set OFBIZ_CP=%OFBIZ_CP%;%OFBIZ_FRAMEWORK%/lib/common/classes12.zip
> >> > set OFBIZ_CP=%OFBIZ_CP%;%OFBIZ_FRAMEWORK%/minerva/lib/jta_1.0.1.jar
> >> > set 
> >> OFBIZ_CP=%OFBIZ_CP%;%OFBIZ_FRAMEWORK%/minerva/lib/oswego-concurrent.jar
> >> > set 
> >> OFBIZ_CP=%OFBIZ_CP%;%OFBIZ_FRAMEWORK%/minerva/build/lib/ofbiz-minerva.jar
> >> > set 
> >> OFBIZ_CP=%OFBIZ_CP%;%OFBIZ_FRAMEWORK%/service/build/lib/ofbiz-service.jar
> >> > set 
> >> OFBIZ_CP=%OFBIZ_CP%;%OFBIZ_FRAMEWORK%/service/build/lib/ofbiz-service-rmi.raj 
> >>
> >> > set OFBIZ_CP=%OFBIZ_CP%;%OFBIZ_FRAMEWORK%/service/lib/wsdl4j.jar
> >> > set OFBIZ_CP=%OFBIZ_CP%;%OFBIZ_FRAMEWORK%/service/config
> >> >
> >> > set 
> >> OFBIZ_CP=%OFBIZ_CP%;%OFBIZ_FRAMEWORK%/security/build/lib/ofbiz-security.jar 
> >>
> >> > set OFBIZ_CP=%OFBIZ_CP%;%OFBIZ_FRAMEWORK%/security/config
> >> > set 
> >> OFBIZ_CP=%OFBIZ_CP%;%OFBIZ_FRAMEWORK%/securityext/build/lib/ofbiz-securityext.jar 
> >>
> >> >
> >> > set 
> >> OFBIZ_CP=%OFBIZ_CP%;%OFBIZ_APPLICATIONS%/order/build/lib/ofbiz-order.jar
> >> >
> >> > set OFBIZ_CP=%OFBIZ_CP%;%LOCAL_LIB%/ofbiz-erp.jar
> >> > set OFBIZ_CP=%OFBIZ_CP%;%LOCAL_LIB%/ofbiz-erp.jar
> >> >
> >> >
> >> > set CP=%OFBIZ_CP%
> >> > rem echo CLASSPATH=%CP%
> >> > rem echo OFBIZ_HOME=%OFBIZ_HOME%
> >> >
> >> >
> >> > java -Dofbiz.home=%OFBIZ_HOME% -cp %CP% <Your RMI Client Program>
> >> >
> >> >
> >> >
> >> >
> >> > On 8/4/06, John Martin <pb...@yahoo.com> wrote:
> >> > > HELP!
> >> > >
> >> > > I've been running into the same problem as what was reported in 
> >> this thread
> >> > > before.  When attempting to run a RMI client I get the exception:
> >> > >
> >> > > org.ofbiz.service.rmi.socket.ssl.SSLClientSocketFactory; local class
> >> > > incompatible: stream classdesc serialVersionUID = 
> >> -6771263703492769955, local
> >> > > class serialVersionUID = 2417260480409974286
> >> > >         at sun.rmi.registry.RegistryImpl_Stub.lookup(Unknown Source)
> >> > >
> >> > > Hopefully this has been resolved by someone?
> >> > >
> >> > > Thanks!
> >> > >
> >> > > John
> >> > >
> >> > > Here's my steps:
> >> > >
> >> > > 1. clean build of the application server: ant build (command line)
> >> > >
> >> > >    codebase: ofbiz_opentaps_424208
> >> > >    WindowsXP
> >> > >    java 1.4.2
> >> > >    Eclipse 3.1
> >> > >
> >> > >
> >> > > 2. Copied the following jars into my classpath:
> >> > >    ofbiz-base.jar
> >> > >    ofbiz-entity.jar   <--- There were some dependencies found in 
> >> this jar
> >> > >    ofbiz-service-rmi.jar
> >> > >    commons-collections.jar
> >> > >    javolution.jar
> >> > >    jdbm.jar
> >> > >    log4j.jar
> >> > >
> >> > >    NOTE:  I had to add a line to the ofbiz-service-rmi.jar 
> >> (rmi-jar) build.xml
> >> > > script because there were a bunch of references into the 
> >> org.ofbiz.service
> >> > > directories not getting pulled in.
> >> > >
> >> > >     <fileset dir="${build.dir}/classes" 
> >> includes="org/ofbiz/service/**"/>
> >> > >
> >> > > 3. start application startofbiz.bat
> >> > >
> >> > > 4. In Eclipse, run the RMI Client Example.
> >> > >
> >> > > When I attempt to execute this line:
> >> > >
> >> > >     rd = (RemoteDispatcher) Naming.lookup(RMI_URL);
> >> > >
> >> > > I get the following exception:
> >> > >
> >> > > java.rmi.UnmarshalException: error unmarshalling return; nested 
> >> exception is:
> >> > >         java.io.InvalidClassException:
> >> > > org.ofbiz.service.rmi.socket.ssl.SSLClientSocketFactory; local class
> >> > > incompatible: stream classdesc serialVersionUID = 
> >> -6771263703492769955, local
> >> > > class serialVersionUID = 2417260480409974286
> >> > >         at sun.rmi.registry.RegistryImpl_Stub.lookup(Unknown Source)
> >> > >         at java.rmi.Naming.lookup(Unknown Source)
> >> > >         at 
> >> org.ofbiz.service.rmi.ExampleRemoteClient.<init>(ExampleRemoteClient.java:55) 
> >>
> >> > >         at 
> >> org.ofbiz.service.rmi.ExampleRemoteClient.main(ExampleRemoteClient.java:76) 
> >>
> >> > > Caused by: java.io.InvalidClassException:
> >> > > org.ofbiz.service.rmi.socket.ssl.SSLClientSocketFactory; local class
> >> > > incompatible: stream classdesc serialVersionUID = 
> >> -6771263703492769955, local
> >> > > class serialVersionUID = 2417260480409974286
> >> > >         at java.io.ObjectStreamClass.initNonProxy(Unknown Source)
> >> > >         at java.io.ObjectInputStream.readNonProxyDesc(Unknown Source)
> >> > >         at java.io.ObjectInputStream.readClassDesc(Unknown Source)
> >> > >         at java.io.ObjectInputStream.readOrdinaryObject(Unknown 
> >> Source)
> >> > >         at java.io.ObjectInputStream.readObject0(Unknown Source)
> >> > >         at java.io.ObjectInputStream.readObject(Unknown Source)
> >> > >         at sun.rmi.transport.tcp.TCPEndpoint.read(Unknown Source)
> >> > >         at sun.rmi.transport.LiveRef.read(Unknown Source)
> >> > >         at sun.rmi.server.UnicastRef2.readExternal(Unknown Source)
> >> > >         at java.rmi.server.RemoteObject.readObject(Unknown Source)
> >> > >         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native 
> >> Method)
> >> > >         at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown 
> >> Source)
> >> > >         at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown 
> >> Source)
> >> > >         at java.lang.reflect.Method.invoke(Unknown Source)
> >> > >         at java.io.ObjectStreamClass.invokeReadObject(Unknown Source)
> >> > >         at java.io.ObjectInputStream.readSerialData(Unknown Source)
> >> > >         at java.io.ObjectInputStream.readOrdinaryObject(Unknown 
> >> Source)
> >> > >         at java.io.ObjectInputStream.readObject0(Unknown Source)
> >> > >         at java.io.ObjectInputStream.readObject(Unknown Source)
> >> > >         ... 4 more
> >> > >
> >> > >
> >>
> >>
> >

Re: binding RMIDispatcher to client

Posted by BJ Freeman <bj...@free-man.net>.
if you put the library paths in the project you need to do a refresh 
after a build. this is to resolve unsatisfied links in the project paths.

  like the simple method of inserting debug info code when I want to see 
something.


Brett Palmer sent the following on 8/4/2006 5:10 PM:
> That would be nice to include an eclipse project to do this.  One
> problem with item 2 is if you depend on the build/lib/*.jar files
> these will be continually deleted by Ant.  This will give you errors
> in eclipse.  And in some cases you want be able to run an Ant clean
> while eclipse is loaded since it will have a handle on those libraries
> and the ant clean target will ffail.
> 
> To do it right, you probably need to copy the build libraries into an
> independent directory specfically for RMI client stuff (and then be
> aware of dependencies when the code changes).
> 
> 
> Brett
> 
> On 8/4/06, Daniel Kunkel <Da...@biowaves.com> wrote:
>> Hi
>>
>> I wonder if we can, and if we should do step 2 at a project level to
>> avoid this problem in the future...
>>
>>
>>
>>
>> On Fri, 2006-08-04 at 17:24 -0600, Brett Palmer wrote:
>> > John,
>> >
>> > Yes this is a problem with trying to run the RMI client in the Eclipse
>> > debugger.  I believe the problem occurs because ofbiz is compiled
>> > using Ant and is not being compiled by Eclipse.  Then when you run the
>> > RMI client within eclipse you get an incompatibility because the RMI
>> > client is using all  the ofibz code that is in eclipse.  Does this
>> > make any sense?  Running Ant within eclipse won't help either because
>> > I believe the is still compiling outside of eclipse.
>> >
>> > There are a couple ways to work around this problem.  The first one is
>> > the easiest and the second is more tedious.
>> >
>> >
>> > 1. Create a simple script that executes the RMI client application.  I
>> > am assuming that you are really trying to debug an ofbiz service and
>> > not the RMI client itself.  Then with Eclipse create a remote debug
>> > session with the server and set your break points in the server code
>> > you want to debug.  When the RMI client request hits the server the
>> > debugger will stop at your break point.
>> >
>> > Your script will need to include all the necessary Jar files to work.
>> > I will include a sample at the bottom of this E-mail.  You usually
>> > have to tweak the classpaths a little but once everything is working
>> > you can easily debug server side code using RMI.
>> >
>> > 2. Another approach would be to create an eclipse project that
>> > contained all the ofbiz built Jar files that were necessary for RMI
>> > communication.  Then server libraries would match with the client
>> > libraries.
>> >
>> > Does anyone else have an easier solution?
>> >
>> >
>> > Brett
>> >
>> > /******************** Sample batch file for executing an RMI Client
>> > ***********************/
>> >
>> >
>> > set OFBIZ_HOME=../../../../ofbiz
>> >
>> > set OFBIZ_BASE=%OFBIZ_HOME%/framework/base
>> > set OFBIZ_FRAMEWORK=%OFBIZ_HOME%/framework
>> > set OFBIZ_APPLICATIONS=%OFBIZ_HOME%/applications
>> > set LOCAL_LIB=../../build/lib
>> >
>> >
>> > set OFBIZ_CP=%OFBIZ_BASE%/lib/junit.jar
>> >
>> > set OFBIZ_CP=%OFBIZ_CP%;%OFBIZ_BASE%/build/lib/ofbiz-base.jar
>> > set OFBIZ_CP=%OFBIZ_CP%;%OFBIZ_BASE%/build/lib/ofbiz.jar
>> > set OFBIZ_CP=%OFBIZ_CP%;%OFBIZ_BASE%/lib/freemarker.jar
>> > set OFBIZ_CP=%OFBIZ_CP%;%OFBIZ_BASE%/lib/xml-apis.jar
>> > set OFBIZ_CP=%OFBIZ_CP%;%OFBIZ_BASE%/lib/xerces.jar
>> > set OFBIZ_CP=%OFBIZ_CP%;%OFBIZ_BASE%/lib/xercesImpl.jar
>> > set OFBIZ_CP=%OFBIZ_CP%;%OFBIZ_BASE%/lib/servlet.jar
>> > set OFBIZ_CP=%OFBIZ_CP%;%OFBIZ_BASE%/lib/activate.jar
>> > set OFBIZ_CP=%OFBIZ_CP%;%OFBIZ_BASE%/lib/log4j.jar
>> > set OFBIZ_CP=%OFBIZ_CP%;%OFBIZ_BASE%/lib/jdbm.jar
>> > set OFBIZ_CP=%OFBIZ_CP%;%OFBIZ_BASE%/lib/javolution.jar
>> >
>> > set 
>> OFBIZ_CP=%OFBIZ_CP%;%OFBIZ_BASE%/lib/avalon-util-exception-1.0.0.jar
>> > set OFBIZ_CP=%OFBIZ_CP%;%OFBIZ_BASE%/lib/commons/commons-logging.jar
>> > set 
>> OFBIZ_CP=%OFBIZ_CP%;%OFBIZ_BASE%/lib/commons/commons-collections.jar
>> > set OFBIZ_CP=%OFBIZ_CP%;%OFBIZ_BASE%/lib/scripting/bsh.jar
>> > set OFBIZ_CP=%OFBIZ_CP%;%OFBIZ_BASE%/lib/scripting/bsf.jar
>> > set OFBIZ_CP=%OFBIZ_CP%;%OFBIZ_BASE%/lib/scripting/js.jar
>> > set OFBIZ_CP=%OFBIZ_CP%;%OFBIZ_BASE%/lib/scripting/oro.jar
>> >
>> > set OFBIZ_CP=%OFBIZ_CP%;%OFBIZ_BASE%/config
>> >
>> > set OFBIZ_CP=%OFBIZ_CP%;%OFBIZ_FRAMEWORK%/entity/dtd
>> > set OFBIZ_CP=%OFBIZ_CP%;%OFBIZ_FRAMEWORK%/entity/config
>> > set 
>> OFBIZ_CP=%OFBIZ_CP%;%OFBIZ_FRAMEWORK%/entity/build/lib/ofbiz-entity.jar
>> > set 
>> OFBIZ_CP=%OFBIZ_CP%;%OFBIZ_FRAMEWORK%/entityext/build/lib/ofbiz-entityext.jar 
>>
>> > set OFBIZ_CP=%OFBIZ_CP%;%OFBIZ_FRAMEWORK%/entityext/dtd
>> > set 
>> OFBIZ_CP=%OFBIZ_CP%;%OFBIZ_FRAMEWORK%/entity/lib/jdbc/mm.mysql-2.0.14-bin.jar 
>>
>> > set 
>> OFBIZ_CP=%OFBIZ_CP%;%OFBIZ_FRAMEWORK%/entity/lib/jdbc/postgresql.jar
>> > set OFBIZ_CP=%OFBIZ_CP%;%OFBIZ_FRAMEWORK%/entity/lib/jotm/jotm.jar
>> > set 
>> OFBIZ_CP=%OFBIZ_CP%;%OFBIZ_FRAMEWORK%/entity/lib/jotm/jotm_iiop_stubs.jar
>> > set 
>> OFBIZ_CP=%OFBIZ_CP%;%OFBIZ_FRAMEWORK%/entity/lib/jotm/jotm_jrmp_stubs.jar
>> > set 
>> OFBIZ_CP=%OFBIZ_CP%;%OFBIZ_FRAMEWORK%/entity/lib/dbcp/commons-pool.jar
>> > set 
>> OFBIZ_CP=%OFBIZ_CP%;%OFBIZ_FRAMEWORK%/entity/lib/dbcp/commons-dbcp.jar
>> > set 
>> OFBIZ_CP=%OFBIZ_CP%;%OFBIZ_FRAMEWORK%/content/build/lib/ofbiz-content.jar
>> > set OFBIZ_CP=%OFBIZ_CP%;%OFBIZ_FRAMEWORK%/lib/common/classes12.zip
>> > set OFBIZ_CP=%OFBIZ_CP%;%OFBIZ_FRAMEWORK%/minerva/lib/jta_1.0.1.jar
>> > set 
>> OFBIZ_CP=%OFBIZ_CP%;%OFBIZ_FRAMEWORK%/minerva/lib/oswego-concurrent.jar
>> > set 
>> OFBIZ_CP=%OFBIZ_CP%;%OFBIZ_FRAMEWORK%/minerva/build/lib/ofbiz-minerva.jar
>> > set 
>> OFBIZ_CP=%OFBIZ_CP%;%OFBIZ_FRAMEWORK%/service/build/lib/ofbiz-service.jar
>> > set 
>> OFBIZ_CP=%OFBIZ_CP%;%OFBIZ_FRAMEWORK%/service/build/lib/ofbiz-service-rmi.raj 
>>
>> > set OFBIZ_CP=%OFBIZ_CP%;%OFBIZ_FRAMEWORK%/service/lib/wsdl4j.jar
>> > set OFBIZ_CP=%OFBIZ_CP%;%OFBIZ_FRAMEWORK%/service/config
>> >
>> > set 
>> OFBIZ_CP=%OFBIZ_CP%;%OFBIZ_FRAMEWORK%/security/build/lib/ofbiz-security.jar 
>>
>> > set OFBIZ_CP=%OFBIZ_CP%;%OFBIZ_FRAMEWORK%/security/config
>> > set 
>> OFBIZ_CP=%OFBIZ_CP%;%OFBIZ_FRAMEWORK%/securityext/build/lib/ofbiz-securityext.jar 
>>
>> >
>> > set 
>> OFBIZ_CP=%OFBIZ_CP%;%OFBIZ_APPLICATIONS%/order/build/lib/ofbiz-order.jar
>> >
>> > set OFBIZ_CP=%OFBIZ_CP%;%LOCAL_LIB%/ofbiz-erp.jar
>> > set OFBIZ_CP=%OFBIZ_CP%;%LOCAL_LIB%/ofbiz-erp.jar
>> >
>> >
>> > set CP=%OFBIZ_CP%
>> > rem echo CLASSPATH=%CP%
>> > rem echo OFBIZ_HOME=%OFBIZ_HOME%
>> >
>> >
>> > java -Dofbiz.home=%OFBIZ_HOME% -cp %CP% <Your RMI Client Program>
>> >
>> >
>> >
>> >
>> > On 8/4/06, John Martin <pb...@yahoo.com> wrote:
>> > > HELP!
>> > >
>> > > I've been running into the same problem as what was reported in 
>> this thread
>> > > before.  When attempting to run a RMI client I get the exception:
>> > >
>> > > org.ofbiz.service.rmi.socket.ssl.SSLClientSocketFactory; local class
>> > > incompatible: stream classdesc serialVersionUID = 
>> -6771263703492769955, local
>> > > class serialVersionUID = 2417260480409974286
>> > >         at sun.rmi.registry.RegistryImpl_Stub.lookup(Unknown Source)
>> > >
>> > > Hopefully this has been resolved by someone?
>> > >
>> > > Thanks!
>> > >
>> > > John
>> > >
>> > > Here's my steps:
>> > >
>> > > 1. clean build of the application server: ant build (command line)
>> > >
>> > >    codebase: ofbiz_opentaps_424208
>> > >    WindowsXP
>> > >    java 1.4.2
>> > >    Eclipse 3.1
>> > >
>> > >
>> > > 2. Copied the following jars into my classpath:
>> > >    ofbiz-base.jar
>> > >    ofbiz-entity.jar   <--- There were some dependencies found in 
>> this jar
>> > >    ofbiz-service-rmi.jar
>> > >    commons-collections.jar
>> > >    javolution.jar
>> > >    jdbm.jar
>> > >    log4j.jar
>> > >
>> > >    NOTE:  I had to add a line to the ofbiz-service-rmi.jar 
>> (rmi-jar) build.xml
>> > > script because there were a bunch of references into the 
>> org.ofbiz.service
>> > > directories not getting pulled in.
>> > >
>> > >     <fileset dir="${build.dir}/classes" 
>> includes="org/ofbiz/service/**"/>
>> > >
>> > > 3. start application startofbiz.bat
>> > >
>> > > 4. In Eclipse, run the RMI Client Example.
>> > >
>> > > When I attempt to execute this line:
>> > >
>> > >     rd = (RemoteDispatcher) Naming.lookup(RMI_URL);
>> > >
>> > > I get the following exception:
>> > >
>> > > java.rmi.UnmarshalException: error unmarshalling return; nested 
>> exception is:
>> > >         java.io.InvalidClassException:
>> > > org.ofbiz.service.rmi.socket.ssl.SSLClientSocketFactory; local class
>> > > incompatible: stream classdesc serialVersionUID = 
>> -6771263703492769955, local
>> > > class serialVersionUID = 2417260480409974286
>> > >         at sun.rmi.registry.RegistryImpl_Stub.lookup(Unknown Source)
>> > >         at java.rmi.Naming.lookup(Unknown Source)
>> > >         at 
>> org.ofbiz.service.rmi.ExampleRemoteClient.<init>(ExampleRemoteClient.java:55) 
>>
>> > >         at 
>> org.ofbiz.service.rmi.ExampleRemoteClient.main(ExampleRemoteClient.java:76) 
>>
>> > > Caused by: java.io.InvalidClassException:
>> > > org.ofbiz.service.rmi.socket.ssl.SSLClientSocketFactory; local class
>> > > incompatible: stream classdesc serialVersionUID = 
>> -6771263703492769955, local
>> > > class serialVersionUID = 2417260480409974286
>> > >         at java.io.ObjectStreamClass.initNonProxy(Unknown Source)
>> > >         at java.io.ObjectInputStream.readNonProxyDesc(Unknown Source)
>> > >         at java.io.ObjectInputStream.readClassDesc(Unknown Source)
>> > >         at java.io.ObjectInputStream.readOrdinaryObject(Unknown 
>> Source)
>> > >         at java.io.ObjectInputStream.readObject0(Unknown Source)
>> > >         at java.io.ObjectInputStream.readObject(Unknown Source)
>> > >         at sun.rmi.transport.tcp.TCPEndpoint.read(Unknown Source)
>> > >         at sun.rmi.transport.LiveRef.read(Unknown Source)
>> > >         at sun.rmi.server.UnicastRef2.readExternal(Unknown Source)
>> > >         at java.rmi.server.RemoteObject.readObject(Unknown Source)
>> > >         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native 
>> Method)
>> > >         at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown 
>> Source)
>> > >         at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown 
>> Source)
>> > >         at java.lang.reflect.Method.invoke(Unknown Source)
>> > >         at java.io.ObjectStreamClass.invokeReadObject(Unknown Source)
>> > >         at java.io.ObjectInputStream.readSerialData(Unknown Source)
>> > >         at java.io.ObjectInputStream.readOrdinaryObject(Unknown 
>> Source)
>> > >         at java.io.ObjectInputStream.readObject0(Unknown Source)
>> > >         at java.io.ObjectInputStream.readObject(Unknown Source)
>> > >         ... 4 more
>> > >
>> > >
>>
>>
> 

Re: binding RMIDispatcher to client

Posted by Brett Palmer <br...@gmail.com>.
That would be nice to include an eclipse project to do this.  One
problem with item 2 is if you depend on the build/lib/*.jar files
these will be continually deleted by Ant.  This will give you errors
in eclipse.  And in some cases you want be able to run an Ant clean
while eclipse is loaded since it will have a handle on those libraries
and the ant clean target will ffail.

To do it right, you probably need to copy the build libraries into an
independent directory specfically for RMI client stuff (and then be
aware of dependencies when the code changes).


Brett

On 8/4/06, Daniel Kunkel <Da...@biowaves.com> wrote:
> Hi
>
> I wonder if we can, and if we should do step 2 at a project level to
> avoid this problem in the future...
>
>
>
>
> On Fri, 2006-08-04 at 17:24 -0600, Brett Palmer wrote:
> > John,
> >
> > Yes this is a problem with trying to run the RMI client in the Eclipse
> > debugger.  I believe the problem occurs because ofbiz is compiled
> > using Ant and is not being compiled by Eclipse.  Then when you run the
> > RMI client within eclipse you get an incompatibility because the RMI
> > client is using all  the ofibz code that is in eclipse.  Does this
> > make any sense?  Running Ant within eclipse won't help either because
> > I believe the is still compiling outside of eclipse.
> >
> > There are a couple ways to work around this problem.  The first one is
> > the easiest and the second is more tedious.
> >
> >
> > 1. Create a simple script that executes the RMI client application.  I
> > am assuming that you are really trying to debug an ofbiz service and
> > not the RMI client itself.  Then with Eclipse create a remote debug
> > session with the server and set your break points in the server code
> > you want to debug.  When the RMI client request hits the server the
> > debugger will stop at your break point.
> >
> > Your script will need to include all the necessary Jar files to work.
> > I will include a sample at the bottom of this E-mail.  You usually
> > have to tweak the classpaths a little but once everything is working
> > you can easily debug server side code using RMI.
> >
> > 2. Another approach would be to create an eclipse project that
> > contained all the ofbiz built Jar files that were necessary for RMI
> > communication.  Then server libraries would match with the client
> > libraries.
> >
> > Does anyone else have an easier solution?
> >
> >
> > Brett
> >
> > /******************** Sample batch file for executing an RMI Client
> > ***********************/
> >
> >
> > set OFBIZ_HOME=../../../../ofbiz
> >
> > set OFBIZ_BASE=%OFBIZ_HOME%/framework/base
> > set OFBIZ_FRAMEWORK=%OFBIZ_HOME%/framework
> > set OFBIZ_APPLICATIONS=%OFBIZ_HOME%/applications
> > set LOCAL_LIB=../../build/lib
> >
> >
> > set OFBIZ_CP=%OFBIZ_BASE%/lib/junit.jar
> >
> > set OFBIZ_CP=%OFBIZ_CP%;%OFBIZ_BASE%/build/lib/ofbiz-base.jar
> > set OFBIZ_CP=%OFBIZ_CP%;%OFBIZ_BASE%/build/lib/ofbiz.jar
> > set OFBIZ_CP=%OFBIZ_CP%;%OFBIZ_BASE%/lib/freemarker.jar
> > set OFBIZ_CP=%OFBIZ_CP%;%OFBIZ_BASE%/lib/xml-apis.jar
> > set OFBIZ_CP=%OFBIZ_CP%;%OFBIZ_BASE%/lib/xerces.jar
> > set OFBIZ_CP=%OFBIZ_CP%;%OFBIZ_BASE%/lib/xercesImpl.jar
> > set OFBIZ_CP=%OFBIZ_CP%;%OFBIZ_BASE%/lib/servlet.jar
> > set OFBIZ_CP=%OFBIZ_CP%;%OFBIZ_BASE%/lib/activate.jar
> > set OFBIZ_CP=%OFBIZ_CP%;%OFBIZ_BASE%/lib/log4j.jar
> > set OFBIZ_CP=%OFBIZ_CP%;%OFBIZ_BASE%/lib/jdbm.jar
> > set OFBIZ_CP=%OFBIZ_CP%;%OFBIZ_BASE%/lib/javolution.jar
> >
> > set OFBIZ_CP=%OFBIZ_CP%;%OFBIZ_BASE%/lib/avalon-util-exception-1.0.0.jar
> > set OFBIZ_CP=%OFBIZ_CP%;%OFBIZ_BASE%/lib/commons/commons-logging.jar
> > set OFBIZ_CP=%OFBIZ_CP%;%OFBIZ_BASE%/lib/commons/commons-collections.jar
> > set OFBIZ_CP=%OFBIZ_CP%;%OFBIZ_BASE%/lib/scripting/bsh.jar
> > set OFBIZ_CP=%OFBIZ_CP%;%OFBIZ_BASE%/lib/scripting/bsf.jar
> > set OFBIZ_CP=%OFBIZ_CP%;%OFBIZ_BASE%/lib/scripting/js.jar
> > set OFBIZ_CP=%OFBIZ_CP%;%OFBIZ_BASE%/lib/scripting/oro.jar
> >
> > set OFBIZ_CP=%OFBIZ_CP%;%OFBIZ_BASE%/config
> >
> > set OFBIZ_CP=%OFBIZ_CP%;%OFBIZ_FRAMEWORK%/entity/dtd
> > set OFBIZ_CP=%OFBIZ_CP%;%OFBIZ_FRAMEWORK%/entity/config
> > set OFBIZ_CP=%OFBIZ_CP%;%OFBIZ_FRAMEWORK%/entity/build/lib/ofbiz-entity.jar
> > set OFBIZ_CP=%OFBIZ_CP%;%OFBIZ_FRAMEWORK%/entityext/build/lib/ofbiz-entityext.jar
> > set OFBIZ_CP=%OFBIZ_CP%;%OFBIZ_FRAMEWORK%/entityext/dtd
> > set OFBIZ_CP=%OFBIZ_CP%;%OFBIZ_FRAMEWORK%/entity/lib/jdbc/mm.mysql-2.0.14-bin.jar
> > set OFBIZ_CP=%OFBIZ_CP%;%OFBIZ_FRAMEWORK%/entity/lib/jdbc/postgresql.jar
> > set OFBIZ_CP=%OFBIZ_CP%;%OFBIZ_FRAMEWORK%/entity/lib/jotm/jotm.jar
> > set OFBIZ_CP=%OFBIZ_CP%;%OFBIZ_FRAMEWORK%/entity/lib/jotm/jotm_iiop_stubs.jar
> > set OFBIZ_CP=%OFBIZ_CP%;%OFBIZ_FRAMEWORK%/entity/lib/jotm/jotm_jrmp_stubs.jar
> > set OFBIZ_CP=%OFBIZ_CP%;%OFBIZ_FRAMEWORK%/entity/lib/dbcp/commons-pool.jar
> > set OFBIZ_CP=%OFBIZ_CP%;%OFBIZ_FRAMEWORK%/entity/lib/dbcp/commons-dbcp.jar
> > set OFBIZ_CP=%OFBIZ_CP%;%OFBIZ_FRAMEWORK%/content/build/lib/ofbiz-content.jar
> > set OFBIZ_CP=%OFBIZ_CP%;%OFBIZ_FRAMEWORK%/lib/common/classes12.zip
> > set OFBIZ_CP=%OFBIZ_CP%;%OFBIZ_FRAMEWORK%/minerva/lib/jta_1.0.1.jar
> > set OFBIZ_CP=%OFBIZ_CP%;%OFBIZ_FRAMEWORK%/minerva/lib/oswego-concurrent.jar
> > set OFBIZ_CP=%OFBIZ_CP%;%OFBIZ_FRAMEWORK%/minerva/build/lib/ofbiz-minerva.jar
> > set OFBIZ_CP=%OFBIZ_CP%;%OFBIZ_FRAMEWORK%/service/build/lib/ofbiz-service.jar
> > set OFBIZ_CP=%OFBIZ_CP%;%OFBIZ_FRAMEWORK%/service/build/lib/ofbiz-service-rmi.raj
> > set OFBIZ_CP=%OFBIZ_CP%;%OFBIZ_FRAMEWORK%/service/lib/wsdl4j.jar
> > set OFBIZ_CP=%OFBIZ_CP%;%OFBIZ_FRAMEWORK%/service/config
> >
> > set OFBIZ_CP=%OFBIZ_CP%;%OFBIZ_FRAMEWORK%/security/build/lib/ofbiz-security.jar
> > set OFBIZ_CP=%OFBIZ_CP%;%OFBIZ_FRAMEWORK%/security/config
> > set OFBIZ_CP=%OFBIZ_CP%;%OFBIZ_FRAMEWORK%/securityext/build/lib/ofbiz-securityext.jar
> >
> > set OFBIZ_CP=%OFBIZ_CP%;%OFBIZ_APPLICATIONS%/order/build/lib/ofbiz-order.jar
> >
> > set OFBIZ_CP=%OFBIZ_CP%;%LOCAL_LIB%/ofbiz-erp.jar
> > set OFBIZ_CP=%OFBIZ_CP%;%LOCAL_LIB%/ofbiz-erp.jar
> >
> >
> > set CP=%OFBIZ_CP%
> > rem echo CLASSPATH=%CP%
> > rem echo OFBIZ_HOME=%OFBIZ_HOME%
> >
> >
> > java -Dofbiz.home=%OFBIZ_HOME% -cp %CP% <Your RMI Client Program>
> >
> >
> >
> >
> > On 8/4/06, John Martin <pb...@yahoo.com> wrote:
> > > HELP!
> > >
> > > I've been running into the same problem as what was reported in this thread
> > > before.  When attempting to run a RMI client I get the exception:
> > >
> > > org.ofbiz.service.rmi.socket.ssl.SSLClientSocketFactory; local class
> > > incompatible: stream classdesc serialVersionUID = -6771263703492769955, local
> > > class serialVersionUID = 2417260480409974286
> > >         at sun.rmi.registry.RegistryImpl_Stub.lookup(Unknown Source)
> > >
> > > Hopefully this has been resolved by someone?
> > >
> > > Thanks!
> > >
> > > John
> > >
> > > Here's my steps:
> > >
> > > 1. clean build of the application server: ant build (command line)
> > >
> > >    codebase: ofbiz_opentaps_424208
> > >    WindowsXP
> > >    java 1.4.2
> > >    Eclipse 3.1
> > >
> > >
> > > 2. Copied the following jars into my classpath:
> > >    ofbiz-base.jar
> > >    ofbiz-entity.jar   <--- There were some dependencies found in this jar
> > >    ofbiz-service-rmi.jar
> > >    commons-collections.jar
> > >    javolution.jar
> > >    jdbm.jar
> > >    log4j.jar
> > >
> > >    NOTE:  I had to add a line to the ofbiz-service-rmi.jar (rmi-jar) build.xml
> > > script because there were a bunch of references into the org.ofbiz.service
> > > directories not getting pulled in.
> > >
> > >     <fileset dir="${build.dir}/classes" includes="org/ofbiz/service/**"/>
> > >
> > > 3. start application startofbiz.bat
> > >
> > > 4. In Eclipse, run the RMI Client Example.
> > >
> > > When I attempt to execute this line:
> > >
> > >     rd = (RemoteDispatcher) Naming.lookup(RMI_URL);
> > >
> > > I get the following exception:
> > >
> > > java.rmi.UnmarshalException: error unmarshalling return; nested exception is:
> > >         java.io.InvalidClassException:
> > > org.ofbiz.service.rmi.socket.ssl.SSLClientSocketFactory; local class
> > > incompatible: stream classdesc serialVersionUID = -6771263703492769955, local
> > > class serialVersionUID = 2417260480409974286
> > >         at sun.rmi.registry.RegistryImpl_Stub.lookup(Unknown Source)
> > >         at java.rmi.Naming.lookup(Unknown Source)
> > >         at org.ofbiz.service.rmi.ExampleRemoteClient.<init>(ExampleRemoteClient.java:55)
> > >         at org.ofbiz.service.rmi.ExampleRemoteClient.main(ExampleRemoteClient.java:76)
> > > Caused by: java.io.InvalidClassException:
> > > org.ofbiz.service.rmi.socket.ssl.SSLClientSocketFactory; local class
> > > incompatible: stream classdesc serialVersionUID = -6771263703492769955, local
> > > class serialVersionUID = 2417260480409974286
> > >         at java.io.ObjectStreamClass.initNonProxy(Unknown Source)
> > >         at java.io.ObjectInputStream.readNonProxyDesc(Unknown Source)
> > >         at java.io.ObjectInputStream.readClassDesc(Unknown Source)
> > >         at java.io.ObjectInputStream.readOrdinaryObject(Unknown Source)
> > >         at java.io.ObjectInputStream.readObject0(Unknown Source)
> > >         at java.io.ObjectInputStream.readObject(Unknown Source)
> > >         at sun.rmi.transport.tcp.TCPEndpoint.read(Unknown Source)
> > >         at sun.rmi.transport.LiveRef.read(Unknown Source)
> > >         at sun.rmi.server.UnicastRef2.readExternal(Unknown Source)
> > >         at java.rmi.server.RemoteObject.readObject(Unknown Source)
> > >         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> > >         at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
> > >         at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
> > >         at java.lang.reflect.Method.invoke(Unknown Source)
> > >         at java.io.ObjectStreamClass.invokeReadObject(Unknown Source)
> > >         at java.io.ObjectInputStream.readSerialData(Unknown Source)
> > >         at java.io.ObjectInputStream.readOrdinaryObject(Unknown Source)
> > >         at java.io.ObjectInputStream.readObject0(Unknown Source)
> > >         at java.io.ObjectInputStream.readObject(Unknown Source)
> > >         ... 4 more
> > >
> > >
>
>

Re: binding RMIDispatcher to client

Posted by Daniel Kunkel <Da...@BioWaves.com>.
Hi

I wonder if we can, and if we should do step 2 at a project level to
avoid this problem in the future...




On Fri, 2006-08-04 at 17:24 -0600, Brett Palmer wrote:
> John,
> 
> Yes this is a problem with trying to run the RMI client in the Eclipse
> debugger.  I believe the problem occurs because ofbiz is compiled
> using Ant and is not being compiled by Eclipse.  Then when you run the
> RMI client within eclipse you get an incompatibility because the RMI
> client is using all  the ofibz code that is in eclipse.  Does this
> make any sense?  Running Ant within eclipse won't help either because
> I believe the is still compiling outside of eclipse.
> 
> There are a couple ways to work around this problem.  The first one is
> the easiest and the second is more tedious.
> 
> 
> 1. Create a simple script that executes the RMI client application.  I
> am assuming that you are really trying to debug an ofbiz service and
> not the RMI client itself.  Then with Eclipse create a remote debug
> session with the server and set your break points in the server code
> you want to debug.  When the RMI client request hits the server the
> debugger will stop at your break point.
> 
> Your script will need to include all the necessary Jar files to work.
> I will include a sample at the bottom of this E-mail.  You usually
> have to tweak the classpaths a little but once everything is working
> you can easily debug server side code using RMI.
> 
> 2. Another approach would be to create an eclipse project that
> contained all the ofbiz built Jar files that were necessary for RMI
> communication.  Then server libraries would match with the client
> libraries.
> 
> Does anyone else have an easier solution?
> 
> 
> Brett
> 
> /******************** Sample batch file for executing an RMI Client
> ***********************/
> 
> 
> set OFBIZ_HOME=../../../../ofbiz
> 
> set OFBIZ_BASE=%OFBIZ_HOME%/framework/base
> set OFBIZ_FRAMEWORK=%OFBIZ_HOME%/framework
> set OFBIZ_APPLICATIONS=%OFBIZ_HOME%/applications
> set LOCAL_LIB=../../build/lib
> 
> 
> set OFBIZ_CP=%OFBIZ_BASE%/lib/junit.jar
> 
> set OFBIZ_CP=%OFBIZ_CP%;%OFBIZ_BASE%/build/lib/ofbiz-base.jar
> set OFBIZ_CP=%OFBIZ_CP%;%OFBIZ_BASE%/build/lib/ofbiz.jar
> set OFBIZ_CP=%OFBIZ_CP%;%OFBIZ_BASE%/lib/freemarker.jar
> set OFBIZ_CP=%OFBIZ_CP%;%OFBIZ_BASE%/lib/xml-apis.jar
> set OFBIZ_CP=%OFBIZ_CP%;%OFBIZ_BASE%/lib/xerces.jar
> set OFBIZ_CP=%OFBIZ_CP%;%OFBIZ_BASE%/lib/xercesImpl.jar
> set OFBIZ_CP=%OFBIZ_CP%;%OFBIZ_BASE%/lib/servlet.jar
> set OFBIZ_CP=%OFBIZ_CP%;%OFBIZ_BASE%/lib/activate.jar
> set OFBIZ_CP=%OFBIZ_CP%;%OFBIZ_BASE%/lib/log4j.jar
> set OFBIZ_CP=%OFBIZ_CP%;%OFBIZ_BASE%/lib/jdbm.jar
> set OFBIZ_CP=%OFBIZ_CP%;%OFBIZ_BASE%/lib/javolution.jar
> 
> set OFBIZ_CP=%OFBIZ_CP%;%OFBIZ_BASE%/lib/avalon-util-exception-1.0.0.jar
> set OFBIZ_CP=%OFBIZ_CP%;%OFBIZ_BASE%/lib/commons/commons-logging.jar
> set OFBIZ_CP=%OFBIZ_CP%;%OFBIZ_BASE%/lib/commons/commons-collections.jar
> set OFBIZ_CP=%OFBIZ_CP%;%OFBIZ_BASE%/lib/scripting/bsh.jar
> set OFBIZ_CP=%OFBIZ_CP%;%OFBIZ_BASE%/lib/scripting/bsf.jar
> set OFBIZ_CP=%OFBIZ_CP%;%OFBIZ_BASE%/lib/scripting/js.jar
> set OFBIZ_CP=%OFBIZ_CP%;%OFBIZ_BASE%/lib/scripting/oro.jar
> 
> set OFBIZ_CP=%OFBIZ_CP%;%OFBIZ_BASE%/config
> 
> set OFBIZ_CP=%OFBIZ_CP%;%OFBIZ_FRAMEWORK%/entity/dtd
> set OFBIZ_CP=%OFBIZ_CP%;%OFBIZ_FRAMEWORK%/entity/config
> set OFBIZ_CP=%OFBIZ_CP%;%OFBIZ_FRAMEWORK%/entity/build/lib/ofbiz-entity.jar
> set OFBIZ_CP=%OFBIZ_CP%;%OFBIZ_FRAMEWORK%/entityext/build/lib/ofbiz-entityext.jar
> set OFBIZ_CP=%OFBIZ_CP%;%OFBIZ_FRAMEWORK%/entityext/dtd
> set OFBIZ_CP=%OFBIZ_CP%;%OFBIZ_FRAMEWORK%/entity/lib/jdbc/mm.mysql-2.0.14-bin.jar
> set OFBIZ_CP=%OFBIZ_CP%;%OFBIZ_FRAMEWORK%/entity/lib/jdbc/postgresql.jar
> set OFBIZ_CP=%OFBIZ_CP%;%OFBIZ_FRAMEWORK%/entity/lib/jotm/jotm.jar
> set OFBIZ_CP=%OFBIZ_CP%;%OFBIZ_FRAMEWORK%/entity/lib/jotm/jotm_iiop_stubs.jar
> set OFBIZ_CP=%OFBIZ_CP%;%OFBIZ_FRAMEWORK%/entity/lib/jotm/jotm_jrmp_stubs.jar
> set OFBIZ_CP=%OFBIZ_CP%;%OFBIZ_FRAMEWORK%/entity/lib/dbcp/commons-pool.jar
> set OFBIZ_CP=%OFBIZ_CP%;%OFBIZ_FRAMEWORK%/entity/lib/dbcp/commons-dbcp.jar
> set OFBIZ_CP=%OFBIZ_CP%;%OFBIZ_FRAMEWORK%/content/build/lib/ofbiz-content.jar
> set OFBIZ_CP=%OFBIZ_CP%;%OFBIZ_FRAMEWORK%/lib/common/classes12.zip
> set OFBIZ_CP=%OFBIZ_CP%;%OFBIZ_FRAMEWORK%/minerva/lib/jta_1.0.1.jar
> set OFBIZ_CP=%OFBIZ_CP%;%OFBIZ_FRAMEWORK%/minerva/lib/oswego-concurrent.jar
> set OFBIZ_CP=%OFBIZ_CP%;%OFBIZ_FRAMEWORK%/minerva/build/lib/ofbiz-minerva.jar
> set OFBIZ_CP=%OFBIZ_CP%;%OFBIZ_FRAMEWORK%/service/build/lib/ofbiz-service.jar
> set OFBIZ_CP=%OFBIZ_CP%;%OFBIZ_FRAMEWORK%/service/build/lib/ofbiz-service-rmi.raj
> set OFBIZ_CP=%OFBIZ_CP%;%OFBIZ_FRAMEWORK%/service/lib/wsdl4j.jar
> set OFBIZ_CP=%OFBIZ_CP%;%OFBIZ_FRAMEWORK%/service/config
> 
> set OFBIZ_CP=%OFBIZ_CP%;%OFBIZ_FRAMEWORK%/security/build/lib/ofbiz-security.jar
> set OFBIZ_CP=%OFBIZ_CP%;%OFBIZ_FRAMEWORK%/security/config
> set OFBIZ_CP=%OFBIZ_CP%;%OFBIZ_FRAMEWORK%/securityext/build/lib/ofbiz-securityext.jar
> 
> set OFBIZ_CP=%OFBIZ_CP%;%OFBIZ_APPLICATIONS%/order/build/lib/ofbiz-order.jar
> 
> set OFBIZ_CP=%OFBIZ_CP%;%LOCAL_LIB%/ofbiz-erp.jar
> set OFBIZ_CP=%OFBIZ_CP%;%LOCAL_LIB%/ofbiz-erp.jar
> 
> 
> set CP=%OFBIZ_CP%
> rem echo CLASSPATH=%CP%
> rem echo OFBIZ_HOME=%OFBIZ_HOME%
> 
> 
> java -Dofbiz.home=%OFBIZ_HOME% -cp %CP% <Your RMI Client Program>
> 
> 
> 
> 
> On 8/4/06, John Martin <pb...@yahoo.com> wrote:
> > HELP!
> >
> > I've been running into the same problem as what was reported in this thread
> > before.  When attempting to run a RMI client I get the exception:
> >
> > org.ofbiz.service.rmi.socket.ssl.SSLClientSocketFactory; local class
> > incompatible: stream classdesc serialVersionUID = -6771263703492769955, local
> > class serialVersionUID = 2417260480409974286
> >         at sun.rmi.registry.RegistryImpl_Stub.lookup(Unknown Source)
> >
> > Hopefully this has been resolved by someone?
> >
> > Thanks!
> >
> > John
> >
> > Here's my steps:
> >
> > 1. clean build of the application server: ant build (command line)
> >
> >    codebase: ofbiz_opentaps_424208
> >    WindowsXP
> >    java 1.4.2
> >    Eclipse 3.1
> >
> >
> > 2. Copied the following jars into my classpath:
> >    ofbiz-base.jar
> >    ofbiz-entity.jar   <--- There were some dependencies found in this jar
> >    ofbiz-service-rmi.jar
> >    commons-collections.jar
> >    javolution.jar
> >    jdbm.jar
> >    log4j.jar
> >
> >    NOTE:  I had to add a line to the ofbiz-service-rmi.jar (rmi-jar) build.xml
> > script because there were a bunch of references into the org.ofbiz.service
> > directories not getting pulled in.
> >
> >     <fileset dir="${build.dir}/classes" includes="org/ofbiz/service/**"/>
> >
> > 3. start application startofbiz.bat
> >
> > 4. In Eclipse, run the RMI Client Example.
> >
> > When I attempt to execute this line:
> >
> >     rd = (RemoteDispatcher) Naming.lookup(RMI_URL);
> >
> > I get the following exception:
> >
> > java.rmi.UnmarshalException: error unmarshalling return; nested exception is:
> >         java.io.InvalidClassException:
> > org.ofbiz.service.rmi.socket.ssl.SSLClientSocketFactory; local class
> > incompatible: stream classdesc serialVersionUID = -6771263703492769955, local
> > class serialVersionUID = 2417260480409974286
> >         at sun.rmi.registry.RegistryImpl_Stub.lookup(Unknown Source)
> >         at java.rmi.Naming.lookup(Unknown Source)
> >         at org.ofbiz.service.rmi.ExampleRemoteClient.<init>(ExampleRemoteClient.java:55)
> >         at org.ofbiz.service.rmi.ExampleRemoteClient.main(ExampleRemoteClient.java:76)
> > Caused by: java.io.InvalidClassException:
> > org.ofbiz.service.rmi.socket.ssl.SSLClientSocketFactory; local class
> > incompatible: stream classdesc serialVersionUID = -6771263703492769955, local
> > class serialVersionUID = 2417260480409974286
> >         at java.io.ObjectStreamClass.initNonProxy(Unknown Source)
> >         at java.io.ObjectInputStream.readNonProxyDesc(Unknown Source)
> >         at java.io.ObjectInputStream.readClassDesc(Unknown Source)
> >         at java.io.ObjectInputStream.readOrdinaryObject(Unknown Source)
> >         at java.io.ObjectInputStream.readObject0(Unknown Source)
> >         at java.io.ObjectInputStream.readObject(Unknown Source)
> >         at sun.rmi.transport.tcp.TCPEndpoint.read(Unknown Source)
> >         at sun.rmi.transport.LiveRef.read(Unknown Source)
> >         at sun.rmi.server.UnicastRef2.readExternal(Unknown Source)
> >         at java.rmi.server.RemoteObject.readObject(Unknown Source)
> >         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> >         at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
> >         at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
> >         at java.lang.reflect.Method.invoke(Unknown Source)
> >         at java.io.ObjectStreamClass.invokeReadObject(Unknown Source)
> >         at java.io.ObjectInputStream.readSerialData(Unknown Source)
> >         at java.io.ObjectInputStream.readOrdinaryObject(Unknown Source)
> >         at java.io.ObjectInputStream.readObject0(Unknown Source)
> >         at java.io.ObjectInputStream.readObject(Unknown Source)
> >         ... 4 more
> >
> >


Re: binding RMIDispatcher to client

Posted by Brett Palmer <br...@gmail.com>.
John,

Yes this is a problem with trying to run the RMI client in the Eclipse
debugger.  I believe the problem occurs because ofbiz is compiled
using Ant and is not being compiled by Eclipse.  Then when you run the
RMI client within eclipse you get an incompatibility because the RMI
client is using all  the ofibz code that is in eclipse.  Does this
make any sense?  Running Ant within eclipse won't help either because
I believe the is still compiling outside of eclipse.

There are a couple ways to work around this problem.  The first one is
the easiest and the second is more tedious.


1. Create a simple script that executes the RMI client application.  I
am assuming that you are really trying to debug an ofbiz service and
not the RMI client itself.  Then with Eclipse create a remote debug
session with the server and set your break points in the server code
you want to debug.  When the RMI client request hits the server the
debugger will stop at your break point.

Your script will need to include all the necessary Jar files to work.
I will include a sample at the bottom of this E-mail.  You usually
have to tweak the classpaths a little but once everything is working
you can easily debug server side code using RMI.

2. Another approach would be to create an eclipse project that
contained all the ofbiz built Jar files that were necessary for RMI
communication.  Then server libraries would match with the client
libraries.

Does anyone else have an easier solution?


Brett

/******************** Sample batch file for executing an RMI Client
***********************/


set OFBIZ_HOME=../../../../ofbiz

set OFBIZ_BASE=%OFBIZ_HOME%/framework/base
set OFBIZ_FRAMEWORK=%OFBIZ_HOME%/framework
set OFBIZ_APPLICATIONS=%OFBIZ_HOME%/applications
set LOCAL_LIB=../../build/lib


set OFBIZ_CP=%OFBIZ_BASE%/lib/junit.jar

set OFBIZ_CP=%OFBIZ_CP%;%OFBIZ_BASE%/build/lib/ofbiz-base.jar
set OFBIZ_CP=%OFBIZ_CP%;%OFBIZ_BASE%/build/lib/ofbiz.jar
set OFBIZ_CP=%OFBIZ_CP%;%OFBIZ_BASE%/lib/freemarker.jar
set OFBIZ_CP=%OFBIZ_CP%;%OFBIZ_BASE%/lib/xml-apis.jar
set OFBIZ_CP=%OFBIZ_CP%;%OFBIZ_BASE%/lib/xerces.jar
set OFBIZ_CP=%OFBIZ_CP%;%OFBIZ_BASE%/lib/xercesImpl.jar
set OFBIZ_CP=%OFBIZ_CP%;%OFBIZ_BASE%/lib/servlet.jar
set OFBIZ_CP=%OFBIZ_CP%;%OFBIZ_BASE%/lib/activate.jar
set OFBIZ_CP=%OFBIZ_CP%;%OFBIZ_BASE%/lib/log4j.jar
set OFBIZ_CP=%OFBIZ_CP%;%OFBIZ_BASE%/lib/jdbm.jar
set OFBIZ_CP=%OFBIZ_CP%;%OFBIZ_BASE%/lib/javolution.jar

set OFBIZ_CP=%OFBIZ_CP%;%OFBIZ_BASE%/lib/avalon-util-exception-1.0.0.jar
set OFBIZ_CP=%OFBIZ_CP%;%OFBIZ_BASE%/lib/commons/commons-logging.jar
set OFBIZ_CP=%OFBIZ_CP%;%OFBIZ_BASE%/lib/commons/commons-collections.jar
set OFBIZ_CP=%OFBIZ_CP%;%OFBIZ_BASE%/lib/scripting/bsh.jar
set OFBIZ_CP=%OFBIZ_CP%;%OFBIZ_BASE%/lib/scripting/bsf.jar
set OFBIZ_CP=%OFBIZ_CP%;%OFBIZ_BASE%/lib/scripting/js.jar
set OFBIZ_CP=%OFBIZ_CP%;%OFBIZ_BASE%/lib/scripting/oro.jar

set OFBIZ_CP=%OFBIZ_CP%;%OFBIZ_BASE%/config

set OFBIZ_CP=%OFBIZ_CP%;%OFBIZ_FRAMEWORK%/entity/dtd
set OFBIZ_CP=%OFBIZ_CP%;%OFBIZ_FRAMEWORK%/entity/config
set OFBIZ_CP=%OFBIZ_CP%;%OFBIZ_FRAMEWORK%/entity/build/lib/ofbiz-entity.jar
set OFBIZ_CP=%OFBIZ_CP%;%OFBIZ_FRAMEWORK%/entityext/build/lib/ofbiz-entityext.jar
set OFBIZ_CP=%OFBIZ_CP%;%OFBIZ_FRAMEWORK%/entityext/dtd
set OFBIZ_CP=%OFBIZ_CP%;%OFBIZ_FRAMEWORK%/entity/lib/jdbc/mm.mysql-2.0.14-bin.jar
set OFBIZ_CP=%OFBIZ_CP%;%OFBIZ_FRAMEWORK%/entity/lib/jdbc/postgresql.jar
set OFBIZ_CP=%OFBIZ_CP%;%OFBIZ_FRAMEWORK%/entity/lib/jotm/jotm.jar
set OFBIZ_CP=%OFBIZ_CP%;%OFBIZ_FRAMEWORK%/entity/lib/jotm/jotm_iiop_stubs.jar
set OFBIZ_CP=%OFBIZ_CP%;%OFBIZ_FRAMEWORK%/entity/lib/jotm/jotm_jrmp_stubs.jar
set OFBIZ_CP=%OFBIZ_CP%;%OFBIZ_FRAMEWORK%/entity/lib/dbcp/commons-pool.jar
set OFBIZ_CP=%OFBIZ_CP%;%OFBIZ_FRAMEWORK%/entity/lib/dbcp/commons-dbcp.jar
set OFBIZ_CP=%OFBIZ_CP%;%OFBIZ_FRAMEWORK%/content/build/lib/ofbiz-content.jar
set OFBIZ_CP=%OFBIZ_CP%;%OFBIZ_FRAMEWORK%/lib/common/classes12.zip
set OFBIZ_CP=%OFBIZ_CP%;%OFBIZ_FRAMEWORK%/minerva/lib/jta_1.0.1.jar
set OFBIZ_CP=%OFBIZ_CP%;%OFBIZ_FRAMEWORK%/minerva/lib/oswego-concurrent.jar
set OFBIZ_CP=%OFBIZ_CP%;%OFBIZ_FRAMEWORK%/minerva/build/lib/ofbiz-minerva.jar
set OFBIZ_CP=%OFBIZ_CP%;%OFBIZ_FRAMEWORK%/service/build/lib/ofbiz-service.jar
set OFBIZ_CP=%OFBIZ_CP%;%OFBIZ_FRAMEWORK%/service/build/lib/ofbiz-service-rmi.raj
set OFBIZ_CP=%OFBIZ_CP%;%OFBIZ_FRAMEWORK%/service/lib/wsdl4j.jar
set OFBIZ_CP=%OFBIZ_CP%;%OFBIZ_FRAMEWORK%/service/config

set OFBIZ_CP=%OFBIZ_CP%;%OFBIZ_FRAMEWORK%/security/build/lib/ofbiz-security.jar
set OFBIZ_CP=%OFBIZ_CP%;%OFBIZ_FRAMEWORK%/security/config
set OFBIZ_CP=%OFBIZ_CP%;%OFBIZ_FRAMEWORK%/securityext/build/lib/ofbiz-securityext.jar

set OFBIZ_CP=%OFBIZ_CP%;%OFBIZ_APPLICATIONS%/order/build/lib/ofbiz-order.jar

set OFBIZ_CP=%OFBIZ_CP%;%LOCAL_LIB%/ofbiz-erp.jar
set OFBIZ_CP=%OFBIZ_CP%;%LOCAL_LIB%/ofbiz-erp.jar


set CP=%OFBIZ_CP%
rem echo CLASSPATH=%CP%
rem echo OFBIZ_HOME=%OFBIZ_HOME%


java -Dofbiz.home=%OFBIZ_HOME% -cp %CP% <Your RMI Client Program>




On 8/4/06, John Martin <pb...@yahoo.com> wrote:
> HELP!
>
> I've been running into the same problem as what was reported in this thread
> before.  When attempting to run a RMI client I get the exception:
>
> org.ofbiz.service.rmi.socket.ssl.SSLClientSocketFactory; local class
> incompatible: stream classdesc serialVersionUID = -6771263703492769955, local
> class serialVersionUID = 2417260480409974286
>         at sun.rmi.registry.RegistryImpl_Stub.lookup(Unknown Source)
>
> Hopefully this has been resolved by someone?
>
> Thanks!
>
> John
>
> Here's my steps:
>
> 1. clean build of the application server: ant build (command line)
>
>    codebase: ofbiz_opentaps_424208
>    WindowsXP
>    java 1.4.2
>    Eclipse 3.1
>
>
> 2. Copied the following jars into my classpath:
>    ofbiz-base.jar
>    ofbiz-entity.jar   <--- There were some dependencies found in this jar
>    ofbiz-service-rmi.jar
>    commons-collections.jar
>    javolution.jar
>    jdbm.jar
>    log4j.jar
>
>    NOTE:  I had to add a line to the ofbiz-service-rmi.jar (rmi-jar) build.xml
> script because there were a bunch of references into the org.ofbiz.service
> directories not getting pulled in.
>
>     <fileset dir="${build.dir}/classes" includes="org/ofbiz/service/**"/>
>
> 3. start application startofbiz.bat
>
> 4. In Eclipse, run the RMI Client Example.
>
> When I attempt to execute this line:
>
>     rd = (RemoteDispatcher) Naming.lookup(RMI_URL);
>
> I get the following exception:
>
> java.rmi.UnmarshalException: error unmarshalling return; nested exception is:
>         java.io.InvalidClassException:
> org.ofbiz.service.rmi.socket.ssl.SSLClientSocketFactory; local class
> incompatible: stream classdesc serialVersionUID = -6771263703492769955, local
> class serialVersionUID = 2417260480409974286
>         at sun.rmi.registry.RegistryImpl_Stub.lookup(Unknown Source)
>         at java.rmi.Naming.lookup(Unknown Source)
>         at org.ofbiz.service.rmi.ExampleRemoteClient.<init>(ExampleRemoteClient.java:55)
>         at org.ofbiz.service.rmi.ExampleRemoteClient.main(ExampleRemoteClient.java:76)
> Caused by: java.io.InvalidClassException:
> org.ofbiz.service.rmi.socket.ssl.SSLClientSocketFactory; local class
> incompatible: stream classdesc serialVersionUID = -6771263703492769955, local
> class serialVersionUID = 2417260480409974286
>         at java.io.ObjectStreamClass.initNonProxy(Unknown Source)
>         at java.io.ObjectInputStream.readNonProxyDesc(Unknown Source)
>         at java.io.ObjectInputStream.readClassDesc(Unknown Source)
>         at java.io.ObjectInputStream.readOrdinaryObject(Unknown Source)
>         at java.io.ObjectInputStream.readObject0(Unknown Source)
>         at java.io.ObjectInputStream.readObject(Unknown Source)
>         at sun.rmi.transport.tcp.TCPEndpoint.read(Unknown Source)
>         at sun.rmi.transport.LiveRef.read(Unknown Source)
>         at sun.rmi.server.UnicastRef2.readExternal(Unknown Source)
>         at java.rmi.server.RemoteObject.readObject(Unknown Source)
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>         at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
>         at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
>         at java.lang.reflect.Method.invoke(Unknown Source)
>         at java.io.ObjectStreamClass.invokeReadObject(Unknown Source)
>         at java.io.ObjectInputStream.readSerialData(Unknown Source)
>         at java.io.ObjectInputStream.readOrdinaryObject(Unknown Source)
>         at java.io.ObjectInputStream.readObject0(Unknown Source)
>         at java.io.ObjectInputStream.readObject(Unknown Source)
>         ... 4 more
>
>

Re: binding RMIDispatcher to client

Posted by John Martin <pb...@yahoo.com>.
HELP!

I've been running into the same problem as what was reported in this thread
before.  When attempting to run a RMI client I get the exception: 

org.ofbiz.service.rmi.socket.ssl.SSLClientSocketFactory; local class
incompatible: stream classdesc serialVersionUID = -6771263703492769955, local
class serialVersionUID = 2417260480409974286
	at sun.rmi.registry.RegistryImpl_Stub.lookup(Unknown Source)

Hopefully this has been resolved by someone? 

Thanks!

John

Here's my steps:

1. clean build of the application server: ant build (command line)

   codebase: ofbiz_opentaps_424208
   WindowsXP
   java 1.4.2
   Eclipse 3.1


2. Copied the following jars into my classpath:
   ofbiz-base.jar
   ofbiz-entity.jar   <--- There were some dependencies found in this jar
   ofbiz-service-rmi.jar
   commons-collections.jar
   javolution.jar
   jdbm.jar
   log4j.jar

   NOTE:  I had to add a line to the ofbiz-service-rmi.jar (rmi-jar) build.xml
script because there were a bunch of references into the org.ofbiz.service
directories not getting pulled in.

    <fileset dir="${build.dir}/classes" includes="org/ofbiz/service/**"/>

3. start application startofbiz.bat

4. In Eclipse, run the RMI Client Example.

When I attempt to execute this line:

    rd = (RemoteDispatcher) Naming.lookup(RMI_URL);

I get the following exception:

java.rmi.UnmarshalException: error unmarshalling return; nested exception is: 
	java.io.InvalidClassException:
org.ofbiz.service.rmi.socket.ssl.SSLClientSocketFactory; local class
incompatible: stream classdesc serialVersionUID = -6771263703492769955, local
class serialVersionUID = 2417260480409974286
	at sun.rmi.registry.RegistryImpl_Stub.lookup(Unknown Source)
	at java.rmi.Naming.lookup(Unknown Source)
	at org.ofbiz.service.rmi.ExampleRemoteClient.<init>(ExampleRemoteClient.java:55)
	at org.ofbiz.service.rmi.ExampleRemoteClient.main(ExampleRemoteClient.java:76)
Caused by: java.io.InvalidClassException:
org.ofbiz.service.rmi.socket.ssl.SSLClientSocketFactory; local class
incompatible: stream classdesc serialVersionUID = -6771263703492769955, local
class serialVersionUID = 2417260480409974286
	at java.io.ObjectStreamClass.initNonProxy(Unknown Source)
	at java.io.ObjectInputStream.readNonProxyDesc(Unknown Source)
	at java.io.ObjectInputStream.readClassDesc(Unknown Source)
	at java.io.ObjectInputStream.readOrdinaryObject(Unknown Source)
	at java.io.ObjectInputStream.readObject0(Unknown Source)
	at java.io.ObjectInputStream.readObject(Unknown Source)
	at sun.rmi.transport.tcp.TCPEndpoint.read(Unknown Source)
	at sun.rmi.transport.LiveRef.read(Unknown Source)
	at sun.rmi.server.UnicastRef2.readExternal(Unknown Source)
	at java.rmi.server.RemoteObject.readObject(Unknown Source)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
	at java.lang.reflect.Method.invoke(Unknown Source)
	at java.io.ObjectStreamClass.invokeReadObject(Unknown Source)
	at java.io.ObjectInputStream.readSerialData(Unknown Source)
	at java.io.ObjectInputStream.readOrdinaryObject(Unknown Source)
	at java.io.ObjectInputStream.readObject0(Unknown Source)
	at java.io.ObjectInputStream.readObject(Unknown Source)
	... 4 more


RE: binding RMIDispatcher to client

Posted by Raj <po...@tenth-planet.com>.
I did it ,but no effect 

-----Original Message-----
From: A. Zeneski [mailto:jaz@ofbiz.org] 
Sent: Monday, July 10, 2006 5:56 PM
To: ofbiz-user@incubator.apache.org
Subject: Re: binding RMIDispatcher to client

Appears that the stubs don't match the implementations. Try a recompile.

Andy

On Jul 9, 2006, at 6:55 PM, Raj wrote:

> 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:andrew@sykesdevelopment.com]
> Sent: Thursday, July 06, 2006 8:50 PM
> To: ofbiz-user@incubator.apache.org
> 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 <po...@tenth-planet.com> 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:andrew@sykesdevelopment.com]
>>> Sent: Thursday, July 06, 2006 2:31 PM
>>> To: ofbiz-user@incubator.apache.org
>>> 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 <po...@tenth-planet.com> 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:brettgpalmer@gmail.com]
>>>>> Sent: Thursday, July 06, 2006 10:55 AM
>>>>> To: ofbiz-user@incubator.apache.org; 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 <po...@tenth-planet.com> 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 <an...@sykesdevelopment.com>
>>> Sykes Development Ltd
>>> http://www.sykesdevelopment.com
>>>
>>>
>>>
> -- 
> Kind Regards
> Andrew Sykes <an...@sykesdevelopment.com>
> Sykes Development Ltd
> http://www.sykesdevelopment.com
>
>



Re: binding RMIDispatcher to client

Posted by "A. Zeneski" <ja...@ofbiz.org>.
Appears that the stubs don't match the implementations. Try a recompile.

Andy

On Jul 9, 2006, at 6:55 PM, Raj wrote:

> 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:andrew@sykesdevelopment.com]
> Sent: Thursday, July 06, 2006 8:50 PM
> To: ofbiz-user@incubator.apache.org
> 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 <po...@tenth-planet.com> 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:andrew@sykesdevelopment.com]
>>> Sent: Thursday, July 06, 2006 2:31 PM
>>> To: ofbiz-user@incubator.apache.org
>>> 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 <po...@tenth-planet.com> 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:brettgpalmer@gmail.com]
>>>>> Sent: Thursday, July 06, 2006 10:55 AM
>>>>> To: ofbiz-user@incubator.apache.org; 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 <po...@tenth-planet.com> 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 <an...@sykesdevelopment.com>
>>> Sykes Development Ltd
>>> http://www.sykesdevelopment.com
>>>
>>>
>>>
> -- 
> Kind Regards
> Andrew Sykes <an...@sykesdevelopment.com>
> Sykes Development Ltd
> http://www.sykesdevelopment.com
>
>


RE: binding RMIDispatcher to client

Posted by Raj <po...@tenth-planet.com>.
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:andrew@sykesdevelopment.com] 
Sent: Thursday, July 06, 2006 8:50 PM
To: ofbiz-user@incubator.apache.org
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 <po...@tenth-planet.com> 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:andrew@sykesdevelopment.com]
> > Sent: Thursday, July 06, 2006 2:31 PM
> > To: ofbiz-user@incubator.apache.org
> > 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 <po...@tenth-planet.com> 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:brettgpalmer@gmail.com]
> > > > Sent: Thursday, July 06, 2006 10:55 AM
> > > > To: ofbiz-user@incubator.apache.org; 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 <po...@tenth-planet.com> 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 <an...@sykesdevelopment.com>
> > Sykes Development Ltd
> > http://www.sykesdevelopment.com
> >
> >
> >
-- 
Kind Regards
Andrew Sykes <an...@sykesdevelopment.com>
Sykes Development Ltd
http://www.sykesdevelopment.com



Re: binnding RMIDispatcher to client

Posted by Andrew Sykes <an...@sykesdevelopment.com>.
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 <po...@tenth-planet.com> 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:andrew@sykesdevelopment.com]
> > Sent: Thursday, July 06, 2006 2:31 PM
> > To: ofbiz-user@incubator.apache.org
> > 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 <po...@tenth-planet.com> 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:brettgpalmer@gmail.com]
> > > > Sent: Thursday, July 06, 2006 10:55 AM
> > > > To: ofbiz-user@incubator.apache.org; 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 <po...@tenth-planet.com> 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 <an...@sykesdevelopment.com>
> > Sykes Development Ltd
> > http://www.sykesdevelopment.com
> >
> >
> >
-- 
Kind Regards
Andrew Sykes <an...@sykesdevelopment.com>
Sykes Development Ltd
http://www.sykesdevelopment.com


Re: binnding RMIDispatcher to client

Posted by Brett Palmer <br...@gmail.com>.
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 <po...@tenth-planet.com> 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:andrew@sykesdevelopment.com]
> Sent: Thursday, July 06, 2006 2:31 PM
> To: ofbiz-user@incubator.apache.org
> 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 <po...@tenth-planet.com> 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:brettgpalmer@gmail.com]
> > > Sent: Thursday, July 06, 2006 10:55 AM
> > > To: ofbiz-user@incubator.apache.org; 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 <po...@tenth-planet.com> 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 <an...@sykesdevelopment.com>
> Sykes Development Ltd
> http://www.sykesdevelopment.com
>
>
>

Re: binnding RMIDispatcher to client

Posted by Brett Palmer <br...@gmail.com>.
Yes, RMI should would work for this.

Brett

On 7/6/06, Andrew Sykes <an...@sykesdevelopment.com> wrote:
> 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 <po...@tenth-planet.com> 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:brettgpalmer@gmail.com]
> > > Sent: Thursday, July 06, 2006 10:55 AM
> > > To: ofbiz-user@incubator.apache.org; 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 <po...@tenth-planet.com> 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 <an...@sykesdevelopment.com>
> Sykes Development Ltd
> http://www.sykesdevelopment.com
>
>

RE: binnding RMIDispatcher to client

Posted by Raj <po...@tenth-planet.com>.
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:andrew@sykesdevelopment.com] 
Sent: Thursday, July 06, 2006 2:31 PM
To: ofbiz-user@incubator.apache.org
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 <po...@tenth-planet.com> 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:brettgpalmer@gmail.com]
> > Sent: Thursday, July 06, 2006 10:55 AM
> > To: ofbiz-user@incubator.apache.org; 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 <po...@tenth-planet.com> 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 <an...@sykesdevelopment.com>
Sykes Development Ltd
http://www.sykesdevelopment.com



Re: binnding RMIDispatcher to client

Posted by Andrew Sykes <an...@sykesdevelopment.com>.
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 <po...@tenth-planet.com> 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:brettgpalmer@gmail.com]
> > Sent: Thursday, July 06, 2006 10:55 AM
> > To: ofbiz-user@incubator.apache.org; 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 <po...@tenth-planet.com> 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 <an...@sykesdevelopment.com>
Sykes Development Ltd
http://www.sykesdevelopment.com


Re: binnding RMIDispatcher to client

Posted by Brett Palmer <br...@gmail.com>.
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 <po...@tenth-planet.com> 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:brettgpalmer@gmail.com]
> Sent: Thursday, July 06, 2006 10:55 AM
> To: ofbiz-user@incubator.apache.org; 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 <po...@tenth-planet.com> 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
> >
> >
> >
>
>

Re: binnding RMIDispatcher to client

Posted by Brett Palmer <br...@gmail.com>.
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 <po...@tenth-planet.com> 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
>
>
>

Re: binnding RMIDispatcher to client

Posted by Chris Howe <cj...@yahoo.com>.
It seems Si had this problem about two years ago...you
can follow the thread discussion here:

http://lists.ofbiz.org/pipermail/users/2004-April/003543.html

--- Raj <po...@tenth-planet.com> 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
> 
>