2 Replies Latest reply on Feb 23, 2003 5:09 PM by Justin Permar

    accessing JBossMQ queue via applet on local computer

    Justin Permar Newbie

      I have a working standalone application which accesses one of the default queues ("queue/A"). Now I'm trying to get the same thing working from an applet on a web page on the local web server.

      I'm using JBoss 3.0.4, with /etc/hosts configured properly, i.e., xxx.xxx.xxx.xxx myhostname

      and i access the applet over my web server at http://myhostname.

      The applet looks up a UILConnectionFactory over JNDI, and then attempts to make a queue connection via createQueueConnection. This is where it fails. Here's the partial stacktrace I have (I can't figure out how to see all the exceptions in the Java Control Panel!)..

      my code is very simple, in the applet's start() method:

      try {
      jndiContext = new InitialContext(env);
      } catch (NamingException e) {
      System.out.println("Could not create JNDI API " +
      "context: " + e.toString());

      try {
      queueConnectionFactory = (QueueConnectionFactory)
      queue = (Queue) jndiContext.lookup(queueName);
      } catch (NamingException e) {
      System.out.println("JNDI API lookup failed: " +

      try {
      queueConnection =

      I get an error on the above line... please note that my stand-alone client works without any username/password in the above method. I simply added the above default user combination since the error below says someting about permissions...

      at java.lang.Class.forName0(Native Method)
      at java.lang.Class.forName(Class.java:140)
      at org.jboss.util.NestedThrowable$Util.class$(NestedThrowable.java:27)
      at org.jboss.util.NestedThrowable$Util.(NestedThrowable.java:101)
      at org.jboss.mq.SpyJMSException.(SpyJMSException.java:67)
      at org.jboss.mq.Connection.authenticate(Connection.java:766)
      at org.jboss.mq.Connection.(Connection.java:233)
      at org.jboss.mq.SpyConnection.(SpyConnection.java:48)
      at org.jboss.mq.SpyConnectionFactory.createQueueConnection(SpyConnectionFactory.java:135)
      at com.jpermar.client.AppletClient.start(AppletClient.java:130)
      at sun.applet.AppletPanel.run(AppletPanel.java:370)
      at java.lang.Thread.run(Thread.java:536)
      Caused by: java.security.AccessControlException: access denied (java.util.PropertyPermission org.jboss.util.NestedThrowable.parentTraceEnabled read)
      at java.security.AccessControlContext.checkPermission(AccessControlContext.java:270)
      at java.security.AccessController.checkPermission(AccessController.java:401)
      at java.lang.SecurityManager.checkPermission(SecurityManager.java:542)
      at java.lang.SecurityManager.checkPropertyAccess(SecurityManager.java:1291)
      at java.lang.System.getProperty(System.java:611)
      at org.jboss.util.NestedThrowable$Util.getBoolean(NestedThrowable.java:123)
      at org.jboss.util.NestedThrowable.(NestedThrowable.java:39)
      ... 12 more

      Any thoughts? I'd very much appreciate any and all ideas/suggestions!!

      Thanks much in advance!