Hello
I am trying to reach a JMS queue defined in Jboss 7.1.
However when I try to send a message, I am getting the exception while looking up for the connection factory. My code is as below:
Properties props = new Properties();
String JBOSS_CONTEXT="org.jboss.naming.remote.client.InitialContextFactory";;
props.put(Context.INITIAL_CONTEXT_FACTORY, JBOSS_CONTEXT);
props.put(Context.PROVIDER_URL, "remote://localhost:4447");
props.put(Context.SECURITY_PRINCIPAL, "usecase2");
props.put(Context.SECURITY_CREDENTIALS, "123456");
ic = new InitialContext(props);
ConnectionFactory connectionFactory = (ConnectionFactory)ic.lookup("RemoteConnectionFactory");
Queue queue = (Queue) ic.lookup("jms/queue/useCase");
And the exception is as below :
INFO: JBoss Remoting version 3.2.2.GA
Exception in thread "main" javax.naming.NameNotFoundException: RemoteConnectionFactory -- service jboss.naming.context.java.jboss.exported.RemoteConnectionFactory
at org.jboss.as.naming.ServiceBasedNamingStore.lookup(ServiceBasedNamingStore.java:97)
at org.jboss.as.naming.NamingContext.lookup(NamingContext.java:177)
at org.jboss.naming.remote.protocol.v1.Protocol$1.handleServerMessage(Protocol.java:124)
at org.jboss.naming.remote.protocol.v1.RemoteNamingServerV1$MessageReciever$1.run(RemoteNamingServerV1.java:70)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:619)
What could be the reason ? Any help is appreciated.
Regards
-emre