Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

RMI client doesn't run the second time - why???

 
Shailendra Guggali
Ranch Hand
Posts: 86
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have completed the assignment using Sockets. wanted to try RMI
I have a peculiar problem ==
The Client works fine the first time it is connected, but if I exit and then try to connect again it gives an exception which is :
Remote object = RMIServerDBAdapter_Stub[RemoteStub [ref: [endpoint:[127.0.0.1:10
80](remote),objID:[3ac748:e8735f5dd2:-8000, 0]]]]
in populate combobox
in populate combobox ::: no. of records = 24
Caught Exceptionnull
java.lang.NullPointerException
at Sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(Unknown Source)
at sun.rmi.transport.StreamRemoteCall.executeCall(Unknown Source)
at sun.rmi.server.UnicastRef.invoke(Unknown Source)
at RMIServerDBAdapter_Stub.getRecord(Unknown Source)
at RMIClientDBAdapter.getRecord(RMIClientDBAdapter.java:157)
at ComboPanel.populateComboBoxOfPort(ComboPanel.java:77)
at ComboPanel.makeInputPanel(ComboPanel.java:29)
at ComboPanel.<init>(ComboPanel.java:137)
at ClientFrame.<init>(ClientFrame.java:66)
at Client.main(Client.java:56)
in populate combobox == return airport = null
EXCEPTION In initializing client.
java.lang.NullPointerException
at javax.swing.DefaultComboBoxModel.<init>(Unknown Source)
at javax.swing.JComboBox.<init>(Unknown Source)
at ComboPanel.makeInputPanel(ComboPanel.java:29)
at ComboPanel.<init>(ComboPanel.java:137)
at ClientFrame.<init>(ClientFrame.java:66)
at Client.main(Client.java:56)
WHAT COULD THE PROBLEM BE?
WHEN I RESTART THE SERVER, EVERYTHING IS FINE.
I am creating registry via server code.
Where shd i start looking for problem?? Testing on one machine.
Pls comment
Thanx
Shailendra
 
Michael Ernest
High Plains Drifter
Sheriff
Posts: 7292
Netbeans IDE VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Obviously this is a guess without seeing source code, but it seems likely that your server code is not freeing its client accept() reference for reuse.
It's possible to write the server-side code in such a way that the server continues to accept connections, but has no way available socket reference to bind it to.
------------------
Michael Ernest, co-author of: The Complete Java 2 Certification Study Guide
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic