In the EJB3 there is a new feature called dependency injection.  With this new 
feature one doesn't need using the JNDI lookup calls. I try use this but it 
doesn't work. I get NULL-Pointer Exception. 

Here are my codes:


  | @Remote
  | public interface MyTestBeanRemote {
  |   public String test(String msg);
  | }
  | 


  | @Stateless
  | public class MyTestBeanImpl implements  MyTestBeanRemote {
  |     public String test(String msg) {
  |             return "Hello, " + msg;
  |     }
  | }
  | 
  | 


  | public class TestEJB3Client4 {
  |     @EJB
  |     private static MyTestBeanRemote beanRemote;
  | 
  |     public static void main(String[] args) {
  |             System.out.println(beanRemote.test("I am here."));
  |     }
  | }
  | 

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

Reply to the post : 
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4149663
_______________________________________________
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user

Reply via email to