Tracing into java.rmi.naming
Hi all!
When debugging, I cannot trace into java.rmi.Naming
in objc = (MyInterface)Naming.lookup(AnObjectAddr);
I have no classes or sources excluded in Project Properties | Run/Debug
What on earth could be wrong?
I have installed the new JDev, which has reverted my settings to default JDK1.2.2 (was JDK1.3) - I was hoping that this might solve the problem, but it does not.
Best regards and thanks in advance,
Christian Loft
Hi all!
When debugging, I cannot trace into java.rmi.Naming
in objc = (MyInterface)Naming.lookup(AnObjectAddr);
I have no classes or sources excluded in Project Properties | Run/Debug
What on earth could be wrong?
I have installed the new JDev, which has reverted my settings to default JDK1.2.2 (was JDK1.3) - I was hoping that this might solve the problem, but it does not.
Best regards and thanks in advance,
Christian Loft
Similar Messages
-
RMI Problem -- java.rmi.UnmarshalException:
I am having a client and a server.... when i am trying to bring the client into server. but when i am doing it... i am getting an exception as below as...
java.rmi.UnmarshalException: Error unmarshaling return header; nested exception is:
java.io.EOFException
at sun.rmi.transport.StreamRemoteCall.executeCall(Unknown Source)
at sun.rmi.server.UnicastRef.invoke(Unknown Source)
at sun.rmi.registry.RegistryImpl_Stub.lookup(Unknown Source)
at java.rmi.Naming.lookup(Unknown Source)
at hsmsgui.rmtmgmt.RmtMgmtHandler.contactClient(RmtMgmtHandler.java:176)
at hsmsgui.display.AddClientWzd.onFinishBtnClicked(AddClientWzd.java:488)
at hsmsgui.display.AddClientWzd.actionPerformed(AddClientWzd.java:346)
at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source)
at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Unknown Source)
at java.awt.Component.processMouseEvent(Unknown Source)
at javax.swing.JComponent.processMouseEvent(Unknown Source)
at java.awt.Component.processEvent(Unknown Source)
at java.awt.Container.processEvent(Unknown Source)
at java.awt.Component.dispatchEventImpl(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Window.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
at java.awt.Dialog$1.run(Unknown Source)
at java.awt.Dialog$3.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.awt.Dialog.show(Unknown Source)
at hsmsgui.display.AddClientAction.actionPerformed(AddClientAction.java:38)
at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source)
at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Unknown Source)
at java.awt.AWTEventMulticaster.mouseReleased(Unknown Source)
at java.awt.Component.processMouseEvent(Unknown Source)
at javax.swing.JComponent.processMouseEvent(Unknown Source)
at java.awt.Component.processEvent(Unknown Source)
at java.awt.Container.processEvent(Unknown Source)
at java.awt.Component.dispatchEventImpl(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Window.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)
Caused by: java.io.EOFException
at java.io.DataInputStream.readByte(Unknown Source)
... 60 more
can any one help me out to solve this problem.......Thanks for ur reply...Now i' m getting the access denied problem..
I am able to create the rmi registry successfully on the server, Then Binding is also done successfully. but when i try to connect the client to the server the exception is thrown Please help me..
TEST - client PC name.
java.security.AccessControlException: access denied (java.net.SocketPermission TEST resolve)
at java.security.AccessControlContext.checkPermission(Unknown Source)
at java.security.AccessController.checkPermission(Unknown Source)
at java.lang.SecurityManager.checkPermission(Unknown Source)
at java.lang.SecurityManager.checkConnect(Unknown Source)
at java.net.InetAddress.getAllByName0(Unknown Source)
at java.net.InetAddress.getAllByName0(Unknown Source)
at java.net.InetAddress.getAllByName(Unknown Source)
at java.net.InetAddress.getByName(Unknown Source)
at java.net.InetSocketAddress.<init>(Unknown Source)
at java.net.Socket.<init>(Unknown Source)
at sun.rmi.transport.proxy.RMIDirectSocketFactory.createSocket(Unknown Source)
at sun.rmi.transport.proxy.RMIMasterSocketFactory.createSocket(Unknown Source)
at sun.rmi.transport.tcp.TCPEndpoint.newSocket(Unknown Source)
at sun.rmi.transport.tcp.TCPChannel.createConnection(Unknown Source)
at sun.rmi.transport.tcp.TCPChannel.newConnection(Unknown Source)
at sun.rmi.server.UnicastRef.newCall(Unknown Source)
at sun.rmi.registry.RegistryImpl_Stub.lookup(Unknown Source)
at java.rmi.Naming.lookup(Unknown Source)
at hsmsgui.rmtmgmt.RmtMgmtHandler.contactClient(RmtMgmtHandler.java:176)
at hsmsgui.display.AddClientWzd.onFinishBtnClicked(AddClientWzd.java:488)
at hsmsgui.display.AddClientWzd.actionPerformed(AddClientWzd.java:346)
at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source)
at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Unknown Source)
at java.awt.Component.processMouseEvent(Unknown Source)
at javax.swing.JComponent.processMouseEvent(Unknown Source)
at java.awt.Component.processEvent(Unknown Source)
at java.awt.Container.processEvent(Unknown Source)
at java.awt.Component.dispatchEventImpl(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Window.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
at java.awt.Dialog$1.run(Unknown Source)
at java.awt.Dialog$3.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.awt.Dialog.show(Unknown Source)
at hsmsgui.display.AddClientAction.actionPerformed(AddClientAction.java:38)
at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source)
at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Unknown Source)
at java.awt.AWTEventMulticaster.mouseReleased(Unknown Source)
at java.awt.Component.processMouseEvent(Unknown Source)
at javax.swing.JComponent.processMouseEvent(Unknown Source)
at java.awt.Component.processEvent(Unknown Source)
at java.awt.Container.processEvent(Unknown Source)
at java.awt.Component.dispatchEventImpl(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Window.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source) -
Java.rmi.UnmarshalException: skeleton class not found but required for clie
Hello everyone,
I am new to RMI and getting a strange exception. I am using Java 1.5.0_07 both on client and server. They are running on the same machine, the rmi registry is started inside the server application.
I am wondering why java complains about skeletons, I thought they are automatically created when using java 5.0?
Please have a look at the stacktrace below.
Thank you for your help.
Best Regards
Patric
java.rmi.ServerException: RemoteException occurred in server thread; nested exception is:
java.rmi.UnmarshalException: error unmarshalling call header; nested exception is:
java.rmi.UnmarshalException: skeleton class not found but required for client version
sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:325)
sun.rmi.transport.Transport$1.run(Transport.java:153)
java.security.AccessController.doPrivileged(Native Method)
sun.rmi.transport.Transport.serviceCall(Transport.java:149)
sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:466)
sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:707)
java.lang.Thread.run(Thread.java:595)
sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(StreamRemoteCall.java:247)
sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:223)
sun.rmi.server.UnicastRef.invoke(UnicastRef.java:343)
sun.rmi.registry.RegistryImpl_Stub.lookup(Unknown Source)
java.rmi.Naming.lookup(Naming.java:84)
org.apache.jsp.index_jsp._jspService(index_jsp.java:58)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:94)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:324)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)The full class path information that I can gather is as follows (some of the library path locations could be suspect...):
Class path: /edge/node3/hotfix::/edge/node3/current/lib/JMdsApi.jar:/edge/node3/current/lib/MemoryProfilingAgent.jar:/edge/node3/current/lib/T2common-2.6.0-SNAPSHOT.3200.jar:/edge/node3/current/lib/T2scripting-jython.jar:/edge/node3/current/lib/activation.jar:/edge/node3/current/lib/alib.jar:/edge/node3/current/lib/alibom.jar:/edge/node3/current/lib/ant.jar:/edge/node3/current/lib/authapi.jar:/edge/node3/current/lib/bbdlapi.jar:/edge/node3/current/lib/bcpg-jdk15-136.jar:/edge/node3/current/lib/bcprov-jdk15-136.jar:/edge/node3/current/lib/c3p0-0.9.1.2.jar:/edge/node3/current/lib/castor-1.1-codegen-anttask.jar:/edge/node3/current/lib/castor-1.1-codegen.jar:/edge/node3/current/lib/castor-1.1-xml.jar:/edge/node3/current/lib/castor-1.1.jar:/edge/node3/current/lib/colt-1.2.0.jar:/edge/node3/current/lib/common-annotations.jar:/edge/node3/current/lib/commons-beanutils.jar:/edge/node3/current/lib/commons-codec-1.3.jar:/edge/node3/current/lib/commons-collections-3.2.1.jar:/edge/node3/current/lib/commons-jexl-1.1.jar:/edge/node3/current/lib/commons-lang-2.3.jar:/edge/node3/current/lib/commons-logging-1.1.1.jar:/edge/node3/current/lib/commons-net-1.4.1.jar:/edge/node3/current/lib/dsn.jar:/edge/node3/current/lib/eagleapi.jar:/edge/node3/current/lib/ezmorph-1.0.3.jar:/edge/node3/current/lib/f2-loader-1.8.jar:/edge/node3/current/lib/fasttrade-boviewer-1.0.1.jar:/edge/node3/current/lib/hsqldb.jar:/edge/node3/current/lib/icu4j-3.4.4.jar:/edge/node3/current/lib/ivy.jar:/edge/node3/current/lib/janino.jar:/edge/node3/current/lib/janus-sdk-1.7.0.0.jar:/edge/node3/current/lib/jasypt-1.4.1.jar:/edge/node3/current/lib/javolution.jar:/edge/node3/current/lib/jcalendar-1.3.2.jar:/edge/node3/current/lib/jcl-over-slf4j-1.5.6.jar:/edge/node3/current/lib/jcommon-1.0.9.jar:/edge/node3/current/lib/jconn2.jar:/edge/node3/current/lib/jconn3-6.05-b26214.jar:/edge/node3/current/lib/jdom.jar:/edge/node3/current/lib/jfreechart-1.0.5.jar:/edge/node3/current/lib/jgroups-all.jar:/edge/node3/current/lib/jline.jar:/edge/node3/current/lib/jmkv123p1.jar:/edge/node3/current/lib/jna.jar:/edge/node3/current/lib/joda-time-1.5.2.jar:/edge/node3/current/lib/jscience.jar:/edge/node3/current/lib/json-lib-2.2.1-jdk15.jar:/edge/node3/current/lib/jul-to-slf4j-1.5.6.jar:/edge/node3/current/lib/junit.jar:/edge/node3/current/lib/jython.jar:/edge/node3/current/lib/log4j-1.2.15.jar:/edge/node3/current/lib/log4j-over-slf4j-1.5.6.jar:/edge/node3/current/lib/loggablePreparedStatement-1.6.jar:/edge/node3/current/lib/looks-2.1.4.jar:/edge/node3/current/lib/mailapi.jar:/edge/node3/current/lib/model-12021.jar:/edge/node3/current/lib/mysql-connector-java-5.1.7-bin.jar:/edge/node3/current/lib/opencsv-1.8.jar:/edge/node3/current/lib/rfa.jar:/edge/node3/current/lib/rspcore.jar:/edge/node3/current/lib/slf4j-api-1.5.6.jar:/edge/node3/current/lib/slf4j-log4j12-1.5.6.jar:/edge/node3/current/lib/smtp.jar:/edge/node3/current/lib/smtphandler-0.6.jar:/edge/node3/current/lib/spring-2.5.2.jar:/edge/node3/current/lib/statsvn.jar:/edge/node3/current/lib/swingx-0.9.3.jar:/edge/node3/current/lib/t2-12021.jar:/edge/node3/current/lib/testng-5.9-jdk15.jar:/edge/node3/current/lib/tibmsg.jar:/edge/node3/current/lib/tibrvj.jar:/edge/node3/current/lib/trove.jar:/edge/node3/current/lib/velocity-tools.jar:/edge/node3/current/lib/velocity.jar:/edge/node3/current/lib/xalan.jar:/edge/node3/current/lib/xerces.jar:/edge/node3/current/lib/patng/activeio-core-3.0.0-incubator.jar:/edge/node3/current/lib/patng/activemq-core-4.1.1.jar:/edge/node3/current/lib/patng/avalon-framework-4.1.3.jar:/edge/node3/current/lib/patng/backport-util-concurrent-2.2.jar:/edge/node3/current/lib/patng/binding-1.4.0.jar:/edge/node3/current/lib/patng/cglib-nodep-2.1_3.jar:/edge/node3/current/lib/patng/common-1.30.jar:/edge/node3/current/lib/patng/commons-cli-1.0.jar:/edge/node3/current/lib/patng/commons-configuration-1.2.jar:/edge/node3/current/lib/patng/commons-discovery-0.2.jar:/edge/node3/current/lib/patng/commons-math-1.1.jar:/edge/node3/current/lib/patng/concurrent-1.3.4.jar:/edge/node3/current/lib/patng/geronimo-j2ee-management_1.0_spec-1.0.jar:/edge/node3/current/lib/patng/geronimo-jms_1.1_spec-1.0.jar:/edge/node3/current/lib/patng/logkit-1.0.1.jar:/edge/node3/current/lib/patng/mina-core-1.0.1.jar:/edge/node3/current/lib/patng/mina-filter-ssl-1.0.1.jar:/edge/node3/current/lib/patng/mina-java5-1.0.1.jar:/edge/node3/current/lib/patng/mx4j-remote-3.0.1.jar:/edge/node3/current/lib/patng/mx4j-tools-3.0.1.jar:/edge/node3/current/lib/patng/org.apache.felix.framework-1.0.0.jar:/edge/node3/current/lib/patng/org.osgi.core-1.0.0.jar:/edge/node3/current/lib/patng/pat-dt-common-1.18.jar:/edge/node3/current/lib/patng/pat-sdt-1.18.jar:/edge/node3/current/lib/patng/patNg-api-1.27.1.jar:/edge/node3/current/lib/patng/patNg-server-aoc-1.21.jar:/edge/node3/current/lib/patng/patNg-server-common-1.21.jar:/edge/node3/current/lib/patng/patNg-server-session-manager-1.21.jar:/edge/node3/current/lib/patng/patNg-utils-1.27.1.jar:/edge/node3/current/lib/patng/qpid-broker-2.2.2.0.jar:/edge/node3/current/lib/patng/qpid-client-2.2.2.0.jar:/edge/node3/current/lib/patng/qpid-common-2.2.2.0.jar:/edge/node3/current/lib/patng/qpid-mina-core-2.2.2.0.jar:/edge/node3/current/lib/patng/rsee-2.11.jar:/edge/node3/current/lib/patng/servlet-api-2.3.jar:/edge/node3/current/lib/patng/silk-1.3.jar:/edge/node3/current/lib/patng/slf4j-api-1.4.0.jar:/edge/node3/current/lib/patng/slf4j-log4j12-1.4.0.jar:/edge/node3/current/lib/patng/validation-1.2.0.jar
Boot class path: /apps/jdk/1.6.0_13/linux/jre/lib/resources.jar:/apps/jdk/1.6.0_13/linux/jre/lib/rt.jar:/apps/jdk/1.6.0_13/linux/jre/lib/sunrsasign.jar:/apps/jdk/1.6.0_13/linux/jre/lib/jsse.jar:/apps/jdk/1.6.0_13/linux/jre/lib/jce.jar:/apps/jdk/1.6.0_13/linux/jre/lib/charsets.jar:/apps/jdk/1.6.0_13/linux/jre/classes:/tmp/yjp200811122006.jar
Library path: /apps/jdk/1.6.0_13/linux/jre/lib/i386/server:/apps/jdk/1.6.0_13/linux/jre/lib/i386:/apps/jdk/1.6.0_13/linux/jre/../lib/i386::/edge/node3/current/lib:/home/eqdev/eqedgeuat/yourkit_7_5_11/yjp-7.5.11/bin/linux-x86-32:/edge/node3/current/lib:/home/eqdev/eqedgeuat/yourkit_7_5_11/yjp-7.5.11/bin/linux-x86-32:/usr/java/packages/lib/i386:/lib:/usr/lib -
I am having problems with the following code that I am currently trying to understand RMI from Java head First, the following are meant to be part of an universal browser that the browser downloads and displays interactive Java GUIs. Can someone explain what I am doing wrong as I am still new to Java please?
import java.awt.*;
import javax.swing.*;
import java.rmi.*;
import java.awt.event.*;
public class ServiceBrowser {
JPanel mainPanel;
JComboBox serviceList;
ServiceServer server;
public void buildGUI() {
JFrame frame = new JFrame("RMI Browser");
mainPanel = new JPanel();
frame.getContentPane().add(BorderLayout.CENTER, mainPanel);
Object[] services = getServicesList();
serviceList = new JComboBox(services);
frame.getContentPane().add(BorderLayout.NORTH, serviceList);
serviceList.addActionListener(new MyListListener());
frame.setSize(500,500);
frame.setVisible(true);
void loadService(Object serviceSelection) {
try {
Service svc = server.getService(serviceSelection);
mainPanel.removeAll();
mainPanel.add(svc.getGuiPanel());
mainPanel.validate();
mainPanel.repaint();
} catch(Exception ex) {
ex.printStackTrace();
Object[] getServicesList() {
Object obj = null;
Object[] services = null;
try {
obj = Naming.lookup("rmi://127.0.0.1/ServiceServer");
catch(Exception ex) {
ex.printStackTrace();
server = (ServiceServer) obj;
try {
services = server.getServiceList();
} catch(Exception ex) {
ex.printStackTrace();
return services;
class MyListListener implements ActionListener {
public void actionPerformed(ActionEvent ev) {
// do things to get the selected service
Object selection = serviceList.getSelectedItem();
loadService(selection);
public static void main(String[] args) {
new ServiceBrowser().buildGUI();
}I am able to compile the code but come up with the following error messages at runtime
java.rmi.ConnectException: Connection refused to host: 127.0.0.1; nested exception is:
java.net.ConnectException: Connection refused
at sun.rmi.transport.tcp.TCPEndpoint.newSocket(TCPEndpoint.java:601)
at sun.rmi.transport.tcp.TCPChannel.createConnection(TCPChannel.java:198)
at sun.rmi.transport.tcp.TCPChannel.newConnection(TCPChannel.java:184)
at sun.rmi.server.UnicastRef.newCall(UnicastRef.java:322)
at sun.rmi.registry.RegistryImpl_Stub.lookup(Unknown Source)
at java.rmi.Naming.lookup(Naming.java:84)
at ServiceBrowser.getServicesList(ServiceBrowser.java:53)
at ServiceBrowser.buildGUI(ServiceBrowser.java:19)
at ServiceBrowser.main(ServiceBrowser.java:82)
Caused by: java.net.ConnectException: Connection refused
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333)
at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:195)
at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:182)
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:432)
at java.net.Socket.connect(Socket.java:529)
at java.net.Socket.connect(Socket.java:478)
at java.net.Socket.<init>(Socket.java:375)
at java.net.Socket.<init>(Socket.java:189)
at sun.rmi.transport.proxy.RMIDirectSocketFactory.createSocket(RMIDirectSocketFactory.java:22)
at sun.rmi.transport.proxy.RMIMasterSocketFactory.createSocket(RMIMasterSocketFactory.java:128)
at sun.rmi.transport.tcp.TCPEndpoint.newSocket(TCPEndpoint.java:595)
... 8 more
java.lang.NullPointerException
at ServiceBrowser.getServicesList(ServiceBrowser.java:64)
at ServiceBrowser.buildGUI(ServiceBrowser.java:19)
at ServiceBrowser.main(ServiceBrowser.java:82)
Exception in thread "main" java.lang.NullPointerException
at javax.swing.DefaultComboBoxModel.<init>(DefaultComboBoxModel.java:53)
at javax.swing.JComboBox.<init>(JComboBox.java:175)
at ServiceBrowser.buildGUI(ServiceBrowser.java:21)
at ServiceBrowser.main(ServiceBrowser.java:82)
The code for the remote implementation compile and runs, but the other code for services compiles but come back with the following error message at runtime:
Exception in thread "main" java.lang.NoSuchMethodError: main
I have included one of the services code below this happens with:
import javax.swing.*;
import java.awt.event.*;
import java.io.*;
public class DiceService implements Service {
JLabel label;
JComboBox numOfDice;
public JPanel getGuiPanel() {
JPanel panel = new JPanel();
JButton button = new JButton("Roll 'em!");
String[] choices = {"1", "2", "3", "4", "5"};
numOfDice = new JComboBox(choices);
label = new JLabel("dice values here");
button.addActionListener(new RollEmListener());
panel.add(numOfDice);
panel.add(button);
panel.add(label);
return panel;
public class RollEmListener implements ActionListener {
public void actionPerformed(ActionEvent ev) {
// roll the dice
String diceOutput = "";
String selection = (String) numOfDice.getSelectedItem();
int numOfDiceToRoll = Integer.parseInt(selection);
for (int i = 0; i < numOfDiceToRoll; i++) {
int r = (int) ((Math.random() * 6) + 1);
diceOutput += (" " + r);
label.setText(diceOutput);
}how I do get suitable server running, can I not test the code on a local ip address first, i have included the remote implementation code below, can you advise how I can resolve this please or point me in the right direction?
import java.rmi.*;
import java.util.*;
import java.rmi.server.*;
public class ServiceServerImpl extends UnicastRemoteObject implements ServiceServer {
HashMap<String, Service> serviceList;
public ServiceServerImpl() throws RemoteException {
// start and set up services
setUpServices();
private void setUpServices() {
serviceList = new HashMap<String, Service>();
serviceList.put("Dice Rolling Service", new DiceService());
serviceList.put("Day of the Week Service", new DayOfTheWeekService());
serviceList.put("Visual Music Service", new MiniMusicService());
public Object[] getServiceList() {
System.out.println("in remote");
return serviceList.keySet().toArray();
public Service getService(Object serviceKey) throws RemoteException {
Service theService = (Service) serviceList.get(serviceKey);
return theService;
public static void main (String[] args) {
try {
Naming.rebind("ServiceServer", new ServiceServerImpl());
} catch(Exception ex) { }
System.out.println("Remote service is running");
} -
Java.rmi.ConnectException
hi I am trying to connect to a remote server from my client as follows
$ java TestRcf -Djava.security.policy=policy
and my policy file is as follows....
grant {
permission java.net.SocketPermission "*:1024-65535", "connect";
I get the following error when i try to connect it...
Do i have to include anything else in the policy file or what is that i am missing?
the error is as follows......
lookup host: //10.1.129.3/RCFSearch10.1.129.3
java.rmi.ConnectException: Connection refused to host: 10.1.129.3; nested exception is:
java.net.ConnectException: Connection timed out
at sun.rmi.transport.tcp.TCPEndpoint.newSocket(TCPEndpoint.java:574)
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:306)
at sun.rmi.registry.RegistryImpl_Stub.lookup(Unknown Source)
at java.rmi.Naming.lookup(Naming.java:84)
at com.lt.rcf.RemoteRCF.<init>(RemoteRCF.java:48)
at com.lt.rcf.RCFMediator.init(RCFMediator.java:405)
at com.lt.rcf.RCFMediator.<init>(RCFMediator.java:60)
at com.lt.rcf.RCFClient.<init>(RCFClient.java:59)
at com.lt.rcf.RCFAppBuilder.create(RCFAppBuilder.java:50)
at TestRcf.test0(TestRcf.java:55)
at TestRcf.main(TestRcf.java:88)
Caused by: java.net.ConnectException: Connection timed out
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333)
at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:195)
at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:182)
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:364)
at java.net.Socket.connect(Socket.java:507)
at java.net.Socket.connect(Socket.java:457)
at java.net.Socket.<init>(Socket.java:365)
at java.net.Socket.<init>(Socket.java:178)
at sun.rmi.transport.proxy.RMIDirectSocketFactory.createSocket(RMIDirectSocketFactory.java:22)
at sun.rmi.transport.proxy.RMIMasterSocketFactory.createSocket(RMIMasterSocketFactory.java:128)
at sun.rmi.transport.tcp.TCPEndpoint.newSocket(TCPEndpoint.java:569)
... 12 more
com.lt.rcf.RCFException: RCF Server connection not available: Connection refused to host: 10.1.129.3; nested exception is:
java.net.ConnectException: Connection timed outfirst of all, which OS are you working on? This
question might sound wierd, but I have noticed a
lotta people working on Linux boxes havecomplained
about this. There is another mail thread about it:
>
http://forum.java.sun.com/thread.jspa?threadID=570065&
tstart=0
is your client able to look up the reference tothe
server ? If so, can you print that reference andfind
out which port the remote server is listening on ?
here did u mean Naming.LookUp("rmi://10.1.129.3") in the client.thats where i get connection refused while doing naming.lookup.
Then use the netstat command to see if the serveris
indeed listenign on that port when the connectionis
refused !
netstat -anp - p | grep <port_of_server>
let me know how it goes.
when i did netstat -anp - p | grep <port_of_server> on my client this is what i get ...
Not all processes could be identified, non-owned process info
will not be shown, you would have to be root to see it all.)
tcp 0 0 0.0.0.0:1099 0.0.0.0:* LISTEN
6435/rmiregistry
tcp 0 0 10.1.129.3:51983 10.1.129.3:1099 ESTABLISHED
6492/java
tcp 0 0 10.1.129.3:1099 10.1.129.3:51983 ESTABLISHED
6435/rmiregistry -
RemoteException: java.rmi.UnmarshalException in jdk 1.4.2
i'm implementing an RMI over the jdk 1.4.2 (can't do it in the 1.5 or 1.6) i've seen this topic [http://forum.java.sun.com/thread.jspa?threadID=370196&messageID=1808449] but it didn't help me, or i'm doing something wrong...
i know the RMI code is ok because it runs on java 1.6 (with the automatic generation of stubs and skeletons) but when i change the platform to 1.4 it throws the exception:
RemoteException: java.rmi.UnmarshalException: error unmarshalling return; nested exception is:
java.lang.ClassNotFoundException: servidor.MensageiroImpl_Stub
the VM is configured to use the -Djava.security.policy=C:\Projecto\Policy\permissions.policy both in the client and server
please help me :S i've been burning my head with this for 3 days
i leave my code here:
The interface:
package rmiinterface;
import java.rmi.Remote;
import java.rmi.RemoteException;
public interface Mensageiro extends Remote {
public void sendMsg(String msg) throws RemoteException;
public String readMsg() throws RemoteException;
}the implementation:
package servidor;
import rmiinterface.Mensageiro;
import java.rmi.RemoteException;
import java.rmi.server.UnicastRemoteObject;
public class MensageiroImpl extends UnicastRemoteObject implements Mensageiro {
public MensageiroImpl() throws RemoteException {
super();
public void sendMsg(String msg) throws RemoteException {
System.out.println(msg);
public String readMsg() throws RemoteException {
return "This is not a Hello World! message";
}the server:
package servidor;
import rmiinterface.Mensageiro;
import java.rmi.Naming;
import java.rmi.RMISecurityManager;
public class MensageiroServer {
public MensageiroServer() {
System.setSecurityManager(new RMISecurityManager());
try {
Mensageiro m = new MensageiroImpl();
java.rmi.registry.LocateRegistry.createRegistry(1099);
System.out.println("RMI registry successfully initiated");
Naming.rebind("MensageiroService", m);
System.out.println("Servidor Online");
} catch (Exception e) {
System.out.println("Trouble: " + e.getMessage());
public static void main(String[] args) {
new MensageiroServer();
}and the client:
package cliente;
import rmiinterface.Mensageiro;
import java.rmi.RMISecurityManager;
import java.rmi.Naming;
import java.rmi.RemoteException;
import java.rmi.NotBoundException;
import java.net.MalformedURLException;
public class MensageiroClient {
public MensageiroClient() {
public static void main(String args[]) {
System.setSecurityManager(new RMISecurityManager());
try {
Mensageiro m = (Mensageiro) Naming.lookup("//localhost/MensageiroService");
System.out.println(m.readMsg());
m.sendMsg("Hello World!");
} catch (MalformedURLException e) {
System.out.println();
System.out.println("MalformedURLException: " + e.toString());
} catch (RemoteException e) {
System.out.println();
System.out.println("RemoteException: " + e.toString());
} catch (NotBoundException e) {
System.out.println();
System.out.println("NotBoundException: " + e.toString());
} catch (Exception e) {
System.out.println();
System.out.println("Exception: " + e.toString());
}NOTE: my IDE is Netbeans 6.1. and the client and server are in diffrent projects
thanks in advance
Best Regards,
Carlos Daniel Ribeirothe stub and the skeleton are being generated, and they are there, in the server project! i don't know why the class defs for the stub filearen't downloded by the client project...I don't know why you think they will be downloaded. They won't be, unless you're using the codebase feature. The client needs the remote interface and the stub on its classpath, and all classes that the remote interface depends on, and so on recursively until closure. You have to do something about that.
It works under 1.6 because it doesn't need the stub at all. -
Dear friends,
I am running an RMI example program,
have used rmic to generate the stub and skeleton class, have used rmiregistry 1010 to start registry service, and used java Pi to start the server, but there are errors generated as follows,
Error --java.rmi.UnknownHostException: Unknown host:Default; nested exception is:
java.net.UnknownHostException:Default
java.rmi.UnknownHostException: Unknown host:Default; nested exception is:
java.net.UnknownHostException:Default
java.net.UnknownHostException:Default
at java.net.InetAddress.getAllByName0(Unknown Source)
at java.net.InetAddress.getAllByName0(Unknown Source)
at java.net.InetAddress.getByName(Unknown Source)
at java.net.Socket.<init>(Unknow Source)
at sun.rmi.transport.proxy.RMIDirectSocketFactory.createSocket(Unknow Source)
at sun.rmi.transport.proxy.RMIMasterSocketFactory.createSocket(Unknow Source)
at sun.rmi.transport.tcp.TCPEndpoint.newSocket(Unknow Source)
at sun.rmi.transport.tcp.TCPChannel.createConnection(Unknow Source)
at sun.rmi.transport.tcp.TCPChannel.newConnection(Unknow Source)
at sun.rmi.server.UnicastRef.newCall(Unknow Source)
at sun.rmi.registry.Registry_Stub.bind(Unknow Source)
at java.rmi.Naming.bind(Unknown Source)
at Pi.main(Pi.java:23)
the program codes are as follows,
//server interface
import java.rmi.*;
interface PiRemote extends Remote {
double getPi() throws RemoteException;
//server
import java.net.*;
import java.rmi.*;
import java.rmi.registry.*;
import java.rmi.server.*;
public class Pi extends UnicastRemoteObject
implements PiRemote {
public double getPi() throws RemoteException {
return Math.PI;
public Pi() throws RemoteException {
public static void main(String[] arguments) {
System.setSecurityManager(new
RMISecurityManager());
try {
Pi p = new Pi();
Naming.bind("//Default:1010/Pi", p);
} catch (Exception e) {
System.out.println("Error -- " +
e.toString());
e.printStackTrace();
//client
import java.rmi.*;
import java.rmi.registry.*;
public class OutputPi {
public static void main(String[] arguments) {
System.setSecurityManager(
new RMISecurityManager());
try {
PiRemote pr =
(PiRemote)Naming.lookup(
"//Default:1010/Pi");
for (int i = 0; i < 10; i++)
System.out.println("Pi = " + pr.getPi());
} catch (Exception e) {
System.out.println("Error -- " + e.toString());
e.printStackTrace();
who know how to resolve the problem, thank you in advance:)I do always use the ip adress/port
You can find it by
try {
ipLocal = InetAddress.getLocalHost();
catch(Exception e) {
new PopUpMessage("ERROR","Error in searching IP", true);
system.out.println("Your IP address is " + ipLocal.getHostAddress()); -
Unreported exception java.rmi.RemoteException; must be caught or declared t
I am receiving an:
unreported exception java.rmi.RemoteException; must be caught or declared to be thrown
error when I attempt to compile the Client.java file.
The Client.java file implements the ATMListener.java interface.
As you will see below, I've stripped them down by taking out all of the code, yet I still receive this error.
Any ideas...
ATMListener.java
import java.rmi.*;
import java.rmi.server.UnicastRemoteObject;
* @author Eddie Brodie
* @version %I%, %G%
public interface ATMListener extends java.rmi.Remote
Client.java
import java.net.MalformedURLException;
import java.rmi.Naming;
import java.rmi.NotBoundException;
import java.rmi.RemoteException;
import java.rmi.UnknownHostException;
public class Client extends java.rmi.server.UnicastRemoteObject implements ATMListenerWell first off unless I am missing something in the API java.rmi.Remote is an interface not a class so implements not inherits, but I do not really know these classes so I cannot be sure I am not missing something.
As for the unreported exception. What could be causing something like this would be an exception thrown by the constructor of the parent class. Even if you have no constructor written for your class it still has a default constructor which will by default call the super constrcutpor meaning an exception could be thrown from the super constrcutor down to your default constructor where you would not know what to do with it. -
Weblogic.rmi and java.rmi
Hi,
I would like to use weblogic to access a java object on another machine that
is using java.rmi. I am using the java "rmiregistry" on the non weblogic box.>
How can I write a java program that maintains state to that object at weblogic
startup and call it with a weblogic client?
Thanks
Desmond Anderson"Pyung Yoon" <[email protected]> writes:
MediatorInterface mediator = (MediatorInterface) java.rmi.Naming.lookup("rmi://localhost:7001/TestMediator);This implies JRMP which the server does not support. You need to use t3 or iiop.
andy -
Exception occurred: java.rmi.ServerException
Hello,
I am trying to run small rmi program on sun solaris unix server. but after running the rmiregistry when I have execute the server program, it's throwing me following error. The same program is running fine in my local windows machine.
java.rmi.ServerException: RemoteException occurred in server thread; nested exception is:
java.rmi.UnmarshalException: error unmarshalling arguments; nested exception is:
java.lang.ClassNotFoundException: RMITest.myRMIInterface
at sun.rmi.server.UnicastServerRef.oldDispatch(UnicastServerRef.java:400)
at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:255)
at sun.rmi.transport.Transport$1.run(Transport.java:168)
at java.security.AccessController.doPrivileged(AccessController.java:274)
at sun.rmi.transport.Transport.serviceCall(Transport.java:164)
at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:506)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.handleRequest(TCPTransport.java:838)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:912)
at java.lang.Thread.run(Thread.java:797)
at sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(StreamRemoteCall.java:263)
at sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:239)
at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:358)
at sun.rmi.registry.RegistryImpl_Stub.rebind(RegistryImpl_Stub.java:133)
at java.rmi.Naming.rebind(Naming.java:174)
at RMITest.myRMIImpl.<init>(myRMIImpl.java:14)
at RMITest.myRMIServer.main(myRMIServer.java:12)
I have check that this exception occured when IMPL class's naming.rebind method called.
import java.rmi.*;
import java.rmi.server.UnicastRemoteObject;
public class myRMIImpl extends UnicastRemoteObject implements myRMIInterface
public myRMIImpl(String name) throws RemoteException
super();
try
Naming.rebind(name, this);
catch(Exception e)
System.out.println("Exception occurred: " + e);
public java.util.Date getDate()
return new java.util.Date();
Can you help me how to solve this problem.
Note : my rmiregistry is running on 4999 port.
- Hiren Modijava.lang.ClassNotFoundException: RMITest.myRMIInterfaceThe Registry can't find that class on its CLASSPATH.
Solution: do something about that. Either run the registry as a separate task with a suitable CLASSPATH setting, or run it in the server JVM via LocateRegistry.createRegistry(). -
I am trying to run a simple RMI Sample from Java tutorial. When i try to run my server class(binding). I get a connection refused exception.
Can anyone please suggest a solution towards it.!
Thanks.
My server class code is
public class RMIHelloImpl extends UnicastRemoteObject implements HelloIF {
public RMIHelloImpl() throws RemoteException {
super();
public String sayHello(String msg)
{return "Hello " + msg + " from RMI!!";
public static void main(String[] args) {
if (System.getSecurityManager() == null) {
System.setSecurityManager(new RMISecurityManager());
String name = "//localhost/Hello";
try {
RMIHelloImpl helloImp = new RMIHelloImpl();
Naming.rebind(name, helloImp);
System.out.println("Hello bound");
} catch (Exception e) {
System.err.println("Hello exception: " + e.getMessage());
e.printStackTrace();
}Exception.................................
C:\eclipse\workspace\RMI\bin>java -Djava.security.policy=jav
a.policy RMIHelloImpl
Hello exception: Connection refused to host: localhost; nested exception is:
java.net.ConnectException: Connection refused: connect
java.rmi.ConnectException: Connection refused to host: localhost; nested excepti
on is:
java.net.ConnectException: Connection refused: connect
at sun.rmi.transport.tcp.TCPEndpoint.newSocket(TCPEndpoint.java:567)
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.registry.RegistryImpl_Stub.rebind(Unknown Source)
at java.rmi.Naming.rebind(Naming.java:160)
at RMIHelloImpl.main(RMIHelloImpl.java:20)
Caused by: java.net.ConnectException: Connection refused: connect
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:305)
at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:171)
at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:158)
at java.net.Socket.connect(Socket.java:452)
at java.net.Socket.connect(Socket.java:402)
at java.net.Socket.<init>(Socket.java:309)
at java.net.Socket.<init>(Socket.java:124)
at sun.rmi.transport.proxy.RMIDirectSocketFactory.createSocket(RMIDirect
SocketFactory.java:22)
at sun.rmi.transport.proxy.RMIMasterSocketFactory.createSocket(RMIMaster
SocketFactory.java:128)
at sun.rmi.transport.tcp.TCPEndpoint.newSocket(TCPEndpoint.java:562)> How do I start the RMI registry?
The Java� Tutorial - Trail: RMI -
hi
i am trying to develop a distributed computing environment using java rmi for scentific computation. client (applet) log on to my server and register. the server invocates the methods on client (call back) and gets back the solution.
my client applet is not able to log on to the server and i have no idea why. here is the code..
import java.awt.*;
import java.awt.event.*;
import java.applet.*;
import java.net.URL;
import java.rmi.*;
import java.rmi.server.*;
import java.rmi.Naming;
import java.rmi.RemoteException;
import java.net.MalformedURLException;
import java.rmi.NotBoundException;
public class ClientImpl extends Applet implements Calculator{
public Callback s = null;
public void init(){
super.init();
try{
UnicastRemoteObject.exportObject(this);
catch(Exception e){
System.out.println("Could not export client remote object");
System.out.println(e);
try{
s = (Callback)Naming.lookup("rmi:///servername");
//Naming.lookup("rmi:///servername");
s.addClient(this);
System.out.println("Client registered");
catch(Exception e){
System.out.println("Could not set client interface at server");
System.out.println(e.toString());
System.err.println("Failed to setup for RMI"+ e.getMessage());
public double summ(double a,double b)throws
java.rmi.RemoteException {
double sum = 0,i;
for(i = a; i <=b; i++)
sum = sum + 1/(i*i*i);
return sum;
and also i have been read that there is a lot of problems associated with rmi when used thru client applet. so i am wondering wether this approach is right.?
any help will be appreciated.
luciferCan't quite figure out what you are doing. You seem to have a client that is trying to register with rmi.
What I EXPECTED to see was
o a server which is a UnicastRemote object, which registers with rmi on the server.
o A client which tries to access the server by doing a naming.lookup.
o The client then calling the server, passing a reference to itself so that the server can do the callback.
There are some subtleties about interfaces that I have ignored (and which I don't see in your code).
There are some good examples of this kind of code in books. Try java Exmples in a Nutsell, Java in a Nutshell, or the O'reilly book on network communications. -
i used the rmi tutorial from the java site.
i did exactly what written there !
i operate the java with
java Djava.rmi.server.codebase=
file:/c:\tmp\engine.ComputEngine_Stub/
-Djava.rmi.server.hostname=my host name
-Djava.security.policy=java.policy engine.ComputeEngine
i even write classpath = c:\tmp\engine;c:\tmp
******** this is the exception ***********
C:\tmp>java -Djava.rmi.server.codebase=file:/c:\tmp\engine.ComputeEngine_Stub -D
java.rmi.server.hostname=TRLAN_BPR -Djava.security.policy=java.policy engine.Com
puteEngine
ComputeEngine exception: RemoteException occurred in server thread; nested excep
tion is:
java.rmi.UnmarshalException: error unmarshalling arguments; nested excep
tion is:
java.lang.ClassNotFoundException: engine.ComputeEngine_Stub
java.rmi.ServerException: RemoteException occurred in server thread; nested exce
ption is:
java.rmi.UnmarshalException: error unmarshalling arguments; nested excep
tion is:
java.lang.ClassNotFoundException: engine.ComputeEngine_Stub
java.rmi.UnmarshalException: error unmarshalling arguments; nested exception is:
java.lang.ClassNotFoundException: engine.ComputeEngine_Stub
java.lang.ClassNotFoundException: engine.ComputeEngine_Stub
at sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(Stream
RemoteCall.java:249)
at sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:
224)
at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:358)
at sun.rmi.registry.RegistryImpl_Stub.rebind(Unknown Source)
at java.rmi.Naming.rebind(Naming.java:165)
at engine.ComputeEngine.main(ComputeEngine.java:25)
what can i try now ?
did i forget anything ?ok solve it .
run rmiregistry (don't forget to specify in the classpath
the _stub file directory )!!!!!!!!!! -
Java.rmi.UnmarshalException after some time without a process restart.
Hello,
I am having a problem when I use RMI connection. I run a process which creates its own RMI registry and binds to it in the following way:
private void registerRmi() throws Exception {
// Register an instance of RunServices with the
// RMI Naming service
// Install a security manager that can handle remote stubs
System.setSecurityManager(new RMISecurityManager());
String serviceName = IScannerRmiCommands.RMI_NAME;
log.infoF("General.Info.RegisteringRMIService", serviceName);
try {
if (s_registry == null) {
s_registry = LocateRegistry.createRegistry(IScannerRmiCommands.RMI_PORT);
s_registry.rebind(serviceName, this);
s_registredRmi = true;
log.infoF("General.Info.RMIServiceRegistered");
} catch (RemoteException e) {
log.fatalF(e, "General.Fatal.RMIServiceRegistrationFailed");
}The client applications are able to connect to this process, but after some time clients start to receive the following exceptions:
java.rmi.UnmarshalException: error unmarshalling return; nested exception is:
java.io.EOFException
at sun.rmi.registry.RegistryImpl_Stub.lookup(Unknown Source)
at java.rmi.Naming.lookup(Unknown Source)
at com.x1.util.RMIHelper.doLookup(RMIHelper.java:23)
at com.x1.util.RMIHelper.lookup(RMIHelper.java:83)
at com.x1.setup.admin.Administration.lookupRemoteScanner(Administration.java:123)
at com.x1.infrastructure.statistics.StatisticResponseHandler.createMPResponse(StatisticsProvider.java:1337)
at com.x1.infrastructure.statistics.StatisticResponseHandler.run(StatisticsProvider.java:157)
at java.lang.Thread.run(Unknown Source)
Caused by: java.io.EOFException
at java.io.ObjectInputStream$BlockDataInputStream.peekByte(Unknown Source)
at java.io.ObjectInputStream.readObject0(Unknown Source)
at java.io.ObjectInputStream.readObject(Unknown Source)
... 8 moreI can't reproduce this on my dev environment but a customer experiences this quite often. They don't have any firewall running or antivirus software on these machines.
Any help will be highly appreciated.
Thanks in advance.
Edited by: rossenv on Oct 2, 2009 2:18 PMNo, I don't see any errors at server's site and this is the most strange thing. It seems that server operates normally except it stopped execute RMI commands until it is restarted. After that it responds properly and after some time stops again with the same client exception.
-
Java.rmi.ConnectException: Connection refuse
Hi all,
I have built a simple RMI client server application.I can run client & server fine locally.
However if I test this appplication over the internet, I get this exception on the client:
java.rmi.ConnectException: Connection refused to host: 169.254.157.53; nested exception is:
java.net.ConnectException: Connection timed out: connectConnection refused to host:169.254.157.53
The RMI server is running on my PC and the client on a friend's remote PC.Both PCs are connected to Internet.
I don't have any firewall running on my PC (including windows XP firewall). The server RMI lookup on the client happens correctly,
the exception is raised when the client tries to call the remote method on the server.
Here is an extract of my RMI server code (it works locally):
public static void main(String[] args) throws Exception {
try {
// args[0] contains the database server name given as command line argument, arg[1] contains binary path that contains weather jpeg files
CPrimaryWeatherServer test = new CPrimaryWeatherServer(args[0], args[1]);
Naming.rebind("rmi://localhost:1099/WeatherPrimaryService", test);
System.out.println("Serveur m�t�o principal d�marr�");
} catch (Exception e){ System.out.println(e.getMessage());}
Here is an extract of my RMI client code (it works locally):
try{
rec=1;
leftClik=1;
System.out.println("Before RMI lookup");
IPrimaryWeatherServerService serveur =(IPrimaryWeatherServerService)Naming.lookup("rmi://"+primWS+":1099/WeatherPrimaryService");
System.out.println("After RMI lookup");
System.out.println("Before server method call");
z=serveur.getFullWeatherData(); --> exception is raised here
System.out.println("After RMI server method call");
I am directly connected to Internet using an ethernet card connected to an ADSL modem.169.254.157.53 is the automatic IP of my network card different from the IP given by my ISP. By the way, the client tries to contact me using my DNS name that resolves correctly to my ISP IP adress.
Thanks a lot for help,because I am guessing that a local IP address is being embedded into the stub so the clien't can't find the remote server. I am guessing because you didn't provide the exception or its text. Anyway the suggestion will cause the correct public IP address/hostname to be embedded into the stub.
Maybe you are looking for
-
Sharepoint Foundation 2010 - Searching for a commentBox web part
Hello! Im sort of new to Sharepoint and i have been working with it in two weeks now. Im currently an full controll user on the site my company is using and im also using Sharepoint Designer. The site is running on Sharepoint Foundation 2010 I have b
-
How can I delete a single song from my iPad?
How can I delete a single song from my iPad?
-
Error when creating a new session manager
I am an absolute rookie in Java and Object to Persistence, and just need a push in the right direction please? Using MyEclipse 5.0 with JBoss 4.0 but just trying a very basic employee mapping with Toplink 10.1.3.1. Standard java application just to r
-
How can I delete iMessages by sender.
I know I can go to settings and have iMessages trashed after 30 days but is there a way to delete all messages by sender? I want to be able to delete multiple text messages (grouped by sender) instead of doing it one at a time. Thanks
-
Trying to read a file with Scanner
This is the code: public void action(){ try{ Scanner sc = new Scanner(new FileReader("examples2.txt")); String s; while((s = sc.nextLine()) != null){