0 Replies Latest reply on Mar 5, 2012 11:26 AM by eduscapal

    Unable to inject jndi dependency into property

    eduscapal Newbie

      Hi, there!

       

      I'm a beginner here and I've been stuck in a problem for a good while already.

       

      As I can see, the application I'm working on was designed to allow Eclipse to automatically generate the respective EAR and make its deployment on JBoss (I'm using JBoss 5.1.0.GA).

       

      The application is run with Maven set to perform clean install. Eclipse builds it successfully and copies the EAR file to the JBoss server/default/deploy folder. Then, when I start the application through the JBoss admin page, I am informed by that page about a deployment problem caused by the WAR in the EAR, but that's shown in the last lines of the output. The console output shows much more information, however, and from that I got to distinguish the first error and the related class.

       

      The RunTimeException message:

       

      11:20:23,681 ERROR [[/acoClient]] Error configuring application listener of class org.client.system.presentation.servlet.TimerListener

      java.lang.RuntimeException: Unable to inject jndi dependency: env/org.client.system.presentation.servlet.TimerListener/timerServiceBean into property org.client.system.presentation.servlet.TimerListener.timerServiceBean: TimerServiceBean not bound

          at org.jboss.injection.JndiPropertyInjector.lookup(JndiPropertyInjector.java:82)

          at org.jboss.injection.JndiPropertyInjector.inject(JndiPropertyInjector.java:99)

       

      The TimerListener class:

       

      package org.client.system.presentation.servlet;

       

      import javax.ejb.EJB;

      import javax.servlet.ServletContextEvent;

      import javax.servlet.ServletContextListener;

       

      import org.client.system.business.beanInterface.TimerServiceBeanLocal;

       

      public class TimerListener implements ServletContextListener {

       

          @EJB

          private TimerServiceBeanLocal timerServiceBean;

         

          @Override

          public void contextDestroyed(ServletContextEvent arg0) {

              System.out.println("Stopping Timer");

              timerServiceBean.destroyTimer();

          }

       

          @Override

          public void contextInitialized(ServletContextEvent arg0) {

              System.out.println("Starting Timer");

              timerServiceBean.createTimer();

          }

      }

       

      Any idea on how I could solve this?

      Should I provide you more information, just ask.

       

      Thank you very much in advance!

       

      Cheers,

      eduscapal