• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • Ron McLeod
  • Junilu Lacar
  • Liutauras Vilda
Sheriffs:
  • Paul Clapham
  • Jeanne Boyarsky
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Piet Souris
  • Carey Brown
Bartenders:
  • Jesse Duncan
  • Frits Walraven
  • Mikalai Zaikin

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

 
Ranch Hand
Posts: 86
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
High Plains Drifter
Posts: 7289
Netbeans IDE VI Editor
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
pie. tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic