You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@qpid.apache.org by Rajith Attapattu <ra...@gmail.com> on 2006/11/22 23:58:44 UTC

Re: Problem with PropertiesFileInitialContextFactory

Hi Martin,

When I use the PropertiesFileInitialContextFactory I get the following error
when trying to connect to the broker.

 ERROR: javax.jms.JMSException: Error creating connection: Virtual host
found at index 7: amqp://guest:guest@localhost.localdomain1164227704603null
?brokerlist='tcp://null:0',ssl='false'
     [java]     at
org.apache.qpid.client.AMQConnectionFactory.createConnection(
AMQConnectionFactory.java:259)
     [java]     at
org.apache.qpid.client.AMQConnectionFactory.createTopicConnection(
AMQConnectionFactory.java:282)

I have also attached my connection props file, can you try to reproduce this
error?

Regards,

Rajith

Re: Problem with PropertiesFileInitialContextFactory

Posted by Rajith Attapattu <ra...@gmail.com>.
Hey Martin,

I really appreciate your help.
thanks a lot.

Regards,

Rajith

On 11/22/06, Martin Ritchie <ri...@apache.org> wrote:
>
> On 23/11/06, Rajith Attapattu <ra...@gmail.com> wrote:
> > Unfortunately the TCK is using the TopicConnection(username,password)
> > method.
> >
> > If you can provide me more details I can fix this method to work with
> the
> > new url format
> >
> > Rajith
> >
> > On 11/22/06, Martin Ritchie <ri...@apache.org> wrote:
> > >
> > > On 23/11/06, Rajith Attapattu <ra...@gmail.com> wrote:
> > > > Here we go
> > > > ---------------------------------- start
> > > > ------------------------------------------
> > > > java.naming.factory.initial =
> > > > org.apache.qpid.jndi.PropertiesFileInitialContextFactory
> > > >
> > > > # use the following property to configure the default connector
> > > > #java.naming.provider.url - ignored.
> > > >
> > > > # register some connection factories
> > > > # connectionfactory.[jndiname] = [ConnectionURL]
> > > > connectionfactory.QueueConnectionFactory =
> amqp://guest:guest@clientid
> > > > /testpath?brokerlist='tcp://localhost:5672'
> > > > connectionfactory.TopicConnectionFactory =
> amqp://guest:guest@clientid
> > > > /testpath?brokerlist='tcp://localhost:5672'
> > > >
> > > >
> > > > # register some queues in JNDI using the form
> > > > # queue.[jndiName] = [physicalName]
> > > > queue.MY_QUEUE=MY_QUEUE
> > > > queue.MY_QUEUE2=MY_QUEUE2
> > > > queue.testQ0=testQ0
> > > > queue.testQ2=testQ1
> > > > queue.testQ2=testQ2
> > > > queue.testQueue2=testQueue2
> > > > queue.Q2=Q2
> > > >
> > > > # register some topics in JNDI using the form
> > > > # topic.[jndiName] = [physicalName]
> > > > topic.MY_TOPIC=MY_TOPIC
> > > > topic.MY_TOPIC2=MY_TOPIC2
> > > >
> > > > # Register an AMQP destination in JNDI
> > > > #   NOTE: Qpid currently only supports direct,topics and headers
> > > > # destination.[jniName] = [BindingURL]
> > > > destination.direct = direct://amq.direct//directQueue
> > > > ------------------------- end
> > > > ----------------------------------------------------
> > > >
> > > >
> > > >
> > > > On 11/22/06, Martin Ritchie <ri...@apache.org> wrote:
> > > > >
> > > > > I didn't see the file again.. can you just paste the text in the
> > > > > email.. it can't be that big.
> > > > >
> > > > > Cheers
> > > > >
> > > > > On 23/11/06, Rajith Attapattu <ra...@gmail.com> wrote:
> > > > > > I am not sure if the attachment went through properly.
> > > > > > So I am resending it again.
> > > > > >
> > > > > > Rajith
> > > > > >
> > > > > >
> > > > > > On 11/22/06, Rajith Attapattu < rajith77@gmail.com> wrote:
> > > > > > > Hi Martin,
> > > > > > >
> > > > > > > When I use the PropertiesFileInitialContextFactory I get
> > > > > > the following error when trying to connect to the broker.
> > > > > > >
> > > > > > >  ERROR: javax.jms.JMSException: Error creating connection:
> Virtual
> > > > > host
> > > > > > found at index 7:
> > > > > > amqp://guest:guest@localhost.localdomain1164227704603null
> > > > > ?brokerlist='tcp://null:0',ssl='false'
> > > > > > >      [java]     at
> > > > > > org.apache.qpid.client.AMQConnectionFactory.createConnection(
> > > > > AMQConnectionFactory.java:259)
> > > > > > >      [java]     at
> > > > > >
> org.apache.qpid.client.AMQConnectionFactory.createTopicConnection(
> > > > > AMQConnectionFactory.java:282)
> > > > > > >
> > > > > > > I have also attached my connection props file, can you try to
> > > > > reproduce
> > > > > > this error?
> > > > > > >
> > > > > > > Regards,
> > > > > > >
> > > > > > > Rajith
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > >
> > > > > >
> > > > >
> > > > >
> > > > > --
> > > > > Martin Ritchie
> > > > >
> > > >
> > > >
> > >
> > > You are calling
> > > createTopicConnection(username,password)
> > > try using
> > > createTopicConnection()
> > >
> > > the formar uses a older technique for setting the parameters not the
> > > ConnectionURL Syntax that the latter uses.
> > >
> > > If you look at the createTopicConnection() method you will see
> > > references to _connectionDetails this is the ConnectionURL object that
> > > is created from the url you entered in the properties file. the
> > > createTopicConnection(username,password) doesn't use
> > > _connectionDetails at all but uses the single _host, _port options
> > > which having not been set are showing as host tcp://null:0 in the
> > > exception.
> > >
> > > HTH
> > >
> > > --
> > > Martin Ritchie
> > >
> >
> >
>
> I just committed the fix.. just remember that the username/password
> must be guest:guest.
>
> You mat have to do the same thing for the queue connection.
>
> Right I really am going to bed now.
>
> --
> Martin Ritchie
>

