[jboss-user] [Beginners Corner] - Newbie trying to run some code!

rodgerca do-not-reply at jboss.com
Wed Jun 20 07:45:36 EDT 2007


I'm getting the following error trying to run a client app.  JBoss server running fine.

javax.naming.CommunicationException: Could not obtain connection to any of these urls: localhost:1099 and discovery failed with error: java.security.AccessControlException: access denied (java.net.SocketPermission 230.0.0.4 connect,accept,resolve) [Root exception is javax.naming.CommunicationException: Failed to connect to server localhost:1099 [Root exception is java.security.AccessControlException: access denied (java.net.SocketPermission 127.0.0.1:1099 connect,resolve)]]

My code is (lifted straight from Trailblazer so surely it can't be wrong?)

QueueConnection cnn = null;
QueueSender sender = null;
QueueSession sess = null;
Queue queue = null;

	try {
					
	InitialContext ctx = getInitialContext(); //this sets the props and creates a RMI Security Manager
	
	queue = (Queue) ctx.lookup("queue/testQueue"); //falls over here!
	QueueConnectionFactory factory = (QueueConnectionFactory)    ctx.lookup("ConnectionFactory");

	cnn = factory.createQueueConnection();

	sess = cnn.createQueueSession(false, QueueSession.AUTO_ACKNOWLEDGE);
			
	TextMessage msg = sess.createTextMessage("Hello Clare");		
	sender = sess.createSender(queue);
	sender.send(msg);

	} catch (Exception e) {
		e.printStackTrace();
		}
	}
Any ideas?

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4055981#4055981

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4055981



More information about the jboss-user mailing list