Announcement Announcement Module
Collapse
No announcement yet.
Spring RMI exception Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Spring RMI exception

    Hi,

    I am getting the below exception

    HTML Code:
    org.springframework.remoting.RemoteLookupFailureException: Lookup of RMI stub failed; nested exception is java.rmi.ConnectException: Connection refused to host: localhost; nested exception is: 
        java.net.ConnectException: Connection refused: connect
        at org.springframework.remoting.rmi.RmiClientInterceptor.lookupStub(RmiClientInterceptor.java:215)
        at org.springframework.remoting.rmi.RmiClientInterceptor.getStub(RmiClientInterceptor.java:232)
        at org.springframework.remoting.rmi.RmiClientInterceptor.invoke(RmiClientInterceptor.java:257)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
        at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:202)
        at $Proxy19.isSuccessfullyInitialized(Unknown Source)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:47)
        at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
        at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:44)
        at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
        at org.springframework.test.context.junit4.statements.RunBeforeTestMethodCallbacks.evaluate(RunBeforeTestMethodCallbacks.java:74)
        at org.springframework.test.context.junit4.statements.RunAfterTestMethodCallbacks.evaluate(RunAfterTestMethodCallbacks.java:83)
        at org.springframework.test.context.junit4.statements.SpringRepeat.evaluate(SpringRepeat.java:72)
        at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:231)
      
    Caused by: java.rmi.ConnectException: Connection refused to host: localhost; nested exception is: 
        java.net.ConnectException: Connection refused: connect
        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 org.springframework.remoting.rmi.RmiClientInterceptor.lookupStub(RmiClientInterceptor.java:200)
        ... 35 more
    Caused by: java.net.ConnectException: Connection refused: connect
        at java.net.PlainSocketImpl.socketConnect(Native Method)
        at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:351)
        at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:213)
        at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:200)
        at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366)
        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)
        ... 41 more
    I tried to using various available ports but it not working. how can I solve this issue?

    While I start my server I get this

    HTML Code:
    2:45:43.388 [main] DEBUG o.s.remoting.rmi.RmiServiceExporter - RMI registry access threw exception
    java.rmi.ConnectIOException: Exception creating connection to: 192.168.190.88; nested exception is: 
        java.net.SocketException: Permission denied: connect
        at sun.rmi.transport.tcp.TCPEndpoint.newSocket(TCPEndpoint.java:614) ~[na:1.6.0_27]
        at sun.rmi.transport.tcp.TCPChannel.createConnection(TCPChannel.java:198) ~[na:1.6.0_27]
        at sun.rmi.transport.tcp.TCPChannel.newConnection(TCPChannel.java:184) ~[na:1.6.0_27]
        at sun.rmi.server.UnicastRef.newCall(UnicastRef.java:322) ~[na:1.6.0_27]
        at sun.rmi.registry.RegistryImpl_Stub.list(Unknown Source) ~[na:1.6.0_27]
        at org.springframework.remoting.rmi.RmiServiceExporter.testRegistry(RmiServiceExporter.java:420) [spring-context-3.1.0.RELEASE.jar:3.1.0.RELEASE]
        at org.springframework.remoting.rmi.RmiServiceExporter.getRegistry(RmiServiceExporter.java:399) [spring-context-3.1.0.RELEASE.jar:3.1.0.RELEASE]
        at org.springframework.remoting.rmi.RmiServiceExporter.getRegistry(RmiServiceExporter.java:377) [spring-context-3.1.0.RELEASE.jar:3.1.0.RELEASE]
        at org.springframework.remoting.rmi.RmiServiceExporter.getRegistry(RmiServiceExporter.java:336) [spring-context-3.1.0.RELEASE.jar:3.1.0.RELEASE]
        at org.springframework.remoting.rmi.RmiServiceExporter.prepare(RmiServiceExporter.java:268) [spring-context-3.1.0.RELEASE.jar:3.1.0.RELEASE]
        at org.springframework.remoting.rmi.RmiServiceExporter.afterPropertiesSet(RmiServiceExporter.java:229) [spring-context-3.1.0.RELEASE.jar:3.1.0.RELEASE]
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1514) [spring-beans-3.1.0.RELEASE.jar:3.1.0.RELEASE]
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1452) [spring-beans-3.1.0.RELEASE.jar:3.1.0.RELEASE]
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:519) [spring-beans-3.1.0.RELEASE.jar:3.1.0.RELEASE]
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456) [spring-beans-3.1.0.RELEASE.jar:3.1.0.RELEASE]
        at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:294) [spring-beans-3.1.0.RELEASE.jar:3.1.0.RELEASE]
        at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:225) [spring-beans-3.1.0.RELEASE.jar:3.1.0.RELEASE]
        at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:291) [spring-beans-3.1.0.RELEASE.jar:3.1.0.RELEASE]
        at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:193) [spring-beans-3.1.0.RELEASE.jar:3.1.0.RELEASE]
        at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:585) [spring-beans-3.1.0.RELEASE.jar:3.1.0.RELEASE]
        at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:913) [spring-context-3.1.0.RELEASE.jar:3.1.0.RELEASE]
        at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:464) [spring-context-3.1.0.RELEASE.jar:3.1.0.RELEASE]
        at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:139) [spring-context-3.1.0.RELEASE.jar:3.1.0.RELEASE]
        at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:83) [spring-context-3.1.0.RELEASE.jar:3.1.0.RELEASE]
        at razorsight.mito.integration.main.IntegrationServiceMain.main(IntegrationServiceMain.java:23) [classes/:na]
    Caused by: java.net.SocketException: Permission denied: connect
        at java.net.PlainSocketImpl.socketConnect(Native Method) ~[na:1.6.0_27]
        at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:351) ~[na:1.6.0_27]
        at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:213) ~[na:1.6.0_27]
        at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:200) ~[na:1.6.0_27]
        at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366) ~[na:1.6.0_27]
        at java.net.Socket.connect(Socket.java:529) ~[na:1.6.0_27]
        at java.net.Socket.connect(Socket.java:478) ~[na:1.6.0_27]
        at java.net.Socket.<init>(Socket.java:375) ~[na:1.6.0_27]
        at java.net.Socket.<init>(Socket.java:189) ~[na:1.6.0_27]
        at sun.rmi.transport.proxy.RMIDirectSocketFactory.createSocket(RMIDirectSocketFactory.java:22) ~[na:1.6.0_27]
        at sun.rmi.transport.proxy.RMIMasterSocketFactory.createSocket(RMIMasterSocketFactory.java:128) ~[na:1.6.0_27]
        at sun.rmi.transport.tcp.TCPEndpoint.newSocket(TCPEndpoint.java:595) ~[na:1.6.0_27]
        ... 24 common frames omitted
    22:45:43.389 [main] INFO  o.s.remoting.rmi.RmiServiceExporter - Could not detect RMI registry - creating new one
    22:45:43.411 [main] DEBUG o.s.remoting.rmi.RmiServiceExporter - RMI service [[email protected]] is an RMI invoker
    22:45:43.413 [main] DEBUG o.s.aop.framework.JdkDynamicAopProxy - Creating JDK dynamic proxy: target source is SingletonTargetSource for target object [[email protected]]
    22:45:43.417 [main] INFO  o.s.remoting.rmi.RmiServiceExporter - Binding service 'hello-service' to RMI registry: RegistryImpl[UnicastServerRef [liveRef: [endpoint:[192.168.190.88:7104](local),objID:[0:0:0, 0]]]]
    It's seems my service is getting registered. But why do client do not able to lookup then?
Working...
X