Re: Problem with PropertiesFileInitialContextFactory

Posted by Martin Ritchie <ri...@apache.org>.
On 23/11/06, Rajith Attapattu <ra...@gmail.com> wrote:
> Unfortunately the TCK is using the TopicConnection(username,password)
> method.
>
> If you can provide me more details I can fix this method to work with the
> new url format
>
> Rajith
>
> On 11/22/06, Martin Ritchie <ri...@apache.org> wrote:
> >
> > On 23/11/06, Rajith Attapattu <ra...@gmail.com> wrote:
> > > Here we go
> > > ---------------------------------- start
> > > ------------------------------------------
> > > java.naming.factory.initial =
> > > org.apache.qpid.jndi.PropertiesFileInitialContextFactory
> > >
> > > # use the following property to configure the default connector
> > > #java.naming.provider.url - ignored.
> > >
> > > # register some connection factories
> > > # connectionfactory.[jndiname] = [ConnectionURL]
> > > connectionfactory.QueueConnectionFactory = amqp://guest:guest@clientid
> > > /testpath?brokerlist='tcp://localhost:5672'
> > > connectionfactory.TopicConnectionFactory = amqp://guest:guest@clientid
> > > /testpath?brokerlist='tcp://localhost:5672'
> > >
> > >
> > > # register some queues in JNDI using the form
> > > # queue.[jndiName] = [physicalName]
> > > queue.MY_QUEUE=MY_QUEUE
> > > queue.MY_QUEUE2=MY_QUEUE2
> > > queue.testQ0=testQ0
> > > queue.testQ2=testQ1
> > > queue.testQ2=testQ2
> > > queue.testQueue2=testQueue2
> > > queue.Q2=Q2
> > >
> > > # register some topics in JNDI using the form
> > > # topic.[jndiName] = [physicalName]
> > > topic.MY_TOPIC=MY_TOPIC
> > > topic.MY_TOPIC2=MY_TOPIC2
> > >
> > > # Register an AMQP destination in JNDI
> > > #   NOTE: Qpid currently only supports direct,topics and headers
> > > # destination.[jniName] = [BindingURL]
> > > destination.direct = direct://amq.direct//directQueue
> > > ------------------------- end
> > > ----------------------------------------------------
> > >
> > >
> > >
> > > On 11/22/06, Martin Ritchie <ri...@apache.org> wrote:
> > > >
> > > > I didn't see the file again.. can you just paste the text in the
> > > > email.. it can't be that big.
> > > >
> > > > Cheers
> > > >
> > > > On 23/11/06, Rajith Attapattu <ra...@gmail.com> wrote:
> > > > > I am not sure if the attachment went through properly.
> > > > > So I am resending it again.
> > > > >
> > > > > Rajith
> > > > >
> > > > >
> > > > > On 11/22/06, Rajith Attapattu < rajith77@gmail.com> wrote:
> > > > > > Hi Martin,
> > > > > >
> > > > > > When I use the PropertiesFileInitialContextFactory I get
> > > > > the following error when trying to connect to the broker.
> > > > > >
> > > > > >  ERROR: javax.jms.JMSException: Error creating connection: Virtual
> > > > host
> > > > > found at index 7:
> > > > > amqp://guest:guest@localhost.localdomain1164227704603null
> > > > ?brokerlist='tcp://null:0',ssl='false'
> > > > > >      [java]     at
> > > > > org.apache.qpid.client.AMQConnectionFactory.createConnection(
> > > > AMQConnectionFactory.java:259)
> > > > > >      [java]     at
> > > > > org.apache.qpid.client.AMQConnectionFactory.createTopicConnection(
> > > > AMQConnectionFactory.java:282)
> > > > > >
> > > > > > I have also attached my connection props file, can you try to
> > > > reproduce
> > > > > this error?
> > > > > >
> > > > > > Regards,
> > > > > >
> > > > > > Rajith
> > > > > >
> > > > > >
> > > > > >
> > > > >
> > > > >
> > > >
> > > >
> > > > --
> > > > Martin Ritchie
> > > >
> > >
> > >
> >
> > You are calling
> > createTopicConnection(username,password)
> > try using
> > createTopicConnection()
> >
> > the formar uses a older technique for setting the parameters not the
> > ConnectionURL Syntax that the latter uses.
> >
> > If you look at the createTopicConnection() method you will see
> > references to _connectionDetails this is the ConnectionURL object that
> > is created from the url you entered in the properties file. the
> > createTopicConnection(username,password) doesn't use
> > _connectionDetails at all but uses the single _host, _port options
> > which having not been set are showing as host tcp://null:0 in the
> > exception.
> >
> > HTH
> >
> > --
> > Martin Ritchie
> >
>
>

