Exception in thread "main" java.lang.reflect.InvocationTargetException
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:498)
        at 
sun.instrument.InstrumentationImpl.loadClassAndStartAgent(InstrumentationImpl.java:386)
        at 
sun.instrument.InstrumentationImpl.loadClassAndCallPremain(InstrumentationImpl.java:401)
Caused by: java.lang.NullPointerException
        at 
io.prometheus.jmx.shaded.io.prometheus.jmx.JavaAgent.premain(JavaAgent.java:25)
        ... 6 more
Hi, i am also getting same error can anyone help me out

On Thursday, October 10, 2019 at 1:56:49 AM UTC+5:30, Satish P wrote:
>
> From the web page: https://github.com/prometheus/jmx_exporter, one should 
> be doing 
>
> java -javaagent:./jmx_prometheus_javaagent-0.12.0.jar=8080:config.yaml -jar 
> yourJar.jar
>
>
> Looks like your last argument need to point to the JAVA application you 
> are trying to Monitor.
>
> On Wednesday, October 9, 2019 at 10:42:25 AM UTC-4, Manikanta Gupta wrote:
>>
>> We are trying to configure the JMX exporter on linux machines to scrape 
>> all the JVM metrics and feed those data to prometheus database and later we 
>> want to visualize those in Grafana, for that we downloaded the jar file 
>> (jmx_prometheus_javaagent-0.12.0.jar) and trying to execute it using the 
>> below command.
>>
>> "java -javaagent:./jmx_prometheus_javaagent-0.12.0.jar=7201:config.yaml 
>> -jar jmx_prometheus_javaagent-0.12.0.jar"
>> but we are getting below two errors
>>
>> ERROR 1 :
>> Exception in thread "main" java.lang.reflect.InvocationTargetException
>> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>> at 
>> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
>> at 
>> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
>> at java.lang.reflect.Method.invoke(Method.java:498)
>> at 
>> sun.instrument.InstrumentationImpl.loadClassAndStartAgent(InstrumentationImpl.java:386)
>> at 
>> sun.instrument.InstrumentationImpl.loadClassAndCallPremain(InstrumentationImpl.java:401)
>> Caused by: java.io.FileNotFoundException: config.yaml (No such file or 
>> directory)
>> at java.io.FileInputStream.open0(Native Method)
>> at java.io.FileInputStream.open(FileInputStream.java:195)
>> at java.io.FileInputStream.(FileInputStream.java:138)
>> at java.io.FileReader.(FileReader.java:72)
>> at 
>> io.prometheus.jmx.shaded.io.prometheus.jmx.JmxCollector.(JmxCollector.java:74)
>> at 
>> io.prometheus.jmx.shaded.io.prometheus.jmx.JavaAgent.premain(JavaAgent.java:29)
>> ... 6 more
>> FATAL ERROR in native method: processing of -javaagent failed
>>
>> Where is the config.yaml file is located?, How to download the 
>> config.yaml?, What the configurations did config.yaml contains, Please help 
>> in providing these.
>>
>> Just as a work around we created an empty file with config.yaml in the 
>> current directory and executed the same command "java 
>> -javaagent:./jmx_prometheus_javaagent-0.12.0.jar=7201:config.yaml -jar 
>> jmx_prometheus_javaagent-0.12.0.jar" then we got another error
>> ------------------------------
>> ERROR 2 :
>> no main manifest attribute, in jmx_prometheus_javaagent-0.12.0.jar
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Prometheus Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/prometheus-users/a67adb45-5c6f-4915-821c-6fbc80be9bfe%40googlegroups.com.

Reply via email to