File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Distributed Java and the fly likes rmi Client-Server Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Java » Distributed Java
Bookmark "rmi Client-Server" Watch "rmi Client-Server" New topic
Author

rmi Client-Server

Jochen Seliger
Greenhorn

Joined: Jan 08, 2005
Posts: 8
Hi,
I have set up an rmi-Server, which should handle all request to an ORACLE DB, and an appropriate rmi-Client, running so fare on the same machine.
The server is comming up fine and binds my remote object.
The rmi-client is looking up the remote object sucessfuly.
I can invoke the inherited methods of my remote object e.g. ProdServer.getClass().
My own methods declared within the serverInterface and implemented within the ServerImplementation I could properly reference them on my ProdServer-Instance, while coding, but if I call any of these methods, I get a 'connection refused to host'-Exception.
I have set an security.police, which allowes at the moment the unresticted acces to my server and have published the server.hostname within the VM-environment.
Could anybody help me to solve this problem?
Nathan Pruett
Bartender

Joined: Oct 18, 2000
Posts: 4121

Can you post the entire error stack trace for the exception you are getting (including all the Caused By: exceptions)?

Calling inherited Object methods on your reference is just calling local methods on the stub - no remote communication is going on. Once you call a remote method the stub then calls across the network to your remote object. Lots of stuff can go wrong here, which is why I'd like to see the full stack trace.


-Nate
Write once, run anywhere, because there's nowhere to hide! - /. A.C.
Jochen Seliger
Greenhorn

Joined: Jan 08, 2005
Posts: 8
Originally posted by Nathan Pruett:
Can you post the entire error stack trace for the exception you are getting (including all the Caused By: exceptions)?

Calling inherited Object methods on your reference is just calling local methods on the stub - no remote communication is going on. Once you call a remote method the stub then calls across the network to your remote object. Lots of stuff can go wrong here, which is why I'd like to see the full stack trace.


Hi Nathan,
I have processed more tests and have implemented the client into my application. There I call rmiClient.lookup().
So I have fixed that I can run the rmi-YServer + Client together with ORACLE as long as I start the rmi-Server first.
Next I have fixed, that the server can be looked up periodicaly for a certain time, but afeter some time the VConnectException occures again.
Here the trace:
java.rmi.ConnectException: Connection refused to host: 192.168.100.97; nested exception is:
java.net.ConnectException: Connection refused
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.invoke(UnicastRef.java:101)
at rmi.Server_Stub.replay(Server_Stub.java:53)
at processappl.rmiClient.lookup(rmiClient.java:86)
at processappl.Frame1.menuItemTesting_actionPerformed(Frame1.java:5651)
at processappl.Frame1$1.actionPerformed(Frame1.java:1442)
at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1764)
at javax.swing.AbstractButton$ForwardActionEvents.actionPerformed(AbstractButton.java:1817)
at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:419)
at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:257)
at javax.swing.AbstractButton.doClick(AbstractButton.java:289)
at javax.swing.plaf.basic.BasicMenuItemUI.doClick(BasicMenuItemUI.java:1113)
at javax.swing.plaf.basic.BasicMenuItemUI$MouseInputHandler.mouseReleased(BasicMenuItemUI.java:943)
at java.awt.Component.processMouseEvent(Component.java:5134)
at java.awt.Component.processEvent(Component.java:4931)
at java.awt.Container.processEvent(Container.java:1566)
at java.awt.Component.dispatchEventImpl(Component.java:3639)
at java.awt.Container.dispatchEventImpl(Container.java:1623)
at java.awt.Component.dispatchEvent(Component.java:3480)
at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:3450)
at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3165)
at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3095)
at java.awt.Container.dispatchEventImpl(Container.java:1609)
at java.awt.Window.dispatchEventImpl(Window.java:1590)
at java.awt.Component.dispatchEvent(Component.java:3480)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:450)
at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:197)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:150)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:144)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:136)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:99)
Caused by: java.net.ConnectException: Connection refused
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:426)
at java.net.Socket.connect(Socket.java:376)
at java.net.Socket.<init>(Socket.java:291)
at java.net.Socket.<init>(Socket.java:119)
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:562)
... 32 more
RMI connection successful
Exception occurred: java.rmi.ConnectException: Connection refused to host: 192.168.100.97; nested exception is:
java.net.ConnectException: Connection refused
After that I have to restart the server and that is possible only when ORACLE is down.
Here loops the whole procedure.
The best way would be if the connection would never be broken unless I do it,
Waiting for your recomendations.
Kind regard
Jochen
Nathan Pruett
Bartender

Joined: Oct 18, 2000
Posts: 4121

It sounds more like a network setup/machine networking configuration problem than a problem with your code, especially since you say that it's able to connect fine for a while.

The other cause might be if your server crashed and closed the socket. But you've said that these errors were only on the client, right? Nothing shows up on the server? Do you have any debug output being printed by the server as it runs? Does it all look normal?
Jochen Seliger
Greenhorn

Joined: Jan 08, 2005
Posts: 8
Originally posted by Nathan Pruett:
It sounds more like a network setup/machine networking configuration problem than a problem with your code, especially since you say that it's able to connect fine for a while.

The other cause might be if your server crashed and closed the socket. But you've said that these errors were only on the client, right? Nothing shows up on the server? Do you have any debug output being printed by the server as it runs? Does it all look normal?

Hi Nathan,
thanks for your help.
Meanwhile I have fixed the problem. The problem is the rmiregistry (and ORACLE??).
First I have fixed that the rmiregistry, started from my /usr/bin-directry is hanging around at two ports atthough I set with tre rebind to tehe standard port 1099. The second one is someting at 30xxx and is switching at every restart. Mostly it is an unassigned port, but once I have found it on a port, assigned to RADIUS.
Second I have experienced quite terrible problems when installing ORACLE10g on SUSE9.1.
Finally fact was, that ORACLE, at least while installation, requires ports, nowhere documented and which are assigned to other programs (they are set in /etc/services by SUSE).
So concerning my problem, I have tested the rmiregistry from my /usr/lib/SUN/Java1.4.2/jre/bin directory. That one is listening only to the 1099-port and all further functionality is running well.
But I have a further question concernig data base connectivity.
As I told you, I am building a quite complex system wich is using ORACE-Tables forCustomizing and process data.
So fare generaly everything was ok, but now I am implementing some functionality for information and additional methods.
Here occures the problem that every time I open datasets via Scrollpanels,JBTables etc(as allready implemented in other cases of the same application) the DBEventMonitor is coming upan interferes all further functionality, allthoug the right data are selected and displayed within the JBTable.
The only fact I know of sure is, that the frames for displaying these date are on the fourth level, respecting the logon-frame and the data to be selected are involved into the result, presented within the love level frame via explcid DB-Get-Metods ore via get.Value from the Table two frame-levels below.
Do you have any recomendation, how to fixe tis problem??
Kind regards

Jochen
p.s. my email-adress: jochen.seliger@t-online.de
Nathan Pruett
Bartender

Joined: Oct 18, 2000
Posts: 4121

Good to know that you've got the RMI problem fixed... Sorry that I can't help you more with the other problems I have used Oracle before, but have never had to set up or administer an Oracle DB server. Also, I've never used DBEventMonitor (though through Googling, it looks like a class that comes with JBuilder for database access).
 
GeeCON Prague 2014
 
subject: rmi Client-Server