I just committed the fix.. just remember that the username/password
must be guest:guest.

You mat have to do the same thing for the queue connection.

Right I really am going to bed now.

-- 
Martin Ritchie

Re: Problem with PropertiesFileInitialContextFactory

Posted by Rajith Attapattu <ra...@gmail.com>.
Unfortunately the TCK is using the TopicConnection(username,password)
method.

If you can provide me more details I can fix this method to work with the
new url format

Rajith

On 11/22/06, Martin Ritchie <ri...@apache.org> wrote:
>
> On 23/11/06, Rajith Attapattu <ra...@gmail.com> wrote:
> > Here we go
> > ---------------------------------- start
> > ------------------------------------------
> > java.naming.factory.initial =
> > org.apache.qpid.jndi.PropertiesFileInitialContextFactory
> >
> > # use the following property to configure the default connector
> > #java.naming.provider.url - ignored.
> >
> > # register some connection factories
> > # connectionfactory.[jndiname] = [ConnectionURL]
> > connectionfactory.QueueConnectionFactory = amqp://guest:guest@clientid
> > /testpath?brokerlist='tcp://localhost:5672'
> > connectionfactory.TopicConnectionFactory = amqp://guest:guest@clientid
> > /testpath?brokerlist='tcp://localhost:5672'
> >
> >
> > # register some queues in JNDI using the form
> > # queue.[jndiName] = [physicalName]
> > queue.MY_QUEUE=MY_QUEUE
> > queue.MY_QUEUE2=MY_QUEUE2
> > queue.testQ0=testQ0
> > queue.testQ2=testQ1
> > queue.testQ2=testQ2
> > queue.testQueue2=testQueue2
> > queue.Q2=Q2
> >
> > # register some topics in JNDI using the form
> > # topic.[jndiName] = [physicalName]
> > topic.MY_TOPIC=MY_TOPIC
> > topic.MY_TOPIC2=MY_TOPIC2
> >
> > # Register an AMQP destination in JNDI
> > #   NOTE: Qpid currently only supports direct,topics and headers
> > # destination.[jniName] = [BindingURL]
> > destination.direct = direct://amq.direct//directQueue
> > ------------------------- end
> > ----------------------------------------------------
> >
> >
> >
> > On 11/22/06, Martin Ritchie <ri...@apache.org> wrote:
> > >
> > > I didn't see the file again.. can you just paste the text in the
> > > email.. it can't be that big.
> > >
> > > Cheers
> > >
> > > On 23/11/06, Rajith Attapattu <ra...@gmail.com> wrote:
> > > > I am not sure if the attachment went through properly.
> > > > So I am resending it again.
> > > >
> > > > Rajith
> > > >
> > > >
> > > > On 11/22/06, Rajith Attapattu < rajith77@gmail.com> wrote:
> > > > > Hi Martin,
> > > > >
> > > > > When I use the PropertiesFileInitialContextFactory I get
> > > > the following error when trying to connect to the broker.
> > > > >
> > > > >  ERROR: javax.jms.JMSException: Error creating connection: Virtual
> > > host
> > > > found at index 7:
> > > > amqp://guest:guest@localhost.localdomain1164227704603null
> > > ?brokerlist='tcp://null:0',ssl='false'
> > > > >      [java]     at
> > > > org.apache.qpid.client.AMQConnectionFactory.createConnection(
> > > AMQConnectionFactory.java:259)
> > > > >      [java]     at
> > > > org.apache.qpid.client.AMQConnectionFactory.createTopicConnection(
> > > AMQConnectionFactory.java:282)
> > > > >
> > > > > I have also attached my connection props file, can you try to
> > > reproduce
> > > > this error?
> > > > >
> > > > > Regards,
> > > > >
> > > > > Rajith
> > > > >
> > > > >
> > > > >
> > > >
> > > >
> > >
> > >
> > > --
> > > Martin Ritchie
> > >
> >
> >
>
> You are calling
> createTopicConnection(username,password)
> try using
> createTopicConnection()
>
> the formar uses a older technique for setting the parameters not the
> ConnectionURL Syntax that the latter uses.
>
> If you look at the createTopicConnection() method you will see
> references to _connectionDetails this is the ConnectionURL object that
> is created from the url you entered in the properties file. the
> createTopicConnection(username,password) doesn't use
> _connectionDetails at all but uses the single _host, _port options
> which having not been set are showing as host tcp://null:0 in the
> exception.
>
> HTH
>
> --
> Martin Ritchie
>

