0

I have found a old project called "cogito" relesed more than 10 years ago. Now technical issues:

  • cogito is composed by just two folders zipped (app and WEB-inf)
  • only file .class were present (no source) and I decompiled (.class files) them with a software called "jd"
  • In the directory with .class I added the source files .java
  • I have imported directories app and WEB-inf directory in eclipse workspace
  • I run evrythings getting this message error:Exception in thread "main" java.lang.NullPointerException: Cannot read the array length because "files" is null at org.fontbox.afm.AFMParser.main(AFMParser.java:318)
  • in the first line of the code there is this message error:Multiple markers at this line
    • The type javax.servlet.http.HttpServletRequest cannot be resolved. It is indirectly referenced from required .class files
    • The type javax.servlet.http.HttpServletRequest cannot be resolved. It is indirectly referenced from required .class files
    • Syntax error on tokens, delete these token

Any guess?

  • 1
    Does this answer your question? [What is a NullPointerException, and how do I fix it?](https://stackoverflow.com/questions/218384/what-is-a-nullpointerexception-and-how-do-i-fix-it) – Glains Dec 29 '20 at 16:45
  • If my answer helped you solve the problem, please accept it by clicking the gray checkmark next to it. It will earn you two reputation. – new Q Open Wid Dec 29 '20 at 18:49

1 Answers1

0

I assume that you have declared a reference type and have not assigned it yet, like this:

Integer myInteger;

Now, if you try to use myInteger, because it is not pointing to anything yet, it will throw an NullPointerException. Hence the name. The way to fix it is to assign it a pointer first:

Integer myInteger;
myInteger = new Integer(20);

before using it. Perhaps, because the code is 10 years old, and outdated, when trying to compile it in new Java version it fails.

new Q Open Wid
  • 2,225
  • 2
  • 18
  • 34