Users - Remote Reference to Service Engine

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

Users - Remote Reference to Service Engine

kuldeep.kshirsagar

Hi there,

I tried to obtain remote ref to service engine from external java web app. I have included the necessary jar’s, set the ofbiz.home java env variable which points to ofbiz home (it has only base directory to provide ref to properties file).

I am getting following error. Any help will be appreciated.

 

Rgds…Kuldeep

java.lang.NoClassDefFoundError
        at org.ofbiz.service.rmi.socket.ssl.SSLClientSocketFactory.createSocket(SSLClientSocketFactory.java:51)
        at sun.rmi.transport.tcp.TCPEndpoint.newSocket(TCPEndpoint.java:562)
        at sun.rmi.transport.tcp.TCPChannel.createConnection(TCPChannel.java:185)
        at sun.rmi.transport.tcp.TCPChannel.newConnection(TCPChannel.java:171)
        at sun.rmi.server.UnicastRef.newCall(UnicastRef.java:313)
        at sun.rmi.transport.DGCImpl_Stub.dirty(Unknown Source)
        at sun.rmi.transport.DGCClient$EndpointEntry.makeDirtyCall(DGCClient.java:328)
        at sun.rmi.transport.DGCClient$EndpointEntry.registerRefs(DGCClient.java:275)
        at sun.rmi.transport.DGCClient.registerRefs(DGCClient.java:112)
        at sun.rmi.transport.ConnectionInputStream.registerRefs(ConnectionInputStream.java:80)
        at sun.rmi.transport.StreamRemoteCall.releaseInputStream(StreamRemoteCall.java:134)
        at sun.rmi.transport.StreamRemoteCall.done(StreamRemoteCall.java:284)
        at sun.rmi.server.UnicastRef.done(UnicastRef.java:422)
        at sun.rmi.registry.RegistryImpl_Stub.lookup(Unknown Source)
        at com.sun.jndi.rmi.registry.RegistryContext.lookup(RegistryContext.java:88)
        at com.sun.jndi.toolkit.url.GenericURLContext.lookup(GenericURLContext.java:185)
        at javax.naming.InitialContext.lookup(InitialContext.java:347)
        at com.poc.MyAction.execute(MyAction.java:48)
        at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:419)
        at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:224)
        at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1194)
        at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:414)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
        at weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run(ServletStubImpl.java:996)
        at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:419)
        at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:315)
        at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:6452)
        at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
        at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:118)
        at weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletContext.java:3661)
        at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java:2630)
        at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:219)
        at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:178)

 

 

 

 

 

 

 

 

 

 

 

 

 
 
On 10/14/05, David E. Jones <jonesde at ofbiz.org> wrote:
>
> The code would look something like this:
>
> protected final static String RMI_URL = "<a
href="rmi://localhost:1099/">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

 


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

Re: Users - Remote Reference to Service Engine

Andrew Zeneski
For a slim client java application to use a remote dispatcher, you need the following:

cache.properties
debug.properties
jsse.properties
ofbiz-base.jar
ofbiz-service-rmi.jar


Then the above requires the following third-party libs

commons-collections.jar
javalution.jar
jdbm.jar
log4j.jar

Using this you may also need a jndi.properties file pointing to the JNDI server (hosted by the OFBiz instance). Then you can run the following code (attached as a java file).

Andy



On Dec 9, 2005, at 6:03 PM, <[hidden email]> <[hidden email]> wrote:

Hi there,

I tried to obtain remote ref to service engine from external java web app. I have included the necessary jar’s, set the ofbiz.home java env variable which points to ofbiz home (it has only base directory to provide ref to properties file).

I am getting following error. Any help will be appreciated.

 

Rgds…Kuldeep

java.lang.NoClassDefFoundError
        at org.ofbiz.service.rmi.socket.ssl.SSLClientSocketFactory.createSocket(SSLClientSocketFactory.java:51)
        at sun.rmi.transport.tcp.TCPEndpoint.newSocket(TCPEndpoint.java:562)
        at sun.rmi.transport.tcp.TCPChannel.createConnection(TCPChannel.java:185)
        at sun.rmi.transport.tcp.TCPChannel.newConnection(TCPChannel.java:171)
        at sun.rmi.server.UnicastRef.newCall(UnicastRef.java:313)
        at sun.rmi.transport.DGCImpl_Stub.dirty(Unknown Source)
        at sun.rmi.transport.DGCClient$EndpointEntry.makeDirtyCall(DGCClient.java:328)
        at sun.rmi.transport.DGCClient$EndpointEntry.registerRefs(DGCClient.java:275)
        at sun.rmi.transport.DGCClient.registerRefs(DGCClient.java:112)
        at sun.rmi.transport.ConnectionInputStream.registerRefs(ConnectionInputStream.java:80)
        at sun.rmi.transport.StreamRemoteCall.releaseInputStream(StreamRemoteCall.java:134)
        at sun.rmi.transport.StreamRemoteCall.done(StreamRemoteCall.java:284)
        at sun.rmi.server.UnicastRef.done(UnicastRef.java:422)
        at sun.rmi.registry.RegistryImpl_Stub.lookup(Unknown Source)
        at com.sun.jndi.rmi.registry.RegistryContext.lookup(RegistryContext.java:88)
        at com.sun.jndi.toolkit.url.GenericURLContext.lookup(GenericURLContext.java:185)
        at javax.naming.InitialContext.lookup(InitialContext.java:347)
        at com.poc.MyAction.execute(MyAction.java:48)
        at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:419)
        at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:224)
        at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1194)
        at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:414)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
        at weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run(ServletStubImpl.java:996)
        at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:419)
        at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:315)
        at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:6452)
        at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
        at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:118)
        at weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletContext.java:3661)
        at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java:2630)
        at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:219)
        at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:178)

 

 

 

 

 

 

 

 

 

 

 

 

 
 
On 10/14/05, David E. Jones <jonesde at ofbiz.org> wrote:
>
> The code would look something like this:
>
> protected final static String RMI_URL = "<A href="rmi://localhost:1099/">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

 


_______________________________________________
Users mailing list


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

ServiceRemote.java (2K) Download Attachment