qpid-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Shahbaz Chaudhary" <schaudh...@genghisfund.com>
Subject RE: javax.naming.NamingException: scheme amqp not recognized
Date Tue, 09 Sep 2008 19:19:17 GMT
Thanks, that was the problem: I was trying to lookup the "amqp://..." directly.

-----Original Message-----
From: Arnaud Simon [mailto:asimon@redhat.com] 
Sent: Tuesday, September 09, 2008 4:04 AM
To: qpid-users@incubator.apache.org
Subject: Re: javax.naming.NamingException: scheme amqp not recognized

Hi Shahbaz,

I believe you are trying to lookup "amqp://guest:guest@1/test?brokerlist='tcp://xxx.xxx.xxx.xxx:5672'"
i.e. your code should do something like: 
ConnectionFactory conFac = (ConnectionFactory)ctx.lookup("amqp://guest:guest@1/test?brokerlist='tcp://localhost:5672");

You cannot do that as the amqpURLContextFactory is not implemented. 

What you should do instead is lookup a connection factory that is defined in your jndi file.


i.e. 
You code should be: 
ConnectionFactory conFac = (ConnectionFactory)ctx.lookup("qpidConnectionfactory");

Where qpidConnectionfactory is defined as follows: 
connectionfactory.qpidConnectionfactory = amqp://guest:guest@1/test?brokerlist='tcp://localhost:5672'

You can either specify your jndi property file location through the java.naming.provider.url
property or explicitly load the properties in your code by doing something like: 
 Properties properties = new Properties();
 properties.load(this.getClass().getResourceAsStream("jndi.properties"));   
 Context ctx = new InitialContext(properties);

Hope this helps

Arnaud



  
----- "Shahbaz Chaudhary" <schaudhary@genghisfund.com> wrote:

> I'm getting a very strange error: javax.naming.NamingException:
> scheme
> amqp not recognized
> 
>  
> 
> A third party vendor provides a bridge between JMS and their product.
> I'm posting it here because the stack trace shows that the problem is
> within the qpid name space.
> 
>  
> 
> The following url is being parsed:
> "amqp://guest:guest@1/test?brokerlist='tcp://xxx.xxx.xxx.xxx:5672'"
> 
> The code seems to strip out "amqp" but doesn't recognize it (this is
> in
> org.apache.qpid.jndi.ReadOnlyContext.lookup())
> 
>  
> 
> Instead of the amqp url, I took the tcp part of the url, and I
> started
> receiving "scheme tcp not recognized" error.
> 
>  
> 
> Following is some more detail:
> 
> javax.naming.NamingException: scheme amqp not recognized
> 
>         at
> org.apache.qpid.jndi.ReadOnlyContext.lookup(ReadOnlyContext.java:250)
> 
>         at
> javax.naming.InitialContext.lookup(InitialContext.java:392)
> 
>         ...vendor classes...
> 
> JMSAdapter error: NamingException: scheme amqp not recognized
> Resolved
> name: null Remaining name: null with error
> javax.naming.NamingException:
> scheme amqp not recognized
> 
>  
> 
>  
> 
> Shahbaz Chaudhary
> 
> Genghis Fund
> 
> 75 Broad
> 
> New York, New York 10004
> 
> O: 212-220-2698
> 
> C: 347-334-1730
> 
> schaudhary@genghisfund.com
Mime
View raw message