users@glassfish.java.net

InjectionException when attempted to send message using MDB

From: <glassfish_at_javadesktop.org>
Date: Tue, 17 Jul 2007 02:40:17 PDT

Hi all,
I have created simple MDB which listening to Map using NetBeans5.5, I have created session to allow my web-app to send mail to user and I intialized it using @Resource(name="mail/wineappMail" )
and I have created simple client using servlet that inject Topic connectionFactory and Topic and send msg to topic that send it to mail user using
 Transport.send(msg);
but when I run my application I got this exception
com.sun.enterprise.InjectionException: Exception attempting to inject Res-Ref-Env-Property: mail/wineappMail_at_javax.mail.Session@ resolved as: jndi: mail/wineappMail_at_res principal: null_at_mail: null
Database Vendor : null
Create Tables at Deploy : false
Delete Tables at Undeploy : false into class ejb.StatusMailerBean
        at com.sun.enterprise.util.InjectionManagerImpl._inject(InjectionManagerImpl.java:373)
        at com.sun.enterprise.util.InjectionManagerImpl.inject(InjectionManagerImpl.java:193)
        at com.sun.enterprise.util.InjectionManagerImpl.injectInstance(InjectionManagerImpl.java:114)
        at com.sun.ejb.containers.MessageBeanContainer.createMessageDrivenEJB(MessageBeanContainer.java:696)
        at com.sun.ejb.containers.MessageBeanContainer.access$100(MessageBeanContainer.java:92)
        at com.sun.ejb.containers.MessageBeanContainer$MessageBeanContextFactory.create(MessageBeanContainer.java:477)
        at com.sun.ejb.containers.util.pool.NonBlockingPool.getObject(NonBlockingPool.java:186)
        at com.sun.ejb.containers.MessageBeanContainer._getContext(MessageBeanContainer.java:540)
        at com.sun.ejb.containers.BaseContainer.getContext(BaseContainer.java:1566)
        at com.sun.ejb.containers.MessageBeanContainer.beforeMessageDelivery(MessageBeanContainer.java:894)
        at com.sun.ejb.containers.MessageBeanListenerImpl.beforeMessageDelivery(MessageBeanListenerImpl.java:57)
        at com.sun.enterprise.connectors.inflow.MessageEndpointInvocationHandler.invoke(MessageEndpointInvocationHandler.java:122)
        at $Proxy30.beforeDelivery(Unknown Source)
        at com.sun.messaging.jms.ra.OnMessageRunner.run(OnMessageRunner.java:199)
        at com.sun.enterprise.connectors.work.OneWork.doWork(OneWork.java:63)
        at com.sun.corba.ee.impl.orbutil.threadpool.ThreadPoolImpl$WorkerThread.run(ThreadPoolImpl.java:479)
Caused by: javax.naming.NameNotFoundException
        at com.sun.enterprise.naming.TransientContext.resolveContext(TransientContext.java:255)
        at com.sun.enterprise.naming.TransientContext.lookup(TransientContext.java:178)
        at com.sun.enterprise.naming.SerialContextProviderImpl.lookup(SerialContextProviderImpl.java:61)
        at com.sun.enterprise.naming.LocalSerialContextProviderImpl.lookup(LocalSerialContextProviderImpl.java:98)
        at com.sun.enterprise.naming.SerialContext.lookup(SerialContext.java:309)
        at com.sun.enterprise.naming.NamingManagerImpl.lookup(NamingManagerImpl.java:770)
        at com.sun.enterprise.naming.java.javaURLContext.lookup(javaURLContext.java:156)
        at com.sun.enterprise.naming.SerialContext.lookup(SerialContext.java:307)
        at javax.naming.InitialContext.lookup(InitialContext.java:351)
        at com.sun.enterprise.util.InjectionManagerImpl._inject(InjectionManagerImpl.java:274)



Note: i don't have any persistence unit and I marked my the injected fields in the client as static
[Message sent by forum member 'm_allam' (m_allam)]

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