OK... I decided to take a step back from my project, create a new project, put an EJB in that, and then try again to see what happened.
I'm STILL getting java.lang.ClassNotFoundException. And the spring.jar file is deployed along with my EJB.
Here's the springconfig.xml file that I'm loading in a simple Java application, the applicationContext file from that sample, and the stacktrace.
If this matters at all, I'm using Framework 1.01. I could REALLY use some help here. This is making me a bit batty.
File: springconfig.xml
Code:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd">
<beans>
<bean id="myComponent"
lazy-init="true"
class="org.springframework.ejb.access.SimpleRemoteStatelessSessionProxyFactoryBean">
<property name="jndiName">
<value>SimpleEJB</value>
</property>
<property name="jndiEnvironment">
<props>
<prop key="java.naming.factory.initial">org.jnp.interfaces.NamingContextFactory</prop>
<prop key="java.naming.factory.url.pkgs">org.jboss.naming:org.jnp.interfaces</prop>
<prop key="java.naming.provider.url">jnp://localhost:1099</prop>
</props>
</property>
<property name="businessInterface">
<value>com.codethought.springejb.services.MyComponent</value>
</property>
</bean>
</beans>
file : applicationContext.xml
Code:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd">
<beans>
<!-- ========================= GENERAL DEFINITIONS ========================= -->
<!-- ========================= RESOURCE DEFINITIONS ========================= -->
<!-- ========================= BUSINESS OBJECT DEFINITIONS ========================= -->
<!-- an EJB proxy with the cached home flag on, to test home lookup every time -->
<bean id="cachedHomeProxy" lazy-init="true" class="org.springframework.ejb.access.SimpleRemoteStatelessSessionProxyFactoryBean">
<property name="jndiName">
<value>SimpleEJB</value>
</property>
<property name="cacheHome">
<value>true</value>
</property>
<property name="businessInterface">
<value>com.codethought.springejb.services.MyComponent</value>
</property>
</bean>
<!-- now another instance with the cached home flag off, to test home lookup every time -->
<bean id="noCachedHomeProxy" lazy-init="true" class="org.springframework.ejb.access.SimpleRemoteStatelessSessionProxyFactoryBean">
<property name="jndiName">
<value>SimpleEJB</value>
</property>
<property name="cacheHome">
<value>false</value>
</property>
<property name="businessInterface">
<value>com.codethought.springejb.services.MyComponent</value>
</property>
</bean>
</beans>
Stacktrace:
Code:
FINE: main: outbound call received exception: [172.20.6.101:4444] exception:
java.rmi.ServerException: RemoteException occurred in server thread; nested exception is:
java.rmi.ServerException: EJBException:; nested exception is:
javax.ejb.EJBException: null; CausedByException is:
Error registering bean with name 'cachedHomeProxy' defined in class path resource [META-INF/servicelayer-applicationContext.xml]: Bean class [org.springframework.ejb.access.SimpleRemoteStatelessSessionProxyFactoryBean] not found; nested exception is java.lang.ClassNotFoundException: Unexpected error during load of: org.springframework.ejb.access.SimpleRemoteStatelessSessionProxyFactoryBean, msg=org/springframework/ejb/access/SimpleRemoteSlsbInvokerInterceptor
at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:292)
at sun.rmi.transport.Transport$1.run(Transport.java:148)
at java.security.AccessController.doPrivileged(Native Method)
at sun.rmi.transport.Transport.serviceCall(Transport.java:144)
at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:460)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:701)
at java.lang.Thread.run(Thread.java:534)
at sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(StreamRemoteCall.java:247)
at sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:223)
at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:133)
at org.jboss.invocation.jrmp.server.JRMPInvoker_Stub.invoke(Unknown Source)
at org.jboss.invocation.jrmp.interfaces.JRMPInvokerProxy.invoke(JRMPInvokerProxy.java:135)
at org.jboss.invocation.InvokerInterceptor.invoke(InvokerInterceptor.java:96)
at org.jboss.proxy.TransactionInterceptor.invoke(TransactionInterceptor.java:46)
at org.jboss.proxy.SecurityInterceptor.invoke(SecurityInterceptor.java:45)
at org.jboss.proxy.ejb.StatelessSessionInterceptor.invoke(StatelessSessionInterceptor.java:100)
at org.jboss.proxy.ClientContainer.invoke(ClientContainer.java:85)
at $Proxy2.myMethod(Unknown Source)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at org.springframework.ejb.access.SimpleRemoteSlsbInvokerInterceptor.invoke(SimpleRemoteSlsbInvokerInterceptor.java:104)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:138)
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:148)
at $Proxy1.myMethod(Unknown Source)
at com.codethought.springejb.test.TestRemoteProxy.main(TestRemoteProxy.java:22)
Caused by: java.rmi.ServerException: EJBException:; nested exception is:
javax.ejb.EJBException: null; CausedByException is:
Error registering bean with name 'cachedHomeProxy' defined in class path resource [META-INF/servicelayer-applicationContext.xml]: Bean class [org.springframework.ejb.access.SimpleRemoteStatelessSessionProxyFactoryBean] not found; nested exception is java.lang.ClassNotFoundException: Unexpected error during load of: org.springframework.ejb.access.SimpleRemoteStatelessSessionProxyFactoryBean, msg=org/springframework/ejb/access/SimpleRemoteSlsbInvokerInterceptor
at org.jboss.ejb.plugins.LogInterceptor.handleException(LogInterceptor.java:347)
at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:195)
at org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor.invoke(ProxyFactoryFinderInterceptor.java:122)
at org.jboss.ejb.StatelessSessionContainer.internalInvoke(StatelessSessionContainer.java:331)
at org.jboss.ejb.Container.invoke(Container.java:700)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBeanDispatcher.java:284)
at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:546)
at org.jboss.invocation.jrmp.server.JRMPInvoker.invoke(JRMPInvoker.java:367)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:261)
at sun.rmi.transport.Transport$1.run(Transport.java:148)
at java.security.AccessController.doPrivileged(Native Method)
at sun.rmi.transport.Transport.serviceCall(Transport.java:144)
at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:460)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:701)
at java.lang.Thread.run(Thread.java:534)
Caused by: javax.ejb.EJBException: null; CausedByException is:
Error registering bean with name 'cachedHomeProxy' defined in class path resource [META-INF/servicelayer-applicationContext.xml]: Bean class [org.springframework.ejb.access.SimpleRemoteStatelessSessionProxyFactoryBean] not found; nested exception is java.lang.ClassNotFoundException: Unexpected error during load of: org.springframework.ejb.access.SimpleRemoteStatelessSessionProxyFactoryBean, msg=org/springframework/ejb/access/SimpleRemoteSlsbInvokerInterceptor
at org.jboss.ejb.StatelessSessionEnterpriseContext.<init>(StatelessSessionEnterpriseContext.java:59)
at org.jboss.ejb.plugins.StatelessSessionInstancePool.create(StatelessSessionInstancePool.java:35)
at org.jboss.ejb.plugins.AbstractInstancePool.get(AbstractInstancePool.java:168)
at org.jboss.ejb.plugins.StatelessSessionInstanceInterceptor.invoke(StatelessSessionInstanceInterceptor.java:58)
at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:84)
at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:267)
at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:128)
at org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInterceptor.java:118)
at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:191)
... 21 more
Aug 19, 2004 10:06:01 AM sun.rmi.server.UnicastRef invoke
FINE: main: free connection (reuse = false)
Aug 19, 2004 10:06:01 AM sun.rmi.transport.tcp.TCPChannel free
FINE: main: close connection
Aug 19, 2004 10:06:01 AM sun.rmi.transport.tcp.TCPConnection close
FINE: main: close connection
org.springframework.remoting.RemoteAccessException: Could not invoke remote EJB [SimpleEJB]; nested exception is java.rmi.ServerException: RemoteException occurred in server thread; nested exception is:
java.rmi.ServerException: EJBException:; nested exception is:
javax.ejb.EJBException: null; CausedByException is:
Error registering bean with name 'cachedHomeProxy' defined in class path resource [META-INF/servicelayer-applicationContext.xml]: Bean class [org.springframework.ejb.access.SimpleRemoteStatelessSessionProxyFactoryBean] not found; nested exception is java.lang.ClassNotFoundException: Unexpected error during load of: org.springframework.ejb.access.SimpleRemoteStatelessSessionProxyFactoryBean, msg=org/springframework/ejb/access/SimpleRemoteSlsbInvokerInterceptor
java.rmi.ServerException: RemoteException occurred in server thread; nested exception is:
java.rmi.ServerException: EJBException:; nested exception is:
javax.ejb.EJBException: null; CausedByException is:
Error registering bean with name 'cachedHomeProxy' defined in class path resource [META-INF/servicelayer-applicationContext.xml]: Bean class [org.springframework.ejb.access.SimpleRemoteStatelessSessionProxyFactoryBean] not found; nested exception is java.lang.ClassNotFoundException: Unexpected error during load of: org.springframework.ejb.access.SimpleRemoteStatelessSessionProxyFactoryBean, msg=org/springframework/ejb/access/SimpleRemoteSlsbInvokerInterceptor
at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:292)
at sun.rmi.transport.Transport$1.run(Transport.java:148)
at java.security.AccessController.doPrivileged(Native Method)
at sun.rmi.transport.Transport.serviceCall(Transport.java:144)
at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:460)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:701)
at java.lang.Thread.run(Thread.java:534)
at sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(StreamRemoteCall.java:247)
at sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:223)
at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:133)
at org.jboss.invocation.jrmp.server.JRMPInvoker_Stub.invoke(Unknown Source)
at org.jboss.invocation.jrmp.interfaces.JRMPInvokerProxy.invoke(JRMPInvokerProxy.java:135)
at org.jboss.invocation.InvokerInterceptor.invoke(InvokerInterceptor.java:96)
at org.jboss.proxy.TransactionInterceptor.invoke(TransactionInterceptor.java:46)
at org.jboss.proxy.SecurityInterceptor.invoke(SecurityInterceptor.java:45)
at org.jboss.proxy.ejb.StatelessSessionInterceptor.invoke(StatelessSessionInterceptor.java:100)
at org.jboss.proxy.ClientContainer.invoke(ClientContainer.java:85)
at $Proxy2.myMethod(Unknown Source)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at org.springframework.ejb.access.SimpleRemoteSlsbInvokerInterceptor.invoke(SimpleRemoteSlsbInvokerInterceptor.java:104)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:138)
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:148)
at $Proxy1.myMethod(Unknown Source)
at com.codethought.springejb.test.TestRemoteProxy.main(TestRemoteProxy.java:22)
Caused by: java.rmi.ServerException: EJBException:; nested exception is:
javax.ejb.EJBException: null; CausedByException is:
Error registering bean with name 'cachedHomeProxy' defined in class path resource [META-INF/servicelayer-applicationContext.xml]: Bean class [org.springframework.ejb.access.SimpleRemoteStatelessSessionProxyFactoryBean] not found; nested exception is java.lang.ClassNotFoundException: Unexpected error during load of: org.springframework.ejb.access.SimpleRemoteStatelessSessionProxyFactoryBean, msg=org/springframework/ejb/access/SimpleRemoteSlsbInvokerInterceptor
at org.jboss.ejb.plugins.LogInterceptor.handleException(LogInterceptor.java:347)
at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:195)
at org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor.invoke(ProxyFactoryFinderInterceptor.java:122)
at org.jboss.ejb.StatelessSessionContainer.internalInvoke(StatelessSessionContainer.java:331)
at org.jboss.ejb.Container.invoke(Container.java:700)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBeanDispatcher.java:284)
at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:546)
at org.jboss.invocation.jrmp.server.JRMPInvoker.invoke(JRMPInvoker.java:367)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:261)
at sun.rmi.transport.Transport$1.run(Transport.java:148)
at java.security.AccessController.doPrivileged(Native Method)
at sun.rmi.transport.Transport.serviceCall(Transport.java:144)
at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:460)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:701)
at java.lang.Thread.run(Thread.java:534)
Caused by: javax.ejb.EJBException: null; CausedByException is:
Error registering bean with name 'cachedHomeProxy' defined in class path resource [META-INF/servicelayer-applicationContext.xml]: Bean class [org.springframework.ejb.access.SimpleRemoteStatelessSessionProxyFactoryBean] not found; nested exception is java.lang.ClassNotFoundException: Unexpected error during load of: org.springframework.ejb.access.SimpleRemoteStatelessSessionProxyFactoryBean, msg=org/springframework/ejb/access/SimpleRemoteSlsbInvokerInterceptor
at org.jboss.ejb.StatelessSessionEnterpriseContext.<init>(StatelessSessionEnterpriseContext.java:59)
at org.jboss.ejb.plugins.StatelessSessionInstancePool.create(StatelessSessionInstancePool.java:35)
at org.jboss.ejb.plugins.AbstractInstancePool.get(AbstractInstancePool.java:168)
at org.jboss.ejb.plugins.StatelessSessionInstanceInterceptor.invoke(StatelessSessionInstanceInterceptor.java:58)
at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:84)
at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:267)
at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:128)
at org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInterceptor.java:118)
at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:191)
... 21 more
Exception in thread "main"