#1
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Apr 2013
    Posts
    62
    Rep Power
    2

    Exception in initalizer error?


    I created a japplet in java and put it on website. there are no errors in eclipse and it works fine.

    on web it say "Error - click for details". when i click on it, it says 'ExceptionInInitializerError' but no details.

    does the error has to do with the code below?

    Code:
    public void run()
    	{
    		while(!player_class.isDEAD()) 		                
                  {
    		    ....	
    			repaint();
    			try
    			{
    				Thread.sleep(10);
    			}
    			catch(InterruptedException e)
    			{
    				e.printStackTrace();
    			}	
    		}/*** end of while loop ***/
    	}/*** end of run method ***/
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Novice (500 - 999 posts)

    Join Date
    May 2007
    Posts
    765
    Rep Power
    928
    Unlikely, if you read the docs (ExceptionInInitializerError), you'll find that this error relates to initializer blocks and variable initializers. Do you have the java console open? it usually provides a stack trace for any unhandled exceptions.

    (BTW, if you ask in the Java forum, there are more people with more java experience there.)
    sub{*{$::{$_}}{CODE}==$_[0]&& print for(%:: )}->(\&Meh);
  4. #3
  5. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Apr 2013
    Posts
    62
    Rep Power
    2
    Originally Posted by OmegaZero
    Unlikely, if you read the docs (ExceptionInInitializerError), you'll find that this error relates to initializer blocks and variable initializers. Do you have the java console open? it usually provides a stack trace for any unhandled exceptions.

    (BTW, if you ask in the Java forum, there are more people with more java experience there.)
    i do have some static variables.
    in top of main class i have:
    Code:
    private static final long serialVersionUID = 1L;
    public static final int WINDOW_WIDTH = 900;
    public static final int WINDOW_HEIGHT = 400;
    public static final int DELAY = 15;
    and in spreet sheet class - where i loading images - i am using static variabnles and methods:
    Code:
    public class SpriteSheet {
    
        private static BufferedImage spriteSheet;
        private static final int TILE_SIZE = 32;
      
        public static BufferedImage loadSprite(String file) {
    
        BufferedImage sprite = null;
    
            try {
                sprite = ImageIO.read(new File("image/" + file + ".gif"));
            } catch (IOException e) {
                e.printStackTrace();
            }
    
            return sprite;
        }
    
        public static BufferedImage getSprite(int xGrid, int yGrid) {
    
            if (spriteSheet == null) {
                spriteSheet = loadSprite("playerSprite");
            }
    
            return spriteSheet.getSubimage(xGrid * TILE_SIZE, yGrid * TILE_SIZE, TILE_SIZE, TILE_SIZE);
        }

    and than i am also using the static variable in different classes. do you think this is the problem??
  6. #4
  7. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Apr 2013
    Posts
    62
    Rep Power
    2
    on java console i did dump thread stack and i got this. not sure what this is tho.


    Code:
    Java Plug-in 10.21.2.11
    Using JRE version 1.7.0_21-b11 Java HotSpot(TM) Client VM
    User home directory = C:\Users\dave
    ----------------------------------------------------
    c:   clear console window
    f:   finalize objects on finalization queue
    g:   garbage collect
    h:   display this help message
    l:   dump classloader list
    m:   print memory usage
    o:   trigger logging
    q:   hide console
    r:   reload policy configuration
    s:   dump system and deployment properties
    t:   dump thread list
    v:   dump thread stack
    x:   clear classloader cache
    0-5: set trace level to <n>
    ----------------------------------------------------
    Dump thread stack ...
    ----------------------------------------------------
    2013-04-30 17:20:01
    Full thread dump Java HotSpot(TM) Client VM (23.21-b01 mixed mode, sharing):
    
    "D3D Screen Updater" daemon prio=8 tid=0x05070400 nid=0x8370 in Object.wait() [0x07eff000]
       java.lang.Thread.State: TIMED_WAITING (on object monitor)
    	at java.lang.Object.wait(Native Method)
    	- waiting on <0x29c78070> (a java.lang.Object)
    	at sun.java2d.d3d.D3DScreenUpdateManager.run(Unknown Source)
    	- locked <0x29c78070> (a java.lang.Object)
    	at java.lang.Thread.run(Unknown Source)
    
    "ConsoleTraceListener" daemon prio=4 tid=0x05070000 nid=0x7704 in Object.wait() [0x0817f000]
       java.lang.Thread.State: WAITING (on object monitor)
    	at java.lang.Object.wait(Native Method)
    	- waiting on <0x29c78888> (a com.sun.deploy.uitoolkit.ui.ConsoleTraceListener$BoundedStringBuffer)
    	at java.lang.Object.wait(Object.java:503)
    	at com.sun.deploy.uitoolkit.ui.ConsoleTraceListener$ConsoleWriterThread.run(Unknown Source)
    	- locked <0x29c78888> (a com.sun.deploy.uitoolkit.ui.ConsoleTraceListener$BoundedStringBuffer)
    
    "AWT-EventQueue-1" prio=6 tid=0x05072c00 nid=0x7a10 waiting on condition [0x08ace000]
       java.lang.Thread.State: RUNNABLE
    	at com.sun.deploy.uitoolkit.ui.ConsoleHelper.dumpAllStacksImpl(Native Method)
    	at com.sun.deploy.uitoolkit.ui.ConsoleHelper.dumpAllStacks(Unknown Source)
    	at com.sun.deploy.uitoolkit.impl.awt.ui.SwingConsoleWindow$3.actionPerformed(Unknown Source)
    	at javax.swing.JComponent$ActionStandin.actionPerformed(Unknown Source)
    	at javax.swing.SwingUtilities.notifyAction(Unknown Source)
    	at javax.swing.JComponent.processKeyBinding(Unknown Source)
    	at javax.swing.KeyboardManager.fireBinding(Unknown Source)
    	at javax.swing.KeyboardManager.fireKeyboardAction(Unknown Source)
    	at javax.swing.JComponent.processKeyBindingsForAllComponents(Unknown Source)
    	at javax.swing.JComponent.processKeyBindings(Unknown Source)
    	at javax.swing.JComponent.processKeyEvent(Unknown Source)
    	at java.awt.Component.processEvent(Unknown Source)
    	at java.awt.Container.processEvent(Unknown Source)
    	at java.awt.Component.dispatchEventImpl(Unknown Source)
    	at java.awt.Container.dispatchEventImpl(Unknown Source)
    	at java.awt.Component.dispatchEvent(Unknown Source)
    	at java.awt.KeyboardFocusManager.redispatchEvent(Unknown Source)
    	at java.awt.DefaultKeyboardFocusManager.dispatchKeyEvent(Unknown Source)
    	at java.awt.DefaultKeyboardFocusManager.preDispatchKeyEvent(Unknown Source)
    	at java.awt.DefaultKeyboardFocusManager.typeAheadAssertions(Unknown Source)
    	at java.awt.DefaultKeyboardFocusManager.dispatchEvent(Unknown Source)
    	at java.awt.Component.dispatchEventImpl(Unknown Source)
    	at java.awt.Container.dispatchEventImpl(Unknown Source)
    	at java.awt.Window.dispatchEventImpl(Unknown Source)
    	at java.awt.Component.dispatchEvent(Unknown Source)
    	at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
    	at java.awt.EventQueue.access$200(Unknown Source)
    	at java.awt.EventQueue$3.run(Unknown Source)
    	at java.awt.EventQueue$3.run(Unknown Source)
    	at java.security.AccessController.doPrivileged(Native Method)
    	at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
    	at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
    	at java.awt.EventQueue$4.run(Unknown Source)
    	at java.awt.EventQueue$4.run(Unknown Source)
    	at java.security.AccessController.doPrivileged(Native Method)
    	at java.security.ProtectionDomain$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)
    
    "TimerQueue" daemon prio=4 tid=0x05070c00 nid=0x6dfc waiting on condition [0x06caf000]
       java.lang.Thread.State: WAITING (parking)
    	at sun.misc.Unsafe.park(Native Method)
    	- parking to wait for  <0x24f884c8> (a java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject)
    	at java.util.concurrent.locks.LockSupport.park(Unknown Source)
    	at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(Unknown Source)
    	at java.util.concurrent.DelayQueue.take(Unknown Source)
    	at javax.swing.TimerQueue.run(Unknown Source)
    	at java.lang.Thread.run(Unknown Source)
    
    "AWT-EventQueue-5" prio=4 tid=0x0506ec00 nid=0x7a60 waiting on condition [0x0832f000]
       java.lang.Thread.State: WAITING (parking)
    	at sun.misc.Unsafe.park(Native Method)
    	- parking to wait for  <0x24e6f470> (a java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject)
    	at java.util.concurrent.locks.LockSupport.park(Unknown Source)
    	at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(Unknown Source)
    	at java.awt.EventQueue.getNextEvent(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)
    
    "Applet 4 LiveConnect Worker Thread" prio=4 tid=0x0506f800 nid=0x68e8 in Object.wait() [0x06e7f000]
       java.lang.Thread.State: WAITING (on object monitor)
    	at java.lang.Object.wait(Native Method)
    	- waiting on <0x24a2d0d8> (a java.lang.Object)
    	at java.lang.Object.wait(Object.java:503)
    	at sun.plugin2.main.client.LiveConnectSupport$PerAppletInfo$LiveConnectWorker.run(Unknown Source)
    	- locked <0x24a2d0d8> (a java.lang.Object)
    	at java.lang.Thread.run(Unknown Source)
    
    "Java Sound Event Dispatcher" daemon prio=4 tid=0x05072400 nid=0x86ac in Object.wait() [0x0897f000]
       java.lang.Thread.State: WAITING (on object monitor)
    	at java.lang.Object.wait(Native Method)
    	- waiting on <0x2a925650> (a com.sun.media.sound.EventDispatcher)
    	at java.lang.Object.wait(Object.java:503)
    	at com.sun.media.sound.EventDispatcher.dispatchEvents(Unknown Source)
    	- locked <0x2a925650> (a com.sun.media.sound.EventDispatcher)
    	at com.sun.media.sound.EventDispatcher.run(Unknown Source)
    	at java.lang.Thread.run(Unknown Source)
    
    "AWT-EventQueue-0" prio=6 tid=0x05071000 nid=0x6f84 waiting on condition [0x0741f000]
       java.lang.Thread.State: WAITING (parking)
    	at sun.misc.Unsafe.park(Native Method)
    	- parking to wait for  <0x29cdf028> (a java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject)
    	at java.util.concurrent.locks.LockSupport.park(Unknown Source)
    	at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(Unknown Source)
    	at java.awt.EventQueue.getNextEvent(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)
    
    "AWT-Shutdown" prio=6 tid=0x0506e400 nid=0x7af4 in Object.wait() [0x071af000]
       java.lang.Thread.State: WAITING (on object monitor)
    	at java.lang.Object.wait(Native Method)
    	- waiting on <0x29cdf080> (a java.lang.Object)
    	at java.lang.Object.wait(Object.java:503)
    	at sun.awt.AWTAutoShutdown.run(Unknown Source)
    	- locked <0x29cdf080> (a java.lang.Object)
    	at java.lang.Thread.run(Unknown Source)
    
    "TimerQueue" daemon prio=6 tid=0x05071c00 nid=0x76f8 waiting on condition [0x09d0f000]
       java.lang.Thread.State: WAITING (parking)
    	at sun.misc.Unsafe.park(Native Method)
    	- parking to wait for  <0x29dad9d8> (a java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject)
    	at java.util.concurrent.locks.LockSupport.park(Unknown Source)
    	at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(Unknown Source)
    	at java.util.concurrent.DelayQueue.take(Unknown Source)
    	at javax.swing.TimerQueue.run(Unknown Source)
    	at java.lang.Thread.run(Unknown Source)
    
    "JVM[id=1]-Heartbeat" daemon prio=6 tid=0x0506f000 nid=0x8678 in Object.wait() [0x07bdf000]
       java.lang.Thread.State: TIMED_WAITING (on object monitor)
    	at java.lang.Object.wait(Native Method)
    	- waiting on <0x29cdf0a8> (a sun.plugin2.main.client.PluginMain$Heartbeat)
    	at sun.plugin2.main.server.HeartbeatThread.run(Unknown Source)
    	- locked <0x29cdf0a8> (a sun.plugin2.main.client.PluginMain$Heartbeat)
    
    "Browser Side Object Cleanup Thread" prio=6 tid=0x0506e000 nid=0x8140 in Object.wait() [0x07a1f000]
       java.lang.Thread.State: WAITING (on object monitor)
    	at java.lang.Object.wait(Native Method)
    	- waiting on <0x29cdf1d8> (a java.lang.ref.ReferenceQueue$Lock)
    	at java.lang.ref.ReferenceQueue.remove(Unknown Source)
    	- locked <0x29cdf1d8> (a java.lang.ref.ReferenceQueue$Lock)
    	at java.lang.ref.ReferenceQueue.remove(Unknown Source)
    	at sun.plugin2.main.client.LiveConnectSupport$BrowserSideObjectCleanupThread.run(Unknown Source)
    
    "CacheCleanUpThread" daemon prio=6 tid=0x0506d800 nid=0x79f4 in Object.wait() [0x06f9f000]
       java.lang.Thread.State: WAITING (on object monitor)
    	at java.lang.Object.wait(Native Method)
    	- waiting on <0x29cdf1f8> (a com.sun.deploy.cache.CleanupThread)
    	at java.lang.Object.wait(Object.java:503)
    	at com.sun.deploy.cache.CleanupThread.run(Unknown Source)
    	- locked <0x29cdf1f8> (a com.sun.deploy.cache.CleanupThread)
    
    "CacheMemoryCleanUpThread" daemon prio=6 tid=0x05066000 nid=0x6a60 in Object.wait() [0x077ff000]
       java.lang.Thread.State: WAITING (on object monitor)
    	at java.lang.Object.wait(Native Method)
    	- waiting on <0x29cdf2e8> (a java.lang.ref.ReferenceQueue$Lock)
    	at java.lang.ref.ReferenceQueue.remove(Unknown Source)
    	- locked <0x29cdf2e8> (a java.lang.ref.ReferenceQueue$Lock)
    	at java.lang.ref.ReferenceQueue.remove(Unknown Source)
    	at com.sun.deploy.cache.MemoryCache$LoadedResourceCleanupThread.run(Unknown Source)
    
    "MemoryCache-DelayedCleanup" daemon prio=6 tid=0x05065800 nid=0x5a30 in Object.wait() [0x0725f000]
       java.lang.Thread.State: WAITING (on object monitor)
    	at java.lang.Object.wait(Native Method)
    	- waiting on <0x29cdf378> (a java.util.TaskQueue)
    	at java.lang.Object.wait(Object.java:503)
    	at java.util.TimerThread.mainLoop(Unknown Source)
    	- locked <0x29cdf378> (a java.util.TaskQueue)
    	at java.util.TimerThread.run(Unknown Source)
    
    "SysExecutionTheadCreator" daemon prio=6 tid=0x05021000 nid=0x853c in Object.wait() [0x077af000]
       java.lang.Thread.State: WAITING (on object monitor)
    	at java.lang.Object.wait(Native Method)
    	- waiting on <0x29cdf388> (a sun.plugin.util.PluginSysUtil$SysExecutionThreadCreator)
    	at java.lang.Object.wait(Object.java:503)
    	at sun.plugin.util.PluginSysUtil$SysExecutionThreadCreator.run(Unknown Source)
    	- locked <0x29cdf388> (a sun.plugin.util.PluginSysUtil$SysExecutionThreadCreator)
    
    "AWT-Windows" daemon prio=6 tid=0x05018c00 nid=0x6ee0 runnable [0x00ecf000]
       java.lang.Thread.State: RUNNABLE
    	at sun.awt.windows.WToolkit.eventLoop(Native Method)
    	at sun.awt.windows.WToolkit.run(Unknown Source)
    
    "Java2D Disposer" daemon prio=10 tid=0x05017c00 nid=0x72a8 in Object.wait() [0x073cf000]
       java.lang.Thread.State: WAITING (on object monitor)
    	at java.lang.Object.wait(Native Method)
    	- waiting on <0x29cdf4c0> (a java.lang.ref.ReferenceQueue$Lock)
    	at java.lang.ref.ReferenceQueue.remove(Unknown Source)
    	- locked <0x29cdf4c0> (a java.lang.ref.ReferenceQueue$Lock)
    	at java.lang.ref.ReferenceQueue.remove(Unknown Source)
    	at sun.java2d.Disposer.run(Unknown Source)
    	at java.lang.Thread.run(Unknown Source)
    
    "Java Plug-In Pipe Worker Thread (Client-Side)" daemon prio=6 tid=0x04ff2800 nid=0x6b64 runnable [0x0737f000]
       java.lang.Thread.State: RUNNABLE
    	at sun.plugin2.os.windows.Windows.ReadFile0(Native Method)
    	at sun.plugin2.os.windows.Windows.ReadFile(Unknown Source)
    	at sun.plugin2.ipc.windows.WindowsNamedPipe.read(Unknown Source)
    	at sun.plugin2.message.transport.NamedPipeTransport$SerializerImpl.read(Unknown Source)
    	at sun.plugin2.message.transport.NamedPipeTransport$SerializerImpl.readByte(Unknown Source)
    	at sun.plugin2.message.AbstractSerializer.readInt(Unknown Source)
    	at sun.plugin2.message.transport.SerializingTransport.read(Unknown Source)
    	at sun.plugin2.message.Pipe$WorkerThread.run(Unknown Source)
    
    "Timer-0" prio=6 tid=0x04fd2000 nid=0x799c in Object.wait() [0x06c5f000]
       java.lang.Thread.State: WAITING (on object monitor)
    	at java.lang.Object.wait(Native Method)
    	- waiting on <0x29cdf800> (a java.util.TaskQueue)
    	at java.lang.Object.wait(Object.java:503)
    	at java.util.TimerThread.mainLoop(Unknown Source)
    	- locked <0x29cdf800> (a java.util.TaskQueue)
    	at java.util.TimerThread.run(Unknown Source)
    
    "traceMsgQueueThread" daemon prio=6 tid=0x04f39000 nid=0x6de8 in Object.wait() [0x051df000]
       java.lang.Thread.State: WAITING (on object monitor)
    	at java.lang.Object.wait(Native Method)
    	- waiting on <0x29c58d08> (a java.util.ArrayList)
    	at java.lang.Object.wait(Object.java:503)
    	at com.sun.deploy.trace.Trace$TraceMsgQueueChecker.run(Unknown Source)
    	- locked <0x29c58d08> (a java.util.ArrayList)
    	at java.lang.Thread.run(Unknown Source)
    
    "Service Thread" daemon prio=6 tid=0x00c2e800 nid=0x71e4 runnable [0x00000000]
       java.lang.Thread.State: RUNNABLE
    
    "C1 CompilerThread0" daemon prio=10 tid=0x00c2a000 nid=0x7570 waiting on condition [0x00000000]
       java.lang.Thread.State: RUNNABLE
    
    "Attach Listener" daemon prio=10 tid=0x00c28400 nid=0x7d54 runnable [0x00000000]
       java.lang.Thread.State: RUNNABLE
    
    "Signal Dispatcher" daemon prio=10 tid=0x00c25400 nid=0x6ec0 runnable [0x00000000]
       java.lang.Thread.State: RUNNABLE
    
    "Finalizer" daemon prio=8 tid=0x00c05000 nid=0x700c in Object.wait() [0x04b0f000]
       java.lang.Thread.State: WAITING (on object monitor)
    	at java.lang.Object.wait(Native Method)
    	- waiting on <0x29cdfa88> (a java.lang.ref.ReferenceQueue$Lock)
    	at java.lang.ref.ReferenceQueue.remove(Unknown Source)
    	- locked <0x29cdfa88> (a java.lang.ref.ReferenceQueue$Lock)
    	at java.lang.ref.ReferenceQueue.remove(Unknown Source)
    	at java.lang.ref.Finalizer$FinalizerThread.run(Unknown Source)
    
    "Reference Handler" daemon prio=10 tid=0x00c03c00 nid=0x83b4 in Object.wait() [0x0496f000]
       java.lang.Thread.State: WAITING (on object monitor)
    	at java.lang.Object.wait(Native Method)
    	- waiting on <0x29cdeff8> (a java.lang.ref.Reference$Lock)
    	at java.lang.Object.wait(Object.java:503)
    	at java.lang.ref.Reference$ReferenceHandler.run(Unknown Source)
    	- locked <0x29cdeff8> (a java.lang.ref.Reference$Lock)
    
    "main" prio=6 tid=0x0092d000 nid=0x4284 in Object.wait() [0x008df000]
       java.lang.Thread.State: WAITING (on object monitor)
    	at java.lang.Object.wait(Native Method)
    	- waiting on <0x29cdfb10> (a sun.plugin2.message.Queue)
    	at sun.plugin2.message.Queue.waitForMessage(Unknown Source)
    	- locked <0x29cdfb10> (a sun.plugin2.message.Queue)
    	at sun.plugin2.message.Pipe$1.run(Unknown Source)
    	at com.sun.deploy.util.Waiter$1.wait(Unknown Source)
    	at com.sun.deploy.util.Waiter.runAndWait(Unknown Source)
    	at sun.plugin2.message.Pipe.receive(Unknown Source)
    	at sun.plugin2.main.client.PluginMain.mainLoop(Unknown Source)
    	at sun.plugin2.main.client.PluginMain.run(Unknown Source)
    	at sun.plugin2.main.client.PluginMain.main(Unknown Source)
    
    "VM Thread" prio=10 tid=0x00c02400 nid=0x6978 runnable 
    
    "VM Periodic Task Thread" prio=10 tid=0x04f0a400 nid=0x5a70 waiting on condition 
    
    known Source)
    	at sun.plugin2.main.client.PluginMain.run(Unknown Source)
    	at sun.plugin2.main.client.PluginMain.main(Unknown Source)
    
    "VM Thread" prio=10 tid=0x00c02400 nid=0x6978 runnable 
    
    "VM Periodic Task Thread" prio=10 tid=0x04f0a400 nid=0x5a70 waiting on condition 
    
    
    ----------------------------------------------------
    Done.
  8. #5
  9. No Profile Picture
    Contributing User
    Devshed Novice (500 - 999 posts)

    Join Date
    May 2007
    Posts
    765
    Rep Power
    928
    With the java console open, try reloading your applet. You should see more details about that exception at the bottom.
    sub{*{$::{$_}}{CODE}==$_[0]&& print for(%:: )}->(\&Meh);
  10. #6
  11. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Apr 2013
    Posts
    62
    Rep Power
    2
    Originally Posted by OmegaZero
    With the java console open, try reloading your applet. You should see more details about that exception at the bottom.
    i did reload it and is button for details but its a empty window.
  12. #7
  13. No Profile Picture
    Contributing User
    Devshed Novice (500 - 999 posts)

    Join Date
    May 2007
    Posts
    765
    Rep Power
    928
    You see nothing new in the java console when you restart the applet? How are you restarting the applet (refresh in the browser window or something else?). You can clear the text in the console to make newly added messages more promininant--I think by typing "c".
    sub{*{$::{$_}}{CODE}==$_[0]&& print for(%:: )}->(\&Meh);
  14. #8
  15. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Apr 2013
    Posts
    62
    Rep Power
    2
    Originally Posted by OmegaZero
    You see nothing new in the java console when you restart the applet? How are you restarting the applet (refresh in the browser window or something else?). You can clear the text in the console to make newly added messages more promininant--I think by typing "c".
    yes i am using 'c'
  16. #9
  17. No Profile Picture
    Contributing User
    Devshed Novice (500 - 999 posts)

    Join Date
    May 2007
    Posts
    765
    Rep Power
    928
    And the ExceptionInInitializerError doesn't show up in the console? (To confirm, you have the console open & cleared, then start your applet?)

    Without a stack trace from the exception there's no easy way to debug this. Maybe the "appletviewer" program will report the exception (I've never used it so I have no idea how to set that up).

    When you say it's working in eclipse, does the current version of eclipse have some fancy applet-testing-mode or are you dropping your code into a JFrame? If the latter, I would be suspicious of the init(), start() and stop() methods (assuming you've overridden them).
    sub{*{$::{$_}}{CODE}==$_[0]&& print for(%:: )}->(\&Meh);
  18. #10
  19. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Apr 2013
    Posts
    62
    Rep Power
    2
    Originally Posted by OmegaZero
    And the ExceptionInInitializerError doesn't show up in the console? (To confirm, you have the console open & cleared, then start your applet?)

    Without a stack trace from the exception there's no easy way to debug this. Maybe the "appletviewer" program will report the exception (I've never used it so I have no idea how to set that up).

    When you say it's working in eclipse, does the current version of eclipse have some fancy applet-testing-mode or are you dropping your code into a JFrame? If the latter, I would be suspicious of the init(), start() and stop() methods (assuming you've overridden them).

    you mean @Override? and no they are not. is that a problem? and iam not using jframe.
  20. #11
  21. No Profile Picture
    Contributing User
    Devshed Novice (500 - 999 posts)

    Join Date
    May 2007
    Posts
    765
    Rep Power
    928
    Not quite sure which of my questions you're answering there. I asked:

    1. With the Java Console open, does running your applet produce any messages on the Java Console?
    2. Have you tried the appletviewer program to see if that produces a stacktrace for the error?
    3. When you test your applet in Eclipse, is there some special applet-testing mode, or are you running your program within a AWT or Swing desktop application?
    4. Have you implemented the init(), start() and/or stop() methods in your Applet subclass?


    Looking back over the code you've shown, I don't see how SpriteSheet.loadSprite can work in an applet context as it's trying to load an image via a file name. I could see the potential for an NPE to become an ExceptionInInitializerError if SpriteSheet.getSprite() is called from an initializer. You might try loading the image via a URL.
    sub{*{$::{$_}}{CODE}==$_[0]&& print for(%:: )}->(\&Meh);

IMN logo majestic logo threadwatch logo seochat tools logo