aspose file tools*
The moose likes Distributed Java and the fly likes java.rmi.ConnectException: Connection refused to host Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Distributed Java
Bookmark "java.rmi.ConnectException: Connection refused to host" Watch "java.rmi.ConnectException: Connection refused to host" New topic
Author

java.rmi.ConnectException: Connection refused to host

Kavitha Kavi
Greenhorn

Joined: Feb 20, 2010
Posts: 3
Hi,

I am having two applications which are deployed in two different servers. One web application in Weblogic and the other EJB application in Pramati server. The cause of the exception is mentioned below.

Case 1 : Both servers are started and When i am trying to invoke the ejb application present in Pramati Server from weblogic server, it is working fine.

Case 2 : When i restart the Pramati Server and try to invoke the ejb application present in Pramati server from application in weblogic, i am getting the Connection refused to host error message.

The stack trace of exception is given below.

java.rmi.ConnectException: Connection refused to host: 10.16.169.144; nested exception is:
java.net.ConnectException: Connection refused: connect
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 com.pramati.util.rmi.ProtonUnicastRef2.invoke(ProtonUnicastRef2.java:127)
at com.pramati.util.rmi.WrapperRemoteRef.invoke(WrapperRemoteRef.java:73)
at com.pramati.ejb.runtime.BREIntegration1HomeImpl_945913725_Stub.create(Unknown Source)
at com.icici.mars.struts.action.login.BREInstance.underwriteApplication(BREInstance.java:66)
at com.icici.mars.struts.action.login.MARSLoginAction.execute(MARSLoginAction.java:137)
at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:419)
at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:224)
at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1194)
at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:432)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:709)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
at com.pramati.web.servlet.core.ServiceAction.run(ServiceAction.java:83)
at com.pramati.security.util.PramatiSecurityHelper._doAs(PramatiSecurityHelper.java:54)
at com.pramati.security.util.AbstractSecurityHelper._doAs(AbstractSecurityHelper.java:195)
at com.pramati.services.security.spi.SecurityHelper.doAs(SecurityHelper.java:144)
at com.pramati.web.servlet.core.PramatiFilterChainImpl.invokeTargetWebResource(PramatiFilterChainImpl.java:320)
at com.pramati.web.servlet.core.PramatiFilterChainImpl.doFilter(PramatiFilterChainImpl.java:164)
at com.icici.mars.struts.filter.MARSFilter.doFilter(MARSFilter.java:46)
at com.pramati.web.servlet.core.PramatiFilterChainImpl.invokeTargetFilter(PramatiFilterChainImpl.java:239)
at com.pramati.web.servlet.core.PramatiFilterChainImpl.doFilter(PramatiFilterChainImpl.java:156)
at com.pramati.web.util.filters.CompressionFilter.doFilter(CompressionFilter.java:113)
at com.pramati.web.servlet.core.PramatiFilterChainImpl.invokeTargetFilter(PramatiFilterChainImpl.java:239)
at com.pramati.web.servlet.core.PramatiFilterChainImpl.doFilter(PramatiFilterChainImpl.java:156)
at com.pramati.web.servlet.core.PramatiFilterChainImpl.startDoFilter(PramatiFilterChainImpl.java:115)
at com.pramati.web.interceptors.ServiceInterceptor.preProcess(ServiceInterceptor.java:113)
at com.pramati.web.interceptors.core.DefaultInterceptor.process(DefaultInterceptor.java:65)
at com.pramati.web.interceptors.core.InterceptorChainImpl.processNext(InterceptorChainImpl.java:48)
at com.pramati.web.interceptors.core.DefaultInterceptor.process(DefaultInterceptor.java:66)
at com.pramati.web.interceptors.core.InterceptorChainImpl.processNext(InterceptorChainImpl.java:48)
at com.pramati.web.interceptors.core.DefaultInterceptor.process(DefaultInterceptor.java:66)
at com.pramati.web.interceptors.core.InterceptorChainImpl.processNext(InterceptorChainImpl.java:48)
at com.pramati.web.interceptors.core.DefaultInterceptor.process(DefaultInterceptor.java:66)
at com.pramati.web.interceptors.core.InterceptorChainImpl.processNext(InterceptorChainImpl.java:48)
at com.pramati.web.interceptors.core.DefaultInterceptor.process(DefaultInterceptor.java:66)
at com.pramati.web.interceptors.core.InterceptorChainImpl.processNext(InterceptorChainImpl.java:48)
at com.pramati.web.interceptors.core.DefaultInterceptor.process(DefaultInterceptor.java:66)
at com.pramati.web.interceptors.core.InterceptorChainImpl.processNext(InterceptorChainImpl.java:48)
at com.pramati.web.interceptors.core.DefaultProcessContainer.process(DefaultProcessContainer.java:97)
at com.pramati.web.core.WorkerThread.processConnection(WorkerThread.java:286)
at com.pramati.web.core.WorkerThread.processConnection(WorkerThread.java:262)
at com.pramati.web.core.WorkerThread.run(WorkerThread.java:128)
Caused by: java.net.ConnectException: Connection refused: connect
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:452)
at com.pramati.util.socket.TimeoutSocket.<init>(TimeoutSocket.java:63)
at com.pramati.util.socket.PramatiMasterSocketFactory.createSocket(PramatiMasterSocketFactory.java:51)
at com.pramati.util.socket.PlainRMISocketFactory.createSocket(PlainRMISocketFactory.java:131)
at sun.rmi.transport.tcp.TCPEndpoint.newSocket(TCPEndpoint.java:562)

Please help me out to solve this problem.

Thanks,
Kavitha
Suhas Bilaye
Ranch Hand

Joined: Sep 10, 2009
Posts: 80
Hi normally this type of error occurs when the host is hosting on a particular port while the client is requesting access to some other port of the host. Also there is a security policy file named java.security.policy in which you should specify the permissions such as connect,accept, listen etc. You may find examples of such policy file on the internet.
Which port are you using for the Pramati server?

I am not very much aware of the EJB and Pramati server but I can suggest solutions with respect to normal JAVA RMI


Thanks and Regards,
Suhas
http://www.xplore-java.blogspot.com/
Devaka Cooray
ExamLab Creator
Saloon Keeper

Joined: Jul 29, 2008
Posts: 3168
    
  47

When i restart the Pramati Server and try to invoke the ejb application present in Pramati server from application in weblogic, i am getting the Connection refused to host error message.


Well, how did you 'invoke' the Pramati server from weblogic?


Author of ExamLab ExamLab - a free SCJP / OCPJP exam simulator
What would SCJP exam questions look like? -- Home -- Twitter -- How to Ask a Question
Kavitha Kavi
Greenhorn

Joined: Feb 20, 2010
Posts: 3
I have invoked using
homeobject = PortableRemoteObject.narrow("jndiname", classname);
remoteobject = homeobject.create();
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: java.rmi.ConnectException: Connection refused to host