[jboss-user] [EJB 3.0] - Re: Jboss 5 Beta 4 Resource Injection problem in Ejb 3

jaikiran do-not-reply at jboss.com
Sat Feb 16 09:17:54 EST 2008


Works fine on JBoss5 Beta-4 for me. I have a similar EJB (but without the Spring related stuff):

@Stateless 
  | @Remote ({UserManager.class})
  | @RemoteBinding (jndiBinding = "RemoteUserManagerBean")
  | public class UserManagerBean implements UserManager {
  | 	
  | 	/**
  | 	 * Instance of logger
  | 	 */
  | 	private static Logger logger = Logger.getLogger(UserManagerBean.class);
  | 	
  | 	@PersistenceContext
  | 	private EntityManager entityManager;
  | 	
  | 	@Resource
  | 	private SessionContext sessionContext;
  | 	
  | 	@Resource(name = "jdbc/TestDs", type = DataSource.class, shareable = true, mappedName = "java:DefaultDS")
  | 	private DataSource dataSource;
  | 	
  | 	@PostConstruct
  | 	public void init() {
  | 		setDataSource(dataSource);
  | 	}
  | 	
  | 	private void setDataSource(DataSource ds) {
  | 		System.out.println("Do nothing ---> " + ds);
  | 	}
  | }

The application deploys fine and accesing this bean too works fine.

Are you sure that the datasource has been deployed, before this bean is being accessed?

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4129821#4129821

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4129821



More information about the jboss-user mailing list