Org.apache.commons.codec.digest.Md5Crypt.md5Crypt. exception occurred under linux but fine under windows

We use commons-codec to encrypt passwords using the org.apache.commons.codec.digest.Md5Crypt.md5Crypt function.

It works fine on Windows, but an exception is thrown on CentOS.

We have three centOS test servers: one is centOS7, one is centOS6.7, and one is centOS7 minimum. The strangest thing is that the code runs on the centOS7 server, but not on the other two. The only difference between them is the OS. Same cats, same jdks, same builds.

Do I need any other things under Linux?

Exception Message:

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

-1
source share
1 answer

Have you checked the jar? and the availability of the library? Perhaps this was eliminated for some obscure reason for security / patent / export?

or at least something has changed. This is an incompatibility problem: see What: java.lang.IllegalAccessError: tried to access the method

Or you already (downloaded) this class because you have several incompatible instances. Try to find it in your packages (caller function or called)

but why not use the library directly?

 import java.security.*; MessageDigest md = MessageDigest.getInstance("MD5"); byte[] thedigest = md.digest(_originebyte); 
0
source

Source: https://habr.com/ru/post/1239416/


All Articles