Results 1 to 4 of 4
  1. #1
    a_butta is offline Member
    Join Date
    Jun 2011
    Posts
    2
    Rep Power
    0

    Default [Applet] All right in AppletViewer but error in browser

    Hi to everyone.
    I'm new in this forum and sorry for my bad english.
    I'n new also to Java programming and i'm trying to create a Java Applet for a school test.
    I'm using NetBeans in order to write and compile the application.
    After finishing the writing of the code, the applet run perfectly in the AppletViewer of NetBeans but when i launch the applet in the browser it appears grey and does nothing.
    The JavaConsole reports this error:
    Java Code:
    security: property package.access value sun.,com.sun.xml.internal.ws.,com.sun.xml.internal.bind.,com.sun.imageio.
    security: property package.access new value sun.,com.sun.xml.internal.ws.,com.sun.xml.internal.bind.,com.sun.imageio.,com.sun.javaws
    security: property package.access value sun.,com.sun.xml.internal.ws.,com.sun.xml.internal.bind.,com.sun.imageio.,com.sun.javaws
    security: property package.access new value sun.,com.sun.xml.internal.ws.,com.sun.xml.internal.bind.,com.sun.imageio.,com.sun.javaws,com.sun.deploy
    security: property package.access value sun.,com.sun.xml.internal.ws.,com.sun.xml.internal.bind.,com.sun.imageio.,com.sun.javaws,com.sun.deploy
    security: property package.access new value sun.,com.sun.xml.internal.ws.,com.sun.xml.internal.bind.,com.sun.imageio.,com.sun.javaws,com.sun.deploy,com.sun.jnlp
    security: property package.definition value null
    security: property package.definition new value com.sun.javaws
    security: property package.definition value com.sun.javaws
    security: property package.definition new value com.sun.javaws,com.sun.deploy
    security: property package.definition value com.sun.javaws,com.sun.deploy
    security: property package.definition new value com.sun.javaws,com.sun.deploy,com.sun.jnlp
    security: property package.access value sun.,com.sun.xml.internal.ws.,com.sun.xml.internal.bind.,com.sun.imageio.,com.sun.javaws,com.sun.deploy,com.sun.jnlp
    security: property package.access new value sun.,com.sun.xml.internal.ws.,com.sun.xml.internal.bind.,com.sun.imageio.,com.sun.javaws,com.sun.deploy,com.sun.jnlp,org.mozilla.jss
    security: property package.definition value com.sun.javaws,com.sun.deploy,com.sun.jnlp
    security: property package.definition new value com.sun.javaws,com.sun.deploy,com.sun.jnlp,org.mozilla.jss
    basic: Aggiunto ascoltatore avanzamento: sun.plugin.util.GrayBoxPainter$GrayBoxProgressListener@6f7ce9
    network: Voce cache non trovata [url: file:/G:/Documenti/Projects/Java/Eclipse/applet_HelloWorld/build/classes/, versione: null]
    network: Voce cache non trovata [url: file:/G:/Documenti/Projects/Java/Eclipse/applet_HelloWorld/build/classes/, versione: null]
    basic: Applet caricato.
    basic: Applet resized and added to parent container
    basic: PERF: AppletExecutionRunnable - applet.init() BEGIN ; jvmLaunch dt 610723 us, pluginInit dt 2408671 us, TotalTime: 3019394 us
    java.lang.reflect.InvocationTargetException
    	at java.awt.EventQueue.invokeAndWait(Unknown Source)
    	at javax.swing.SwingUtilities.invokeAndWait(Unknown Source)
    	at EnigmaApplet.init(EnigmaApplet.java:59)
    	at sun.plugin2.applet.Plugin2Manager$AppletExecutionRunnable.run(Unknown Source)
    	at java.lang.Thread.run(Unknown Source)
    Caused by: java.security.AccessControlException: access denied (java.awt.AWTPermission setAppletStub)
    	at java.security.AccessControlContext.checkPermission(Unknown Source)
    	at java.security.AccessController.checkPermission(Unknown Source)
    	at java.lang.SecurityManager.checkPermission(Unknown Source)
    	at java.applet.Applet.setStub(Unknown Source)
    	at EnigmaApplet.initComponents(EnigmaApplet.java:116)
    	at EnigmaApplet.access$000(EnigmaApplet.java:53)
    	at EnigmaApplet$1.run(EnigmaApplet.java:61)
    	at java.awt.event.InvocationEvent.dispatch(Unknown Source)
    	at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
    	at java.awt.EventQueue.access$000(Unknown Source)
    	at java.awt.EventQueue$1.run(Unknown Source)
    	at java.awt.EventQueue$1.run(Unknown Source)
    	at java.security.AccessController.doPrivileged(Native Method)
    	at java.security.AccessControlContext$1.doIntersectionPrivilege(Unknown Source)
    	at java.awt.EventQueue.dispatchEvent(Unknown Source)
    	at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
    	at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
    	at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
    	at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
    	at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
    	at java.awt.EventDispatchThread.run(Unknown Source)
    basic: Applet initialized
    basic: Rimosso ascoltatore avanzamento: sun.plugin.util.GrayBoxPainter$GrayBoxProgressListener@6f7ce9
    basic: Applet made visible
    basic: Starting applet
    basic: completed perf rollup
    basic: Applet started
    basic: Told clients applet is started
    I can't understand how to resolve this problem... Anyone who can help me?
    Thanks a lot in advance.

  2. #2
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    Eastern Florida
    Posts
    17,882
    Rep Power
    25

    Default

    AccessControlException: access denied (java.awt.AWTPermission setAppletStub)
    It looks like your applet does not have permission for what it is trying to do.

    at EnigmaApplet.initComponents(EnigmaApplet.java:116)

    What is your applet doing at line 116? Calling setStub() is unusual.

    There are some tips on how to use applets here:
    What Applets Can and Cannot Do (The Java™ Tutorials > Deployment > Applets)
    Deploying an Applet (The Java™ Tutorials > Deployment > Applets)

  3. #3
    a_butta is offline Member
    Join Date
    Jun 2011
    Posts
    2
    Rep Power
    0

    Default

    Oh my God! It was the line 89 that generated the problem:
    Java Code:
    setStub(null);
    I don't know what it is (i'm very new to Java programming);
    it was automatically generated by NetBeans, but it was enough deleting this line to make the applet run perfectly into the browser.

    Thank's a lot for the solution!! :)

  4. #4
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    Eastern Florida
    Posts
    17,882
    Rep Power
    25

Similar Threads

  1. No sound when applet is in browser
    By Ambergahill in forum New To Java
    Replies: 5
    Last Post: 11-21-2010, 07:40 AM
  2. Replies: 1
    Last Post: 07-27-2009, 12:59 PM
  3. Applet Slideshow in web browser
    By Urgle in forum New To Java
    Replies: 0
    Last Post: 12-01-2008, 05:30 AM
  4. Problem with applet, between appletviewer and browser
    By Goodwine in forum Java Applets
    Replies: 0
    Last Post: 11-30-2008, 04:09 AM
  5. applet won't run in browser...
    By shwein in forum Java Applets
    Replies: 6
    Last Post: 10-17-2008, 07:24 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •