0

I asked a similar question here but I am posting a picture with exactly what I have:

enter image description here

enter image description here

Whenever the server receives a message, the console throws out this error. As you can see all of the JAR files are there. There are no errors with the

import edu.sanford.nlp.pipeline.Annotation; because otherwise Eclipse would show me. So what really is the problem.

I see that the compiler says that it didn't find this class: edu/stanford/nlp/pipeline/Annotation. But in reality the import has . (periods) in it, not /. (Is the compiler looking for the wrong thing?) How can I fix this problem?

Thank you

Community
  • 1
  • 1
user5139637
  • 775
  • 3
  • 10
  • 29
  • This isn't a ClassNotFoundException, it's a NoClassDefFoundException. This can happen when an uncaught exception is thrown during a static intializer call. Is there a caused-by in that stack trace? Are you certain it's in your classpath? – jgitter Oct 27 '15 at 18:52
  • @jgitter. I am certain its in my class path because if it weren't then it would give me an error right? I put the caused-by that's in the stack trace – user5139637 Oct 27 '15 at 18:55
  • ClassNotFoundException IS the exception you would get. Add it to the classpath. – jgitter Oct 27 '15 at 18:57
  • Ok I see what you are trying to say. How can I do this in eclipse. I went to build path -> configure build path -> libraries -> and added external JARs. Is this not the way to add JAR files to the class path? – user5139637 Oct 27 '15 at 19:05
  • Are you deploying this to GlassFish? Did you package it into your artifact? – jgitter Oct 27 '15 at 19:06
  • thanks. I got it to work (almost). Now its telling me this: `java.lang.RuntimeException: Error parsing file: tr.txt` `Caused by: java.io.FileNotFoundException: tr.txt (No such file or directory) at java.io.FileInputStream.open0(Native Method)` Well, the file is in the same folder. Any thoughts? – user5139637 Oct 27 '15 at 19:18
  • In what same folder? Is it packaged in the artifact? Where in the artifact is it packaged? How are you trying to access it? If you stick it in the WEB-INF/classes folder, you can load it as a resource. – jgitter Oct 27 '15 at 20:20

0 Answers0