rmi

NullPointerException in invokeLater while running through Java Webstart

*爱你&永不变心* 提交于 2019-11-27 01:36:22
After upgraded from JRE 1.7.0_21 to 1.7.0_25-b15 my application started to throw NullPointerException in SwingUtilities.invokeLater(...) when it is run from Java WebStart. Surprisingly when it is executed as a standalone application (outside JWS), it works great. Here is the top of the stack: Exception in thread "AWT-EventQueue-2" java.lang.NullPointerException at sun.awt.SunToolkit.getSystemEventQueueImplPP(SunToolkit.java:1011) at sun.awt.SunToolkit.getSystemEventQueueImplPP(SunToolkit.java:1007) at sun.awt.SunToolkit.getSystemEventQueueImpl(SunToolkit.java:1002) at java.awt.Toolkit

Java: no security manager: RMI class loader disabled

谁说我不能喝 提交于 2019-11-27 01:33:56
Hi I have RMI application and now I try to invoke some methods at server from my client. I have following code: public static void main(final String[] args) { try { //Setting the security manager System.setSecurityManager(new RMISecurityManager()); IndicatorsService server = (IndicatorsService) Naming .lookup("rmi://localhost/" + IndicatorsService.SERVICE_NAME); DataProvider provider = new OHLCProvider(server); server.registerOHLCProvider(provider); } catch (MalformedURLException e) { e.printStackTrace(); } catch (RemoteException e) { e.printStackTrace(); } catch (NotBoundException e) { e

What port is used by Java RMI connection?

余生长醉 提交于 2019-11-27 01:09:10
May I know what port is used by Java RMI connection? If I want to connect a Java client application to a Java server application using RMI connection, what port I need to open at the server machine so that the client application can connect to it? I want to set up a firewall in the server machine but I don't know which port I should open. skaffman RMI generally won't work over a firewall, since it uses unpredictable ports (it starts off on 1099, and then runs off with a random port after that). In these situations, you generally need to resort to tunnelling RMI over HTTP, which is described

Java RMI proxy-casting issue

孤者浪人 提交于 2019-11-26 23:48:32
问题 I'm trying to get a RMI program to work. So far, the server starts up correctly but the client fails casting the remote object to the interface. Exception in thread "AWT-EventQueue-0" java.lang.ClassCastException: com.sun.proxy.$Proxy0 cannot be cast to MonitorClient.InterfaceMonitor All other answers I've found are for cases where the end user has cast the equivalent of InterfaceMonitorImpl (unknown to the client) instead of the Interface instead. This is not my case and I'm really at a loss

RMI connection refused on localhost

岁酱吖の 提交于 2019-11-26 23:20:25
I am trying to learn RMI coding and when I run server side of RMI I get connection refused. This is my server main method public static void main(String[] args)throws Exception { Implementation impl=new Implementation(); Naming.rebind("//localhost:2020/RMI", impl); System.out.println("Implementation has been bind to the name RMI and is ready for use"); } I believe that the code for Implementation does not matter as it simply is the implemented interface that will run the code. The exception I am getting is this Exception in thread "main" java.rmi.ConnectException: Connection refused to host:

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

青春壹個敷衍的年華 提交于 2019-11-26 23:18:11
问题 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? 回答1: 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

How a server can make a session with a client in RMI

无人久伴 提交于 2019-11-26 23:04:36
I want someone to tell me where to search for how to make a session between the client(s) and the server in RMI, i.e what is the name of that concept for searching purposes? I named this the Remote Session pattern in my 2001 book. The idea is to have a singleton RMI object, bound in the Registry, with nothing but a login() method. That method, if successful, returns a new RemoteSession object for every call, that contains the API you need for the session. RemoteSession is another remote interface of course. It also contains a logout() method, which unexports the object, and it also implements

Remote method invocation port in use

こ雲淡風輕ζ 提交于 2019-11-26 22:46:30
问题 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

java.net.ConnectException :connection timed out: connect?

家住魔仙堡 提交于 2019-11-26 22:35:22
I have used RMI in my code : import java.rmi.*; public interface AddServerIntf extends Remote { double add(double d1,double d2) throws RemoteException; } import java.rmi.*; import java.rmi.server.*; public class AddServerImpl extends UnicastRemoteObject implements AddServerIntf { public AddServerImpl() throws RemoteException { } public double add(double d1,double d2) throws RemoteException { return d1+d2; } } import java.net.*; import java.rmi.*; public class AddServer { public static void main(String args[]) { try { AddServerImpl addServerImpl=new AddServerImpl(); Naming.rebind("AddServer"

What is the penalty for unnecessarily implementing Serializable?

荒凉一梦 提交于 2019-11-26 22:05:28
问题 I need to develop a Java RMI application for my distributed systems class. During the lecture, the professor was stressing to only let classes implement Serializable that have to be passed by value over the network. This implies that there is some downside or penalty to letting too many classes implement Serializable . Classes that don't require to be sent over the network. I don't see how there could be any downside since the serialization/deserialization would never happen if you never