Hi,
I am very new to Spring and am attempting to make 2 seperate applications communicate using Spring RMI. I have 2 applications running on Tomcat 5.5 (from Eclipse)and one application calls the method present in second using Spring RMI. But when i try to call the remote method, i am getting this error. Would be grateful for any help/ clues !!
Error
RemoteProxyFailureException: No matching RMI stub method found for: public abstract void au.com.macquarie.rmd.scorecards.service.CrwsRemote Service.saveScorecard(int); nested exception is java.lang.NoSuchMethodException: sun.rmi.registry.RegistryImpl_Stub.saveScorecard(i nt)
at org.springframework.remoting.rmi.RmiClientIntercep torUtils.doInvoke(RmiClientInterceptorUtils.java:1 11)
at org.springframework.remoting.rmi.RmiClientIntercep tor.doInvoke(RmiClientInterceptor.java:358)
at org.springframework.remoting.rmi.RmiClientIntercep tor.invoke(RmiClientInterceptor.java:258)
at org.springframework.aop.framework.ReflectiveMethod Invocation.proceed(ReflectiveMethodInvocation.java :171)
at org.springframework.aop.framework.JdkDynamicAopPro xy.invoke(JdkDynamicAopProxy.java:204)
Remote Service
package au.com.macquarie.rmd.scorecards.service;
public interface CrwsRemoteService{
public void saveScorecard(int id);
}
Remote Service Impl
package au.com.macquarie.rmd.scorecards.service;
public class CrwsRemoteServiceImpl implements CrwsRemoteService {
public CrwsRemoteServiceImpl() {
System.out.print("GOT CALLED");
}
public void saveScorecard(int id){
System.out.println(" IT WORKS " );
}
}
Remote Service Application Context
<bean id="crwsRemoteService"
class="au.com.macquarie.rmd.scorecards.service.Crw sRemoteServiceImpl" />
<bean class="org.springframework.remoting.rmi.RmiService Exporter">
<property name="serviceName" value="CrwsRemoteService"/>
<property name="service" ref="crwsRemoteService"/>
<property name="serviceInterface" value="au.com.macquarie.rmd.scorecards.service.Crw sRemoteService"/>
<!-- defaults to 1099 -->
</bean>
Client code calling remote service
I have a struts application from which i am trying to call the remote service
RemoteObject remoteObject = (RemoteObject) WebApplicationContextUtils.getWebApplicationContex t(getServlet().getServletContext()).getBean("remot eObject");
try{
remoteObject.getRemoteService().saveScorecard(111) ;
}catch(Exception e){
e.printStackTrace();
}
Client's Application Context
<bean id="remoteService" class="org.springframework.remoting.rmi.RmiProxyFa ctoryBean">
<property name="serviceUrl" value="rmi://CrwsRemoteService"/>
<property name="serviceInterface" value="au.com.macquarie.rmd.scorecards.service.Crw sRemoteService"/>
</bean>
<bean id="remoteObject" class="au.com.macquarie.rmd.workbook.struts.Remote Object">
<property name="remoteService" ref="remoteService"/>
</bean>
Please let me know if i have missed providing any other useful info. And thanks a ton in advance
Ankur


Reply With Quote