Java-Gaming.org    
Featured games (91)
games approved by the League of Dukes
Games in Showcase (579)
games submitted by our members
Games in WIP (500)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  Broken applet - assist please  (Read 1672 times)
0 Members and 1 Guest are viewing this topic.
Offline Eli Delventhal

JGO Kernel


Medals: 42
Projects: 12


Game Engineer


« Posted 2012-08-30 08:55:56 »

Fixed now, thanks. Smiley

This applet is broken, I get an InvocationTargetException. As far as I know these generally come up when something unrelated is wrong. Running this as an app or in my local applet loader works fine. For some reason, my console is empty so I can't get a stack trace.

Could someone please try running this and post the stack trace they get? Thanks very much.

See my work:
OTC Software
Offline Tim Spekler
« Reply #1 - Posted 2012-08-30 09:24:37 »

This is the error I get:

1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
18  
19  
20  
21  
22  
23  
24  
25  
26  
27  
28  
29  
30  
31  
32  
33  
34  
35  
36  
37  
java.lang.reflect.InvocationTargetException
   at com.sun.deploy.util.DeployAWTUtil.invokeAndWait(Unknown Source)
   at sun.plugin2.applet.Plugin2Manager.runOnEDT(Unknown Source)
   at sun.plugin2.applet.Plugin2Manager.createApplet(Unknown Source)
   at sun.plugin2.applet.Plugin2Manager$AppletExecutionRunnable.run(Unknown Source)
   at java.lang.Thread.run(Unknown Source)
Caused by: java.security.AccessControlException: access denied (java.util.PropertyPermission sun.java2d.opengl write)
   at java.security.AccessControlContext.checkPermission(Unknown Source)
   at java.security.AccessController.checkPermission(Unknown Source)
   at java.lang.SecurityManager.checkPermission(Unknown Source)
   at java.lang.System.setProperty(Unknown Source)
   at com.otcsw.darwinsapple.Globals.initialize(Globals.java:65)
   at com.otcsw.darwinsapple.DarwinsAppleController.initialize(DarwinsAppleController.java:36)
   at com.otcsw.darwinsapple.DarwinsAppleMain.<init>(DarwinsAppleMain.java:34)
   at com.otcsw.darwinsapple.DarwinsAppleMain.<init>(DarwinsAppleMain.java:23)
   at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
   at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
   at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
   at java.lang.reflect.Constructor.newInstance(Unknown Source)
   at java.lang.Class.newInstance0(Unknown Source)
   at java.lang.Class.newInstance(Unknown Source)
   at sun.plugin2.applet.Plugin2Manager$12.run(Unknown Source)
   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)
Exception : java.lang.reflect.InvocationTargetException


It seems that you did not sign your jar correctly... (I think  Roll Eyes )
Offline Eli Delventhal

JGO Kernel


Medals: 42
Projects: 12


Game Engineer


« Reply #2 - Posted 2012-08-30 17:55:44 »

Ah, I think I asked for hardware acceleration and maybe I'm not allowed to get it? The JAR works completely within the sandbox, shouldn't need to be signed. Thanks for the stack trace, I'll have a look later.

See my work:
OTC Software
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline nsigma
« Reply #3 - Posted 2012-08-30 18:06:52 »

How are you requesting it?  Shouldn't system properties be specified in a <param> tag (doesn't seem to be looking at your page source)?  According to the deployment guidelines that property shouldn't cause the need for signing.

IANAAS (I am not an applet specialist)  Wink

Praxis LIVE - open-source intermedia toolkit and live interactive visual editor
Digital Prisoners - interactive spaces and projections
Offline Eli Delventhal

JGO Kernel


Medals: 42
Projects: 12


Game Engineer


« Reply #4 - Posted 2012-08-30 19:09:20 »

I was getting very bad performance drawing some images so I tried turning on hardware acceleration using both launch params and this code I found on the internets:

1  
System.setProperty("sun.java2d.opengl","True");


Turning it on seemed to do nothing whatsoever, so I *sigh* had to make my code not shitty instead. I removed that line of code, looks hunky dory now. Amusingly enough it won't grab focus so keyboard input won't work. New problems, go! I'll fix that when I get some time.

[EDIT]I fixed the focus issue. I was already calling requestFocusInWindow() but interestingly enough it performs slightly differently in an applet than it does in an app. It must be called later (after the applet is already loaded and added to screen). I added in a popup that appears if you don't have focus, works well enough.[/EDIT]

See my work:
OTC Software
Offline Rorkien
« Reply #5 - Posted 2012-08-30 21:34:29 »

