[jboss-user] [EJB 3.0] - resource-ref problem

rak0t do-not-reply at jboss.com
Thu Aug 24 10:42:06 EDT 2006


Hi. I am trying to inject resources into my MDB, here is the code in MDB:


  | @Resource(name="senderQueue")
  | protected Queue _queue;
  | 

Here is ejb-jar.xml entry


  | <resource-ref>
  | 				<description>Sender destination</description>
  |                 <res-ref-name>senderQueue</res-ref-name>
  |                 <res-type>javax.jms.Queue</res-type>
  | 				<res-auth>Container</res-auth>
  |             </resource-ref>
  | 

Here is jboss.xml entry


  | <resource-ref>
  | 				<description>Sender destination</description>
  |                 <res-ref-name>senderQueue</res-ref-name>
  |                 <res-type>javax.jms.Queue</res-type>
  | 				<jndi-name>GEDDEV1-ORC.CLIENT.CHANNEL-JAVAQ7</jndi-name>
  |             </resource-ref>
  | 

when my MDB initializes it throws

  | java.lang.RuntimeException: Unable to inject jndi dependency: env/senderQueue into field interface javax.jms.Queue
  | 	at org.jboss.ejb3.injection.JndiFieldInjector.lookup(JndiFieldInjector.java:86)
  | 	at org.jboss.ejb3.injection.JndiFieldInjector.inject(JndiFieldInjector.java:99)
  | 	at org.jboss.ejb3.injection.JndiFieldInjector.inject(JndiFieldInjector.java:61)
  | 	at org.jboss.ejb3.AbstractPool.create(AbstractPool.java:88)
  | 	at org.jboss.ejb3.ThreadlocalPool.get(ThreadlocalPool.java:48)
  | 	at org.jboss.ejb3.stateless.StatelessInstanceInterceptor.invoke(StatelessInstanceInterceptor.java:54)
  | 	at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
  | 	at org.jboss.ejb3.mdb.MDB.localInvoke(MDB.java:865)
  | 	at org.jboss.ejb3.mdb.MDB.localInvoke(MDB.java:844)
  | 	at org.jboss.ejb3.mdb.MDB$MessageListenerImpl.onMessage(MDB.java:1074)
  | 	at org.jboss.jms.asf.StdServerSession.onMessage(StdServerSession.java:266)
  | 	at com.ibm.mq.jms.MQSession.run(MQSession.java:1561)
  | 	at org.jboss.jms.asf.StdServerSession.run(StdServerSession.java:196)
  | 	at EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run(PooledExecutor.java:743)
  | 	at java.lang.Thread.run(Thread.java:595)
  | Caused by: javax.naming.NamingException: Could not dereference object [Root exception is javax.naming.NameNotFoundException: GEDDEV1-ORC.CLIENT.CHANNEL-JAVAQ7 not bound]
  | 	at org.jnp.interfaces.NamingContext.resolveLink(NamingContext.java:1067)
  | 	at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:700)
  | 	at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:587)
  | 	at org.jboss.ejb3.injection.JndiFieldInjector.lookup(JndiFieldInjector.java:75)
  | 	... 14 more
  | Caused by: javax.naming.NameNotFoundException: GEDDEV1-ORC.CLIENT.CHANNEL-JAVAQ7 not bound
  | 	at org.jnp.server.NamingServer.getBinding(NamingServer.java:529)
  | 	at org.jnp.server.NamingServer.getBinding(NamingServer.java:537)
  | 	at org.jnp.server.NamingServer.getObject(NamingServer.java:543)
  | 	at org.jnp.server.NamingServer.lookup(NamingServer.java:296)
  | 	at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:625)
  | 	at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:587)
  | 	at javax.naming.InitialContext.lookup(InitialContext.java:351)
  | 	at org.jnp.interfaces.NamingContext.resolveLink(NamingContext.java:1061)
  | 	... 17 more
  | 

When i go to JNDIView i see this entry under java:

GEDDEV1-ORC.CLIENT.CHANNEL-JAVAQ7
com.ibm.mq.jms.MQQueue

Any help is appreciated

thanks

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3967242#3967242

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3967242



More information about the jboss-user mailing list