Help coderanch get a
new server
by contributing to the fundraiser
  • 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:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

java.rmi.ConnectException: Connection refused to host

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Ranch Hand
Posts: 80
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Sheriff
Posts: 7163
1382
IntelliJ IDE jQuery Eclipse IDE Postgres Database Tomcat Server Chrome Google App Engine
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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?
 
Kavitha Kavi
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have invoked using
homeobject = PortableRemoteObject.narrow("jndiname", classname);
remoteobject = homeobject.create();
 
"How many licks ..." - I think all of this dog's research starts with these words. Tasty tiny ad:
We need your help - Coderanch server fundraiser
https://coderanch.com/t/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic