0 Replies Latest reply on Oct 9, 2007 11:37 AM by tripp

    @EJB in a web service

    tripp Newbie

      I am having some problems with dependency injection of an ejb in a webservice on jboss 4.0.5. What am i doing wrong?

      The below code i have also tried @EJB without any parameters:
      Also i could not get the setter to work either. it never entered the setter and displayed the logs.

       RemoteLookupTest ps;
      /* public void setPersonService(RemoteLookupTest newPs){
       log.info("injecting new personService: "+newPs);
       this.ps = newPs;
       log.info("injected personService: ps="+ps);
       public Person queryPerson(long personId) throws RemoteException{

      this code gives me a null pointer exception at the ps.getName();

      this next code snippet is the next function in the web service and it works fine. this makes me think that the bean is deployed correctly.

       public void testLookupBean() throws RemoteException{
       Context ctx = new InitialContext();
       String jndiName = "LookupTest/remote";
       RemoteLookupTest obj = (RemoteLookupTest)ctx.lookup(jndiName);

      thanks in advance