Help : problem on starting RMI service via Spring
Hi everyone.
When i start my Spring container with one rmi service, i get an error.
Can someone help me out !!
Thanks a lot
config
Code:
<beans>
<bean id="accountService"
class="com.iberville.account.AccountServiceSpringXMLImpl">
<property name="userAccounts">
<list>
<bean id="Account_1" class="com.iberville.account.classes.Account" singleton="false">
<property name="id"><value>jojo</value></property>
<property name="boxNumber"><value>1</value></property>
<property name="userName"><value>Jxx Wxxht</value></property>
<property name="password"><value>jojonumberone</value></property>
<property name="email"><value>josixx@yahoo.ca</value></property>
</bean>
<bean id="Account_2" class="com.iberville.account.classes.Account" singleton="false">
<property name="boxNumber"><value>2</value></property>
<property name="id"><value>hevo</value></property>
<property name="userName"><value>xx xxer</value></property>
<property name="password"><value>hevoNumberone</value></property>
<property name="email"><value>hxxer@vidxxn.ca</value></property>
</bean>
<bean id="Account_3" class="com.iberville.account.classes.Account" singleton="false">
<property name="boxNumber"><value>3</value></property>
<property name="id"><value>manu</value></property>
<property name="userName"><value>xxuel xxnd</value></property>
<property name="password"><value>manuNumberOne</value></property>
<property name="email"><value>mxx@yahoo.ca</value></property>
</bean>
</list>
</property>
</bean>
<bean class="org.springframework.remoting.rmi.RmiServiceExporter">
<property name="serviceName">
<value>AccountService</value>
</property>
<property name="service">
<ref bean="accountService"/>
</property>
<property name="serviceInterface">
<value>com.iberville.services.AccountService</value>
</property>
<property name="registryPort">
<value>1199</value>
</property>
</bean>
</beans>
ERROR
Code:
[java] [2004-12-11 15:20:08,468 [main]] WARN org.springframework.remoting.rmi.RmiServiceExporter - Could not detect RMI registry - creating new one
[java] [2004-12-11 15:20:08,468 [main]] INFO org.springframework.remoting.rmi.RmiServiceExporter - Binding RMI service 'AccountService' to registry at port '1199'
[java] [2004-12-11 15:20:08,468 [main]] INFO org.springframework.beans.factory.support.DefaultListableBeanFactory - Destroying singletons in factory {org.springframework.beans.factory.support.DefaultListableBeanFactory defining beans [accountService,org.springframework.remoting.rmi.RmiServiceExporter]; Root of BeanFactory hierarchy}
[java] [2004-12-11 15:20:08,468 [main]] DEBUG org.springframework.beans.factory.support.DefaultListableBeanFactory - Retrieving dependent beans for bean 'accountService'
[java] [2004-12-11 15:20:08,484 [main]] DEBUG org.springframework.beans.factory.support.DefaultListableBeanFactory - Applying DestructionAwareBeanPostProcessors to bean with name 'accountService'
[java] [2004-12-11 15:20:08,484 [main]] INFO org.springframework.beans.factory.support.DefaultListableBeanFactory - Destroying inner beans in factory {org.springframework.beans.factory.support.DefaultListableBeanFactory defining beans [accountService,org.springframework.remoting.rmi.RmiServiceExporter]; Root of BeanFactory hierarchy}
[java] org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.remoting.rmi.RmiServiceExporter' defined in class path resource [AccountService.xml]: Initialization of bean failed; nested exception is java.rmi.server.ExportException: object already exported
[java] at org.apache.tools.ant.taskdefs.ExecuteJava.execute(ExecuteJava.java:172)
[java] at org.apache.tools.ant.taskdefs.Java.run(Java.java:705)
[java] at org.apache.tools.ant.taskdefs.Java.executeJava(Java.java:177)
[java] at org.apache.tools.ant.taskdefs.Java.execute(Java.java:83)
[java] at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:275)
[java] at org.apache.tools.ant.Task.perform(Task.java:364)
[java] at org.apache.tools.ant.Target.execute(Target.java:341)
[java] at org.apache.tools.ant.Target.performTasks(Target.java:369)
[java] at org.apache.tools.ant.Project.executeTarget(Project.java:1214)
[java] at org.apache.tools.ant.Project.executeTargets(Project.java:1062)
[java] at org.eclipse.ant.internal.ui.antsupport.InternalAntRunner.run(InternalAntRunner.java:377)
[java] at org.eclipse.ant.internal.ui.antsupport.InternalAntRunner.main(InternalAntRunner.java:135)
[java] Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.remoting.rmi.RmiServiceExporter' defined in class path resource [AccountService.xml]: Initialization of bean failed; nested exception is java.rmi.server.ExportException: object already exported
[java] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:300)
[java] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:205)
[java] at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:204)
[java] at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:136)
[java] at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:236)
[java] at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:284)
[java] at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:80)
[java] at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:65)
[java] at startup.<init>(startup.java:23)
[java] at startup.main(startup.java:13)
[java] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[java] at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
[java] at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
[java] at java.lang.reflect.Method.invoke(Unknown Source)
[java] at org.apache.tools.ant.taskdefs.ExecuteJava.run(ExecuteJava.java:193)
[java] at org.apache.tools.ant.taskdefs.ExecuteJava.execute(ExecuteJava.java:130)
[java] ... 11 more
[java] Caused by: java.rmi.server.ExportException: object already exported
[java] at sun.rmi.transport.ObjectTable.putTarget(Unknown Source)
[java] at sun.rmi.transport.Transport.exportObject(Unknown Source)
[java] at sun.rmi.transport.tcp.TCPTransport.exportObject(Unknown Source)
[java] at sun.rmi.transport.tcp.TCPEndpoint.exportObject(Unknown Source)
[java] at sun.rmi.transport.LiveRef.exportObject(Unknown Source)
[java] at sun.rmi.server.UnicastServerRef.exportObject(Unknown Source)
[java] at java.rmi.server.UnicastRemoteObject.exportObject(Unknown Source)
[java] at java.rmi.server.UnicastRemoteObject.exportObject(Unknown Source)
[java] at org.springframework.remoting.rmi.RmiServiceExporter.afterPropertiesSet(RmiServiceExporter.java:160)
[java] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1057)
[java] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:287)
[java] ... 26 more
[java] --- Nested Exception ---
[java] org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.remoting.rmi.RmiServiceExporter' defined in class path resource [AccountService.xml]: Initialization of bean failed; nested exception is java.rmi.server.ExportException: object already exported
[java] java.rmi.server.ExportException: object already exported
[java] at sun.rmi.transport.ObjectTable.putTarget(Unknown Source)
[java] at sun.rmi.transport.Transport.exportObject(Unknown Source)
[java] at sun.rmi.transport.tcp.TCPTransport.exportObject(Unknown Source)
[java] at sun.rmi.transport.tcp.TCPEndpoint.exportObject(Unknown Source)
[java] at sun.rmi.transport.LiveRef.exportObject(Unknown Source)
[java] at sun.rmi.server.UnicastServerRef.exportObject(Unknown Source)
[java] at java.rmi.server.UnicastRemoteObject.exportObject(Unknown Source)
[java] at java.rmi.server.UnicastRemoteObject.exportObject(Unknown Source)
[java] at org.springframework.remoting.rmi.RmiServiceExporter.afterPropertiesSet(RmiServiceExporter.java:160)
[java] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1057)
[java] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:287)
[java] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:205)
[java] at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:204)
[java] at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:136)
[java] at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:236)
[java] at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:284)
[java] at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:80)
[java] at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:65)
[java] at startup.<init>(startup.java:23)
[java] at startup.main(startup.java:13)
[java] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[java] at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
[java] at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
[java] at java.lang.reflect.Method.invoke(Unknown Source)
[java] at org.apache.tools.ant.taskdefs.ExecuteJava.run(ExecuteJava.java:193)
[java] at org.apache.tools.ant.taskdefs.ExecuteJava.execute(ExecuteJava.java:130)
[java] at org.apache.tools.ant.taskdefs.Java.run(Java.java:705)
[java] at org.apache.tools.ant.taskdefs.Java.executeJava(Java.java:177)
[java] at org.apache.tools.ant.taskdefs.Java.execute(Java.java:83)
[java] at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:275)
[java] at org.apache.tools.ant.Task.perform(Task.java:364)
[java] at org.apache.tools.ant.Target.execute(Target.java:341)
[java] at org.apache.tools.ant.Target.performTasks(Target.java:369)
[java] at org.apache.tools.ant.Project.executeTarget(Project.java:1214)
[java] at org.apache.tools.ant.Project.executeTargets(Project.java:1062)
[java] at org.eclipse.ant.internal.ui.antsupport.InternalAntRunner.run(InternalAntRunner.java:377)
[java] at org.eclipse.ant.internal.ui.antsupport.InternalAntRunner.main(InternalAntRunner.java:135)
I found the problem !! is it normal and why ?
If the remote object extends UnicastRemoteObject Spring container crashes during load time.
Re: I found the problem !! is it normal and why ?
Quote:
Originally Posted by hevo
If the remote object extends UnicastRemoteObject Spring container crashes during load time.
If it's a bug/defect I think a case in JIRA should be opened for this. Otherwise the developers of Spring isn't aware of this bug