Thread: Java RMI registry.bind() on Ubuntu Jaunty
hello all!
having problem rmi running on linux (i use ubuntu 9.04). maybe of faced same problem , found solution , can share me.
remoteexception each time try bind stub rmi registry. according posts read, people have problems client calls, cannot close it.
rmic code before executing , far know don't need worried setting policy file or securitymanager this.
read item a.1 in rmi faq, couldn't working. googled information read related clients trying connect existent working server (and can not working).
static ip address in network 192.168.0.101
## /etc/hosts file content:
## /etc/hosts.allow file content:code:127.0.0.1 localhost 127.0.1.1 lobo-laptop
## (trimmed , simplyfied) relevant part of code follows:code:all: 192.168.0.111, 192.168.0.112, 192.168.0.100, 127.0.0.1, 127.0.1.1
## stub information:code://dataserver inteface extends remote. dataserver instance = new dataserverimpl(); dataserver stub; registry rmiregistry; //i read in net hostname should map computer's host name, //but tried after trying without setting property , //it didn't work (also tried ip addr no luck). system.setproperty("java.rmi.server.hostname", "lobo-laptop"); try { stub = (dataserver) unicastremoteobject.exportobject(instance)); rmiregistry = locateregistry.getregistry(); //here exception thrown. rmiregistry.rebind("dataserver", stub); } catch (remoteexception re) { re.printstacktrace(); system.err.println(); }
## registry information:code:dataserverimpl_stub[unicastref [liveref: [endpoint:[lobo-laptop:47839](local),objid:[-31110a77:12407db5840:-7fff, -6460063892832792796]]]]
## exception information:code:registryimpl_stub[unicastref [liveref: [endpoint:[127.0.1.1:1099](remote),objid:[0:0:0, 0]]]]
code:1. ----remote exception---- 2. java.rmi.connectexception: connection refused host: 127.0.1.1; nested exception is: 3. java.net.connectexception: connection refused 4. @ sun.rmi.transport.tcp.tcpendpoint.newsocket(tcpendpoint.java:601) 5. @ sun.rmi.transport.tcp.tcpchannel.createconnection(tcpchannel.java:198) 6. @ sun.rmi.transport.tcp.tcpchannel.newconnection(tcpchannel.java:184) 7. @ sun.rmi.server.unicastref.newcall(unicastref.java:322) 8. @ sun.rmi.registry.registryimpl_stub.rebind(unknown source) 9. @ suncertify.db.dataserverimpl.finishcompositeinitialization(dataserverimpl.java:327) 10. @ suncertify.common.abstractcompositecomponent.finishinitialization(abstractcompositecomponent.java:206) 11. @ suncertify.common.abstractcomponent.initialize(abstractcomponent.java:101) 12. @ suncertify.db.dataserverimpltest.constructor(dataserverimpltest.java:175) 13. @ sun.reflect.nativemethodaccessorimpl.invoke0(native method) 14. @ sun.reflect.nativemethodaccessorimpl.invoke(nativemethodaccessorimpl.java:39) 15. @ sun.reflect.delegatingmethodaccessorimpl.invoke(delegatingmethodaccessorimpl.java:25) 16. @ java.lang.reflect.method.invoke(method.java:597) 17. @ org.junit.runners.model.frameworkmethod$1.runreflectivecall(frameworkmethod.java:44) 18. @ org.junit.internal.runners.model.reflectivecallable.run(reflectivecallable.java:15) 19. @ org.junit.runners.model.frameworkmethod.invokeexplosively(frameworkmethod.java:41) 20. @ org.junit.internal.runners.statements.invokemethod.evaluate(invokemethod.java:20) 21. @ org.junit.internal.runners.statements.runbefores.evaluate(runbefores.java:28) 22. @ org.junit.internal.runners.statements.runafters.evaluate(runafters.java:31) 23. @ org.junit.runners.blockjunit4classrunner.runchild(blockjunit4classrunner.java:73) 24. @ org.junit.runners.blockjunit4classrunner.runchild(blockjunit4classrunner.java:46) 25. @ org.junit.runners.parentrunner.runchildren(parentrunner.java:180) 26. @ org.junit.runners.parentrunner.access$000(parentrunner.java:41) 27. @ org.junit.runners.parentrunner$1.evaluate(parentrunner.java:173) 28. @ org.junit.internal.runners.statements.runbefores.evaluate(runbefores.java:28) 29. @ org.junit.internal.runners.statements.runafters.evaluate(runafters.java:31) 30. @ org.junit.runners.parentrunner.run(parentrunner.java:220) 31. @ junit.framework.junit4testadapter.run(junit4testadapter.java:39) 32. @ org.apache.tools.ant.taskdefs.optional.junit.junittestrunner.run(junittestrunner.java:420) 33. @ org.apache.tools.ant.taskdefs.optional.junit.junittestrunner.launch(junittestrunner.java:911) 34. @ org.apache.tools.ant.taskdefs.optional.junit.junittestrunner.main(junittestrunner.java:768) 35. caused by: java.net.connectexception: connection refused 36. @ java.net.plainsocketimpl.socketconnect(native method) 37. @ java.net.plainsocketimpl.doconnect(plainsocketimpl.java:333) 38. @ java.net.plainsocketimpl.connecttoaddress(plainsocketimpl.java:195) 39. @ java.net.plainsocketimpl.connect(plainsocketimpl.java:182) 40. @ java.net.sockssocketimpl.connect(sockssocketimpl.java:366) 41. @ java.net.socket.connect(socket.java:519) 42. @ java.net.socket.connect(socket.java:469) 43. @ java.net.socket.<init>(socket.java:366) 44. @ java.net.socket.<init>(socket.java:180) 45. @ sun.rmi.transport.proxy.rmidirectsocketfactory.createsocket(rmidirectsocketfactory.java:22) 46. @ sun.rmi.transport.proxy.rmimastersocketfactory.createsocket(rmimastersocketfactory.java:128) 47. @ sun.rmi.transport.tcp.tcpendpoint.newsocket(tcpendpoint.java:595) 48. ... 30 more
looks weird me registry implementation bound 127.0.1.1, , objid [0:0:0, 0].
seems hava not able create sockets, ubuntu's log mechanism has no information about
ideas on how solve this?
thanks!
there's better option that,,....just take eclipse plugin & make use of it.......i having same exception & installed & able things successfully....the plugins page link is: http://www.genady.net/rmi/v20/downloads.html enjoy!!!![]()
Forum The Ubuntu Forum Community Ubuntu Specialised Support Development & Programming Programming Talk Java RMI registry.bind() on Ubuntu Jaunty
Ubuntu
Comments
Post a Comment