rmi

Applet - server communication, how can I can do it?

穿精又带淫゛_ 提交于 2019-11-27 23:21:26
I have an applet and I must send a request to a web application to get data from the server that is in a database. I am working with objects and it is very useful that the server responses me with objects!! How an applet can communicate with a server? I think web services method, RMI and... make me happy, but which is the best and reliable? As long as its only your applet communicating with the server you can use a serialized object. You just need to maintain the same version of the object class in both the applet jar and on the server. Its not the most open or expandable way to go but it is

廖雪峰Java13网络编程-3其他-2RMI远程调用

徘徊边缘 提交于 2019-11-27 20:43:54
RMI远程调用: Remote Method Invocation 目的:把一个接口方法暴露给远程 RMI远程调用示例: publicInterface 客户端: 服务器端: 在一个RMI远程调用中,客户端持有的是Clock引用,它只想的真正对象是有JVM帮我们创建的ClockClientStub类,而Server端我们创建的是Clock接口和ClockImpl实现类,JVM同样会创建一个类似于ClockServerStub的包装类型,然后通过网络,简介实现远程调用。 来源: https://www.cnblogs.com/csj2018/p/11375743.html

RMI客户端无法连接服务器,显示服务器虚拟机ip地址拒绝访问

99封情书 提交于 2019-11-27 19:27:57
今天在捣鼓rmi时候,出现一个问题,客户端一直显示一个莫名其妙的ip地址拒绝访问,这就很奇怪了,哪里来的?后来经过排查发现这个ip地址是虚拟机的一个虚拟网卡的ip地址,不知道为什么客户端在寻找服务器的ip地址的时候会自动映射到该虚拟机的ip上。解决的方法是先将这个虚拟网卡关了,然后重启rmi的服务器端就可以正确连接了。(ps:重启后在打开虚拟网卡,就相互不影响了)。 个人猜测的是,在服务器注册服务时候,会自动选择一个ip地址,这个ip地址在选择时候出现了错误。也没找到java这块的源码。下面上源码,有大哥可以帮帮小弟解答吗。。。 服务器: import java.rmi.Naming; import java.rmi.RemoteException; import java.rmi.registry.LocateRegistry; import java.rmi.registry.Registry; public class RegistryService { public static void main(String[] args) { try { Registry registry= LocateRegistry.createRegistry(8848); HellowRegistryFacade hello=new HellowRegistryFacadeImpl();

Remote method invocation port in use

做~自己de王妃 提交于 2019-11-27 19:08:48
I have created a Server, Client kind of program with RMI. But whenever I run my Server after starting the rmiregistry from command prompt, the port already in use error is thrown. Its only me who started the rmiregistry. I have checked it from netstat. Server Code: public class Server implements Runnable, Linker{ private static Server server = null; private static Linker l = null; private String name = null; public Server(){} public void setName(String name){ this.name = name; } public String getName(){ return name; } public void run(){ while(!("Andy").equalsIgnoreCase(name)){ } } public

How to connect to a java program on localhost jvm using JMX?

吃可爱长大的小学妹 提交于 2019-11-27 17:12:59
I should connect to a java program on localhost jvm using JMX. In other words I want to develop a JMX client to config a java program on localhost. Don't recommend using JConsole! JConsole is not suitable because it is general JMX client and have negative effect on main program performance. Samples on oracle site use RMIConnector and host:port params but I don't know: where should set jmx port? JConsole have an option to connect to java processes by PID. But I don't find any method in JMX api that have PID as input param. We use something like the following to programatically connect to our

Web Services vs EJB vs RMI, advantages and disadvantages?

牧云@^-^@ 提交于 2019-11-27 16:45:15
My web server would be overloaded quickly if all the work were done there. I'm going to stand up a second server behind it, to process data. What's the advantage of EJB over RMI, or vice versa? What about web services (SOAP, REST)? duffymo EJBs are built on top of RMI. Both imply Java clients and beans. If your clients need to be written in something else (e.g., .NET, PHP, etc.) go with web services or something else that speaks a platform-agnostic wire protocol, like HTTP or XML over HTTP or SOAP. If you choose RMI, you don't need a Java EE EJB app server. You have to keep client and server

Using JAVA RMI in Android application

北城以北 提交于 2019-11-27 14:02:55
问题 I've read lots of threads about this issue, and i couldnt see a 'real' solution for it. I made a java project - which is a rmi server and i have an android application which suppose to be also a rmi client. When i checked if the server works I wasn't wise enough to test the client on an android project and i made a test client on a simple java project. Now when i'm trying to connect my android application to server i fail because the android project doesn't recognize the java rmi package. Why

Java RMI and Thread Synchronization questions

不想你离开。 提交于 2019-11-27 12:51:56
问题 I actually have two questions about Java RMI and thread synchronization: 1) If I implement my RMI remote methods as synchronized, are they guaranteed to be mutually exclusive? I need to make sure that no two of my RMI methods (methods offered to clients) execute at the same time. 2) I have a method that the server executes periodically. It is used to do cleanups. I have to make sure that this particular method does not execute when there is any RMI method being run/used by remote clients.

Communication between local JVMs

白昼怎懂夜的黑 提交于 2019-11-27 11:05:34
问题 My question: What approach could/should I take to communicate between two or more JVM instances that are running locally? Some description of the problem: I am developing a system for a project that requires separate JVM instances to isolate certain tasks from each other entirely. In it's running, the 'parent' JVM will create 'child' JVMs that it will expect to execute and then return results to it (in the format of relatively simple POJO classes, or perhaps structured XML data). These

Is it possible for a thread to Deadlock itself?

纵饮孤独 提交于 2019-11-27 10:55:17
Is it technically possible for a thread in Java to deadlock itself? I was asked this at an interview a while back and responded that it wasn't possible but the interviewer told me that it is. Unfortunately I wasn't able to get his method on how to achieve this deadlock. This got me thinking and the only situation that I can think of is where you can have this happen is where you have an RMI server process which contained a method that calls itself. The line of code that calls the method is placed in a synchronized block. Is that even possible or was the interviewer incorrect? The source code I