Announcement Announcement Module
Collapse
No announcement yet.
RMI Problem, java.lang.IllegalArgumentException Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • RMI Problem, java.lang.IllegalArgumentException

    Hey,

    has anyone an idea what this error msg means?

    Code:
    Exception in thread "main" org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'remoteInfoBeanRMI' defined in class path resource [a.xml]: Invocation of init method failed; nested exception is java.lang.IllegalArgumentException: Service interface [beans.IRemoteInfoBean] needs to be implemented by service [remoteInfoBean] of class [java.lang.String]
    Caused by: java.lang.IllegalArgumentException: Service interface [beans.IRemoteInfoBean] needs to be implemented by service [remoteInfoBean] of class [java.lang.String]
    	at org.springframework.remoting.support.RemoteExporter.checkServiceInterface(RemoteExporter.java:132)
    	at org.springframework.remoting.support.RemoteExporter.getProxyForService(RemoteExporter.java:152)
    	at org.springframework.remoting.rmi.RmiBasedExporter.getObjectToExport(RmiBasedExporter.java:61)
    	at org.springframework.remoting.rmi.RmiServiceExporter.prepare(RmiServiceExporter.java:252)
    	at org.springframework.remoting.rmi.RmiServiceExporter.afterPropertiesSet(RmiServiceExporter.java:211)
    	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1175)
    	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1145)
    I am using Spring 2.0.4.
    This is on the server side with the following code:

    beans.IRemoteInfoBean:

    Code:
    package beans;
    
    public interface IRemoteInfoBean {
    	
    	public int getMwStSatz();
    
    	public void setMwStSatz(int mwStSatz);
    
    	public int getRemindingDays();
    
    	public void setRemindingDays(int remindingDays);
    
    	public String getVersion();
    
    	public void setVersion(String version);
    
    }
    beans.RemoteInfoBean:

    Code:
    package beans;
    
    public class RemoteInfoBean implements IRemoteInfoBean {
    	
    	private int remindingDays;
    	
    	private String version;
    	
    	private int mwStSatz;
    
    	public int getMwStSatz() {
    		return mwStSatz;
    	}
    
    	public void setMwStSatz(int mwStSatz) {
    		this.mwStSatz = mwStSatz;
    	}
    
    	public int getRemindingDays() {
    		return remindingDays;
    	}
    
    	public void setRemindingDays(int remindingDays) {
    		this.remindingDays = remindingDays;
    	}
    
    	public String getVersion() {
    		return version;
    	}
    
    	public void setVersion(String version) {
    		this.version = version;
    	}
    }
    and here is my spring xml file:

    Code:
    ...
        <bean id="remoteInfoBean" class="beans.RemoteInfoBean">
        </bean>
        
        <bean id="activationDataDAO" class="dao.ActivationDataDAO">
            <property name="sessionFactory" ref="hibernateSessionFactory" />
        </bean>
       
        <bean id="remoteInfoBeanRMI" class="org.springframework.remoting.rmi.RmiServiceExporter">
            <property name="serviceName" value="RemoteInfoBean" />
            <property name="service" value="remoteInfoBean" />
            <property name="serviceInterface" value="beans.IRemoteInfoBean" />
        </bean>
    ...
    hibernate stuff...
    Thank you in advance!

  • #2
    I've found the error:

    Changing "value" to "ref" in the appContext.xml by the service attribute will do it.

    Comment

    Working...
    X