Applet not initialised

I have an applet that performs this code in the init() method:

try {

conn = new XMPPConnection(“myjabber.net”);

conn.login(“jabberapplet”, “jabberapplet”);

} catch (XMPPException e) {

System.out.println(e.getMessage());

}

which does not initialise and gives this output:

java.lang.ExceptionInInitializerError: java.security.AccessControlException: access denied (java.util.PropertyPermission smack.debugEnabled read)

at java.security.AccessControlContext.checkPermission(AccessControlContext.java:26 7)

at java.security.AccessController.checkPermission(AccessController.java:394)

at java.lang.SecurityManager.checkPermission(SecurityManager.java:540)

at java.lang.SecurityManager.checkPropertyAccess(SecurityManager.java:1273)

at java.lang.System.getProperty(System.java:555)

at java.lang.Boolean.getBoolean(Boolean.java:166)

at org.jivesoftware.smack.XMPPConnection.(XMPPConnection.java:95)

at SmackApplet.init(SmackApplet.java:28)

at sun.applet.AppletPanel.run(AppletPanel.java:339)

at java.lang.Thread.run(Thread.java:491)

The html code is like this:

Your browser does not support Java, so nothing is displayed.

In other words the applet is being loaded from the same place as the html page so I thought it would work. Any ideas?

thanks.

Sonicbeez,

This is an interesting problem. I’‘m fairly certain that trying to access a Java system property is triggering a security exception since applets are not supposed to be able to do this operation unless they are signed. I hadn’‘t thought about this before. To fix the problem, I’‘m adding a Java permission check to the code. If you download the 4/29 daily build when it’'s up at http://www.jivesoftware.com/xmpp/smack/dailybuilds.jsp , it will include the fix. Let me know how it goes.

Regards,

Matt

That seems to have done the trick!

Thanks.