[jboss-user] [JNDI and Naming] - How to override providerAdapterJNDI in @MessageDriven bean? Naming alias?

Phil Krasko do-not-reply at jboss.com
Wed Feb 9 01:29:14 EST 2011


Phil Krasko [http://community.jboss.org/people/pkrasko] created the discussion

"How to override providerAdapterJNDI in @MessageDriven bean? Naming alias?"

To view the discussion, visit: http://community.jboss.org/message/586372#586372

--------------------------------------------------------------
JBoss 4.2.3GA

I have an application that needs to connect to a remote JMS topic (another JBoss box).
For the deployment of this application I have a *-ds.xml file to specify the remote JMS provider ("RemoteJmsProvider").
The MDB is using annotations and I have specified one @ActivationConfigProperty that sets the "providerAdapterJNDI" to java:/RemoteJmsProvider.

Everything works perfect as of now.

The question is how do I reconfigure this when I deploy the application on the same JBoss instance that is hosting the topic that I need to connect to?  In this scenario a remote jms provider should no longer be required.

I've attempted to create a naming alias to map the java:/RemoteJmsProvider to the local DefaultJmsProvider.  I'm not sure if this will work, but I've always ending up with a javax.naming.NameNotFoundException: RemoteJmsProvider not bound.

Here is the naming alias I created in a *-service.xml file within my deploy directory:
{code:xml} 
<mbean code="org.jboss.naming.NamingAlias"
         name="jboss.mq:service=NamingAlias,fromName=RemoteJmsProvider">
    <attribute name="FromName">RemoteJmsProvider</attribute>
    <attribute name="ToName">DefaultJMSProvider</attribute>
</mbean>
{code}

Is this a valid use of the naming alias?  
Has anyone encountered similar issues?
--------------------------------------------------------------

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

Start a new discussion in JNDI and Naming at Community
[http://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/20110209/4299e35b/attachment-0001.html 


More information about the jboss-user mailing list