5

Here is the question I asked recently: org.apache.commons.codec.digest.Md5Crypt.md5Crypt function. exception occured under linux, but fine under windows

Although finally, I resolved it, but I'm still confused. What made this happen?

My jdk was 1.7, my tomcat was 7, my web application was compiled by jdk 1.7, version of commons-codec.jar was 1.10, then an exception was thrown.

java.lang.IllegalAccessError: tried to access method org.apache.commons.codec.digest.DigestUtils.getMd5Digest()Ljava/security/MessageDigest; from class org.apache.commons.codec.digest.Md5Crypt

When I changed my tomcat from 7 to 8, it worked fine. Why? What does tomcat do to applications?

Community
  • 1
  • 1
Anson .K
  • 57
  • 5

1 Answers1

2

I strongly suggest that the problem was not resolved because you used tomcat 8 instead of 7, but it was resolved because you had a conflict in your java build path meaning that you had two different versions of the commons-codec JAR at run time probably had one in your tomcat 7 lib folder.

QuakeCore
  • 1,886
  • 2
  • 15
  • 33
  • You can check your previous build path to confirm or refute my claims! – QuakeCore Dec 29 '15 at 10:10
  • I've checked that before! I'm using maven to manage jars, I'm sure there is only one commons-codec jar. and the tomcat was new downloaded. – Anson .K Dec 30 '15 at 02:37
  • You were right, I found a different commons-codec was included by a third party jar file in WEB-INF/lib folder, and it's not managed by maven, so I can't found that through maven dependence. I deleted this ugly jar file, it works fine. now I can say "I resolve this problem", right? thank you! – Anson .K Dec 30 '15 at 03:32