i am tired.I am very disappointed to spring!!
All the whole month i want to be success in using spring(client)+ejb+spring(service and dao)+hibernate but i am very disappointed.
I cant get any help from anyone. I am not sure does spring can really be used like this.I got an error but nobody can help me,nobody can give me a simple example,i am very tired.really!!
Environment:windows 2003 server+jboss4.0+jdk1.5
First ,i am very very sure commons-collection.jar is in my classpath!In fact i have add all jars which hibernate and spring used and database driver into the MANIFEST.MF
13:16:43,686 INFO [FileSystemXmlApplicationContext] No MessageSource found for context [org.springframework.context.support.FileSystemXmlA pplicationContext;hashCode=12893404]: using empty default
13:16:43,686 INFO [FileSystemXmlApplicationContext] No ApplicationEventMulticaster found for context [org.springframework.context.support.FileSystemXmlA pplicationContext;hashCode=12893404]: using default
13:16:43,702 INFO [FileSystemXmlApplicationContext] Refreshing listeners
13:16:43,702 INFO [DefaultListableBeanFactory] Pre-instantiating singletons in factory [org.springframework.beans.factory.support.DefaultL istableBeanFactory defining beans [userManagerService]; Root of BeanFactory hierarchy]
13:16:43,702 INFO [DefaultListableBeanFactory] Creating shared instance of singleton bean 'userManagerService'
13:16:44,125 INFO [SimpleRemoteStatelessSessionProxyFactoryBean] Located object with JNDI name [UserManager]: value=[UserManagerHome]
13:16:44,157 INFO [CollectionFactory] Using JDK 1.4 collections
Exception in thread "main" org.springframework.remoting.RemoteAccessException : Cannot access remote service [UserManager]; 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 creating bean with name 'servicelayer-context' defined in URL [jar:file:/D:/jboss4/server/default/tmp/deploy/tmp38515MyGS.ear-contents/SwanEjb.jar!/beanRefContext.xml]: Instantiation of bean failed; nested exception is org.springframework.beans.FatalBeanException: Could not instantiate class [org.springframework.context.support.ClassPathXmlAp plicationContext]; constructor threw exception; nested exception is org.springframework.beans.factory.BeanCreationExce ption: Error creating bean with name 'mysqlSessionFactory' defined in class path resource [spring-system.xml]: Initialization of bean failed; nested exception is java.lang.NoClassDefFoundError: org/apache/commons/collections/SequencedHashMap
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 creating bean with name 'servicelayer-context' defined in URL [jar:file:/D:/jboss4/server/default/tmp/deploy/tmp38515MyGS.ear-contents/SwanEjb.jar!/beanRefContext.xml]: Instantiation of bean failed; nested exception is org.springframework.beans.FatalBeanException: Could not instantiate class [org.springframework.context.support.ClassPathXmlAp plicationContext]; constructor threw exception; nested exception is org.springframework.beans.factory.BeanCreationExce ption: Error creating bean with name 'mysqlSessionFactory' defined in class path resource [spring-system.xml]: Initialization of bean failed; nested exception is java.lang.NoClassDefFoundError: org/apache/commons/collections/SequencedHashMap
at sun.rmi.server.UnicastServerRef.dispatch(UnicastSe rverRef.java:325)
at sun.rmi.transport.Transport$1.run(Transport.java:1 53)
at java.security.AccessController.doPrivileged(Native Method)
at sun.rmi.transport.Transport.serviceCall(Transport. java:149)
at sun.rmi.transport.tcp.TCPTransport.handleMessages( TCPTransport.java:460)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandl er.run(TCPTransport.java:701)
at java.lang.Thread.run(Thread.java:595)
at sun.rmi.transport.StreamRemoteCall.exceptionReceiv edFromServer(StreamRemoteCall.java:247)
at sun.rmi.transport.StreamRemoteCall.executeCall(Str eamRemoteCall.java:223)
at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:1 26)
at org.jboss.invocation.jrmp.server.JRMPInvoker_Stub. invoke(Unknown Source)
at org.jboss.invocation.jrmp.interfaces.JRMPInvokerPr oxy.invoke(JRMPInvokerProxy.java:118)
at org.jboss.invocation.InvokerInterceptor.invoke(Inv okerInterceptor.java:96)
at org.jboss.proxy.TransactionInterceptor.invoke(Tran sactionInterceptor.java:46)
at org.jboss.proxy.SecurityInterceptor.invoke(Securit yInterceptor.java:55)
at org.jboss.proxy.ejb.StatelessSessionInterceptor.in voke(StatelessSessionInterceptor.java:97)
at org.jboss.proxy.ClientContainer.invoke(ClientConta iner.java:86)
at $Proxy2.getUser(Unknown Source)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Nativ e Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Native MethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(De legatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.springframework.remoting.rmi.RmiClientIntercep torUtils.doInvoke(RmiClientInterceptorUtils.java:9 8)
at org.springframework.ejb.access.SimpleRemoteSlsbInv okerInterceptor.doInvoke(SimpleRemoteSlsbInvokerIn terceptor.java:73)
at org.springframework.ejb.access.AbstractRemoteSlsbI nvokerInterceptor.invoke(AbstractRemoteSlsbInvoker Interceptor.java:72)
at org.springframework.aop.framework.ReflectiveMethod Invocation.proceed(ReflectiveMethodInvocation.java :138)
at org.springframework.aop.framework.JdkDynamicAopPro xy.invoke(JdkDynamicAopProxy.java:152)
at $Proxy1.getUser(Unknown Source)
at com.rusty.test.ejb.UserManagerSpringTest.main(User ManagerSpringTest.java:27)
Caused by: java.rmi.ServerException: EJBException:; nested exception is:
javax.ejb.EJBException: null; CausedByException is:
Error creating bean with name 'servicelayer-context' defined in URL [jar:file:/D:/jboss4/server/default/tmp/deploy/tmp38515MyGS.ear-contents/SwanEjb.jar!/beanRefContext.xml]: Instantiation of bean failed; nested exception is org.springframework.beans.FatalBeanException: Could not instantiate class [org.springframework.context.support.ClassPathXmlAp plicationContext]; constructor threw exception; nested exception is org.springframework.beans.factory.BeanCreationExce ption: Error creating bean with name 'mysqlSessionFactory' defined in class path resource [spring-system.xml]: Initialization of bean failed; nested exception is java.lang.NoClassDefFoundError: org/apache/commons/collections/SequencedHashMap
at org.jboss.ejb.plugins.LogInterceptor.handleExcepti on(LogInterceptor.java:347)
at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInt erceptor.java:195)
at org.jboss.ejb.plugins.ProxyFactoryFinderIntercepto r.invoke(ProxyFactoryFinderInterceptor.java:122)
at org.jboss.ejb.SessionContainer.internalInvoke(Sess ionContainer.java:624)
at org.jboss.ejb.Container.invoke(Container.java:854)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Nativ e Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Native MethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(De legatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.jboss.mx.interceptor.ReflectedDispatcher.invok e(ReflectedDispatcher.java:141)
at org.jboss.mx.server.Invocation.dispatch(Invocation .java:80)
at org.jboss.mx.server.Invocation.invoke(Invocation.j ava:72)
at org.jboss.mx.server.AbstractMBeanInvoker.invoke(Ab stractMBeanInvoker.java:242)
at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanSe rverImpl.java:642)
at org.jboss.invocation.jrmp.server.JRMPInvoker$MBean ServerAction.invoke(JRMPInvoker.java:775)
at org.jboss.invocation.jrmp.server.JRMPInvoker.invok e(JRMPInvoker.java:382)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Nativ e Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Native MethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(De legatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at sun.rmi.server.UnicastServerRef.dispatch(UnicastSe rverRef.java:294)
at sun.rmi.transport.Transport$1.run(Transport.java:1 53)
at java.security.AccessController.doPrivileged(Native Method)
at sun.rmi.transport.Transport.serviceCall(Transport. java:149)
at sun.rmi.transport.tcp.TCPTransport.handleMessages( TCPTransport.java:460)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandl er.run(TCPTransport.java:701)
at java.lang.Thread.run(Thread.java:595)
Caused by: javax.ejb.EJBException: null; CausedByException is:
Error creating bean with name 'servicelayer-context' defined in URL [jar:file:/D:/jboss4/server/default/tmp/deploy/tmp38515MyGS.ear-contents/SwanEjb.jar!/beanRefContext.xml]: Instantiation of bean failed; nested exception is org.springframework.beans.FatalBeanException: Could not instantiate class [org.springframework.context.support.ClassPathXmlAp plicationContext]; constructor threw exception; nested exception is org.springframework.beans.factory.BeanCreationExce ption: Error creating bean with name 'mysqlSessionFactory' defined in class path resource [spring-system.xml]: Initialization of bean failed; nested exception is java.lang.NoClassDefFoundError: org/apache/commons/collections/SequencedHashMap
at org.jboss.ejb.StatelessSessionEnterpriseContext.<i nit>(StatelessSessionEnterpriseContext.java:70)
at org.jboss.ejb.plugins.StatelessSessionInstancePool .create(StatelessSessionInstancePool.java:35)
at org.jboss.ejb.plugins.AbstractInstancePool.get(Abs tractInstancePool.java:146)
at org.jboss.ejb.plugins.StatelessSessionInstanceInte rceptor.invoke(StatelessSessionInstanceInterceptor .java:80)
at org.jboss.webservice.server.ServiceEndpointInterce ptor.invoke(ServiceEndpointInterceptor.java:51)
at org.jboss.ejb.plugins.CallValidationInterceptor.in voke(CallValidationInterceptor.java:48)
at org.jboss.ejb.plugins.AbstractTxInterceptor.invoke Next(AbstractTxInterceptor.java:105)
at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTran sactions(TxInterceptorCMT.java:316)
at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxIn terceptorCMT.java:149)
at org.jboss.ejb.plugins.SecurityInterceptor.invoke(S ecurityInterceptor.java:128)
at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInt erceptor.java:191)
... 25 more
13:16:45,192 WARN [SimpleRemoteStatelessSessionProxyFactoryBean] Could not invoke 'remove' on remote EJB proxy
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 creating bean with name 'servicelayer-context' defined in URL [jar:file:/D:/jboss4/server/default/tmp/deploy/tmp38515MyGS.ear-contents/SwanEjb.jar!/beanRefContext.xml]: Instantiation of bean failed; nested exception is org.springframework.beans.FatalBeanException: Could not instantiate class [org.springframework.context.support.ClassPathXmlAp plicationContext]; constructor threw exception; nested exception is org.springframework.beans.factory.BeanCreationExce ption: Error creating bean with name 'mysqlSessionFactory' defined in class path resource [spring-system.xml]: Initialization of bean failed; nested exception is java.lang.NoClassDefFoundError: org/apache/commons/collections/SequencedHashMap
at sun.rmi.server.UnicastServerRef.dispatch(UnicastSe rverRef.java:325)
at sun.rmi.transport.Transport$1.run(Transport.java:1 53)
at java.security.AccessController.doPrivileged(Native Method)
at sun.rmi.transport.Transport.serviceCall(Transport. java:149)
at sun.rmi.transport.tcp.TCPTransport.handleMessages( TCPTransport.java:460)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandl er.run(TCPTransport.java:701)
at java.lang.Thread.run(Thread.java:595)
at sun.rmi.transport.StreamRemoteCall.exceptionReceiv edFromServer(StreamRemoteCall.java:247)
at sun.rmi.transport.StreamRemoteCall.executeCall(Str eamRemoteCall.java:223)
at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:1 26)
at org.jboss.invocation.jrmp.server.JRMPInvoker_Stub. invoke(Unknown Source)
at org.jboss.invocation.jrmp.interfaces.JRMPInvokerPr oxy.invoke(JRMPInvokerProxy.java:118)
at org.jboss.invocation.InvokerInterceptor.invoke(Inv okerInterceptor.java:96)
at org.jboss.proxy.TransactionInterceptor.invoke(Tran sactionInterceptor.java:46)
at org.jboss.proxy.SecurityInterceptor.invoke(Securit yInterceptor.java:55)
at org.jboss.proxy.ejb.StatelessSessionInterceptor.in voke(StatelessSessionInterceptor.java:97)
at org.jboss.proxy.ClientContainer.invoke(ClientConta iner.java:86)
at $Proxy2.remove(Unknown Source)
at org.springframework.ejb.access.AbstractRemoteSlsbI nvokerInterceptor.removeSessionBeanInstance(Abstra ctRemoteSlsbInvokerInterceptor.java:161)
at org.springframework.ejb.access.SimpleRemoteSlsbInv okerInterceptor.releaseSessionBeanInstance(SimpleR emoteSlsbInvokerInterceptor.java:118)
at org.springframework.ejb.access.SimpleRemoteSlsbInv okerInterceptor.doInvoke(SimpleRemoteSlsbInvokerIn terceptor.java:95)
at org.springframework.ejb.access.AbstractRemoteSlsbI nvokerInterceptor.invoke(AbstractRemoteSlsbInvoker Interceptor.java:72)
at org.springframework.aop.framework.ReflectiveMethod Invocation.proceed(ReflectiveMethodInvocation.java :138)
at org.springframework.aop.framework.JdkDynamicAopPro xy.invoke(JdkDynamicAopProxy.java:152)
at $Proxy1.getUser(Unknown Source)
at com.rusty.test.ejb.UserManagerSpringTest.main(User ManagerSpringTest.java:27)
Caused by: java.rmi.ServerException: EJBException:; nested exception is:
javax.ejb.EJBException: null; CausedByException is:
Error creating bean with name 'servicelayer-context' defined in URL [jar:file:/D:/jboss4/server/default/tmp/deploy/tmp38515MyGS.ear-contents/SwanEjb.jar!/beanRefContext.xml]: Instantiation of bean failed; nested exception is org.springframework.beans.FatalBeanException: Could not instantiate class [org.springframework.context.support.ClassPathXmlAp plicationContext]; constructor threw exception; nested exception is org.springframework.beans.factory.BeanCreationExce ption: Error creating bean with name 'mysqlSessionFactory' defined in class path resource [spring-system.xml]: Initialization of bean failed; nested exception is java.lang.NoClassDefFoundError: org/apache/commons/collections/SequencedHashMap
at org.jboss.ejb.plugins.LogInterceptor.handleExcepti on(LogInterceptor.java:347)
at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInt erceptor.java:195)
at org.jboss.ejb.plugins.ProxyFactoryFinderIntercepto r.invoke(ProxyFactoryFinderInterceptor.java:122)
at org.jboss.ejb.SessionContainer.internalInvoke(Sess ionContainer.java:624)
at org.jboss.ejb.Container.invoke(Container.java:854)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Nativ e Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Native MethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(De legatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.jboss.mx.interceptor.ReflectedDispatcher.invok e(ReflectedDispatcher.java:141)
at org.jboss.mx.server.Invocation.dispatch(Invocation .java:80)
at org.jboss.mx.server.Invocation.invoke(Invocation.j ava:72)
at org.jboss.mx.server.AbstractMBeanInvoker.invoke(Ab stractMBeanInvoker.java:242)
at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanSe rverImpl.java:642)
at org.jboss.invocation.jrmp.server.JRMPInvoker$MBean ServerAction.invoke(JRMPInvoker.java:775)
at org.jboss.invocation.jrmp.server.JRMPInvoker.invok e(JRMPInvoker.java:382)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Nativ e Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Native MethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(De legatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at sun.rmi.server.UnicastServerRef.dispatch(UnicastSe rverRef.java:294)
at sun.rmi.transport.Transport$1.run(Transport.java:1 53)
at java.security.AccessController.doPrivileged(Native Method)
at sun.rmi.transport.Transport.serviceCall(Transport. java:149)
at sun.rmi.transport.tcp.TCPTransport.handleMessages( TCPTransport.java:460)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandl er.run(TCPTransport.java:701)
at java.lang.Thread.run(Thread.java:595)
Caused by: javax.ejb.EJBException: null; CausedByException is:
Error creating bean with name 'servicelayer-context' defined in URL [jar:file:/D:/jboss4/server/default/tmp/deploy/tmp38515MyGS.ear-contents/SwanEjb.jar!/beanRefContext.xml]: Instantiation of bean failed; nested exception is org.springframework.beans.FatalBeanException: Could not instantiate class [org.springframework.context.support.ClassPathXmlAp plicationContext]; constructor threw exception; nested exception is org.springframework.beans.factory.BeanCreationExce ption: Error creating bean with name 'mysqlSessionFactory' defined in class path resource [spring-system.xml]: Initialization of bean failed; nested exception is java.lang.NoClassDefFoundError: org/apache/commons/collections/SequencedHashMap
at org.jboss.ejb.StatelessSessionEnterpriseContext.<i nit>(StatelessSessionEnterpriseContext.java:70)
at org.jboss.ejb.plugins.StatelessSessionInstancePool .create(StatelessSessionInstancePool.java:35)
at org.jboss.ejb.plugins.AbstractInstancePool.get(Abs tractInstancePool.java:146)
at org.jboss.ejb.plugins.StatelessSessionInstanceInte rceptor.invoke(StatelessSessionInstanceInterceptor .java:80)
at org.jboss.webservice.server.ServiceEndpointInterce ptor.invoke(ServiceEndpointInterceptor.java:51)
at org.jboss.ejb.plugins.CallValidationInterceptor.in voke(CallValidationInterceptor.java:48)
at org.jboss.ejb.plugins.AbstractTxInterceptor.invoke Next(AbstractTxInterceptor.java:105)
at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTran sactions(TxInterceptorCMT.java:316)
at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxIn terceptorCMT.java:149)
at org.jboss.ejb.plugins.SecurityInterceptor.invoke(S ecurityInterceptor.java:128)
at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInt erceptor.java:191)
... 25 more