anotheria / moskito

Monitoring for Java applications. Complete ecosystem for DevOps. Free & open source
http://www.moskito.org
MIT License
225 stars 68 forks source link

Invalid signature file digest for Manifest main attributes #262

Closed monkiki closed 1 year ago

monkiki commented 1 year ago

I've follower the instructions to configure the agent, but it doesn't work. Tomcat fails with this trace:

Exception in thread "main" java.lang.SecurityException: Invalid signature file digest for Manifest main attributes
        at sun.security.util.SignatureFileVerifier.processImpl(SignatureFileVerifier.java:317)
        at sun.security.util.SignatureFileVerifier.process(SignatureFileVerifier.java:259)
        at java.util.jar.JarVerifier.processEntry(JarVerifier.java:323)
        at java.util.jar.JarVerifier.update(JarVerifier.java:234)
        at java.util.jar.JarFile.initializeVerifier(JarFile.java:394)
        at java.util.jar.JarFile.ensureInitialization(JarFile.java:632)
        at java.util.jar.JavaUtilJarAccessImpl.ensureInitialization(JavaUtilJarAccessImpl.java:69)
        at sun.misc.URLClassPath$JarLoader$2.getManifest(URLClassPath.java:993)
        at java.net.URLClassLoader.defineClass(URLClassLoader.java:456)
        at java.net.URLClassLoader.access$100(URLClassLoader.java:74)
        at java.net.URLClassLoader$1.run(URLClassLoader.java:369)
        at java.net.URLClassLoader$1.run(URLClassLoader.java:363)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(URLClassLoader.java:362)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:418)
        at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:352)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:351)
        at sun.instrument.InstrumentationImpl.loadClassAndStartAgent(InstrumentationImpl.java:304)
        at sun.instrument.InstrumentationImpl.loadClassAndCallPremain(InstrumentationImpl.java:401)
FATAL ERROR in native method: processing of -javaagent failed
dvayanu commented 1 year ago

Hello @monkiki , could you please provide your java and tomcat version? Is this the guide you mentioned: https://anotheria.net/blog/msk/monitoring-existing-application-using-moskito-javaagent/ ?

kind regards Leon

monkiki commented 1 year ago

Yes, this is the guide I followed. And these are the Tomcat and Java versions used:

And the setenv.sh configuration:

JAVA_OPTS="$JAVA_OPTS -Xms1024m -Xmx4096m -XX:+UseG1GC -XX:+UseStringDeduplication"
JAVA_OPTS="$JAVA_OPTS -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=$CATALINA_HOME"
JAVA_OPTS="$JAVA_OPTS -Djava.net.preferIPv4Stack=true -Dmail.mime.ignoreunknownencoding=true"
JAVA_OPTS="$JAVA_OPTS -Dfile.encoding=UTF-8 -Dsun.jnu.encoding=UTF-8 -Djava.awt.headless=true"
JAVA_OPTS="$JAVA_OPTS -Dsun.java2d.cmm=sun.java2d.cmm.kcms.KcmsServiceProvider"
JAVA_OPTS="$JAVA_OPTS -javaagent:$CATALINA_HOME/bin/moskito-javaagent-2.10.0.jar"
dvayanu commented 1 year ago

@PshenAI please reproduce

dvayanu commented 1 year ago

@monkiki can you download and try with this one? https://www.moskito.org/download/moskito-javaagent-2.10.1.jar Also is using an agent a requirement for you? The source code integration via AOP is more powerful.

monkiki commented 1 year ago

With this version the problem is gone.

Thanks.