New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Jolokia 1.3.3 no longer work with Java 6 #249

Closed
seboudry opened this Issue Mar 10, 2016 · 14 comments

Comments

Projects
None yet
3 participants
@seboudry

seboudry commented Mar 10, 2016

Hi !

I'm stuck with Java 6 on a legacy app and notice that new version 1.3.3 of Jolokia doesn't work on it.
It seems that a new dependency required a Java 7 class : java.lang.ReflectiveOperationException.
It appears with WAR and JVM agents.
Jolokia 1.3.2 is OK on Java 6.

I didn't found on the docs the required minimum Java version but for me a minor update don't have to force an upgrade of Java.

Here the full stacktrace :

 Exception in thread "main" java.lang.reflect.InvocationTargetException
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at sun.instrument.InstrumentationImpl.loadClassAndStartAgent(InstrumentationImpl.java:325)
    at sun.instrument.InstrumentationImpl.loadClassAndCallPremain(InstrumentationImpl.java:338)
Caused by: java.lang.NoClassDefFoundError: java/lang/ReflectiveOperationException
    at org.jolokia.jvmagent.handler.JolokiaHttpHandler.start(JolokiaHttpHandler.java:105)
    at org.jolokia.jvmagent.handler.JolokiaHttpHandler.start(JolokiaHttpHandler.java:132)
    at org.jolokia.jvmagent.JolokiaServer.start(JolokiaServer.java:111)
    at org.jolokia.jvmagent.JvmAgent.startAgent(JvmAgent.java:89)
    at org.jolokia.jvmagent.JvmAgent.premain(JvmAgent.java:67)
    ... 6 more
Caused by: java.lang.ClassNotFoundException: java.lang.ReflectiveOperationException
    at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
    ... 11 more

BTW, thanks for the job. Jolokia works like a charm !

@rhuss

This comment has been minimized.

Owner

rhuss commented Apr 6, 2016

Sorry, seems that a Java 7 only class slipped in.

Maybe a hint to drop Java 6 support sometimes soon ;-) (Just kidding, trying to support even dinosaur Java versions as long as possible and as long as it make sense).

will be fixed for the next version.

@seboudry

This comment has been minimized.

seboudry commented Apr 11, 2016

Thanks for the prio1 for next version.
Yeah, that's for some big legacy project, so no Java 7 until axe and hammer handiwork ;-)

@rhuss rhuss closed this in db28cf8 Apr 13, 2016

@rhuss

This comment has been minimized.

Owner

rhuss commented Apr 13, 2016

@Secathor just pushed a 1.3.4-SNAPSHOT with the corresponding fix.

Could you please try it whether it works for you ?

@rhuss rhuss added this to the 1.3.4 milestone Apr 13, 2016

@seboudry

This comment has been minimized.

seboudry commented Apr 14, 2016

Hi !
Version 1.3.4-SNAPSHOT is OK on java 6 runtime. Thanks

PS: snapshot versions are not accessible from maven central, I've to built it locally.

@amitjain3

This comment has been minimized.

amitjain3 commented Jul 20, 2016

Hi,
Could you please help me with integration of jolokia agent with weblogic.
I am not able to understand why it works in weblogic when running in production_mode false but as soon as production_mode is set to true i start to get classnotfound "Caused by: java.lang.ClassNotFoundException: java.lang.ReflectiveOperationException"

@rhuss

This comment has been minimized.

Owner

rhuss commented Jul 20, 2016

@amitjain3 thats because of an error introduced in 1.3.3 which relied on Java 7. This has been fixed in 1.3.4-SNAPSHOT. I will release a 1.3.4 very soon now, just waiting on some final feedbacks for a PR.

@amitjain3

This comment has been minimized.

amitjain3 commented Jul 20, 2016

@rhuss thanks. one question still which i am not able to understand is how it works fine without any error in weblogic when production_mode set to false. Does it try to use ReflectiveOperationException class on conditional basis in logic.

@rhuss

This comment has been minimized.

Owner

rhuss commented Jul 20, 2016

Maybe it uses a different JVM under the hood ? Sorry, I have really no exepriences with Weblogin in this respect. In the working case you could have a look at the java.lang:type=Runtime MBean and then check the systemProperties attribute to get the Java version your server is running with.

Also you could try 1.3.2 which doesn't have this issue.

@amitjain3

This comment has been minimized.

amitjain3 commented Jul 22, 2016

@rhuss I tried using old version

http://search.maven.org/remotecontent?filepath=org/jolokia/jolokia-agent-jvm/2.0.0-M1/jolokia-agent-jvm-2.0.0-M1-agent.jar

