2 Replies Latest reply: Dec 30, 2008 9:12 PM by Ragav Gomatam RSS

How to inject spring-bean with @Resource annotation

i f Newbie

Hello.

I'm deploying my Spring2.5.6 application to JBoss AS 5.0.0GA.
And I'm using @Resource annotation for injecting a spring-bean into annother spring-bean.
Then, I encountered the following error.

javax.ejb.EJBException: java.lang.ClassNotFoundException: test.bean.ITestSubBean from BaseClassLoader@1706444{VFSClassLoaderPolicy@1c6c5b7{name=vfsfile:/D:/ProgramData/APServer/jboss-5.0.0.GA/server/default/deploy/jbossweb.sar/ domain=ClassLoaderDomain@c9630a{name=DefaultDomain parentPolicy=BEFORE parent=org.jboss.system.NoAnnotationURLClassLoader@cdfc9c} roots=[MemoryContextHandler@14587704[path= context=vfsmemory://a2b4m5d-y9l0uf-fp3qt38v-1-fp3qtcud-x real=vfsmemory://a2b4m5d-y9l0uf-fp3qt38v-1-fp3qtcud-x], FileHandler@26864201[path=jbossweb.sar context=file:/D:/ProgramData/APServer/jboss-5.0.0.GA/server/default/deploy/ real=file:/D:/ProgramData/APServer/jboss-5.0.0.GA/server/default/deploy/jbossweb.sar/], DelegatingHandler@31751735[path=jbossweb.sar/jasper-jdt.jar context=file:/D:/ProgramData/APServer/jboss-5.0.0.GA/server/default/deploy/ real=file:/D:/ProgramData/APServer/jboss-5.0.0.GA/server/default/deploy/jbossweb.sar/jasper-jdt.jar], DelegatingHandler@1732531[path=jbossweb.sar/jboss-web-service.jar context=file:/D:/ProgramData/APServer/jboss-5.0.0.GA/server/default/deploy/ real=file:/D:/ProgramData/APServer/jboss-5.0.0.GA/server/default/deploy/jbossweb.sar/jboss-web-service.jar], DelegatingHandler@26966228[path=jbossweb.sar/jbossweb.jar context=file:/D:/ProgramData/APServer/jboss-5.0.0.GA/server/default/deploy/ real=file:/D:/ProgramData/APServer/jboss-5.0.0.GA/server/default/deploy/jbossweb.sar/jbossweb.jar], DelegatingHandler@1686435[path=jbossweb.sar/jstl.jar context=file:/D:/ProgramData/APServer/jboss-5.0.0.GA/server/default/deploy/ real=file:/D:/ProgramData/APServer/jboss-5.0.0.GA/server/default/deploy/jbossweb.sar/jstl.jar], DelegatingHandler@23976389[path=jbossweb.sar/jsf-libs/jboss-faces.jar context=file:/D:/ProgramData/APServer/jboss-5.0.0.GA/server/default/deploy/ real=file:/D:/ProgramData/APServer/jboss-5.0.0.GA/server/default/deploy/jbossweb.sar/jsf-libs/jboss-faces.jar], DelegatingHandler@16001737[path=jbossweb.sar/jsf-libs/jsf-api.jar context=file:/D:/ProgramData/APServer/jboss-5.0.0.GA/server/default/deploy/ real=file:/D:/ProgramData/APServer/jboss-5.0.0.GA/server/default/deploy/jbossweb.sar/jsf-libs/jsf-api.jar], DelegatingHandler@2428757[path=jbossweb.sar/jsf-libs/jsf-impl.jar context=file:/D:/ProgramData/APServer/jboss-5.0.0.GA/server/default/deploy/ real=file:/D:/ProgramData/APServer/jboss-5.0.0.GA/server/default/deploy/jbossweb.sar/jsf-libs/jsf-impl.jar]] delegates=null exported=[org.eclipse.jdt.internal.compiler.env, com.sun.faces.config.processor, org.apache.taglibs.standard.tag.rt.sql, com.sun.faces.spi, org.jboss.web.tomcat.service.session, org.eclipse.jdt.internal.compiler.codegen, org.apache.taglibs.standard.tag.el.xml, org.apache.taglibs.standard.lang.jstl, org.apache.taglibs.standard.extra.spath, org.apache.taglibs.standard, org.apache.tomcat.util.net, com.sun.faces.renderkit.html_basic, org.jboss.net.protocol.jndi, org.apache.catalina.core, com.sun.faces.io, javax.servlet.jsp.jstl.tlv, org.apache.jasper.runtime, org.apache.jasper.compiler.tagplugin, com.sun.faces.vendor, org.apache.tomcat.util.json, org.jboss.web.jsf.integration.config, org.eclipse.jdt.internal.compiler.parser.diagnose, javax.servlet.jsp.jstl.fmt, org.jboss.web.tomcat.filters, org.apache.catalina.ssi, org.apache.taglibs.standard.lang.jstl.parser, org.apache.catalina.deploy, org.apache.naming.factory.webservices, org.apache.tomcat.bayeux.request, org.jboss.web.tomcat.metadata, org.jboss.web.tomcat.statistics, com.sun.faces.taglib.jsf_core, org.jboss.web.tomcat.security.jaspi, org.apache.tomcat.bayeux, org.apache.tomcat.util.http, com.sun.faces.ext.component, org.apache.el.parser, org.apache.tomcat.util.net.jsse.res, org.apache.catalina.connector, org.eclipse.jdt.internal.compiler.lookup, org.apache.catalina.authenticator, org.eclipse.jdt.internal.core.util, org.apache.jasper.servlet, org.apache.catalina.ant.jmx, org.apache.tomcat.util.digester, com.sun.faces.config.configprovider, org.apache.catalina.manager.host, org.apache.naming.java, com.sun.faces, org.eclipse.jdt.internal.compiler, org.apache.catalina.util, org.apache.catalina.ant, org.apache.cometd.bayeux, org.apache.catalina.manager, org.apache.catalina.startup, org.apache.tomcat.util.http.fileupload, javax.faces.event, org.jboss.web.php, org.eclipse.jdt.internal.compiler.util, com.sun.faces.application, org.apache.jasper.xmlparser, org.apache.taglibs.standard.tag.el.sql, org.apache.jasper.compiler, org.apache.taglibs.standard.lang.jstl.test, org.apache.catalina.security, org.apache.coyote.http11, javax.faces, org.apache.jasper.util, javax.faces.context, org.apache.jasper.tagplugins.jstl.core, javax.faces.webapp, org.apache.tomcat.util.net.jsse, org.apache.el, org.apache.tomcat.util.buf.res, org.apache.catalina.mbeans, org.apache.coyote, org.jboss.web.tomcat.service.deployers, org.apache.coyote.memory, org.apache.taglibs.standard.tag.common.xml, org.apache.naming.resources.jndi, org.eclipse.jdt.core.compiler, org.jboss.net.ssl, org.apache.jasper.security, javax.servlet.jsp.jstl.sql, org.apache.taglibs.standard.tei, com.sun.faces.lifecycle, org.apache.catalina.manager.util, org.apache.taglibs.standard.tag.common.core, org.apache.tomcat.util.modeler, org.apache.coyote.ajp, com.sun.faces.config, org.apache.tomcat.util.res, com.sun.faces.context, org.jboss.web.tomcat.security.login, org.eclipse.jdt.internal.compiler.flow, org.apache.tomcat.jni, org.apache.naming, com.sun.faces.ext.validator, org.jboss.web.cluster, org.jboss.web.tomcat.security.jaspi.modules, org.apache.tomcat.util.buf, org.eclipse.jdt.internal.compiler.problem, org.apache.tomcat.util.http.mapper, com.sun.faces.util, com.sun.faces.resources, javax.faces.validator, org.apache.taglibs.standard.tag.common.fmt, com.sun.faces.el, org.jboss.web.tomcat.security.authenticators, org.apache.jasper.el, org.jboss.web.rewrite, META-INF, org.apache.taglibs.standard.resources, org.eclipse.jdt.internal.compiler.classfmt, org.apache.tomcat.util.http.res, javax.faces.component.html, org.apache.naming.factory, org.jboss.web.tomcat.service.sso, org.jboss.web.tomcat.service.jca, org.eclipse.jdt.internal.compiler.parser, org.apache.jasper, javax.faces.lifecycle, org.apache.taglibs.standard.tag.rt.fmt, org.jboss.web.tomcat.service.session.notification, org.apache.tomcat.util, com.sun.faces.taglib, org.apache.catalina.session, org.apache.taglibs.standard.tlv, com.sun.faces.renderkit, org.apache.taglibs.standard.tag.el.fmt, org.apache.catalina, org.apache.jasper.tagplugins.jstl, com.sun.faces.taglib.html_basic, META-INF.services, org.apache.jasper.resources, org.jboss.web.tomcat.security, org.jboss.web.tomcat.service.injection, com.sun.faces.ext.render, org.apache.tomcat.util.modeler.modules, org.apache.catalina.loader, org.apache.naming.resources, javax.faces.convert, org.apache.taglibs.standard.functions, org.apache.el.lang, org.eclipse.jdt.internal.compiler.batch, com.sun.faces.ext.taglib, org.jboss.web.tomcat.servlets, org.apache.el.util, org.jboss.web.tomcat.service, javax.faces.el, org.apache.taglibs.standard.lang.jstl.test.beans, org.jboss.web.tomcat.service.jasper, javax.faces.application, org.eclipse.jdt.core.compiler.batch, org.jboss.web.cluster.advertise, org.apache.taglibs.standard.tag.el.core, org.eclipse.jdt.internal.compiler.ast, org.jboss.web.jsf.integration.injection, com.sun.faces.scripting, javax.faces.render, org.jboss.servlet.http, org.apache.catalina.valves, org.apache.catalina.realm, org.jboss.web.jsf.integration.serialization, org.apache.tomcat.util.net.res, org.apache.tomcat.util.log, org.apache.coyote.http11.filters, org.apache.taglibs.standard.tag.rt.xml, javax.servlet.jsp.jstl.core, org.apache.catalina.servlets, org.apache, org.apache.taglibs.standard.tag.rt.core, javax.faces.component, org.apache.taglibs.standard.lang.support, org.eclipse.jdt.internal.compiler.impl, com.sun.faces.mgbean, org.apache.taglibs.standard.tag.common.sql, javax.faces.model, ] <IMPORT-ALL>NON_EMPTY}}
 at org.jboss.web.tomcat.service.injection.WebResourceHandler.loadXmlResourceEnvRefs(WebResourceHandler.java:267)
 at org.jboss.web.tomcat.service.injection.WebResourceHandler.loadXml(WebResourceHandler.java:307)
 at org.jboss.web.tomcat.service.TomcatInjectionContainer.processMetadata(TomcatInjectionContainer.java:544)
 at org.jboss.web.tomcat.service.WebCtxLoader.start(WebCtxLoader.java:158)
 at org.apache.catalina.core.StandardContext.start(StandardContext.java:4272)
 at org.jboss.web.tomcat.service.deployers.TomcatDeployment.performDeployInternal(TomcatDeployment.java:367)
 at org.jboss.web.tomcat.service.deployers.TomcatDeployment.performDeploy(TomcatDeployment.java:146)
 at org.jboss.web.deployers.AbstractWarDeployment.start(AbstractWarDeployment.java:460)
 at org.jboss.web.deployers.WebModule.startModule(WebModule.java:118)
 at org.jboss.web.deployers.WebModule.start(WebModule.java:96)
 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:585)
 at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:157)
 at org.jboss.mx.server.Invocation.dispatch(Invocation.java:96)
 at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
 at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
 at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:668)
 at org.jboss.system.microcontainer.ServiceProxy.invoke(ServiceProxy.java:206)
 at $Proxy36.start(Unknown Source)
 at org.jboss.system.microcontainer.StartStopLifecycleAction.installAction(StartStopLifecycleAction.java:42)
 at org.jboss.system.microcontainer.StartStopLifecycleAction.installAction(StartStopLifecycleAction.java:37)
 at org.jboss.dependency.plugins.action.SimpleControllerContextAction.simpleInstallAction(SimpleControllerContextAction.java:62)
 at org.jboss.dependency.plugins.action.AccessControllerContextAction.install(AccessControllerContextAction.java:71)
 at org.jboss.dependency.plugins.AbstractControllerContextActions.install(AbstractControllerContextActions.java:51)
 at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:348)
 at org.jboss.system.microcontainer.ServiceControllerContext.install(ServiceControllerContext.java:286)
 at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:1598)
 at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:934)
 at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1062)
 at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:984)
 at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:822)
 at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:553)
 at org.jboss.system.ServiceController.doChange(ServiceController.java:688)
 at org.jboss.system.ServiceController.start(ServiceController.java:460)
 at org.jboss.system.deployers.ServiceDeployer.start(ServiceDeployer.java:146)
 at org.jboss.system.deployers.ServiceDeployer.deploy(ServiceDeployer.java:104)
 at org.jboss.system.deployers.ServiceDeployer.deploy(ServiceDeployer.java:45)
 at org.jboss.deployers.spi.deployer.helpers.AbstractSimpleRealDeployer.internalDeploy(AbstractSimpleRealDeployer.java:62)
 at org.jboss.deployers.spi.deployer.helpers.AbstractRealDeployer.deploy(AbstractRealDeployer.java:50)
 at org.jboss.deployers.plugins.deployers.DeployerWrapper.deploy(DeployerWrapper.java:171)
 at org.jboss.deployers.plugins.deployers.DeployersImpl.doDeploy(DeployersImpl.java:1439)
 at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:1157)
 at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:1178)
 at org.jboss.deployers.plugins.deployers.DeployersImpl.install(DeployersImpl.java:1098)
 at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:348)
 at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:1598)
 at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:934)
 at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1062)
 at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:984)
 at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:822)
 at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:553)
 at org.jboss.deployers.plugins.deployers.DeployersImpl.process(DeployersImpl.java:781)
 at org.jboss.deployers.plugins.main.MainDeployerImpl.process(MainDeployerImpl.java:545)
 at org.jboss.system.server.profileservice.ProfileServiceBootstrap.loadProfile(ProfileServiceBootstrap.java:304)
 at org.jboss.system.server.profileservice.ProfileServiceBootstrap.start(ProfileServiceBootstrap.java:205)
 at org.jboss.bootstrap.AbstractServerImpl.start(AbstractServerImpl.java:405)
 at org.jboss.Main.boot(Main.java:209)
 at org.jboss.Main$1.run(Main.java:547)
 at java.lang.Thread.run(Thread.java:595)
