title: How to resolve java.lang.NumberFormatException: For input string
body: <p>so I been working with this project for a while now, and I recently came across with this problem.</p>
  
  <p>Everytime the app compiles just fine, but when the app its going to launch it gives me this when i press the details button:</p>
  
  <pre><code>java.lang.NumberFormatException: For input string: "\ProyectoOUMA\ouma.administracfdi.Reader\dist"
      at java.lang.NumberFormatException.forInputString(NumberFormatException.java:65)
      at java.lang.Integer.parseInt(Integer.java:580)
      at java.lang.Integer.parseInt(Integer.java:615)
      at com.sun.deploy.security.DeployManifestChecker.verifyCodebaseEx(Unknown Source)
      at com.sun.deploy.security.DeployManifestChecker.verifyCodebase(Unknown Source)
      at com.sun.deploy.security.DeployManifestChecker.verify(Unknown Source)
      at com.sun.deploy.security.DeployManifestChecker.verify(Unknown Source)
      at com.sun.javaws.security.AppPolicy.grantUnrestrictedAccess(Unknown Source)
      at com.sun.javaws.security.JNLPSignedResourcesHelper.checkSignedResourcesHelper(Unknown Source)
      at com.sun.javaws.security.JNLPSignedResourcesHelper.checkSignedResources(Unknown Source)
      at com.sun.javaws.Launcher.prepareResources(Unknown Source)
      at com.sun.javaws.Launcher.prepareAllResources(Unknown Source)
      at com.sun.javaws.Launcher.prepareToLaunch(Unknown Source)
      at com.sun.javaws.Launcher.prepareToLaunch(Unknown Source)
      at com.sun.javaws.Launcher.launch(Unknown Source)
      at com.sun.javaws.Main.launchApp(Unknown Source)
      at com.sun.javaws.Main.continueInSecureThread(Unknown Source)
      at com.sun.javaws.Main.access$000(Unknown Source)
      at com.sun.javaws.Main$1.run(Unknown Source)
      at java.lang.Thread.run(Thread.java:745)
  </code></pre>
  
  <p>Here is the code I'm working with:</p>
  
  <pre><code>   `package ouma.administracfdi.reader;
  
      import java.io.File;
      import java.io.IOException;
      import java.nio.file.Files;
      import java.util.ArrayList;
      import javax.xml.parsers.DocumentBuilder;
      import javax.xml.parsers.DocumentBuilderFactory;
      import javax.xml.parsers.ParserConfigurationException;
      import jxl.read.biff.BiffException;
      import jxl.write.WriteException;
      import org.w3c.dom.Element;
      import org.w3c.dom.Node;
      import org.w3c.dom.NodeList;
      import org.xml.sax.SAXException;
      import org.xml.sax.SAXParseException;
  
     public class OumaAdministracfdiReader {
  
  public static ArrayList&lt;DatosCfdi&gt; arraydatoscfdi = new ArrayList&lt;&gt;();
  
  DatosCfdi leerXml(File file, String ruta) throws ParserConfigurationException, SAXException, IOException{
      DatosCfdi cfdi = new DatosCfdi();
      NodeList list;
      Node node;
      Element element;
      String naturaleza = null;
  
      try {
          DocumentBuilderFactory documentBuilderFactory = DocumentBuilderFactory.newInstance();
          DocumentBuilder documentBuilder = documentBuilderFactory.newDocumentBuilder();
          list = (NodeList)  documentBuilder.parse(file).getElementsByTagName("cfdi:Comprobante"); //VALIDADA
          NodeList sublista, subsublista;
          Node subnodo, subsubnodo;
  
          for (int i = 0; i &lt; list.getLength(); i++){
              node = list.item(i);
              try {
                   cfdi.setSubt(Double.parseDouble(node.getAttributes().getNamedItem("subTotal").getNodeValue()));
                   cfdi.setTotal(Double.parseDouble(node.getAttributes().getNamedItem("total").getNodeValue()));
                   cfdi.setTipo(node.getAttributes().getNamedItem("tipoDeComprobante").getNodeValue());
                   cfdi.setMotdes(node.getAttributes().getNamedItem("motivoDescuento").getNodeValue());      
              } catch (NullPointerException | NumberFormatException numex) { }//CATCH
                   cfdi.setFecha(node.getAttributes().getNamedItem("fecha").getNodeValue());
                  cfdi.setRuta(ruta);
  
              sublista = node.getChildNodes();
                  for (int a = 0; a &lt; sublista.getLength(); a++){
                      subnodo = sublista.item(a);
                      try {
                      switch(subnodo.getNodeName()){
                          case "cfdi:Emisor": cfdi.setRfce(subnodo.getAttributes().getNamedItem("rfc").getNodeValue());
                              cfdi.setNome(subnodo.getAttributes().getNamedItem("nombre").getNodeValue()); break;
                          case "cfdi:Receptor": cfdi.setRfcr(subnodo.getAttributes().getNamedItem("rfc").getNodeValue());
                              cfdi.setNomr(subnodo.getAttributes().getNamedItem("nombre").getNodeValue()); break;
                          case "cfdi:Impuestos": 
                              try {
                              cfdi.setImpTra(Double.parseDouble(subnodo.getAttributes().getNamedItem("totalImpuestosTrasladados").getNodeValue()));
                              cfdi.setImpRet(Double.parseDouble(subnodo.getAttributes().getNamedItem("totalImpuestosRetenidos").getNodeValue()));
                          } catch (NullPointerException nullex) {}
                              subsublista = subnodo.getChildNodes();
                              //System.out.println("Tamaño sublista: " + subsublista.getLength());
                              for (int e = 0; e &lt; subsublista.getLength(); e++){
                                 // System.out.println("Valor de e: " + e);
                                  subsubnodo = subsublista.item(e);
                                  //System.out.println("NOMBRE DEL SUB SUB NODO: " + subsubnodo.getNodeName());
                                      if (subsubnodo.getNodeName().equalsIgnoreCase("cfdi:Retenciones")){
                                          NodeList ssubsubnodo;
                                          ssubsubnodo = subsubnodo.getChildNodes();                   
                                          for (int u = 0; u &lt; ssubsubnodo.getLength(); u++){
                                              //System.out.println("Valor de U: " + u);
                                              if (ssubsubnodo.item(u).getNodeName().equalsIgnoreCase("cfdi:Retencion")){
                                                  //System.out.println("NOMBRE DEL SSSUBNODO: " + ssubsubnodo.item(u).getNodeName());
                                                  //System.out.println(ssubsubnodo.item(u).getAttributes().getNamedItem("impuesto").getNodeValue() + " " + ssubsubnodo.item(u).getAttributes().getNamedItem("importe").getNodeValue());
                                                             if (ssubsubnodo.item(u).getAttributes().getNamedItem("impuesto").getNodeValue().equalsIgnoreCase("ISR")) {
                                                                  cfdi.setImpRetIsr(Double.parseDouble(ssubsubnodo.item(u).getAttributes().getNamedItem("importe").getNodeValue()));}
                                                              if (ssubsubnodo.item(u).getAttributes().getNamedItem("impuesto").getNodeValue().equalsIgnoreCase("IVA")) {
                                                                  cfdi.setImpRetIva(Double.parseDouble(ssubsubnodo.item(u).getAttributes().getNamedItem("importe").getNodeValue()));}
                                              }
                                          }//FOR
                                          }//IF
                              } break;
                          case "cfdi:Complemento": subsublista = subnodo.getChildNodes();
                              for (int e=0; e &lt; subsublista.getLength(); e++){
                                  subsubnodo = subsublista.item(e);
                                      if (subsubnodo.getNodeName().matches("tfd:TimbreFiscalDigital")){
                                          cfdi.setUuid(subsubnodo.getAttributes().getNamedItem("UUID").getNodeValue());}
                              } break;
                          default : break;
                  }} catch(NullPointerException nullex) {}
                  }             
           }//FOR 
      } catch (SAXParseException saxe) {cfdi.setRuta(saxe.getMessage() + " " + ruta);}
  return cfdi;}
  
  public void recorrerCarpetas(String ruta, CfdiReader f) throws ParserConfigurationException, SAXException, IOException {
      DatosCfdi cfdi = new DatosCfdi();
      File folder = new File(ruta);
      File[] xmlFiles = folder.listFiles();
      String filetype;
      DocumentBuilderFactory documentBuilderFactory = DocumentBuilderFactory.newInstance();
      DocumentBuilder documentBuilder = documentBuilderFactory.newDocumentBuilder();
      //NodeList list, listemisor, listreceptor, listtfd;
    for (int a = 0; a &lt; xmlFiles.length; a++) {
        filetype = Files.probeContentType(xmlFiles[a].toPath()); 
          if (xmlFiles[a].isFile()  &amp;&amp; filetype.contains("xml") &amp;&amp; !(xmlFiles[a].getName().equals(".xml"))){
              //System.out.println(xmlFiles[a].getPath() + " " + xmlFiles[a].getName());
              System.out.println(xmlFiles[a].getPath());
                f.archivosenprocesoText.setText(Integer.toString(a));
                f.salidaTextArea.setText(xmlFiles[a].getPath());
                cfdi = this.leerXml(xmlFiles[a], ruta + "\\" + xmlFiles[a].getName());
                  arraydatoscfdi.add(cfdi);
                  }//IS FILE?
          else { if (xmlFiles[a].isDirectory()) {
                      this.recorrerCarpetas(ruta + "\\"+xmlFiles[a].getName(), f);}}
  
      }
    }
  
  public static void main(String[] args) throws ParserConfigurationException, IOException, SAXException, BiffException, WriteException, Exception {
      OumaAdministracfdiReader a = new OumaAdministracfdiReader();
      //a.ejecuta(args);
  }
  
  public void ejecuta(String[] args, CfdiReader f) throws Exception {
      OumaAdministracfdiReader lee = new OumaAdministracfdiReader();
      GuardarDatosExcelApache aexcel = new GuardarDatosExcelApache();
      String carpetaactual, carpetaguardar, nombrearchivo;
          carpetaactual = f.directorioTextField.getText();
          carpetaguardar = f.directorioguardarText.getText();
          nombrearchivo = f.nombrearchivoText.getText();   
          lee.recorrerCarpetas(carpetaactual, f);
          f.archivosenprocesoText.setText(String.valueOf(arraydatoscfdi.size()));
          //System.out.println(arraydatoscfdi.size());
         aexcel.guardarEnExcel(arraydatoscfdi, nombrearchivo, carpetaguardar);
      }
  
  public static final String NEWLINE = "\n";
  </code></pre>
  
  <p>}`</p>
  
  <p>Here is the jnlp:</p>
  
  <pre><code>`&lt;?xml version="1.0" encoding="UTF-8" standalone="no"?&gt;
   &lt;jnlp codebase="file:/C:/ProyectoOUMA/ouma.administracfdi.Reader/dist/"               href="launch.jnlp" spec="1.0+"&gt;
  &lt;information&gt;
      &lt;title&gt;ouma.administracfdi.Reader&lt;/title&gt;
      &lt;vendor&gt;USUARIO&lt;/vendor&gt;
      &lt;homepage href=""/&gt;
      &lt;description&gt;ouma.administracfdi.Reader&lt;/description&gt;
      &lt;description kind="short"&gt;ouma.administracfdi.Reader&lt;/description&gt;
  &lt;offline-allowed/&gt;
  &lt;/information&gt;
  &lt;update check="background"/&gt;
  &lt;security&gt;
  &lt;all-permissions/&gt;
  &lt;/security&gt;
  &lt;resources&gt;
      &lt;j2se java-vm-args="-Xms2048m" version="1.8+"/&gt;
      &lt;jar href="ouma.administracfdi.Reader.jar" main="true"/&gt;
   &lt;jar href="lib/poi-ooxml-3.13-20150929.jar"/&gt;
   &lt;jar href="lib/poi-3.13-20150929.jar"/&gt;
   &lt;jar href="lib/xmlbeans-2.6.0.jar"/&gt;
   &lt;jar href="lib/poi-examples-3.13-20150929.jar"/&gt;
   &lt;jar href="lib/poi-excelant-3.13-20150929.jar"/&gt;
   &lt;jar href="lib/poi-ooxml-schemas-3.13-20150929.jar"/&gt;
   &lt;jar href="lib/jxl.jar"/&gt;
   &lt;extension href="jnlpcomponent1.jnlp"/&gt;
   &lt;/resources&gt;
  &lt;application-desc main-class="ouma.administracfdi.reader.CfdiReader"&gt;
  &lt;/application-desc&gt;
  &lt;/jnlp&gt;`
  </code></pre>
  
  <p>I'm working in NetBeans.</p>
  
  <p>Thanks for the answers!</p>