-
1. Re: Exceptions after changing connection.type from netty to jndi: SEVERE: JBAS011855: Name 'RemoteConnectionFactory' not found in context ''
jbertram Mar 12, 2012 1:47 PM (in response to avah99)1 of 1 people found this helpfulIt looks to me like the quick-start is wrong. If it uses JNDI it needs to lookup "jms/RemoteConnectionFactory" since that is the name in the "exported" JNDI namespace which is available to remote clients. Add this to the pom.xml when you use the "jndi" connection.type:
<systemProperty>
<key>cf.name</key>
<value>jms/RemoteConnectionFactory</value>
</systemProperty>
-
2. Re: Exceptions after changing connection.type from netty to jndi: SEVERE: JBAS011855: Name 'RemoteConnectionFactory' not found in context ''
jbertram Mar 12, 2012 4:07 PM (in response to avah99)Did my previous suggestion work for you?
-
3. Re: Exceptions after changing connection.type from netty to jndi: SEVERE: JBAS011855: Name 'RemoteConnectionFactory' not found in context ''
avah99 Mar 12, 2012 11:28 PM (in response to jbertram)Thank you Bertram! I have just tried that and found the following exception:
SEVERE: JBAS011855: Name 'jms' not found in context ''
I am debugging this...
-
4. Re: Exceptions after changing connection.type from netty to jndi: SEVERE: JBAS011855: Name 'RemoteConnectionFactory' not found in context ''
jbertram Mar 13, 2012 12:12 AM (in response to avah99)It looks to me like this quick-start was written before JNDI functionality was completed for AS 7.1.0.Final, and it needs to be revisited. In the mean-time, try this bit of code for a remote JMS client:
import java.util.HashMap;
import java.util.Properties;
import javax.naming.Context;
import javax.naming.InitialContext;
import javax.jms.Connection;
import javax.jms.ConnectionFactory;
import javax.jms.Destination;
import javax.jms.Message;
import javax.jms.MessageProducer;
import javax.jms.Session;
public class PlainMessageSender {
public static void main(String[] args) throws Exception {
final Properties env = new Properties();
env.put(Context.INITIAL_CONTEXT_FACTORY, "org.jboss.naming.remote.client.InitialContextFactory");
env.put(Context.PROVIDER_URL, "remote://localhost:4447");
env.put(Context.SECURITY_PRINCIPAL, "guest");
env.put(Context.SECURITY_CREDENTIALS, "pass");
Context context = new InitialContext(env);
ConnectionFactory cf = (ConnectionFactory) context.lookup("jms/RemoteConnectionFactory");
Destination destination = (Destination) context.lookup("jms/queue/test");
context.close();
Connection connection = cf.createConnection("guest", "pass");
Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
MessageProducer producer = session.createProducer(destination);
Message msg = session.createTextMessage("example text");
producer.send(msg);
connection.close();
}
}
Before you run this make sure you execute <JBOSS_HOME>/bin/add-user.sh to add a user/password to the "ApplicationRealm" (e.g. guest/pass). Also, make sure the user belongs to the role "guest" since that is the role which has a few default JMS permissions. To be clear, both the JNDI look-up and the JMS operation will be secured with this username and password (which is why the credentials appear twice in the code).
-
5. Re: Exceptions after changing connection.type from netty to jndi: SEVERE: JBAS011855: Name 'RemoteConnectionFactory' not found in context ''
avah99 Mar 15, 2012 5:36 AM (in response to jbertram)Thank you Bertram very much! It is appreciated!