[OFBiz] Dev - Sample RMI Client from ofbiz blog

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
9 messages Options
Reply | Threaded
Open this post in threaded view
|

[OFBiz] Dev - Sample RMI Client from ofbiz blog

Brett
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
Reply | Threaded
Open this post in threaded view
|

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

David E. Jones

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

smime.p7s (3K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

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

Brett
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
Reply | Threaded
Open this post in threaded view
|

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

David E. Jones

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
Reply | Threaded
Open this post in threaded view
|

[OFBiz] Dev - ssl accelerator ideas

Alex Schmelkin
A production web cluster that we maintain is planned to be upgraded to
terminate ssl directly on our load balancer, a cisco content switch.  All
ssl keys and encryption/decryption will be moved to the l-b, which in turn
will only communicate over http with the web servers.

Setup:
request -> load balancer -> apache (mod_jk) -> tomcat/ofbiz

Ofbiz is not loving the setup for pages that are configured to require ssl
(checkout, payment, my account, etc).  Requests that are indeed secure
appear to have been communicated to ofbiz over a non-encrypted channel, and
ofbiz issues a 302 redirect to serve the current page with ssl.

This results in a endless loop of 302's as the request will never satisfy
ofbiz's encrypted requirement and always result in a redirect response.

Two options come to mind that we don't love.  I'm hoping there are setups
that others are using in production clusters that are a bit better:

1) turn off secure page requirements -- but, this would allow someone to
manually browse to http://server/myaccount, which is not ideal

2) have the load balancer re-encrypt the ssl traffic and communicate with
the web server over https again -- this would make this problem go away but
doubles the load on the l-b, and puts ssl load back on the web servers
again.

Any suggestions are greatly appreciated!

Thanks.

 
_______________________________________________
Dev mailing list
[hidden email]
http://lists.ofbiz.org/mailman/listinfo/dev
Reply | Threaded
Open this post in threaded view
|

Re: [OFBiz] Dev - ssl accelerator ideas

David E. Jones

Alex,

This is an issue common to all SSL accelerators. The option #1 that  
you mentioned is a good way to go and generally the approach for  
applications behind this sort of tool. In most cases the SSL  
accelerator can send the encrypted requests to a different port or  
add an entry to the HTTP request header so that applications can  
distinguish between secure and insecure pages, and for either of  
these options OFBiz would have to be changed to recognize these as  
qualifiers for secure requests.

To turn off the SSL forwarding and requirement in general just change  
use https property in the url.properties file, or the corresponding  
field on the webapp's WebSite record.

Generally when an SSL accelerator is used, whether a separate port or  
HTTP header entry is added or not, the application servers should be  
available only through the accelerator and should either be on an  
internal only network, or have all such ports blocked from the  
outside with a firewall. That is true for load balancers and other  
such pass through appliances in general actually, even for things  
like an Apache front facing server or such.

-David


On Oct 17, 2005, at 6:56 AM, Alex Schmelkin wrote:

> A production web cluster that we maintain is planned to be upgraded to
> terminate ssl directly on our load balancer, a cisco content  
> switch.  All
> ssl keys and encryption/decryption will be moved to the l-b, which  
> in turn
> will only communicate over http with the web servers.
>
> Setup:
> request -> load balancer -> apache (mod_jk) -> tomcat/ofbiz
>
> Ofbiz is not loving the setup for pages that are configured to  
> require ssl
> (checkout, payment, my account, etc).  Requests that are indeed secure
> appear to have been communicated to ofbiz over a non-encrypted  
> channel, and
> ofbiz issues a 302 redirect to serve the current page with ssl.
>
> This results in a endless loop of 302's as the request will never  
> satisfy
> ofbiz's encrypted requirement and always result in a redirect  
> response.
>
> Two options come to mind that we don't love.  I'm hoping there are  
> setups
> that others are using in production clusters that are a bit better:
>
> 1) turn off secure page requirements -- but, this would allow  
> someone to
> manually browse to http://server/myaccount, which is not ideal
>
> 2) have the load balancer re-encrypt the ssl traffic and  
> communicate with
> the web server over https again -- this would make this problem go  
> away but
> doubles the load on the l-b, and puts ssl load back on the web servers
> again.
>
> Any suggestions are greatly appreciated!
>
> Thanks.
>
>
> _______________________________________________
> Dev mailing list
> [hidden email]
> http://lists.ofbiz.org/mailman/listinfo/dev
>

 
_______________________________________________
Dev mailing list
[hidden email]
http://lists.ofbiz.org/mailman/listinfo/dev
Reply | Threaded
Open this post in threaded view
|

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

Brett
In reply to this post by David E. Jones
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
Reply | Threaded
Open this post in threaded view
|

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

Brett
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
Reply | Threaded
Open this post in threaded view
|

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

David E. Jones

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