I am trying to use the Autowiring Interceptor for EJB 3...
At root or ear file is "beanRefContext.xml"Code:atStateless atInterceptors(SpringBeanAutowiringInterceptor.class) public class MyBean implements MyBeanLocal, MyBeanRemote { atAutowired private MyDao _myDao; ... }
Also at root of ear file is myContext.xml with a single bean definition:Code:... <bean id="myContext" class="org.springframework.context.support.ClassPathXmlAp licationContext"> <constructor-arg value="myContext.xml"/> </bean> ...
When I run my app I get the following:Code:... <bean id="myDao" class="com.foo.MyDao"/> ...
Am I missing something here? Are my config files in the correct location? I am using JBoss 4.2.2/JDK 5.0Code:Caused by: org.springframework.beans.factory.access.BootstrapException: Unable to return specified BeanFactory instance: factory key [null], from group with resource name [classpath*:beanRefContext.xml]; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No unique bean of type [org.springframework.beans.factory.BeanFactory] is defined: expected single bean but found 0 at org.springframework.beans.factory.access.SingletonBeanFactoryLocator.useBeanFactory(SingletonBeanFactoryLocator.java:410) at org.springframework.ejb.interceptor.SpringBeanAutowiringInterceptor.getBeanFactoryReference(SpringBeanAutowiringInterceptor.java:139) at org.springframework.ejb.interceptor.SpringBeanAutowiringInterceptor.getBeanFactory(SpringBeanAutowiringInterceptor.java:120) at org.springframework.ejb.interceptor.SpringBeanAutowiringInterceptor.autowireBean(SpringBeanAutowiringInterceptor.java:100) 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.ejb3.interceptor.LifecycleInvocationContextImpl.proceed(LifecycleInvocationContextImpl.java:131) at org.jboss.ejb3.interceptor.LifecycleInterceptorHandler.postConstruct(LifecycleInterceptorHandler.java:109) ... 71 more
Thanks


Reply With Quote

