1

問題なく Eclipse 内で実行される Swing アプレットを作成しましたが、Chrome を使用して html ファイルで実行すると、実行時例外 java.lang.reflect.InvocationTargetException が発生します。誰が何が間違っているのか提案できますか? これが私が試したことです:

  • InvocationTargetException が他のエラーをラップすることを読みました (別のエラーが原因です) が、有用なエラーを取得するために try{} catch(InvocationTargetException e){ e.toString()} を配置するメソッドがわかりません。

  • オンライン資料は、jdb を使用してスタック トレースを生成したことを示唆していますが、例外の原因を見つけるための有用な情報が含まれていないようです。

スタックトレース

TimerQueue:
  [1] sun.misc.Unsafe.park (native method)
  [2] java.util.concurrent.locks.LockSupport.park (null)
  [3] java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.awai
t (null)
  [4] java.util.concurrent.DelayQueue.take (null)
  [5] javax.swing.TimerQueue.run (null)
  [6] java.lang.Thread.run (null)
ConsoleTraceListener:
  [1] java.lang.Object.wait (native method)
  [2] java.lang.Object.wait (Object.java:503)
  [3] com.sun.deploy.uitoolkit.ui.ConsoleTraceListener$ConsoleWriterThread.run (
null)
TimerQueue:
  [1] sun.misc.Unsafe.park (native method)
  [2] java.util.concurrent.locks.LockSupport.park (null)
  [3] java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.awai
t (null)
  [4] java.util.concurrent.DelayQueue.take (null)
  [5] javax.swing.TimerQueue.run (null)
  [6] java.lang.Thread.run (null)
D3D Screen Updater:
  [1] java.lang.Object.wait (native method)
  [2] sun.java2d.d3d.D3DScreenUpdateManager.run (null)
  [3] java.lang.Thread.run (null)
AWT-EventQueue-1:
  [1] sun.misc.Unsafe.park (native method)
  [2] java.util.concurrent.locks.LockSupport.park (null)
  [3] java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.awai
t (null)
  [4] java.awt.EventQueue.getNextEvent (null)
  [5] java.awt.EventDispatchThread.pumpOneEventForFilters (null)
  [6] java.awt.EventDispatchThread.pumpEventsForFilter (null)
  [7] java.awt.EventDispatchThread.pumpEventsForHierarchy (null)
  [8] java.awt.EventDispatchThread.pumpEvents (null)
  [9] java.awt.EventDispatchThread.pumpEvents (null)
  [10] java.awt.EventDispatchThread.run (null)
AWT-EventQueue-2:
  [1] sun.misc.Unsafe.park (native method)
  [2] java.util.concurrent.locks.LockSupport.park (null)
  [3] java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.awai
t (null)
  [4] java.awt.EventQueue.getNextEvent (null)
  [5] java.awt.EventDispatchThread.pumpOneEventForFilters (null)
  [6] java.awt.EventDispatchThread.pumpEventsForFilter (null)
  [7] java.awt.EventDispatchThread.pumpEventsForHierarchy (null)
  [8] java.awt.EventDispatchThread.pumpEvents (null)
  [9] java.awt.EventDispatchThread.pumpEvents (null)
  [10] java.awt.EventDispatchThread.run (null)
Applet 3 LiveConnect Worker Thread:
  [1] java.lang.Object.wait (native method)
  [2] java.lang.Object.wait (Object.java:503)
  [3] sun.plugin2.main.client.LiveConnectSupport$PerAppletInfo$LiveConnectWorker
.run (null)
  [4] java.lang.Thread.run (null)
Browser Side Object Cleanup Thread:
  [1] java.lang.Object.wait (native method)
  [2] java.lang.ref.ReferenceQueue.remove (null)
  [3] java.lang.ref.ReferenceQueue.remove (null)
  [4] sun.plugin2.main.client.LiveConnectSupport$BrowserSideObjectCleanupThread.
run (null)
CacheCleanUpThread:
  [1] java.lang.Object.wait (native method)
  [2] java.lang.Object.wait (Object.java:503)
  [3] com.sun.deploy.cache.CleanupThread.run (null)
CacheMemoryCleanUpThread:
  [1] java.lang.Object.wait (native method)
  [2] java.lang.ref.ReferenceQueue.remove (null)
  [3] java.lang.ref.ReferenceQueue.remove (null)
  [4] com.sun.deploy.cache.MemoryCache$LoadedResourceCleanupThread.run (null)
