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 ]