Re: Problem with PropertiesFileInitialContextFactory

Posted by Martin Ritchie <ri...@apache.org>.
On 23/11/06, Rajith Attapattu <ra...@gmail.com> wrote:
> Here we go
> ---------------------------------- start
> ------------------------------------------
> java.naming.factory.initial =
> org.apache.qpid.jndi.PropertiesFileInitialContextFactory
>
> # use the following property to configure the default connector
> #java.naming.provider.url - ignored.
>
> # register some connection factories
> # connectionfactory.[jndiname] = [ConnectionURL]
> connectionfactory.QueueConnectionFactory = amqp://guest:guest@clientid
> /testpath?brokerlist='tcp://localhost:5672'
> connectionfactory.TopicConnectionFactory = amqp://guest:guest@clientid
> /testpath?brokerlist='tcp://localhost:5672'
>
>
> # register some queues in JNDI using the form
> # queue.[jndiName] = [physicalName]
> queue.MY_QUEUE=MY_QUEUE
> queue.MY_QUEUE2=MY_QUEUE2
> queue.testQ0=testQ0
> queue.testQ2=testQ1
> queue.testQ2=testQ2
> queue.testQueue2=testQueue2
> queue.Q2=Q2
>
> # register some topics in JNDI using the form
> # topic.[jndiName] = [physicalName]
> topic.MY_TOPIC=MY_TOPIC
> topic.MY_TOPIC2=MY_TOPIC2
>
> # Register an AMQP destination in JNDI
> #   NOTE: Qpid currently only supports direct,topics and headers
> # destination.[jniName] = [BindingURL]
> destination.direct = direct://amq.direct//directQueue
> ------------------------- end
> ----------------------------------------------------
>
>
>
> On 11/22/06, Martin Ritchie <ri...@apache.org> wrote:
> >
> > I didn't see the file again.. can you just paste the text in the
> > email.. it can't be that big.
> >
> > Cheers
> >
> > On 23/11/06, Rajith Attapattu <ra...@gmail.com> wrote:
> > > I am not sure if the attachment went through properly.
> > > So I am resending it again.
> > >
> > > Rajith
> > >
> > >
> > > On 11/22/06, Rajith Attapattu < rajith77@gmail.com> wrote:
> > > > Hi Martin,
> > > >
> > > > When I use the PropertiesFileInitialContextFactory I get
> > > the following error when trying to connect to the broker.
> > > >
> > > >  ERROR: javax.jms.JMSException: Error creating connection: Virtual
> > host
> > > found at index 7:
> > > amqp://guest:guest@localhost.localdomain1164227704603null
> > ?brokerlist='tcp://null:0',ssl='false'
> > > >      [java]     at
> > > org.apache.qpid.client.AMQConnectionFactory.createConnection(
> > AMQConnectionFactory.java:259)
> > > >      [java]     at
> > > org.apache.qpid.client.AMQConnectionFactory.createTopicConnection(
> > AMQConnectionFactory.java:282)
> > > >
> > > > I have also attached my connection props file, can you try to
> > reproduce
> > > this error?
> > > >
> > > > Regards,
> > > >
> > > > Rajith
> > > >
> > > >
> > > >
> > >
> > >
> >
> >
> > --
> > Martin Ritchie
> >
>
>

