Hi All,
I am trying to follow the Spring documentation and have defined a bean as below. I use Xdoclet to generate the session bean and Home and Remote interfaces. I am having a problem where getBeanFactory() always raises a NullPointerException. Looking at the AbstractEnterpriseBean code, it looks like Spring can't find the configuration xml file. What am I doing wrong? Any help is greatly appreciated.
thanks
Abhilash
/**
* @ejb.bean name="Login"
* display-name="Name for Login"
* description="Description for Login"
* jndi-name="ejb/Login"
* type="Stateless"
* view-type="remote"
*
* @ejb.home extends="javax.ejb.EJBHome"
*
* @ejb.interface extends="javax.ejb.EJBObject"
*
* @ejb.env-entry name="ejb/BeanFactoryPath" type="java.lang.String" value="/beanRefContext.xml"
*
*/
public class LoginBean extends AbstractStatelessSessionBean implements SessionBean, LoginBI {
private LoginBI myImpl = null;
protected void onEjbCreate() throws CreateException {
myImpl = (LoginBI) getBeanFactory().getBean(RNCSApplicationContext.LO GIN_BEAN);
}
/**
* @see com.united.rncs.interfaces.LoginBI#login(java.lang .String, java.lang.String)
*
* @ejb.interface-method
*/
public RncsUser login(String user, String password) {
return myImpl.login(user, password);
}
}


Reply With Quote