[jboss-user] [Beginner's Corner] - Unable to inject jndi dependency into property

eduscapal do-not-reply at jboss.com
Mon Mar 5 11:26:44 EST 2012


eduscapal [https://community.jboss.org/people/eduscapal] created the discussion

"Unable to inject jndi dependency into property"

To view the discussion, visit: https://community.jboss.org/message/721590#721590

--------------------------------------------------------------
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
--------------------------------------------------------------

Reply to this message by going to Community
[https://community.jboss.org/message/721590#721590]

Start a new discussion in Beginner's Corner at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2075]

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/jboss-user/attachments/20120305/fbae2877/attachment.html 


More information about the jboss-user mailing list