0

I have directory with classes files. I want to put them in the WEB-INF/classes directory, I don't have the source Java files, just the classes.

When I start tomcat I got error java.lang.ClassNotFoundException because there is listener in the web.xml that call some class that exists in my classes directory.

How can I do that?

I tried to insert the classes files to JAR and add it to the project library, but I am still getting java.lang.ClassNotFoundException.

I tried to put the directory with the classes in the src directory but same, I got error that the class not found.

Andrew Thompson
  • 168,117
  • 40
  • 217
  • 433
kfir
  • 732
  • 10
  • 22
  • More information about the Exception is needed. It sounds likely that the call for your classes is not happening from your web app classloader but from a higher-level classloader that won't have access to it, or perhaps from a classloader in another sibling web app. Can you post more information like log msgs with the stacktrace? Do you know what class is throwing the excepting? Cheers! – Pete Kelley Sep 18 '19 at 11:32
  • *"I tried to insert the classes files to JAR"* Were they added to the **correct path** in the JAR file, using the package names as paths for the classes? BTW: Always copy/paste *entire* error and exception output! – Andrew Thompson Sep 18 '19 at 11:56
  • Tnx i solved the problem by delete work directory in the tomcat – kfir Sep 18 '19 at 12:19

0 Answers0