You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by spruitt <st...@hp.com> on 2016/01/13 20:54:11 UTC

Schema amqp not found

Boy, getting a simple client working is a chore.

Properties p = new Properties();
p.put("java.naming.factory.initial",
"org.apache.activemq.artemis.jndi.ActiveMQInitialContextFactory");
p.put("connectionFactory.ConnectionFactory", "amqp://localhost:5672");
p.put("queue.queue/exampleQueue", "exampleQueue");
initialContext = new InitialContext(p);

Results in:
java.lang.NullPointerException: Schema amqp not found
	at
org.apache.activemq.artemis.utils.uri.URIFactory.newObject(URIFactory.java:56)

atorg.apache.activemq.artemis.jndi.ActiveMQInitialContextFactory.createConnectionFactory(ActiveMQInitialCntextFactory.java:159)
:
Exception in thread "main" javax.naming.NamingException: Invalid broker URL
	at
org.apache.activemq.artemis.jndi.ActiveMQInitialContextFactory.getInitialContext(ActiveMQInitialContexFactory.java:65)
	at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:684)



--
View this message in context: http://activemq.2283324.n4.nabble.com/Schema-amqp-not-found-tp4705950.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Re: Schema amqp not found

Posted by Clebert Suconic <cl...@gmail.com>.
On Thu, Jan 14, 2016 at 9:27 AM, spruitt <st...@hp.com> wrote:
> That is the code I started with.  But I get:
>
> Exception in thread "main" javax.jms.JMSSecurityException: AMQ119031: Unable
> to validate user
>
> So next I started trying:
>
> connection = connectionFactory.createConnection(user, pw);
>
> But I still get:
>
> Exception in thread "main" javax.jms.JMSSecurityException: AMQ119031: Unable
> to validate user


There are a lot of examples on the distribution. Maybe you could look
at how they are configured?
>
> Properties p = new Properties();
> p.put("java.naming.factory.initial",
> "org.apache.activemq.artemis.jndi.ActiveMQInitialContextFactory");
> p.put("connectionFactory.ConnectionFactory",
> "amqp://localhost:5672&amqp.vhost=localhost");
> p.put("queue.queue/exampleQueue", "exampleQueue");
> initialContext = new InitialContext(p);



I don't know where you took this amqp example from?
ActiveMQInitialContextFactory from our JNDI doesn't know how to deal
with AMQP or other libraries.  Look at the AMQP example to how to
instantiate an AMQP connection factory. I don't think you can use JNDI
with that. (Unless the AMQP-jms provides you the JNDI)

Re: Schema amqp not found

Posted by Robbie Gemmell <ro...@gmail.com>.
Both of the exeception messages below are from the Artemis JMS client,
showing it failing to authenticate in similar manner to what you were
presumably seeing from the Qpid JMS client beforehand. I'd again
assume this is a result of the bootstrap issues mentioned in your
other thread, and I'd expect both clients to have issues until that is
resolved.

As clebert mentioned, the Artemis JMS client does not use AMQP as its
protocol and so didn't understand the amqp scheme in the URI
configuration you were specifying in your earlier attempts at using
it. That URI configuration actually being from the Qpid JMS client,
which does use AMQP and does use that scheme in its config.

There are examples of the various ways to configure/use the Qpid
client via JNDI in its configuration docs, with the examples that ship
with the Qpid client demonstrating the first of those. For the current
release docs see:
http://qpid.apache.org/releases/qpid-jms-0.7.0/docs/index.html

Robbie

On 14 January 2016 at 14:27, spruitt <st...@hp.com> wrote:
> That is the code I started with.  But I get:
>
> Exception in thread "main" javax.jms.JMSSecurityException: AMQ119031: Unable
> to validate user
>
> So next I started trying:
>
> connection = connectionFactory.createConnection(user, pw);
>
> But I still get:
>
> Exception in thread "main" javax.jms.JMSSecurityException: AMQ119031: Unable
> to validate user
>
> The user is defined in the Artemis property files.  I tried many things
> trying to get past this.  I turned security off and the sample worked ok.
> So I know the broker is running fine.
>
> After giving up on this example code, I switched over to a naming context to
> see if I could find a path to get this code running.  I found this example
> code and I found ActiveMQInitialContextFactory in
> artemis-jms-client-1.2.0.jar.  But it gives the error in the original post:
>
> Properties p = new Properties();
> p.put("java.naming.factory.initial",
> "org.apache.activemq.artemis.jndi.ActiveMQInitialContextFactory");
> p.put("connectionFactory.ConnectionFactory",
> "amqp://localhost:5672&amqp.vhost=localhost");
> p.put("queue.queue/exampleQueue", "exampleQueue");
> initialContext = new InitialContext(p);
> :
>
>
>
>
>
>
>
> --
> View this message in context: http://activemq.2283324.n4.nabble.com/Schema-amqp-not-found-tp4705950p4705988.html
> Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Re: Schema amqp not found

