Re: FileNotFoundException when running JAR Application through jSwat
Nathan Fiedler <[email protected]> Fri, 15 Oct 2004 09:42:59 -0700
| Newsgroups | gmane.comp.java.jswat.user |
|---|---|
| Organization | Blue Marsh Softworks |
| Message-ID | <1097858579.22973.2.camel@nuts> |
Do you normally run your program from a particular directory? That is, if you launch it from c:\myproj and the data file is in c:\myproj\data\user.dat, then your program is using a relative path to find its data file. But when launched from JSwat, your program will inherit the current working directory of JSwat. So you launch JSwat from c:\jswat then your program will look for c:\jswat\data\user.dat and not find the data file. Or, it could be there's an element missing or mistyped in the classpath, assuming your program uses the classpath to find the data file. n On Fri, 2004-10-15 at 07:56, [email protected] wrote: > I'm trying to run my application through jSwat and I'm running into an > issue of the application (the app I'm trying to debug) throwing an > Exception b/c it can't find a file. > > I can run the application by itself just fine and it doesn't throw any > exceptions but when I try to run it through jSwat via 'Start VM' I get the > following stacktrace: > > java.io.FileNotFoundException: data\user.dat (The system cannot find the > path specified) at java.io.RandomAccessFile.open(Native Method) at > java.io.RandomAccessFile.<init>(RandomAccessFile.java:204) at > java.io.RandomAccessFile.<init>(RandomAccessFile.java:94) at > com.cratersandfreighters.ems.util.SecurityBroker.storePassword(SecurityBroker.java:122) at > com.cratersandfreighters.ems.gui.LoginWindow.actionPerformed(LoginWindow.java:180) at > javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1786) at > javax.swing.AbstractButton$ForwardActionEvents.actionPerformed(AbstractButton.java:1839) at > javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:420) at > javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:258) at > javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:245) at > java.awt.Component.processMouseEvent(Component.java:5100) at > java.awt.Component.processEvent(Component.java:4897) at > java.awt.Container.processEvent(Container.java:1569) at > java.awt.Component.dispatchEventImpl(Component.java:3615) at > java.awt.Container.dispatchEventImpl(Container.java:1627) at > java.awt.Component.dispatchEvent(Component.java:3477) at > java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:3483) at > java.awt.LightweightDispatcher.processMouseEvent(Container.java:3198) at > java.awt.LightweightDispatcher.dispatchEvent(Container.java:3128) at > java.awt.Container.dispatchEventImpl(Container.java:1613) at > java.awt.Window.dispatchEventImpl(Window.java:1606) at > java.awt.Component.dispatchEvent(Component.java:3477) at > java.awt.EventQueue.dispatchEvent(EventQueue.java:456) at > java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:201) at > java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:151) at > java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:145) at > java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:137) at > java.awt.EventDispatchThread.run(EventDispatchThread.java:100)java.io.FileNotFoundException: > ems.cfg (The system cannot find the file specified) at > java.io.FileInputStream.open(Native Method) at > java.io.FileInputStream.<init>(FileInputStream.java:106) at > java.io.FileInputStream.<init>(FileInputStream.java:66) at > com.cratersandfreighters.ems.gui.LoginWindow.actionPerformed(LoginWindow.java:193) at > javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1786) at > javax.swing.AbstractButton$ForwardActionEvents.actionPerformed(AbstractButton.java:1839) at > javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:420) at > javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:258) at > javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:245) at > java.awt.Component.processMouseEvent(Component.java:5100) at > java.awt.Component.processEvent(Component.java:4897) at > java.awt.Container.processEvent(Container.java:1569) at > java.awt.Component.dispatchEventImpl(Component.java:3615) at > java.awt.Container.dispatchEventImpl(Container.java:1627) at > java.awt.Component.dispatchEvent(Component.java:3477) at > java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:3483) at > java.awt.LightweightDispatcher.processMouseEvent(Container.java:3198) at > java.awt.LightweightDispatcher.dispatchEvent(Container.java:3128) at > java.awt.Container.dispatchEventImpl(Container.java:1613) at > java.awt.Window.dispatchEventImpl(Window.java:1606) at > java.awt.Component.dispatchEvent(Component.java:3477) at > java.awt.EventQueue.dispatchEvent(EventQueue.java:456) at > java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:201) at > java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:151) at > java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:145) at > java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:137) at > java.awt.EventDispatchThread.run(EventDispatchThread.java:100) > > > Now this file is on the system but I'm not sure why jswat can't find it > when running the app. Is this a classpath issue? > > Any help will greatly be appreciated. > > Thank you. > > - Billy -