[jboss-user] [JNDI and Naming] - How can i map java:/queues/myQueue to java:comp/env/myQueue

Alphonse Bendt do-not-reply at jboss.com
Wed May 8 08:22:01 EDT 2013


Alphonse Bendt [https://community.jboss.org/people/abendt] created the discussion

"How can i map java:/queues/myQueue to java:comp/env/myQueue"

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

--------------------------------------------------------------
Hi all,

i'm currently porting an application to JBoss AS 7.

The old code accesses Ressources using @Resource:


@Resource(mappedName = "myQueue")
Queue myQueue;


I tried to use jboss-ejb3.xml to set up a mapping from the specified name to the actual JNDI name. Unfortunately i was unable to find a working configuration.
I have tried various combinations of using the name/mappedName attribute of @Resource and also tried "myQueue" and "java:comp/env/myQueue" as value.
I have set up a test project:  https://github.com/abendt/jboss-as7-jndinames https://github.com/abendt/jboss-as7-jndinames which contains the tests i have made.

Here are some EJB's using the @Resource annotation:
 https://github.com/abendt/jboss-as7-jndinames/tree/master/src/main/java/com/example/jmsexample https://github.com/abendt/jboss-as7-jndinames/tree/master/src/main/java/com/example/jmsexample

jboss-ejb3.xml:
 https://github.com/abendt/jboss-as7-jndinames/blob/master/src/main/resources/META-INF/jboss-ejb3.xml https://github.com/abendt/jboss-as7-jndinames/blob/master/src/main/resources/META-INF/jboss-ejb3.xml

any help appreciated!

best regards,
   Alphonse Bendt
--------------------------------------------------------------

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

Start a new discussion in JNDI and Naming at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2083]

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


More information about the jboss-user mailing list