PDA

View Full Version : RmiProxyFactoryBean ClassNotFound


cmgharris
Sep 17th, 2004, 11:58 AM
I have RMI working in my app, and I'm trying to convert to the Spring rmi support.

So I have the following in my spring config:

<bean name="cpmsrmi" class="org.stl.wo.data.CpmsDataAccessorSpringRmiImpl">
<property name="CpmsServerIntf"><ref bean="cpmsRmiProxy"/></property>
</bean>

<bean id="cpmsRmiProxy" class="org.springframework.remoting.rmi.RmiProxyFactoryBe an">
<property name="serviceInterface">
<value>org.stl.cpmsserver.business.CpmsServerIntf</value>
</property>
<property name="serviceUrl"><value></value></property>
<property name="lookupStubOnStartup"><value>false</value></property>
<property name="refreshStubOnConnectFailure"><value>true</value></property>
</bean>


When I run the app, I get a ClassNotFoundException for RmiProxyFactoryBean. I have the Spring 1.1 jar in my classpath, and all the other Spring classes are found; I've checked and checked again for typos, but maybe I've missed something. I'd be grateful for any suggestions.

Here is part of the error log:

org.springframework.beans.factory.BeanCreationExce ption: Error creating bean wit
h name 'org.stl.wo.appcontext' defined in URL [file:/user1/jboss-3.2.5/server/de
fault/deploy/wo.ear/scheduler.sar/beanRefFactory.xml]: Instantiation of bean fai
led; nested exception is org.springframework.beans.FatalBeanException: Could not
instantiate class [org.springframework.context.support.ClassPathXmlA pplicationC
ontext]; constructor threw exception; nested exception is org.springframework.be
ans.factory.BeanDefinitionStoreException: Error registering bean with name 'cpms
RmiProxy' defined in class path resource [wo_bus_config.xml]: Bean class [org.sp
ringframework.remoting.rmi.RmiProxyFactoryBean] not found; nested exception is j
ava.lang.ClassNotFoundException: org.springframework.remoting.rmi.RmiProxyFactor
yBean
org.springframework.beans.FatalBeanException: Could not instantiate class [org.s
pringframework.context.support.ClassPathXmlApplica tionContext]; constructor thre
w exception; nested exception is org.springframework.beans.factory.BeanDefinitio
nStoreException: Error registering bean with name 'cpmsRmiProxy' defined in clas
s path resource [wo_bus_config.xml]: Bean class [org.springframework.remoting.rm
i.RmiProxyFactoryBean] not found; nested exception is java.lang.ClassNotFoundExc
eption: org.springframework.remoting.rmi.RmiProxyFactoryBe an
org.springframework.beans.factory.BeanDefinitionSt oreException: Error registerin
g bean with name 'cpmsRmiProxy' defined in class path resource [wo_bus_config.xm
l]: Bean class [org.springframework.remoting.rmi.RmiProxyFactoryB ean] not found;
nested exception is java.lang.ClassNotFoundException: org.springframework.remot
ing.rmi.RmiProxyFactoryBean
java.lang.ClassNotFoundException: org.springframework.remoting.rmi.RmiProxyFacto
ryBean
at java.net.URLClassLoader.run(URLClassLoader.java:19 5)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.j ava:183)
at java.lang.ClassLoader.loadClass(ClassLoader.java:2 94)
at java.lang.ClassLoader.loadClass(ClassLoader.java:2 50)
at java.lang.ClassLoader.loadClassInternal(ClassLoade r.java:310)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:190)
at org.springframework.beans.factory.support.BeanDefi nitionReaderUtils.c
reateBeanDefinition(BeanDefinitionReaderUtils.java :50)
at org.springframework.beans.factory.xml.DefaultXmlBe anDefinitionParser.
parseBeanDefinition(DefaultXmlBeanDefinitionParser .java:279)
at org.springframework.beans.factory.xml.DefaultXmlBe anDefinitionParser.
parseBeanDefinition(DefaultXmlBeanDefinitionParser .java:239)
at org.springframework.beans.factory.xml.DefaultXmlBe anDefinitionParser.
registerBeanDefinition(DefaultXmlBeanDefinitionPar ser.java:205)
at org.springframework.beans.factory.xml.DefaultXmlBe anDefinitionParser.
registerBeanDefinitions(DefaultXmlBeanDefinitionPa rser.java:173)
at org.springframework.beans.factory.xml.XmlBeanDefin itionReader.registe
rBeanDefinitions(XmlBeanDefinitionReader.java:164)
at org.springframework.beans.factory.xml.XmlBeanDefin itionReader.loadBea
nDefinitions(XmlBeanDefinitionReader.java:128)

Alef Arendsen
Sep 19th, 2004, 05:06 PM
Would you mind trying this with JBoss 3.2.6 (wichever RC is the latest) or 3.2.3. There are some classloading bugs that slipped into JBoss 3.2.5 that also affected Quartz integration.

I wouldn't know if this issue is also caused by the bug, but before we get into it any further, it would be nice if you could check it.

alef

cmgharris
Sep 20th, 2004, 06:37 AM
I've just installed jboss 3.2.6RC1, and get exactly the same error.

I was going to try 3.2.3, but I've changed my app to take advantage of Tomcat 5 Servlet 2.4/JSP 2.0, so it no longer works with 3.2.3.

It may well be something I've got wrong, just not sure what . . .

cmgharris
Sep 21st, 2004, 04:45 AM
I was working on the server end of the rmi, and got a classnotfound on one of the aopalliance classes . . . which set me thinking . . .

I've now got aopalliance.jar in my classpath on the client end, and it all works fine.

Perhaps the error message on the client side could be a bit clearer?

glaha03
Apr 6th, 2005, 02:49 AM
I found this thread on Google and it was similar to my problem. I tried cmgharris's aopalliance.jar fix and it works. Thanks.