• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Getting a reference to a JMS Queue defined in JBoss AS 7

 
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi All,
Here is my question.

I defined a queue in JBoss, by editing standalone-full.xml, with following entry.

<jms-destinations>
..........
<jms-queue name="myQueue">
<entry name="queue/testOne"/>
<entry name="java:jboss/exported/jms/queue/testOne"/>
</jms-queue>
.........
</jms-destinations>


Then I stared the JBoss server in full standalone mode.

In my java class, I tried to get an access to the above defined queue. Following is the code snippet:

Hashtable<String, String> envmnt = new Hashtable<String, String>();
envmnt.put(Context.PROVIDER_URL, "http://localhost");
envmnt.put(Context.INITIAL_CONTEXT_FACTORY, "org.jboss.naming.remote.client.InitialContextFactory");
jndiContext = new InitialContext(envmnt);


However, I'm getting the following exception:
Could not create JNDI API context: javax.naming.NamingException: Failed to create remoting connection [Root exception is org.jboss.remoting3.UnknownURISchemeException: No connection provider for URI scheme "http" is installed]

Please help, as I've just began learning JMS and would like to move ahead asap.

Regards
Yogi
 
Ranch Hand
Posts: 808
1
Android Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Where are you performing JNDI lookup? Is it POJO or managed component? I think that your InitialContext configuration is bad. If you are inside a managed component you can try:
new InitialContext().lookup("....").
 
Yogendra Singh Butola
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I think I didn't put up my question correctly and you are right my initial context is not right. My query is regarding correcting this initial context only. What should I put in the hashtable or properties to get hold of a context where I'll be able to look up for a queue defined in JBoss AS 7.

Thanks
Yogi
 
Yogendra Singh Butola
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
And yes this is a POJO.
 
Yogendra Singh Butola
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks, I got the answer.

Following is the correct way of setting perovider URL:

envmnt.put(Context.PROVIDER_URL, "remote://localhost:4447");

After that you need to provide the credentials (username and password)



Thanks Again
Yogi
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic