File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Websphere and the fly likes SocketTimeoutException, ConnectIOException: Read timed out Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Products » Websphere
Bookmark "SocketTimeoutException, ConnectIOException: Read timed out" Watch "SocketTimeoutException, ConnectIOException: Read timed out" New topic
Author

SocketTimeoutException, ConnectIOException: Read timed out

M M Islam Chisty
Greenhorn

Joined: Aug 31, 2003
Posts: 17
Hi,

I'm facing the following problem while trying to access a application deployed in WebSphere 5.1. I need to use RMI feature since the application (business logic, hibernate transaction beans etc) will be deployed in WAS 5.1 and will be accessed by RMI from outside client application. I'm using Spring and Hibernate for this application. I created the war, deployed in WAS 5.1. But when I tried to access it though rmi, I get the following error (java.net.SocketTimeoutException: Read timed out):

[Note: We can't upgrade to WAS 6.x versions at this time because this is our customer's side environment/requirements]

Here is the Error Details:
================

Exception in thread "main" org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'mProductSearchServiceProxyClient' defined in file [C:\WorkSpaceJ4\TestRMI\src\resources\service-rmiproxy.xml]: Cannot resolve reference to bean 'mProductSearchServiceProxy' while setting bean property 'productSearchService'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'mProductSearchServiceProxy' defined in file [C:\WorkSpaceJ4\TestRMI\src\resources\service-rmiproxy.xml]: Invocation of init method failed; nested exception is org.springframework.remoting.RemoteLookupFailureException: Lookup of RMI stub failed; nested exception is java.rmi.ConnectIOException: error during JRMP connection establishment; nested exception is:
java.net.SocketTimeoutException: Read timed out

Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'mProductSearchServiceProxy' defined in file [C:\WorkSpaceJ4\TestRMI\src\resources\service-rmiproxy.xml]: Invocation of init method failed; nested exception is org.springframework.remoting.RemoteLookupFailureException: Lookup of RMI stub failed; nested exception is java.rmi.ConnectIOException: error during JRMP connection establishment; nested exception is:
java.net.SocketTimeoutException: Read timed out

Caused by: org.springframework.remoting.RemoteLookupFailureException: Lookup of RMI stub failed; nested exception is java.rmi.ConnectIOException: error during JRMP connection establishment; nested exception is:
java.net.SocketTimeoutException: Read timed out

Caused by: java.rmi.ConnectIOException: error during JRMP connection establishment; nested exception is:
java.net.SocketTimeoutException: Read timed out
at sun.rmi.transport.tcp.TCPChannel.createConnection(TCPChannel.java:273)
at sun.rmi.transport.tcp.TCPChannel.newConnection(TCPChannel.java:171)
at sun.rmi.server.UnicastRef.newCall(UnicastRef.java:306)
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:198)
at org.springframework.remoting.rmi.RmiClientInterceptor.prepare(RmiClientInterceptor.java:145)
at org.springframework.remoting.rmi.RmiClientInterceptor.afterPropertiesSet(RmiClientInterceptor.java:133)
at org.springframework.remoting.rmi.RmiProxyFactoryBean.afterPropertiesSet(RmiProxyFactoryBean.java:74)
...



Here is my server side config file (applicationContext-service.xml):
===========================================
... ..
..

<bean id="serviceExporter" class="org.springframework.remoting.rmi.RmiServiceExporter">
<property name="serviceName">
<value>mProductSearchServiceRMI</value>
</property>
<property name="service">
<ref local="mProductSearchService" />
</property>
<property name="serviceInterface">
<value>ims.dashboard.cmscpa.service.interfaces.ProductSearchService</value>
</property>
<property name="registryPort">
<value>2809</value>
</property>
<property name="servicePort">
<value>2222</value> <!-- 9001 -->
</property>
</bean>

..



Here is my client side config file (service-rmiproxy.xml):
====================================
.....

<bean id="mProductSearchServiceProxyClient"
class="ws.ims.dashboard.cmscpa.rmiproxy.ProductSearchServiceRmiProxyClient">
<property name="productSearchService">
<ref local="mProductSearchServiceProxy" />
</property>
</bean>

<bean id="mProductSearchServiceProxy"
class="org.springframework.remoting.rmi.RmiProxyFactoryBean">
<property name="serviceUrl" value="rmi://bddh01-w0025:2809/mProductSearchServiceRMI"/>
<property name="serviceInterface" value="ims.dashboard.cmscpa.service.interfaces.ProductSearchService"/>
</bean>
..



And my client side code:
================

public class ProductSearchServiceRmiProxyClient {

private ProductSearchService mProductSearchService;

public static void main(String[] args) throws Exception {
ApplicationContext ctx = new FileSystemXmlApplicationContext(
"C:/WorkSpaceJ4/TestRMI/src/resources/service-rmiproxy.xml");
ProductSearchServiceRmiProxyClient proxyClient = (ProductSearchServiceRmiProxyClient) ctx.getBean("mProductSearchServiceProxyClient");
proxyClient.run();
}
/**
* @return the productSearchService
*/
public ProductSearchService getProductSearchService() {
return mProductSearchService;
}

/**
* @param productSearchService the productSearchService to set
*/
public void setProductSearchService(ProductSearchService productSearchService) {
mProductSearchService = productSearchService;
}


public void run() {

System.out.println("Getting rmi narp value: " + mProductSearchService.findNarpStatesByName("ZYPREXA101").get(0));
}
}




Can you suggest anything? The same application works fine if it is deployed in Tomcat 5.5. Why is it showing timeout in WAS 5.1? Is there anything I'm missing?

Thanks,
... Chisty
[ November 07, 2007: Message edited by: M M Islam Chisty ]

M. M. Islam Chisty<br />Sr. J2EE Engineer<br />M&H Informatics<br />Ph. 8802-7121293<br />Dhaka, Bangladesh
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: SocketTimeoutException, ConnectIOException: Read timed out
 
Similar Threads
Spring +JAX-RPC +Operation timed out
lookup not working It throws NamingException
Failed to retrieve RMIServer stub
glassfish-v2 server unable to start on win-vista
startup will throw exception for 6.0.10