but this is also giving below error in jdk1.6 , could you please suggest what I am doing wrong as it looks like it is trying to refer jdk1.7 class.

No access restrictor found at classpath:/jolokia-access.xml, access to all MBeans is allowed
Exception in thread "main" java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at sun.instrument.InstrumentationImpl.loadClassAndStartAgent(InstrumentationImpl.java:325)
at sun.instrument.InstrumentationImpl.loadClassAndCallPremain(InstrumentationImpl.java:338)
Caused by: java.lang.NoClassDefFoundError: java/nio/charset/StandardCharsets
at org.jolokia.service.notif.sse.SseNotificationBackend.(SseNotificationBackend.java:27)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:247)
at org.jolokia.server.core.util.ClassUtil.classForName(ClassUtil.java:64)
at org.jolokia.server.core.util.ClassUtil.classForName(ClassUtil.java:43)
at org.jolokia.server.core.util.LocalServiceFactory.createOrRemoveService(LocalServiceFactory.java:162)
at org.jolokia.server.core.util.LocalServiceFactory.readServiceDefinitionFromUrl(LocalServiceFactory.java:126)
at org.jolokia.server.core.util.LocalServiceFactory.readServiceDefinitions(LocalServiceFactory.java:110)
at org.jolokia.server.core.util.LocalServiceFactory.createServices(LocalServiceFactory.java:72)
at org.jolokia.server.core.util.LocalServiceFactory.createServices(LocalServiceFactory.java:101)
at org.jolokia.server.core.service.impl.ClasspathServiceCreator.getServices(ClasspathServiceCreator.java:32)
at org.jolokia.server.core.service.impl.JolokiaServiceManagerImpl.addServices(JolokiaServiceManagerImpl.java:157)
at org.jolokia.jvmagent.JolokiaServer.init(JolokiaServer.java:232)
at org.jolokia.jvmagent.JolokiaServer.init(JolokiaServer.java:194)
at org.jolokia.jvmagent.JolokiaServer.(JolokiaServer.java:87)
at org.jolokia.jvmagent.JvmAgent.startAgent(JvmAgent.java:91)
at org.jolokia.jvmagent.JvmAgent.premain(JvmAgent.java:71)
... 6 more
Caused by: java.lang.ClassNotFoundException: java.nio.charset.StandardCharsets
at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
... 23 more
FATAL ERROR in native method: processing of -javaagent failed

@rhuss

This comment has been minimized.

Owner

rhuss commented Jul 22, 2016

Could you please try 1.3.2 ?

Jolokia 2.0.0 wont work with Java 1.6 anymore (intentionally)

@seboudry

This comment has been minimized.

seboudry commented Jul 23, 2016

Hi @amitjain3 !
I'm using Jolokia 1.3.2 on Java 6 and everything is OK ;)

@amitjain3

This comment has been minimized.

amitjain3 commented Jul 24, 2016

Sorry my bad, downloaded wrong jar from section.

"I would be more than happy if you would try out the JAR and WAR agent which are supposed to be drop in replacements for Jolokia 1.3.2."

is this correct jar to download

https://jar-download.com/explore-java-source-code.php?a=jolokia-jsr160&g=org.jolokia&v=1.3.2&downloadable=1

Thanks a lot.
Thanks and Regards,
 
Amit Jain   

-----Roland Huß notifications@github.com wrote: -----
To: rhuss/jolokia jolokia@noreply.github.com
From: Roland Huß notifications@github.com
Date: 07/22/2016 05:11PM
Cc: Amit Jain j.amit@intellectdesign.com, Mention mention@noreply.github.com
Subject: Re: [rhuss/jolokia] Jolokia 1.3.3 no longer work with Java 6 (#249)

Could you please try 1.3.2 ?

Jolokia 2.0.0 wont work with Java 1.6 anymore (intentionally)


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.

This e-Mail may contain proprietary and confidential information and is sent for the intended recipient(s) only. If by an addressing or transmission error this mail has been misdirected to you, you are requested to delete this mail immediately. You are also hereby notified that any use, any form of reproduction, dissemination, copying, disclosure, modification, distribution and/or publication of this e-mail message, contents or its attachment other than by its intended recipient/s is strictly prohibited.

Visit us at http://www.intellectdesign.com

@rhuss

This comment has been minimized.

@amitjain3

This comment has been minimized.

amitjain3 commented Jul 25, 2016

Thanks a lot @rhuss working fine now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment