Re: FileNotFoundException when running JAR Application through jSwat
Billy Bacon <[email protected]> Fri, 15 Oct 2004 10:52:01 -0600
| Newsgroups | gmane.comp.java.jswat.user |
|---|---|
| Message-ID | <BD955C51.C9A8%[email protected]> |
Yes, the application is actually installed in C:\Program Files\CF EMS\ The directory structure underneath 'CF EMS' looks like so CF EMS\data CF EMS\diagrams CF EMS\jre1.3.1 CF EMS\images There's a JAR file in the 'CF EMS' directory which I execute to start the application. In jSwat the command looks like so (in the 'Start VM' dialog box) Class name and arguments: com.cratersandfreighters.ems.EMSLauncher I have the following paths for my Classpath in jSwat: C:\Program Files\CF EMS\cf.jar (this is the jar for the application and has the 'EMSLauncher' class) C:\Program Files\CF EMS\jdom.jar C:\Program Files\CF EMS\mysql.jar C:\Program Files\CF EMS\xalan.jar C:\Program Files\CF EMS\xerces.jar C:\Program Files\CF EMS\gemini\BCEL.jar C:\Program Files\CF EMS\gemini\debug.jar C:\Program Files\CF EMS\gemini\dom4j.jar C:\Program Files\CF EMS\gemini\GeminiJavaAPI.jar C:\Program Files\CF EMS\gemini\wasp.jar Do you have a solution that I can try out? Thanks for the reply! - Billy - On 10/15/04 10:42 AM, "Nathan Fiedler" <[email protected]> wrote: > 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:42 >> 0) 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.jav >> a: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.FileNot >> FoundException: >> 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:42 >> 0) 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.jav >> a: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 - > > >