Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

java.net.SocketTimeoutException: Read timed out

843834Nov 7 2007 — edited Nov 7 2007
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 version at this time because this is our client 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)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1201)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1171)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:425)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:251)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:156)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:248)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:160)
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:261)
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:109)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1099)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:861)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:421)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:251)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:156)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:248)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:160)
at ...


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

Comments

JohnGoodwin
Answer

When installing if you select "Financial Management Server" it will automatically select the database clients so you must have deselected them, they are selected for a reason, obviously if you were connecting to SQL Server you would not need them selected.

It is also possible to use an existing Oracle client - Using an Existing Oracle Database Client

Cheers

John

Marked as Answer by JanGLi · Sep 27 2020
JanGLi

Damn i even searched the shared document for database client maybe i didn't searched property.

Well any way i have already started the re-installation

Thanks for always helping

QA

@John Goodwin

Do we still need DB client, when we use/specify jdbc connection string during config?

Thanks

A

JohnGoodwin

1002763 wrote:

Do we still need DB client, when we use/specify jdbc connection string during config?

No you don't need a database client for the configuration.

1 - 4
Locked Post
New comments cannot be posted to this locked post.

Post Details

Locked on Dec 5 2007
Added on Nov 7 2007
1 comment
2,221 views