Skip to content

Jolokia 1.3.3 no longer work with Java 6 #249

Closed

Description

@seboudry

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 !

Activity

  1. rhuss commented on Apr 6, 2016

    @rhuss
    Member

    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.

  2. seboudry commented on Apr 11, 2016

    @seboudry
    Author

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

  3. added a commit that references this issue on Apr 13, 2016
  4. rhuss commented on Apr 13, 2016

    @rhuss
    Member

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

    Could you please try it whether it works for you ?

  5. added this to the 1.3.4 milestone on Apr 13, 2016
  6. seboudry commented on Apr 14, 2016

    @seboudry
    Author

    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.

  7. amitjain3 commented on Jul 20, 2016

    @amitjain3

    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"

  8. rhuss commented on Jul 20, 2016

    @rhuss
    Member

    @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.

  9. amitjain3 commented on Jul 20, 2016

    @amitjain3

    @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.

  10. rhuss commented on Jul 20, 2016

    @rhuss
    Member

    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.

  11. amitjain3 commented on Jul 22, 2016

    @amitjain3

    @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

  12. rhuss commented on Jul 22, 2016

    @rhuss
    Member

    Could you please try 1.3.2 ?

    Jolokia 2.0.0 wont work with Java 1.6 anymore (intentionally)

  13. seboudry commented on Jul 23, 2016

    @seboudry
    Author

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

  14. amitjain3 commented on Jul 24, 2016

    @amitjain3

    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

  15. rhuss commented on Jul 25, 2016

    @rhuss
    Member
  16. amitjain3 commented on Jul 25, 2016

    @amitjain3

    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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions