Java-Gaming.org Hi !
Featured games (90)
games approved by the League of Dukes
Games in Showcase (736)
Games in Android Showcase (224)
games submitted by our members
Games in WIP (814)
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  
  Applets throwing NPE when succesfully loading jars  (Read 8804 times)
0 Members and 1 Guest are viewing this topic.
Offline Riven
Administrator

« JGO Overlord »


Medals: 1310
Projects: 4
Exp: 16 years


Hand over your head.


« Posted 2008-03-18 17:31:47 »

Everytime I load an applet, this ends up printed in the 'Sun Java Console' of JRE 1.6.0.05 (in IE7, FireFox 2 and Opera)

1  
2  
3  
4  
5  
java.lang.NullPointerException
   at sun.plugin.AppletViewer.loadJarFiles(Unknown Source)
   at sun.applet.AppletPanel.runLoader(Unknown Source)
   at sun.applet.AppletPanel.run(Unknown Source)
   at java.lang.Thread.run(Unknown Source)


The applets works fine (if it can get passed the initial locking-on-the-orange-java-logo, which happens about 20% (!!) of the time Angry)


(The NPE happens regardless of the lockup...)

Hi, appreciate more people! Σ ♥ = ¾
Learn how to award medals... and work your way up the social rankings!
Offline SimonH
« Reply #1 - Posted 2008-03-18 17:46:45 »

Anything odd in the manifest? Can you post a link for me to check here? (IE6 JRE 1.6.0.03)

People make games and games make people
Offline Riven
Administrator

« JGO Overlord »


Medals: 1310
Projects: 4
Exp: 16 years


Hand over your head.


« Reply #2 - Posted 2008-03-18 19:04:04 »

Can the lack of a manifest cause this? (I'm an Applet n00b)

Hi, appreciate more people! Σ ♥ = ¾
Learn how to award medals... and work your way up the social rankings!
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline SimonH
« Reply #3 - Posted 2008-03-19 13:52:07 »

Shouldn't do! Is this any help?
Reducing the jar size might help - keep resources separate &c.
It's not a bug I've ever found myself - I don't like the sound of it!

People make games and games make people
Offline DzzD
« Reply #4 - Posted 2008-03-19 14:55:05 »

it should not be related to your manifest, it is not requiered for unsigned applet you can simply zip your classes directory and rename it to .jar it should work often, at least for 1.6.0.03 and below.

maybe you can try with a jar containing only one classes ?

Offline Riven
Administrator

« JGO Overlord »


Medals: 1310
Projects: 4
Exp: 16 years


Hand over your head.


« Reply #5 - Posted 2008-04-05 09:27:04 »

I changed the JARs so that they have proper manifests...



when I remove the applet from the DOM tree, while it is hanging, it becomes clear what is blocking
1  
2  
3  
4  
5  
6  
7  
8  
java.lang.InterruptedException
   at java.lang.Object.wait(Native Method)
   at java.lang.Object.wait(Object.java:485)
   at sun.plugin.ClassLoaderInfo.lock(Unknown Source) <----------------------
   at sun.plugin.AppletViewer.loadJarFiles(Unknown Source)
   at sun.applet.AppletPanel.runLoader(Unknown Source)
   at sun.applet.AppletPanel.run(Unknown Source)
   at java.lang.Thread.run(Unknown Source)



this is a VERY serious problem!! 20% of the time an applet is loaded, IT HANGS!

this is a commercial site, we need that applet right there!




Maybe I should add that the initial NPE (see first post) has a similar stacktrace.

I bet the NPE (which is always thrown) causes a situation where a deadlock might occur.



.

Hi, appreciate more people! Σ ♥ = ¾
Learn how to award medals... and work your way up the social rankings!
Offline CommanderKeith
« Reply #6 - Posted 2008-04-05 10:11:17 »

So is the intial NPE still thrown?

I just did some googling about applets on the sun site and the guide I found was massive  Cry

Offline Riven
Administrator

« JGO Overlord »


Medals: 1310
Projects: 4
Exp: 16 years


Hand over your head.


« Reply #7 - Posted 2008-04-05 10:21:19 »

So is the intial NPE still thrown?

I just did some googling about applets on the sun site and the guide I found was massive  Cry


Yup, that silly NPE is there to stay.

I filled a bug in the BugParade and I hope they will have enough info to fix it, as it is now apparant the hanging is in their code, not some random browser screwup.

Hi, appreciate more people! Σ ♥ = ¾
Learn how to award medals... and work your way up the social rankings!
Offline DzzD
« Reply #8 - Posted 2008-04-05 15:05:48 »

what Tag did you use for your applet ?

did you get same error on other applet over internet ?

Offline CommanderKeith
« Reply #9 - Posted 2008-04-05 16:11:56 »

Have you tried using someone's example applet and html and modifying only what you need to? At least there's lots of people here who know about applets, maybe you should just try their html code and methods of jar'ing etc. DzzD's applets work pretty well.

Starting from scratch and trying to learn how the applet black box works sounds like the hard way.

Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline DzzD
« Reply #10 - Posted 2008-04-05 16:40:19 »

Very interristing summary on Applet :

http://java.sun.com/docs/books/tutorial/deployment/applet/

and that very annoying section... cant beleve nothing is done to correct that point:
Quote
...In many applet viewers (including browsers), reloading is not reliable. This is why we recommend that you simply use the JDK Applet Viewer, invoking it anew every time you change the applet.....

in
http://java.sun.com/docs/books/tutorial/deployment/applet/problemsindex.html


quote from this sun website, I would also recommend to not use lastest JRE Smiley (-target x.x)
Quote
Note: The HTML specification states that the applet tag is deprecated, and that you should use the object tag instead. However, the specification is vague about how browsers should implement the object tag to support Java applets, and browser support is currently inconsistent. It is therefore recommended that you continue to use the applet tag as a consistent way to deploy Java applets across browsers on all platforms

Offline Riven
Administrator

« JGO Overlord »


Medals: 1310
Projects: 4
Exp: 16 years


Hand over your head.


« Reply #11 - Posted 2008-04-05 18:18:00 »

DzzD, I get NPEs on your applets too.... could you check your Java Console?

http://dzzd.net/demo/PLANETARIUM/

Hi, appreciate more people! Σ ♥ = ¾
Learn how to award medals... and work your way up the social rankings!
Offline DzzD
« Reply #12 - Posted 2008-04-05 18:49:14 »

first try:

Quote
Java Plug-in 1.6.0_05
Utilisation de la version JRE 1.6.0_05 Java HotSpot(TM) Client VM
Répertoire d'accueil de l'utilisateur =
network: Chargement de la configuration du proxy définie par l'utilisateur ...
network: Terminé.
network: Chargement de la configuration du proxy à partir d'Internet Explorer ...
network: Terminé.
network: Chargement de la configuration directe du proxy ...
network: Terminé.
network: Configuration du proxy : Aucun proxy


----------------------------------------------------
c:   effacer la fenêtre de la console
f:   finaliser les objets de la file d'attente de finalisation
g:   libérer la mémoire
h:   afficher ce message d'aide
l:   vider la liste des chargeurs de classes
m:   imprimer le relevé d'utilisation de la mémoire
o:   déclencher la consignation
p:   recharger la configuration du proxy
q:   masquer la console
r:   recharger la configuration des politiques
s:   vider les propriétés système et déploiement
t:   vider la liste des threads
v:   vider la pile des threads
x:   effacer le cache de chargeurs de classes
0-5: fixer le niveau de traçage à <n>
----------------------------------------------------

liveconnect: Appel de la méthode JS : document
liveconnect: Appel de la méthode JS : URL
basic: Référence au chargeur de classes : sun.plugin.ClassLoaderInfo@c1cd1f, refcount=1
basic: Récepteur de progression ajouté : sun.plugin.util.GrayBoxPainter@7259da
basic: Chargement de l'applet...
basic: Initialisation de l'applet...
basic: Démarrage de l'applet...
basic: completed perf rollup
basic: Arrêt de l'applet...
basic: Récepteur de progression supprimé : sun.plugin.util.GrayBoxPainter@7259da
basic: Recherche d'informations...
basic: Libération du chargeur de classes : sun.plugin.ClassLoaderInfo@c1cd1f, refcount=0
basic: Mise en cache du chargeur de classes : sun.plugin.ClassLoaderInfo@c1cd1f
basic: Taille de cache du chargeur de classes courant : 1
basic: Terminé...
basic: Jonction du thread d'applet...
basic: Destruction de l'applet...
basic: Elimination de l'applet...
java.lang.NullPointerException
   at sun.plugin.AppletViewer.loadJarFiles(Unknown Source)
   at sun.applet.AppletPanel.runLoader(Unknown Source)
   at sun.applet.AppletPanel.run(Unknown Source)
   at java.lang.Thread.run(Unknown Source)
basic: Exception : java.lang.NullPointerException
basic: Thread d'applet joint...
basic: Sortie de l'applet...

But it seems to happend before I ran any applet, when you open this page the only applet launched is code=java.applet.Applet, seems to happend on an applet destruction...

EDIT:
In this sample an Applet code=java.applet.Applet is first created and immediatly destroyed (removed from DOM) seems that cause the crash, what is strange is that Applet dont use any jar and only a local class file ....

Offline ddyer
« Reply #13 - Posted 2008-04-22 12:02:06 »

It's very easy to end up with strange, probabilistic errors due to initializations running
in multiple threads, along with window setup, refresh events, "run" processes of
runnable threads - all firing off at the same time.

It's wise to keep initialization as simple and untangled as possible.  For example, constructors
shouldn't try to create windows or set up event listeners.  Window repaint routines and event
listeners ought to do nothing until a flag you set at the end of all necessary initialization is set.

My applets feed EVERYTHING through one thread - mouse, network, window events.  Every line
of code is in effect only executed by one particular thread.  Java threads are extremely dangerous.
Offline Riven
Administrator

« JGO Overlord »


Medals: 1310
Projects: 4
Exp: 16 years


Hand over your head.


« Reply #14 - Posted 2008-04-22 14:02:13 »

Well, is a HelloWorld applet too advanced? It throws the NPE too, and hangs 20% of the time.


And uh... thanks Sun, for ignoring my bug report, or is one month of silence to be expected?

Hi, appreciate more people! Σ ♥ = ¾
Learn how to award medals... and work your way up the social rankings!
Offline DzzD
« Reply #15 - Posted 2008-10-26 14:07:17 »

anything new about this one ?

Offline Riven
Administrator

« JGO Overlord »


Medals: 1310
Projects: 4
Exp: 16 years


Hand over your head.


« Reply #16 - Posted 2008-10-26 14:24:40 »

I got a reply some time ago: could not reproduce.

Hi, appreciate more people! Σ ♥ = ¾
Learn how to award medals... and work your way up the social rankings!
Pages: [1]
  ignore  |  Print  
 
 
You cannot reply to this message, because it is very, very old.

 
cybrmynd (138 views)
2017-08-02 12:28:51

cybrmynd (159 views)
2017-08-02 12:19:43

cybrmynd (153 views)
2017-08-02 12:18:09

Sralse (169 views)
2017-07-25 17:13:48

Archive (648 views)
2017-04-27 17:45:51

buddyBro (767 views)
2017-04-05 03:38:00

CopyableCougar4 (1301 views)
2017-03-24 15:39:42

theagentd (1265 views)
2017-03-24 15:32:08

Rule (1237 views)
2017-03-19 12:43:22

Rule (1312 views)
2017-03-19 12:42:17
List of Learning Resources
by elect
2017-03-13 14:05:44

List of Learning Resources
by elect
2017-03-13 14:04:45

SF/X Libraries
by philfrei
2017-03-02 08:45:19

SF/X Libraries
by philfrei
2017-03-02 08:44:05

SF/X Libraries
by SkyAphid
2017-03-02 06:38:56

SF/X Libraries
by SkyAphid
2017-03-02 06:38:32

SF/X Libraries
by SkyAphid
2017-03-02 06:38:05

SF/X Libraries
by SkyAphid
2017-03-02 06:37:51
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!