Posted by spruitt <st...@hp.com>.
That is the code I started with.  But I get:

Exception in thread "main" javax.jms.JMSSecurityException: AMQ119031: Unable
to validate user

So next I started trying:

connection = connectionFactory.createConnection(user, pw);

But I still get:

Exception in thread "main" javax.jms.JMSSecurityException: AMQ119031: Unable
to validate user

The user is defined in the Artemis property files.  I tried many things
trying to get past this.  I turned security off and the sample worked ok. 
So I know the broker is running fine.

After giving up on this example code, I switched over to a naming context to
see if I could find a path to get this code running.  I found this example
code and I found ActiveMQInitialContextFactory in
artemis-jms-client-1.2.0.jar.  But it gives the error in the original post:

Properties p = new Properties();
p.put("java.naming.factory.initial",
"org.apache.activemq.artemis.jndi.ActiveMQInitialContextFactory");
p.put("connectionFactory.ConnectionFactory",
"amqp://localhost:5672&amqp.vhost=localhost");
p.put("queue.queue/exampleQueue", "exampleQueue");
initialContext = new InitialContext(p);
:







--
View this message in context: http://activemq.2283324.n4.nabble.com/Schema-amqp-not-found-tp4705950p4705988.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Re: Schema amqp not found

Posted by Clebert Suconic <cl...@gmail.com>.
On Wed, Jan 13, 2016 at 4:00 PM, Clebert Suconic
<cl...@gmail.com> wrote:
> amqp doesn't exist as an schema... Artemis doesn't implement the AMQP
> protocol itself.


I meant to say the client doesn't implement it. you have to use the
proper client/library for AMQP client. Again, look at the example.

Re: Schema amqp not found

Posted by Clebert Suconic <cl...@gmail.com>.
amqp doesn't exist as an schema... Artemis doesn't implement the AMQP
protocol itself.

Look at the amqp example, where the proper API / library is used.


it is under:

examples/protocols/amqp/queue/src/main/java/org/apache/activemq/artemis/jms/example


Notice the package name is:

import org.apache.qpid.jms.JmsConnectionFactory;


And that is coming from:


   <dependencies>

      <dependency>

         <groupId>org.apache.qpid</groupId>

         <artifactId>qpid-jms-client</artifactId>

         <version>0.5.0</version>

      </dependency>

   </dependencies>




The example should be all inclusive.


On Wed, Jan 13, 2016 at 2:54 PM, spruitt <st...@hp.com> wrote:
> Boy, getting a simple client working is a chore.
>
> Properties p = new Properties();
> p.put("java.naming.factory.initial",
> "org.apache.activemq.artemis.jndi.ActiveMQInitialContextFactory");
> p.put("connectionFactory.ConnectionFactory", "amqp://localhost:5672");
> p.put("queue.queue/exampleQueue", "exampleQueue");
> initialContext = new InitialContext(p);
>
> Results in:
> java.lang.NullPointerException: Schema amqp not found
>         at
> org.apache.activemq.artemis.utils.uri.URIFactory.newObject(URIFactory.java:56)
>
> atorg.apache.activemq.artemis.jndi.ActiveMQInitialContextFactory.createConnectionFactory(ActiveMQInitialCntextFactory.java:159)
> :
> Exception in thread "main" javax.naming.NamingException: Invalid broker URL
>         at
> org.apache.activemq.artemis.jndi.ActiveMQInitialContextFactory.getInitialContext(ActiveMQInitialContexFactory.java:65)
>         at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:684)
>
>
>
> --
> View this message in context: http://activemq.2283324.n4.nabble.com/Schema-amqp-not-found-tp4705950.html
> Sent from the ActiveMQ - User mailing list archive at Nabble.com.



-- 
Clebert Suconic