Login  Register

Re: [OFBiz] Dev - Sample RMI Client from ofbiz blog

Posted by David E. Jones on Oct 22, 2005; 6:52am
URL: http://ofbiz.116.s1.nabble.com/OFBiz-Dev-Sample-RMI-Client-from-ofbiz-blog-tp166143p166149.html


Thanks for letting me know... I hadn't had time to look into this yet  
but if that was a genuine problem it was a little scary...

Yeah, the remote invocation with fairly minimal OFBiz jars in the  
classpath and such is nice. Andy originally implemented that as part  
of plans to create some specialized client applications like a  
shipping station and such.

Glad it's of use...

-David


On Oct 21, 2005, at 3:50 PM, Brett Palmer wrote:

> David,
>
> Please disregard my previous post.  The "cannot locate service" error
> I was seeing in the RemoteDispatcherImpl.runSync() method was caused
> from the service being named incorrectly in the code.
>
> Calling services remotely is a very cool feature for us.  Thanks again
> for your efforts.
>
>
> Brett
>
> On 10/20/05, Brett Palmer <[hidden email]> wrote:
>
>> David,
>>
>> Thanks for the information.  I was able to get a simple RMI client
>> connecting to the RMIDispatcher successfully.  The problem I am  
>> seeing
>> right now is that the RemorteDispatcherImpl.runSync() is not able to
>> find the service name.  It looks like the service initialization for
>> the remote access is not working right.  I first thought it was an
>> "export" setting in the service but this was not the case.  I have
>> tried several services and I get the same "Cannot locate service by
>> name".
>>
>>
>> Here is a short stack trace:
>>
>> org.ofbiz.service.GenericServiceException: Cannot locate service by
>> name (testSvc)
>>         at org.ofbiz.service.DispatchContext.getModelService
>> (DispatchContext.java:208)
>>         at org.ofbiz.service.GenericDispatcher.runSync
>> (GenericDispatcher.java:109)
>>         at org.ofbiz.service.rmi.RemoteDispatcherImpl.runSync
>> (RemoteDispatcherImpl.java:66)
>>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native  
>> Method)
>>
>>
>> I know you're busy so if you can point me in some direction as to
>> where this problem could be occurring I'll track it down and report
>> back.  I don't think it is a configuration problem, because I can  
>> call
>> the services all right from inside the applications, but let me know
>> if you think otherwise.
>>
>> Thanks again for your help.
>>
>>
>> Brett
>>
>>
>>
>>
>>
>> On 10/14/05, David E. Jones <[hidden email]> wrote:
>>
>>>
>>> The code would look something like this:
>>>
>>> protected final static String RMI_URL = "rmi://localhost:1099/
>>> RMIDispatcher"; // change to match the remote server
>>> RemoteDispatcher rd = (RemoteDispatcher) Naming.lookup(RMI_URL);
>>> rd.runSync("testScv", context);
>>>
>>> There are some jar and other files you need in the client
>>> application, including these (should be all, but if you run into any
>>> errors with missing resources there might be more):
>>>
>>> ofbiz-service-rmi.raj (rename to .jar instead of .raj)
>>> commons-collections.jar
>>> javolution.jar
>>> jdbm.jar
>>> log4j.jar
>>> ofbiz-base.jar
>>> debug.properties
>>> cache.properties
>>> jsse.properties
>>>
>>> You may also need the "ofbiz.home" java env variable set for
>>> locations (like in jsse.properties) that are relative to ofbiz.home.
>>>
>>> -David
>>>
>>>
>>> On Oct 14, 2005, at 3:59 PM, Brett Palmer wrote:
>>>
>>>
>>>> I would like to have a remote reference to the service engine via
>>>> JNDI.  This is intended for utility applications that woud be run
>>>> within a data center as well as server to server integration.  What
>>>> can I call from the RmiServiceContainer that is listening on port
>>>> 1099?
>>>>
>>>> Thanks,
>>>>
>>>> Brett
>>>>
>>>> On 10/14/05, David E. Jones <[hidden email]> wrote:
>>>>
>>>>
>>>>>
>>>>> What kind of RMI client are you trying to use? Will the client  
>>>>> have
>>>>> an instance of the service engine running locally, or will it  
>>>>> get a
>>>>> remote reference to a service engine via JNDI?
>>>>>
>>>>> -David
>>>>>
>>>>>
>>>>> On Oct 14, 2005, at 4:45 AM, Brett Palmer wrote:
>>>>>
>>>>>
>>>>>
>>>>>> There was a reference to an RMI Client on the ofbiz blog, Friday,
>>>>>> April 29, 2005, SVN r4930 :
>>>>>>
>>>>>> "RMI client added to build (r4911)"
>>>>>>
>>>>>> I haven't been able to this RMI client.  Does anyone have one  
>>>>>> that
>>>>>> they can post?  I would like to use RMI to call ofbiz services
>>>>>> remotely from one server to another.
>>>>>>
>>>>>> Thanks in advance,
>>>>>>
>>>>>>
>>>>>> Brett
>>>>>>
>>>>>> _______________________________________________
>>>>>> Dev mailing list
>>>>>> [hidden email]
>>>>>> http://lists.ofbiz.org/mailman/listinfo/dev
>>>>>>
>>>>>>
>>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>> _______________________________________________
>>>>> Dev mailing list
>>>>> [hidden email]
>>>>> http://lists.ofbiz.org/mailman/listinfo/dev
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>
>>>> _______________________________________________
>>>> Dev mailing list
>>>> [hidden email]
>>>> http://lists.ofbiz.org/mailman/listinfo/dev
>>>>
>>>>
>>>
>>>
>>> _______________________________________________
>>> Dev mailing list
>>> [hidden email]
>>> http://lists.ofbiz.org/mailman/listinfo/dev
>>>
>>>
>>
>>
>
> _______________________________________________
> Dev mailing list
> [hidden email]
> http://lists.ofbiz.org/mailman/listinfo/dev
>

 
_______________________________________________
Dev mailing list
[hidden email]
http://lists.ofbiz.org/mailman/listinfo/dev

smime.p7s (3K) Download Attachment