[jboss-dev-forums] [JBoss AS 7 Development] - Exception in thread "main" javax.naming.NameNotFoundException: RemoteConnectionFactory -- service jboss.naming.context.java.jboss.exported.RemoteConnectionFactory
emre nakilcioglu
do-not-reply at jboss.com
Thu Mar 1 09:34:01 EST 2012
emre nakilcioglu [https://community.jboss.org/people/emrenak] created the discussion
"Exception in thread "main" javax.naming.NameNotFoundException: RemoteConnectionFactory -- service jboss.naming.context.java.jboss.exported.RemoteConnectionFactory"
To view the discussion, visit: https://community.jboss.org/message/720877#720877
--------------------------------------------------------------
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
--------------------------------------------------------------
Reply to this message by going to Community
[https://community.jboss.org/message/720877#720877]
Start a new discussion in JBoss AS 7 Development at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2225]
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/jboss-dev-forums/attachments/20120301/f9d29b4f/attachment.html
More information about the jboss-dev-forums
mailing list