It is working perfectly fine for me, no exceptions and good speed Smiley
Offline gouessej

« In padded room »



TUER


« Reply #6 - Posted 2012-08-30 21:37:44 »

Sorry I see only a black screen.

Offline ra4king

JGO Kernel


Medals: 322
Projects: 2
Exp: 4 years


I'm the King!


« Reply #7 - Posted 2012-08-31 04:01:45 »

Setting sun.* properties in Java is not allowed for applets. To do so, you have to set them as parameters in the html file:
1  
2  
3  
4  
<applet ..... >
    <param name="java_arguments" value="-Dsun.java2d.opengl=true" />
    ....
</applet>

Offline Vladiedoo
« Reply #8 - Posted 2012-08-31 04:56:11 »

Works for me (Windows 7) as well.
Offline .exe

Senior Newbie





« Reply #9 - Posted 2012-08-31 15:22:42 »

this one works for me, in index.html file:

1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
18  
<applet code="org.jdesktop.applet.util.JNLPAppletLauncher"
      width="100%"
      height="100%"
      archive="jar/applet-launcher.jar,
               jar/gluegen-rt.jar,
               jar/jogl.all.jar,
               jar/<your_file>.jar"
>
   <param name="codebase_lookup" value="false">
   <param name="subapplet.classname" value="main.class.here">
   <param name="subapplet.displayname" value="">
   <param name="noddraw.check" value="true">
   <param name="progressbar" value="true">
   <param name="jnlpNumExtensions" value="1">
   <param name="jnlpExtension1"
          value="jar/jogl-all-awt.jnlp">
   <param name="java_arguments" value="-Dsun.java2d.noddraw=true">
   <param name="jnlp_href" value="jar/applet-launcher.jnlp">
</applet>


applet-launcher.jnlp:
1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
18  
19  
20  
21  
22  
23  
24  
25  
<?xml version="1.0" encoding="utf-8"?>
<jnlp href="applet-launcher.jnlp">
  <information>
    <title></title>
    <vendor></vendor>
    <homepage href=""/>
    <description></description>
    <description kind="short"></description>
    <offline-allowed/>
  </information>

    <resources>
      <j2se href="http://java.sun.com/products/autodl/j2se" version="1.4+"/>
      <property name="sun.java2d.noddraw" value="true"/>
      <jar href="yourfile.jar" main="true"/>
      <extension name="newt-all-awt" href="jogl-all-awt.jnlp" />
    </resources>

  <applet-desc
      name="Applet"
      main-class="main/class.here"
      width="640"
      height="480">
  </applet-desc>
</jnlp>
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline Eli Delventhal

JGO Kernel


Medals: 42
Projects: 12


Game Engineer


« Reply #10 - Posted 2012-09-03 01:58:07 »

Setting sun.* properties in Java is not allowed for applets. To do so, you have to set them as parameters in the html file:
1  
2  
3  
4  
<applet ..... >
    <param name="java_arguments" value="-Dsun.java2d.opengl=true" />
    ....
</applet>

Ayup, I had that on as well and it didn't seem to do anything so I turned it off. I forgot I still had it being set in code. I was trying both to attempt to get any sort of difference.

See my work:
OTC Software
Pages: [1]
  ignore  |  Print  
 
 
You cannot reply to this message, because it is very, very old.

 

Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

xsi3rr4x (41 views)
2014-04-15 18:08:23

BurntPizza (37 views)
2014-04-15 03:46:01

UprightPath (53 views)
2014-04-14 17:39:50

UprightPath (35 views)
2014-04-14 17:35:47

Porlus (52 views)
2014-04-14 15:48:38

tom_mai78101 (74 views)
2014-04-10 04:04:31

BurntPizza (133 views)
2014-04-08 23:06:04

tom_mai78101 (233 views)
2014-04-05 13:34:39

trollwarrior1 (195 views)
2014-04-04 12:06:45

CJLetsGame (203 views)
2014-04-01 02:16:10
List of Learning Resources
by SHC
2014-04-18 03:17:39

List of Learning Resources
by Longarmx
2014-04-08 03:14:44

Good Examples
by matheus23
2014-04-05 13:51:37

Good Examples
by Grunnt
2014-04-03 15:48:46

Good Examples
by Grunnt
2014-04-03 15:48:37

Good Examples
by matheus23
2014-04-01 18:40:51

Good Examples
by matheus23
2014-04-01 18:40:34

Anonymous/Local/Inner class gotchas
by Roquen
2014-03-11 15:22:30
java-gaming.org is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑gaming.org
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!