jms applet stange errors
citu_adrian Feb 12, 2003 12:34 PMHi,
I have jboss3.0.3 on a xp station. I have an applet that it connects to a topin on the server.
If i launch the applet from the appletviewer it's working fine but the problem is when i try to load the applet in the browser. The error is:
java.lang.ExceptionInInitializerError
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:130)
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.Connection.(Connection.java:264)
at org.jboss.mq.SpyConnection.(SpyConnection.java:59)
at org.jboss.mq.SpyConnectionFactory.createTopicConnection(SpyConnectionFactory.java:78)
at JmsApplet.Applet1.init(Applet1.java:84)
at sun.applet.AppletPanel.run(AppletPanel.java:341)
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)
And now i will give the applet code:
Hashtable env = new Hashtable();
env.put ("java.naming.factory.initial", "org.jnp.interfaces.NamingContextFactory");
env.put ("java.naming.provider.url", "jnp://"+this.getCodeBase().getHost()+":1099");
env.put("java.naming.rmi.security.manager", "yes");
env.put ("java.naming.factory.url.pkgs", "org.jboss.naming:org.jboss.interfaces");
env.put ("jnp.socketFactory", "org.jnp.interfaces.TimedSocketFactory");
InitialContext jndi = new InitialContext(env);
System.out.println("I have InitialContext");
// Lookup a JMS connection factory
//TopicConnectionFactory conFactory = (TopicConnectionFactory)jndi.lookup("ConnectionFactory");
TopicConnectionFactory conFactory = (TopicConnectionFactory)jndi.lookup("UILConnectionFactory");
System.out.println("I have my Factory");
// Create a JMS connection
connection = conFactory.createTopicConnection();
System.out.println("Apres connection");
// Create a JMS session object
pubSession = connection.createTopicSession(false,Session.AUTO_ACKNOWLEDGE);
subSession = connection.createTopicSession(false,Session.AUTO_ACKNOWLEDGE);
jbInit();
Topic chatTopic = (Topic)jndi.lookup("topic/testTopic");
System.out.println("I have my Topic");
publisher = pubSession.createPublisher(chatTopic);
subscriber = subSession.createSubscriber(chatTopic);
// Set a JMS message listener
subscriber.setMessageListener(this);
connection.start();
So what's the problem? what's the difference between an appletviewer execution and browser execution?
Thank's
Ady