4 Replies Latest reply: Oct 28, 2010 6:17 PM by EJP RSS

    BUILT JAR FILE UNABLE TO RUN

    809060
      Hi,
      I know there are existing problems and solutions to the common problems of .JAR file unable to run successfully which is mostly due to the library and other issues.

      However I had tried to solve all those possible problems that cause the .jar file built to be unable to run, but still could not solve the problem.
      I am however, able to debug or test run through netbeans

      The error message shown on cmd java -jar <application>.jar are :
      java.io.FileNotFoundException: C:\Users\YarmageddonY\src\warehouse\resources\Con
      fig.xml (The system cannot find the path specified)
              at java.io.FileInputStream.open(Native Method)
              at java.io.FileInputStream.<init>(Unknown Source)
              at java.io.FileInputStream.<init>(Unknown Source)
              at sun.net.www.protocol.file.FileURLConnection.connect(Unknown Source)
              at sun.net.www.protocol.file.FileURLConnection.getInputStream(Unknown So
      urce)
              at com.sun.org.apache.xerces.internal.impl.XMLEntityManager.setupCurrent
      Entity(Unknown Source)
              at com.sun.org.apache.xerces.internal.impl.XMLVersionDetector.determineD
      ocVersion(Unknown Source)
              at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(U
      nknown Source)
              at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(U
      nknown Source)
              at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(Unknown So
      urce)
              at com.sun.org.apache.xerces.internal.parsers.DOMParser.parse(Unknown So
      urce)
              at com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl.parse(Unk
      nown Source)
              at javax.xml.parsers.DocumentBuilder.parse(Unknown Source)
              at warehouse.logic.ReadXMLFile.find(ReadXMLFile.java:55)
              at warehouse.WarehouseView.configAppearance(WarehouseView.java:127)
              at warehouse.WarehouseView.<init>(WarehouseView.java:57)
              at warehouse.WarehouseApp.startup(WarehouseApp.java:19)
              at org.jdesktop.application.Application$1.run(Application.java:171)
              at java.awt.event.InvocationEvent.dispatch(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)
      Oct 28, 2010 10:41:00 PM org.jdesktop.application.Application$1 run
      SEVERE: Application class warehouse.WarehouseApp failed to launch
      java.lang.NumberFormatException: For input string: "Error"
              at java.lang.NumberFormatException.forInputString(Unknown Source)
              at java.lang.Integer.parseInt(Unknown Source)
              at java.lang.Integer.parseInt(Unknown Source)
              at warehouse.WarehouseView.configAppearance(WarehouseView.java:128)
              at warehouse.WarehouseView.<init>(WarehouseView.java:57)
              at warehouse.WarehouseApp.startup(WarehouseApp.java:19)
              at org.jdesktop.application.Application$1.run(Application.java:171)
              at java.awt.event.InvocationEvent.dispatch(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)
      Exception in thread "AWT-EventQueue-0" java.lang.Error: Application class wareho
      use.WarehouseApp failed to launch
              at org.jdesktop.application.Application$1.run(Application.java:177)
              at java.awt.event.InvocationEvent.dispatch(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)
      Caused by: java.lang.NumberFormatException: For input string: "Error"
              at java.lang.NumberFormatException.forInputString(Unknown Source)
              at java.lang.Integer.parseInt(Unknown Source)
              at java.lang.Integer.parseInt(Unknown Source)
              at warehouse.WarehouseView.configAppearance(WarehouseView.java:128)
              at warehouse.WarehouseView.<init>(WarehouseView.java:57)
              at warehouse.WarehouseApp.startup(WarehouseApp.java:19)
              at org.jdesktop.application.Application$1.run(Application.java:171)
              ... 8 more
      Below are a few screen shot of what I have configured for my application.


      http://i52.tinypic.com/il9a4y.jpg


      Please do guide or give any advice if necessary :)
      Thanks a lot
        • 1. Re: BUILT JAR FILE UNABLE TO RUN
          tschodt
          It looks like the jar runs fine
          you just have a file access issue.

          Does the file
          C:\Users\YarmageddonY\src\warehouse\resources\Config.xml
          exist and is it readable in this context?
          • 2. Re: BUILT JAR FILE UNABLE TO RUN
            809060
            Yes it exist inside one of my package called warehouse.bean
            and its readable, I am able to debug it and run in netbean as a whole
            • 3. Re: BUILT JAR FILE UNABLE TO RUN
              800560
              806057 wrote:
              Yes it exist inside one of my package called warehouse.bean
              and its readable, I am able to debug it and run in netbean as a whole
              Your answer makes it seem to me like the file path should have ....warehouse\bean in it. Instead of C:\Users\YarmageddonY\src\warehouse\resources\Config.xml maybe it is something like C:\Users\YarmageddonY\src\warehouse\bean\Config.xml

              Edited by: wwbeer on Oct 28, 2010 3:21 PM
              • 4. Re: BUILT JAR FILE UNABLE TO RUN
                EJP
                Yes it exist inside one of my package called warehouse.bean
                Inside the JAR file? Not on the C: drive as per the path in the exception? If it isn't in that path at runtime it won't be opened at runtime. If that's not the correct path at runtime, fix it. If you want to distribute the file inside the JAR, you can't open it with FileInputStream, because it isn't a file, is it? You have to use Class.getResourceAsStream().