title: Java String to Long Conversion
body: <p>Simple problem i know but I cannot see what is wrong. I have the following code:</p>
  
  <pre><code>String dxorderId = request.getParameter("orderid");
      long orderid = Long.parseLong((dxorderId));
  </code></pre>
  
  <p>It is inside a servlet which is called from a PL/SQL procedure. The value of dxorderid is retrieved from a parameter in the URL of the page called. Therefore it seems to be treated as a string. So I must convert the string into a long. However, when I use the code above, I get the following error:</p>
  
  <pre><code>14-Nov-2013 13:07:41 org.apache.catalina.core.StandardWrapperValve invoke
  SEVERE: Servlet.service() for servlet [com.zf.proceed.service.servlets.ViewOrderServlet] in context with path [/webapp] threw exception
  java.lang.NumberFormatException: null
  at java.lang.Long.parseLong(Long.java:372)
  at java.lang.Long.parseLong(Long.java:461)
  at com.zf.proceed.service.servlets.ViewOrderServlet.doRequest(ViewOrderServlet.java:28)
  at com.zf.proceed.service.servlets.ProceedBaseServlet.doRequest(ProceedBaseServlet.java:106)
  at com.zf.proceed.service.servlets.ProceedBaseServlet.doGet(ProceedBaseServlet.java:39)
  at javax.servlet.http.HttpServlet.service(HttpServlet.java:621)
  at javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
  at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
  at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
  at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:222)
  at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123)
  at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:502)
  at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171)
  at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:99)
  at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:953)
  at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
  at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408)
  at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1023)
  at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:589)
  at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:310)
  at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
  at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
  at java.lang.Thread.run(Thread.java:619)
  </code></pre>
  
  <p>I know it means that it cant be parsed but I dont Know why it cant. the value being input is 1454.</p>