SysExecutionTheadCreator:
  [1] java.lang.Object.wait (native method)
  [2] java.lang.Object.wait (Object.java:503)
  [3] sun.plugin.util.PluginSysUtil$SysExecutionThreadCreator.run (null)
AWT-EventQueue-0:
  [1] sun.misc.Unsafe.park (native method)
  [2] java.util.concurrent.locks.LockSupport.park (null)
  [3] java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.awai
t (null)
  [4] java.awt.EventQueue.getNextEvent (null)
  [5] java.awt.EventDispatchThread.pumpOneEventForFilters (null)
  [6] java.awt.EventDispatchThread.pumpEventsForFilter (null)
  [7] java.awt.EventDispatchThread.pumpEventsForHierarchy (null)
  [8] java.awt.EventDispatchThread.pumpEvents (null)
  [9] java.awt.EventDispatchThread.pumpEvents (null)
  [10] java.awt.EventDispatchThread.run (null)
AWT-Windows:
  [1] sun.awt.windows.WToolkit.eventLoop (native method)
  [2] sun.awt.windows.WToolkit.run (null)
AWT-Shutdown:
  [1] java.lang.Object.wait (native method)
  [2] java.lang.Object.wait (Object.java:503)
  [3] sun.awt.AWTAutoShutdown.run (null)
  [4] java.lang.Thread.run (null)
Java2D Disposer:
  [1] java.lang.Object.wait (native method)
  [2] java.lang.ref.ReferenceQueue.remove (null)
  [3] java.lang.ref.ReferenceQueue.remove (null)
  [4] sun.java2d.Disposer.run (null)
  [5] java.lang.Thread.run (null)
Java Plug-In Pipe Worker Thread (Client-Side):
  [1] sun.plugin2.os.windows.Windows.ReadFile0 (native method)
  [2] sun.plugin2.os.windows.Windows.ReadFile (null)
  [3] sun.plugin2.ipc.windows.WindowsNamedPipe.read (null)
  [4] sun.plugin2.message.transport.NamedPipeTransport$SerializerImpl.read (null
)
  [5] sun.plugin2.message.transport.NamedPipeTransport$SerializerImpl.readByte (
null)
  [6] sun.plugin2.message.AbstractSerializer.readInt (null)
  [7] sun.plugin2.message.transport.SerializingTransport.read (null)
  [8] sun.plugin2.message.Pipe$WorkerThread.run (null)
Timer-0:
  [1] java.lang.Object.wait (native method)
  [2] java.lang.Object.wait (Object.java:503)
  [3] java.util.TimerThread.mainLoop (null)
  [4] java.util.TimerThread.run (null)
traceMsgQueueThread:
  [1] java.lang.Object.wait (native method)
  [2] java.lang.Object.wait (Object.java:503)
  [3] com.sun.deploy.trace.Trace$TraceMsgQueueChecker.run (null)
  [4] java.lang.Thread.run (null)
Attach Listener:
Signal Dispatcher:
Finalizer:
  [1] java.lang.Object.wait (native method)
  [2] java.lang.ref.ReferenceQueue.remove (null)
  [3] java.lang.ref.ReferenceQueue.remove (null)
  [4] java.lang.ref.Finalizer$FinalizerThread.run (null)
Reference Handler:
  [1] java.lang.Object.wait (native method)
  [2] java.lang.Object.wait (Object.java:503)
  [3] java.lang.ref.Reference$ReferenceHandler.run (null)
main:
  [1] java.lang.Object.wait (native method)
  [2] sun.plugin2.message.Queue.waitForMessage (null)
  [3] sun.plugin2.message.Pipe$1.run (null)
  [4] com.sun.deploy.util.Waiter$1.wait (null)
  [5] com.sun.deploy.util.Waiter.runAndWait (null)
  [6] sun.plugin2.message.Pipe.receive (null)
  [7] sun.plugin2.main.client.PluginMain.mainLoop (null)
  [8] sun.plugin2.main.client.PluginMain.run (null)
  [9] sun.plugin2.main.client.PluginMain.main (null)
4

1 に答える 1

0

init()問題は、メソッドの外で変数を初期化していたことです。Eclipse ではこれに問題はないようですが、ブラウザのJava Plug-Inで実行するとjava.lang.reflection.InterruptedThreadException.

于 2012-08-03T07:09:25.077 に答える