Caused by: java.lang.ClassNotFoundException: test.bean.ITestSubBean from BaseClassLoader@1706444{VFSClassLoaderPolicy@1c6c5b7{name=vfsfile:/D:/ProgramData/APServer/jboss-5.0.0.GA/server/default/deploy/jbossweb.sar/ domain=ClassLoaderDomain@c9630a{name=DefaultDomain parentPolicy=BEFORE parent=org.jboss.system.NoAnnotationURLClassLoader@cdfc9c} roots=[MemoryContextHandler@14587704[path= context=vfsmemory://a2b4m5d-y9l0uf-fp3qt38v-1-fp3qtcud-x real=vfsmemory://a2b4m5d-y9l0uf-fp3qt38v-1-fp3qtcud-x], FileHandler@26864201[path=jbossweb.sar context=file:/D:/ProgramData/APServer/jboss-5.0.0.GA/server/default/deploy/ real=file:/D:/ProgramData/APServer/jboss-5.0.0.GA/server/default/deploy/jbossweb.sar/], DelegatingHandler@31751735[path=jbossweb.sar/jasper-jdt.jar context=file:/D:/ProgramData/APServer/jboss-5.0.0.GA/server/default/deploy/ real=file:/D:/ProgramData/APServer/jboss-5.0.0.GA/server/default/deploy/jbossweb.sar/jasper-jdt.jar], DelegatingHandler@1732531[path=jbossweb.sar/jboss-web-service.jar context=file:/D:/ProgramData/APServer/jboss-5.0.0.GA/server/default/deploy/ real=file:/D:/ProgramData/APServer/jboss-5.0.0.GA/server/default/deploy/jbossweb.sar/jboss-web-service.jar], DelegatingHandler@26966228[path=jbossweb.sar/jbossweb.jar context=file:/D:/ProgramData/APServer/jboss-5.0.0.GA/server/default/deploy/ real=file:/D:/ProgramData/APServer/jboss-5.0.0.GA/server/default/deploy/jbossweb.sar/jbossweb.jar], DelegatingHandler@1686435[path=jbossweb.sar/jstl.jar context=file:/D:/ProgramData/APServer/jboss-5.0.0.GA/server/default/deploy/ real=file:/D:/ProgramData/APServer/jboss-5.0.0.GA/server/default/deploy/jbossweb.sar/jstl.jar], DelegatingHandler@23976389[path=jbossweb.sar/jsf-libs/jboss-faces.jar context=file:/D:/ProgramData/APServer/jboss-5.0.0.GA/server/default/deploy/ real=file:/D:/ProgramData/APServer/jboss-5.0.0.GA/server/default/deploy/jbossweb.sar/jsf-libs/jboss-faces.jar], DelegatingHandler@16001737[path=jbossweb.sar/jsf-libs/jsf-api.jar context=file:/D:/ProgramData/APServer/jboss-5.0.0.GA/server/default/deploy/ real=file:/D:/ProgramData/APServer/jboss-5.0.0.GA/server/default/deploy/jbossweb.sar/jsf-libs/jsf-api.jar], DelegatingHandler@2428757[path=jbossweb.sar/jsf-libs/jsf-impl.jar context=file:/D:/ProgramData/APServer/jboss-5.0.0.GA/server/default/deploy/ real=file:/D:/ProgramData/APServer/jboss-5.0.0.GA/server/default/deploy/jbossweb.sar/jsf-libs/jsf-impl.jar]] delegates=null exported=[org.eclipse.jdt.internal.compiler.env, com.sun.faces.config.processor, org.apache.taglibs.standard.tag.rt.sql, com.sun.faces.spi, org.jboss.web.tomcat.service.session, org.eclipse.jdt.internal.compiler.codegen, org.apache.taglibs.standard.tag.el.xml, org.apache.taglibs.standard.lang.jstl, org.apache.taglibs.standard.extra.spath, org.apache.taglibs.standard, org.apache.tomcat.util.net, com.sun.faces.renderkit.html_basic, org.jboss.net.protocol.jndi, org.apache.catalina.core, com.sun.faces.io, javax.servlet.jsp.jstl.tlv, org.apache.jasper.runtime, org.apache.jasper.compiler.tagplugin, com.sun.faces.vendor, org.apache.tomcat.util.json, org.jboss.web.jsf.integration.config, org.eclipse.jdt.internal.compiler.parser.diagnose, javax.servlet.jsp.jstl.fmt, org.jboss.web.tomcat.filters, org.apache.catalina.ssi, org.apache.taglibs.standard.lang.jstl.parser, org.apache.catalina.deploy, org.apache.naming.factory.webservices, org.apache.tomcat.bayeux.request, org.jboss.web.tomcat.metadata, org.jboss.web.tomcat.statistics, com.sun.faces.taglib.jsf_core, org.jboss.web.tomcat.security.jaspi, org.apache.tomcat.bayeux, org.apache.tomcat.util.http, com.sun.faces.ext.component, org.apache.el.parser, org.apache.tomcat.util.net.jsse.res, org.apache.catalina.connector, org.eclipse.jdt.internal.compiler.lookup, org.apache.catalina.authenticator, org.eclipse.jdt.internal.core.util, org.apache.jasper.servlet, org.apache.catalina.ant.jmx, org.apache.tomcat.util.digester, com.sun.faces.config.configprovider, org.apache.catalina.manager.host, org.apache.naming.java, com.sun.faces, org.eclipse.jdt.internal.compiler, org.apache.catalina.util, org.apache.catalina.ant, org.apache.cometd.bayeux, org.apache.catalina.manager, org.apache.catalina.startup, org.apache.tomcat.util.http.fileupload, javax.faces.event, org.jboss.web.php, org.eclipse.jdt.internal.compiler.util, com.sun.faces.application, org.apache.jasper.xmlparser, org.apache.taglibs.standard.tag.el.sql, org.apache.jasper.compiler, org.apache.taglibs.standard.lang.jstl.test, org.apache.catalina.security, org.apache.coyote.http11, javax.faces, org.apache.jasper.util, javax.faces.context, org.apache.jasper.tagplugins.jstl.core, javax.faces.webapp, org.apache.tomcat.util.net.jsse, org.apache.el, org.apache.tomcat.util.buf.res, org.apache.catalina.mbeans, org.apache.coyote, org.jboss.web.tomcat.service.deployers, org.apache.coyote.memory, org.apache.taglibs.standard.tag.common.xml, org.apache.naming.resources.jndi, org.eclipse.jdt.core.compiler, org.jboss.net.ssl, org.apache.jasper.security, javax.servlet.jsp.jstl.sql, org.apache.taglibs.standard.tei, com.sun.faces.lifecycle, org.apache.catalina.manager.util, org.apache.taglibs.standard.tag.common.core, org.apache.tomcat.util.modeler, org.apache.coyote.ajp, com.sun.faces.config, org.apache.tomcat.util.res, com.sun.faces.context, org.jboss.web.tomcat.security.login, org.eclipse.jdt.internal.compiler.flow, org.apache.tomcat.jni, org.apache.naming, com.sun.faces.ext.validator, org.jboss.web.cluster, org.jboss.web.tomcat.security.jaspi.modules, org.apache.tomcat.util.buf, org.eclipse.jdt.internal.compiler.problem, org.apache.tomcat.util.http.mapper, com.sun.faces.util, com.sun.faces.resources, javax.faces.validator, org.apache.taglibs.standard.tag.common.fmt, com.sun.faces.el, org.jboss.web.tomcat.security.authenticators, org.apache.jasper.el, org.jboss.web.rewrite, META-INF, org.apache.taglibs.standard.resources, org.eclipse.jdt.internal.compiler.classfmt, org.apache.tomcat.util.http.res, javax.faces.component.html, org.apache.naming.factory, org.jboss.web.tomcat.service.sso, org.jboss.web.tomcat.service.jca, org.eclipse.jdt.internal.compiler.parser, org.apache.jasper, javax.faces.lifecycle, org.apache.taglibs.standard.tag.rt.fmt, org.jboss.web.tomcat.service.session.notification, org.apache.tomcat.util, com.sun.faces.taglib, org.apache.catalina.session, org.apache.taglibs.standard.tlv, com.sun.faces.renderkit, org.apache.taglibs.standard.tag.el.fmt, org.apache.catalina, org.apache.jasper.tagplugins.jstl, com.sun.faces.taglib.html_basic, META-INF.services, org.apache.jasper.resources, org.jboss.web.tomcat.security, org.jboss.web.tomcat.service.injection, com.sun.faces.ext.render, org.apache.tomcat.util.modeler.modules, org.apache.catalina.loader, org.apache.naming.resources, javax.faces.convert, org.apache.taglibs.standard.functions, org.apache.el.lang, org.eclipse.jdt.internal.compiler.batch, com.sun.faces.ext.taglib, org.jboss.web.tomcat.servlets, org.apache.el.util, org.jboss.web.tomcat.service, javax.faces.el, org.apache.taglibs.standard.lang.jstl.test.beans, org.jboss.web.tomcat.service.jasper, javax.faces.application, org.eclipse.jdt.core.compiler.batch, org.jboss.web.cluster.advertise, org.apache.taglibs.standard.tag.el.core, org.eclipse.jdt.internal.compiler.ast, org.jboss.web.jsf.integration.injection, com.sun.faces.scripting, javax.faces.render, org.jboss.servlet.http, org.apache.catalina.valves, org.apache.catalina.realm, org.jboss.web.jsf.integration.serialization, org.apache.tomcat.util.net.res, org.apache.tomcat.util.log, org.apache.coyote.http11.filters, org.apache.taglibs.standard.tag.rt.xml, javax.servlet.jsp.jstl.core, org.apache.catalina.servlets, org.apache, org.apache.taglibs.standard.tag.rt.core, javax.faces.component, org.apache.taglibs.standard.lang.support, org.eclipse.jdt.internal.compiler.impl, com.sun.faces.mgbean, org.apache.taglibs.standard.tag.common.sql, javax.faces.model, ] <IMPORT-ALL>NON_EMPTY}}
 at org.jboss.classloader.spi.base.BaseClassLoader.loadClass(BaseClassLoader.java:385)
 at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
 at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
 at java.lang.Class.forName0(Native Method)
 at java.lang.Class.forName(Class.java:164)
 at org.jboss.web.tomcat.service.injection.WebResourceHandler.loadXmlResourceEnvRefs(WebResourceHandler.java:212)
 ... 60 more


The following is my Bean classes and interfaces.
package test.bean;

public interface ITestBean {
 public String execute();
}

package test.bean;

import javax.annotation.Resource;

public class TestBean implements ITestBean {
 @Resource
 private ITestSubBean testSubBean;

 public String execute() {
 return testSubBean.execute();
 }

 public ITestSubBean getSubLogicBean() {
 return testSubBean;
 }

 public void setSubLogicBean(ITestSubBean testSubBean) {
 this.testSubBean = testSubBean;
 }
}

package test.bean;

public interface ITestSubBean {
 public String execute();
}

package test.bean;

public class TestSubBean implements ITestSubBean {
 public String execute() {
 return this.getClass().getName() + " was executed.";
 }
}


The following is my ApplicationContext.
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/schema/context"
 xsi:schemaLocation="http://www.springframework.org/schema/beans
 http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
 http://www.springframework.org/schema/context
 http://www.springframework.org/schema/context/spring-context-2.5.xsd">
 <context:annotation-config />
 <bean id="testBean" class="test.bean.TestBean" />
 <bean id="testSubBean" class="test.bean.TestSubBean" />
</beans>


Using @Resource annotation for spring-bean injection, EJBException has thrown by container.
How can I use @Resource annotation for spring-bean injection?