-1

I wanna run a servlet application on my tomcat8.5 which is running on my centos server. Maybe its important to know that my app doesn't use a web.xml. I get this exception:

java.lang.NullPointerException
    javax.imageio.ImageIO.write(ImageIO.java:1538)
    com.google.zxing.client.j2me.MatrixToImageWriter.writeToPath(MatrixToImageWriter.java:99)
    com.google.zxing.client.j2me.MatrixToImageWriter.writeToPath(MatrixToImageWriter.java:81)
    com.paipai0.Pai.testEncode(Pai.java:107)
    com.paipai0.Pai.doGet(Pai.java:67)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:635)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:742)
    org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
    org.apache.catalina.filters.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:108)

Note The full stack trace of the root cause is available in the server logs.

Paolo Forgia
  • 6,572
  • 8
  • 46
  • 58
seelvy
  • 13
  • 1

1 Answers1

0

You have passed in a File or Path variable indicating where you want the library to write the result, where you did not ensure it was not null.

Thorbjørn Ravn Andersen
  • 73,784
  • 33
  • 194
  • 347