jmx_exporter icon indicating copy to clipboard operation
jmx_exporter copied to clipboard

No main manifest attribute, in jmx_prometheus_javaagent-0.16.1.jar

Open vabinav opened this issue 3 years ago • 5 comments
trafficstars

When following the README command,

java -javaagent:./jmx_prometheus_javaagent-0.16.1.jar=8080:config.yaml -jar jmx_prometheus_javaagent-0.16.1.jar

I get the following error: no main manifest attribute, in jmx_prometheus_javaagent-0.16.1.jar

In The MANIFEST.MF and pom.xml file, I do not see a Main-Class but only an Agent-Class and a Premain-Class. Is this intended? What is the correct way to run this?

vabinav avatar Dec 02 '21 08:12 vabinav

The last argument should be the JAR file of your application that you want to monitor, like

java -javaagent:./jmx_prometheus_javaagent-0.16.1.jar=8080:config.yaml -jar yourJar.jar

fstab avatar Dec 02 '21 09:12 fstab

The last argument should be the JAR file of your application that you want to monitor, like

java -javaagent:./jmx_prometheus_javaagent-0.16.1.jar=8080:config.yaml -jar yourJar.jar

Even if we provide the jar we want to monitor, it gives same error

aftabshk avatar Sep 09 '22 11:09 aftabshk

Could you try to run the same command without the -javaagent:./jmx_prometheus_javaagent-0.16.1.jar=8080:config.yaml parameter? I assume that the Main-Class attribute is missing in your application JAR, and that's causing the error.

fstab avatar Sep 09 '22 12:09 fstab

I tried that and it didn't work. Have another suggestion?

massariolmc avatar Sep 16 '22 02:09 massariolmc

Please provide the full/exact command line you are using.

dhoard avatar Sep 16 '22 02:09 dhoard

Closing as stale. Please reopen if you would like to continue the discussion.

dhoard avatar Jun 24 '23 03:06 dhoard

Hi, I am also getting the error after running : java -javaagent:./jmx_prometheus_javaagent-0.19.0.jar=12345:kafka-0-8-2.yml -jar jmx_prometheus_javaagent-0.19.0.jar

no main manifest attribute, in jmx_prometheus_javaagent-0.19.0.jar

please help to fix the same or any other command which will work

BIPINAIREE avatar Apr 10 '24 13:04 BIPINAIREE

@BIPINAIREE this is working as expected. The JMX Exporter Java agent jar is a Java agent that you configure to run with your application.

Example:

java -javaagent:./jmx_prometheus_javaagent-0.16.1.jar=8080:config.yaml -jar yourJar.jar

dhoard avatar Apr 10 '24 13:04 dhoard