You are calling
createTopicConnection(username,password)
try using
createTopicConnection()

the formar uses a older technique for setting the parameters not the
ConnectionURL Syntax that the latter uses.

If you look at the createTopicConnection() method you will see
references to _connectionDetails this is the ConnectionURL object that
is created from the url you entered in the properties file. the
createTopicConnection(username,password) doesn't use
_connectionDetails at all but uses the single _host, _port options
which having not been set are showing as host tcp://null:0 in the
exception.

HTH

-- 
Martin Ritchie

Re: Problem with PropertiesFileInitialContextFactory

Posted by Rajith Attapattu <ra...@gmail.com>.
Here we go
---------------------------------- start
------------------------------------------
java.naming.factory.initial =
org.apache.qpid.jndi.PropertiesFileInitialContextFactory

# use the following property to configure the default connector
#java.naming.provider.url - ignored.

# register some connection factories
# connectionfactory.[jndiname] = [ConnectionURL]
connectionfactory.QueueConnectionFactory = amqp://guest:guest@clientid
/testpath?brokerlist='tcp://localhost:5672'
connectionfactory.TopicConnectionFactory = amqp://guest:guest@clientid
/testpath?brokerlist='tcp://localhost:5672'


# register some queues in JNDI using the form
# queue.[jndiName] = [physicalName]
queue.MY_QUEUE=MY_QUEUE
queue.MY_QUEUE2=MY_QUEUE2
queue.testQ0=testQ0
queue.testQ2=testQ1
queue.testQ2=testQ2
queue.testQueue2=testQueue2
queue.Q2=Q2

# register some topics in JNDI using the form
# topic.[jndiName] = [physicalName]
topic.MY_TOPIC=MY_TOPIC
topic.MY_TOPIC2=MY_TOPIC2

