users@glassfish.java.net

Re: Injection of ref to EJB fails

From: <glassfish_at_javadesktop.org>
Date: Tue, 20 Mar 2007 06:53:09 PST

Hi

Thanks for your answer. I already had a look at the suggested URLs, but I still have the problem; moreover, it seems related to the order EJB modules are deployed to GlassFish.

Here's the exception I get when it's trying to inject a reference to SessionStore into the MessageBrokerBean

[#|2007-03-20T15:42:41.094+0100|SEVERE|sun-appserver-pe9.0|javax.enterprise.system.container.ejb.mdb|_ThreadID=21;_ThreadName=p: thread-pool-1; w: 3;limbsMessageBrokerEJB:MessageBrokerBean;com.sun.enterprise.InjectionException: Exception attempting to inject Unresolved Ejb-Ref SessionStoreBean_at_jndi: ejb/SessionStore_at_null@org.limbs.broker.session.SessionStore_at_Session@null into class org.limbs.broker.messageBroker.MessageBrokerBean;_RequestID=51b8584d-0a64-41e5-bee6-eb6c36d64646;|MDB00050: Message-driven bean [limbsMessageBrokerEJB:MessageBrokerBean]: Exception in creating message-driven ejb : [com.sun.enterprise.InjectionException: Exception attempting to inject Unresolved Ejb-Ref SessionStoreBean_at_jndi: ejb/SessionStore_at_null@org.limbs.broker.session.SessionStore_at_Session@null into class org.limbs.broker.messageBroker.MessageBrokerBean]|#]
 
The SessionStore interface is defined as:
@Remote
public interface SessionStore {

The SessionStoreBean class is defined as:
@Stateless
public class SessionStoreBean implements SessionStore {

ejb-jar for the SessionStore EJB module states:
<session>
            <ejb-name>SessionStoreBean</ejb-name>
            <mapped-name>ejb/SessionStore</mapped-name>
            <ejb-class>org.limbs.broker.session.SessionStoreBean</ejb-class>
            <transaction-type>Container</transaction-type>

The MessageBrokerBean is defined as:
@MessageDriven(mappedName = "jms/LimbsCentralQueue", activationConfig = {
    @ActivationConfigProperty(propertyName = "acknowledgeMode", propertyValue = "Auto-acknowledge"),
    @ActivationConfigProperty(propertyName = "destinationType", propertyValue = "javax.jms.Queue")})
    public class MessageBrokerBean implements MessageListener {
    // EJB References
    @EJB(name="SessionCollectorBean", mappedName="ejb/SessionCollector")
    private SessionCollector sessionCollector;
    @EJB(name="SessionStoreBean", mappedName="ejb/SessionStore")
    private SessionStore sessionStore;

I don't understand why I'm getting this error.

Thanks for your help

Jean-Noel Colin
[Message sent by forum member 'jncolin' (jncolin)]

http://forums.java.net/jive/thread.jspa?messageID=208956