4 Replies Latest reply on Dec 5, 2008 4:46 PM by Srik Chin

    @Resource annotation question

    Srik Chin Newbie

      Hi,

      I am using @Resource annotation for injecting the data source as below:

      @Resource(name="OracleDS")
       private DataSource dataSource;


      But, I get a Null Pointer Exception.

      If i do a JNDI look up like this it works

      DataSource dataSource = (DataSource) context.lookup("java:/OracleDS");


      What am i doing wrong with injecting the data source?

      Thanks,
      Srikanth.