5

I have a rogue jar being loaded into my tomcat instance. I would like to be able to tell where the corresponding jar file is being loaded from. If not available, I would like to be able to see where a class that is in that jar is being loaded from.

I have looked at the ~/conf/logging.properties file, but from that it is not clear to me how to specify what I want.

Or, is this something one does from startup.sh as a java option?

Thanks for any ideas.

Timothy Clotworthy
  • 1,960
  • 2
  • 19
  • 42

3 Answers3

11

I was able to answer my own question. I added -verbose:class to the JAVA_OPTS of the tomcat setenv.sh file. This made all class loading information get written to the catalina.out log and I found my rogue jar!

Timothy Clotworthy
  • 1,960
  • 2
  • 19
  • 42
0

In my case, there was no setenv.sh file as mentioned here.So I added the -verbose:class to the JAVA_OPTS in catalina.sh file using the below line and it worked.

JAVA_OPTS="$JAVA_OPTS -verbose:class"

Note: JAVA_OPTS variable was already present in the file.I just added the verbose option using the above command.

U R
  • 490
  • 9
  • 15
0

How about this? also, add it to the JAVA_OPTS within catalina.sh

-XX:+TraceClassLoading
Yang Xu
  • 63
  • 2
  • 10