# Register an AMQP destination in JNDI
#   NOTE: Qpid currently only supports direct,topics and headers
# destination.[jniName] = [BindingURL]
destination.direct = direct://amq.direct//directQueue
------------------------- end
----------------------------------------------------



On 11/22/06, Martin Ritchie <ri...@apache.org> wrote:
>
> I didn't see the file again.. can you just paste the text in the
> email.. it can't be that big.
>
> Cheers
>
> On 23/11/06, Rajith Attapattu <ra...@gmail.com> wrote:
> > I am not sure if the attachment went through properly.
> > So I am resending it again.
> >
> > Rajith
> >
> >
> > On 11/22/06, Rajith Attapattu < rajith77@gmail.com> wrote:
> > > Hi Martin,
> > >
> > > When I use the PropertiesFileInitialContextFactory I get
> > the following error when trying to connect to the broker.
> > >
> > >  ERROR: javax.jms.JMSException: Error creating connection: Virtual
> host
> > found at index 7:
> > amqp://guest:guest@localhost.localdomain1164227704603null
> ?brokerlist='tcp://null:0',ssl='false'
> > >      [java]     at
> > org.apache.qpid.client.AMQConnectionFactory.createConnection(
> AMQConnectionFactory.java:259)
> > >      [java]     at
> > org.apache.qpid.client.AMQConnectionFactory.createTopicConnection(
> AMQConnectionFactory.java:282)
> > >
> > > I have also attached my connection props file, can you try to
> reproduce
> > this error?
> > >
> > > Regards,
> > >
> > > Rajith
> > >
> > >
> > >
> >
> >
>
>
> --
> Martin Ritchie
>

Re: Problem with PropertiesFileInitialContextFactory

Posted by Martin Ritchie <ri...@apache.org>.
I didn't see the file again.. can you just paste the text in the
email.. it can't be that big.

Cheers

On 23/11/06, Rajith Attapattu <ra...@gmail.com> wrote:
> I am not sure if the attachment went through properly.
> So I am resending it again.
>
> Rajith
>
>
> On 11/22/06, Rajith Attapattu < rajith77@gmail.com> wrote:
> > Hi Martin,
> >
> > When I use the PropertiesFileInitialContextFactory I get
> the following error when trying to connect to the broker.
> >
> >  ERROR: javax.jms.JMSException: Error creating connection: Virtual host
> found at index 7:
> amqp://guest:guest@localhost.localdomain1164227704603null?brokerlist='tcp://null:0',ssl='false'
> >      [java]     at
> org.apache.qpid.client.AMQConnectionFactory.createConnection(AMQConnectionFactory.java:259)
> >      [java]     at
> org.apache.qpid.client.AMQConnectionFactory.createTopicConnection(AMQConnectionFactory.java:282)
> >
> > I have also attached my connection props file, can you try to reproduce
> this error?
> >
> > Regards,
> >
> > Rajith
> >
> >
> >
>
>


-- 
Martin Ritchie

Re: Problem with PropertiesFileInitialContextFactory

Posted by Rajith Attapattu <ra...@gmail.com>.
I am not sure if the attachment went through properly.
So I am resending it again.

Rajith

On 11/22/06, Rajith Attapattu <ra...@gmail.com> wrote:
>
> Hi Martin,
>
> When I use the PropertiesFileInitialContextFactory I get the following
> error when trying to connect to the broker.
>
>  ERROR: javax.jms.JMSException: Error creating connection: Virtual host
> found at index 7:
> amqp://guest:guest@localhost.localdomain1164227704603null
> ?brokerlist='tcp://null:0',ssl='false'
>      [java]     at
> org.apache.qpid.client.AMQConnectionFactory.createConnection(
> AMQConnectionFactory.java:259)
>      [java]     at
> org.apache.qpid.client.AMQConnectionFactory.createTopicConnection(
> AMQConnectionFactory.java:282)
>
> I have also attached my connection props file, can you try to reproduce
> this error?
>
> Regards,
>
> Rajith
>
>
>