rmi

Java RMI ServerException - java.lang.ClassNotFoundException: org.prog.rmi.RmiServer_Stub

我的未来我决定 提交于 2019-12-04 06:16:12
问题 I have inherited some Java RMI client/server code, and while it runs fine on one machine, I haven't been able to get it to run in my dev environment. The problem is when I run the server using the following java.exe -Djava.security.policy=conf\server.policy -SRC;. -Djava.library.path=. org.prog.rmi.RmiServer I get the following error: java.rmi.ServerException: RemoteException occurred in server thread; nested exception is: java.rmi.UnmarshalException: error unmarshalling arguments; nested

Do we really need to create Stub in java RMI?

纵饮孤独 提交于 2019-12-04 06:12:23
I am reading some RMI document and all the books say that we need to create Stub for the client in order to communicate with the server. However, I have tried to not create stub and things worked like a charm. I have put the client program on one machine and the server on another, things worked perfectly. So, what is actually the purpose of creating Stub and do we really need to create one? Thanks. Since Java 1.5 you don't have to: This release adds support for the dynamic generation of stub classes at runtime, obviating the need to use [...] stub compiler, rmic , to pregenerate stub classes

Java: Sockets or RMI?

*爱你&永不变心* 提交于 2019-12-04 05:04:28
I need to separate our application into a light-weight gui application and a business logic application. This won't be a client/server setup as such, as the 'server' component will only have one client. The other limitation in the application is that it has only one entry/exit point. Therefore if we were to use RMI, it would only ever be on one function. All form data is already wrapped up into a string and passed through one transport area. Should I just use Java Sockets to enhance this application, or go with RMI? Or some other Java technology? I made a previous post outlining the

java RMI via SSH v2 protocol

两盒软妹~` 提交于 2019-12-04 05:00:14
问题 How to implement java RMI over SSH v2 protocol.Is this possible?.If its not possible then can i achieve this using raw socket communication?.Simply i want to transmit my data via RMI but it should be encrypted as SSH v2 packets . 回答1: Did you check Using RMI with SSL? The The New RMI article on java.net might be worth the read too. (EDIT: The OP has updated his question and is actually looking for RMI over SSH so I'm updating my answer. I never tried it but I guess you should be able to

Deserialize remote object to the narrowest accessible class

独自空忆成欢 提交于 2019-12-04 02:21:59
问题 In shared.jar I have: abstract class MyParent { } abstract class MyClass { MyParent getFoo(); } server.jar contains abstract class MyChild extends MyParent { } abstract class MyClassConcrete { MyParent getFoo() {return new MyChild();} } client.jar : MyParent foo = myClass.getFoo(); If all 3 jars are in one classloader everything works well. But client and server are in different JVMs while: JVM-1 contains: server.jar , shared.jar JVM-2 contains: client.jar , shared.jar Client makes call to

error with JRMP connection establishment

给你一囗甜甜゛ 提交于 2019-12-04 01:43:35
I am getting following exception trace : java.rmi.ConnectIOException: error during JRMP connection establishment; nested exception is: java.net.SocketTimeoutException: Read timed out at sun.rmi.transport.tcp.TCPChannel.createConnection(TCPChannel.java:293) at sun.rmi.transport.tcp.TCPChannel.newConnection(TCPChannel.java:190) I read some forums on this but not getting clarity on the root cause of this exception. Is this due to one of the following reasons? Insufficient memory. RMI calls getting failed due to increased number of requests to the server causing one of them to wait and causing

Java远程通讯可选技术及原理

家住魔仙堡 提交于 2019-12-03 22:38:28
原文网址链接http://www.blogjava.net/BlueDavy/archive/2008/03/04/182077.html 在分布式服务框架中,一个最基础的问题就是远程服务是怎么通讯的,在Java领域中有很多可实现远程通讯的技术,例如:RMI、MINA、ESB、Burlap、Hessian、SOAP、EJB和JMS等,这些名词之间到底是些什么关系呢,它们背后到底是基于什么原理实现的呢,了解这些是实现分布式服务框架的基础知识,而如果在性能上有高的要求的话,那深入了解这些技术背后的机制就是必须的了,在这篇blog中我们将来一探究竟,抛砖引玉,欢迎大家提供更多的实现远程通讯的技术和原理的介绍。 基本原理 要实现网络机器间的通讯,首先得来看看计算机系统网络通信的基本原理,在底层层面去看,网络通信需要做的就是将流从一台计算机传输到另外一台计算机,基于传输协议和网络IO来实现,其中传输协议比较出名的有http、tcp、udp等等,http、tcp、udp都是在为某类应用场景而定义出的传输协议,网络IO,主要有bio、nio、aio三种方式,所有的分布式应用通讯都基于这个原理而实现,只是为了应用的易用,各种语言通常都会提供一些更为贴近应用易用的应用层协议。 应用级协议 远程服务通讯,需要达到的目标是在一台计算机发起请求,另外一台机器在接收到请求后进行相应的处理并将结果返回给请求端

servelet,webservice,RMI的区别

橙三吉。 提交于 2019-12-03 22:38:13
最近项目中有提供或者调用别的接口,在纠结中到底是用servlet还是用webservice,所以上网查看了下他们以及RMI之间的区别,方便加深了解。 首先比较下servlet和webservice下 请求: servlet:提供了请求/响应模式,是JAVA的一种规范,只能使用于java上,用来替代早期使用的难懂的CGI,是一种无状态的请求响应,客 户端访问一个服务器的url,只需要发送简单的httprequest即可。 规定了四个范围:pageContext、request、session、application。一定依赖于各种SERVLET容器,但 servlet只能接受一个简单的http请求; WebService最早是微软提出了一种以XML为载体网络信息传输的规范,现在几乎所有的语言与平台都支持,带有状态机制,不依赖于 SERVLET容器,可以发送一个xml作为其请求内容,WebService通常是基于http的远程方法调用(RMI),号称是可以反回远程对象, 一般来说客户段可以象调用本地方法一样调用WebService的方法。 传输: servlet使用http协议传输数据,如果你用Servlet返回XML,那个XML的描述框架就是你定的,必须告知使用者具体的说明,没有统一标准。 webservice使用固定的XML格式封装成soap消息,可以使用http作为底层数据传输

help for solving problems in a java rmi assignment

假装没事ソ 提交于 2019-12-03 21:04:44
I want to write an application to share desktop between client and server with java rmi. This is the interface: public interface IServer extends Remote{ public void share(BufferedImage image) throws RemoteException; } ----------------------------- // This is the server side code: public class ServerFrame extends JFrame implements IServer{ public static void main(String args[]) { try { ServerFrame frame = new ServerFrame(); frame.setVisible(true); LocateRegistry.createRegistry(1099); Naming.bind("test", frame); System.out.println("Server Started Successfully..."); } catch (Exception e) { e

Bad idea to chain exceptions with RMI?

旧街凉风 提交于 2019-12-03 20:58:10
Is it a bad idea to use exception chaining when throwing RemoteExceptions? We have an RMI server that does something like this: public Object doSomething() throws RemoteException { try { return getData(); } catch (CustomException ex) { throw new RemoteException(ex); } } I'm getting UnmarshallException caused by a ClassNotFoundException in my client. On the plus side, it turns out that CustomException itself IS exported. Unfortunately, another exception deep inside this guy is NOT exported, which is where the ClassNotFoundException comes in. I think the hierarchy is something like this: