You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by Hendry <he...@elasitas.com> on 2007/03/21 05:21:47 UTC

JMS Client connecting to Broker

Hi, I'm trying to connecting my jms client to broker that embedded into 
Jetty, but I'm getting NamingException, these are the codes:

Properties properties = new Properties();
 
properties.load(Resources.getResourceAsStream("jndi.properties"));
InitialContext jndiContext = new InitialContext(properties);

QueueConnectionFactory queueConnectionFactory = (QueueConnectionFactory) 
jndiContext.lookup("java:comp/env/jms/connectionFactory");

and the errors:

Naming Exception: javax.naming.NamingException: scheme java not recognized
[ERROR] 
org.apache.activemq.jndi.ReadOnlyContext.lookup(ReadOnlyContext.java:199)
[ERROR] javax.naming.InitialContext.lookup(InitialContext.java:351)
[ERROR] 
com.elasitas.message.MessageReceiver.establishConnection(MessageReceiver.java:83)

Could anyone tell me what's wrong? Thanx.

-- 
Regards,
Hendry

Re: JMS Client connecting to Broker

Posted by James Strachan <ja...@gmail.com>.
On 3/21/07, Hendry <he...@elasitas.com> wrote:
> Ok, it works, but now I don't receive any message from the broker, the
> provider url that I used :
> vm://localhost
> I've also tried the url:
> vm:(broker:(tcp://localhost:61616)?persistent=false)?marshal=false
>
> Both doesn't work. Any suggestion? Thanx.

There's not much to go on, could it be this
http://activemq.apache.org/i-am-not-receiving-any-messages-what-is-wrong.html

-- 

James
-------
http://radio.weblogs.com/0112098/

Re: JMS Client connecting to Broker

Posted by Hendry <he...@elasitas.com>.
Ok, it works, but now I don't receive any message from the broker, the 
provider url that I used :
vm://localhost
I've also tried the url: 
vm:(broker:(tcp://localhost:61616)?persistent=false)?marshal=false

Both doesn't work. Any suggestion? Thanx.

Regards,
Hendry


James Strachan wrote:
> The ActiveMQ JNDI context is not a J2EE container, so doesn't support
> "java:comp/env" stuff by default.
> 
> try using the name "ConnectionFactory" like the example...
> 
> http://activemq.apache.org/jndi-support.html

Re: JMS Client connecting to Broker

Posted by James Strachan <ja...@gmail.com>.
The ActiveMQ JNDI context is not a J2EE container, so doesn't support
"java:comp/env" stuff by default.

try using the name "ConnectionFactory" like the example...

http://activemq.apache.org/jndi-support.html


On 3/21/07, Hendry <he...@elasitas.com> wrote:
> Hi, I'm trying to connecting my jms client to broker that embedded into
> Jetty, but I'm getting NamingException, these are the codes:
>
> Properties properties = new Properties();
>
> properties.load(Resources.getResourceAsStream("jndi.properties"));
> InitialContext jndiContext = new InitialContext(properties);
>
> QueueConnectionFactory queueConnectionFactory = (QueueConnectionFactory)
> jndiContext.lookup("java:comp/env/jms/connectionFactory");
>
> and the errors:
>
> Naming Exception: javax.naming.NamingException: scheme java not recognized
> [ERROR]
> org.apache.activemq.jndi.ReadOnlyContext.lookup(ReadOnlyContext.java:199)
> [ERROR] javax.naming.InitialContext.lookup(InitialContext.java:351)
> [ERROR]
> com.elasitas.message.MessageReceiver.establishConnection(MessageReceiver.java:83)
>
> Could anyone tell me what's wrong? Thanx.
>
> --
> Regards,
> Hendry
>


-- 

James
-------
http://radio.weblogs.com/0112098/