Hi All,
I am using, EJB2.1, Spring 2.5.5, Weblogic server 10.0 and the IDE is Weblogic studio 10.2.
I have written a Stateless Session bean and trying to invoke that from a TestServlet class through JNDI. I am able to invoke the EJB method from servlet. It works fine.
The next step is to invoke the methods of other layer in EJB through Spring IoC (Dependency Injection). To achieve this, I am using @Autowired annotations. I am not able to get the bean instantiation into the local variable of EJB.
I am able to call the methods through the following piece of code (This doesnt use annotations).
I am getting the null pointer exception when i try to invoke the method as follows:Code:BeanFactoryLocator locator = ContextSingletonBeanFactoryLocator .getInstance("beanRefContext.xml"); BeanFactoryReference bfr = locator.useBeanFactory("businessBeanFactory"); BeanFactory factory = bfr.getFactory(); private IGeoCodeSearchEngine geoCodeSearchEngine = (IGeoCodeSearchEngine) factory .getBean("geoCodeSearchEngine");
I am not able to find where i am struck.Code:@Interceptors(TaxCalculatorAutowireInterceptor.class) public class TaxCalculator extends GenericSessionBean implements SessionBean { private static final long serialVersionUID = 1L; @Autowired private IGeoCodeSearchEngine geoCodeSearchEngine; geoCodeSearchEngine.searchGeoCode();
Please help me in this....




Reply With Quote
