Results 1 to 2 of 2

Thread: RMI Problem, java.lang.IllegalArgumentException

  1. #1
    Join Date
    Apr 2007
    Location
    Cologne, Germany
    Posts
    10

    Default 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. #2
    Join Date
    Apr 2007
    Location
    Cologne, Germany
    Posts
    10

    Default

    I've found the error:

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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •