Forum Stats

  • 3,769,955 Users
  • 2,253,036 Discussions
  • 7,875,251 Comments

Discussions

JDK9-EA build 121: modules -> BDB/je 5.0.104 com.sleepycat.je.utilint.JVMSystemUtils can't access su

jerven
jerven Member Posts: 43
edited Jul 19, 2016 8:59AM in Berkeley DB Java Edition

Dear BDB/je developers,

I suspect you already know this but in case not. In series 5 there is access to a class that is now no longer exported in the new jigsawed JDk9.

java.lang.IllegalAccessException: class com.sleepycat.je.utilint.JVMSystemUtils cannot access class sun.management.BaseOperatingSystemImpl (in module java.management) because module java.management does

not export sun.management to unnamed module

Do you think there is a workarround? Or only by upgrading to the 6 series?

It feels like this is actually a bug in jigsaw, looking very quickly at the bytecode only the public OperatingSystemMBean is used.

If you agree would you like me to open a JDK  bug report or will you?

.

Regards,

Jerven Bolleman

jerven

Answers

  • Greybird-Oracle
    Greybird-Oracle Member Posts: 2,690
    edited Jun 6, 2016 8:22PM

    Hi Jerven,

    No, we weren't aware of this.

    I think you're right -- this is probably a JDK 9 bug.  Could you please post the JE version and the stack trace so we can confirm?

    Yes, using a newer version of JDK 9 sounds like a good idea, and please let us know if that solves it.

    Thanks,

    --mark

  • jerven
    jerven Member Posts: 43
    edited Jun 9, 2016 10:50AM

    Stack trace

    java.lang.IllegalStateException: java.lang.IllegalAccessException: class com.sleepycat.je.utilint.JVMSystemUtils cannot access class sun.management.BaseOperatingSystemImpl (in module java.management) because module java.management does not export sun.management to unnamed module @9816741

       at com.sleepycat.je.utilint.JVMSystemUtils.getSystemLoad(JVMSystemUtils.java:50)

       at com.sleepycat.je.statcap.JvmStats.loadStats(JvmStats.java:81)

       at com.sleepycat.je.statcap.StatCapture.getStats(StatCapture.java:234)

       at com.sleepycat.je.statcap.StatCapture.outputStats(StatCapture.java:177)

       at com.sleepycat.je.statcap.StatCapture.onWakeup(StatCapture.java:150)

       at com.sleepycat.je.utilint.DaemonThread.run(DaemonThread.java:148)

       at java.lang.Thread.run([email protected]/Thread.java:843)


    Version of BDB/je is


    java -cp je.jar com.sleepycat.je.util.DbVerify -V

    5.0.104


    JVM is JDK-9-ea-121

  • Greybird-Oracle
    Greybird-Oracle Member Posts: 2,690
    edited Jun 9, 2016 11:28AM

    Thanks. I did a little searching and it seems to be more of a JDK 9 feature than a bug. I found a couple possible solutions. I haven't tried them yet, and I will investigate further, but I wanted to let you know about the first one now, since it be a quick solution for you.

    JEP 261: Module System

    talks about adding this JVM command line option:

    -XaddExports:java.management/sun.management=ALL-UNNAMED

    Hopefully this works for you.

    A fix in NetBeans may provide a way to avoid having to add the JVM option. This would be better in the long term of course, if it works.

    http://hg.netbeans.org/main-silver/rev/874045c8030f

    I'll look into doing this in JE.

    --mark

    jerven
  • jerven
    jerven Member Posts: 43
    edited Jun 10, 2016 4:47AM

    Ah I see why. Yeah, that is a feature will you consider backporting the patch to the 5 series? There is 286 days before JDK9 is GA, so not in a hurry.

  • Greybird-Oracle
    Greybird-Oracle Member Posts: 2,690
    edited Jun 10, 2016 8:00PM

    Did you try using -XaddExports? I think it would help others on the forum to know about this.

    No, we won't be back-porting any fixes to the 5.0.x versions of JE unless a customer requires it. I strongly recommend upgrading to the latest version, because we can support you much better that way.

    --mark

    jerven
  • jerven
    jerven Member Posts: 43
    edited Jun 15, 2016 12:58PM

    Yes the -XaddExports works like a charm. Unfortunately, a licensing conflict prevents us from upgrading and budgets as a non profit means we can't afford the commercial license. Understand about the 5.0.x decision. We might split the project into 2 so that we can live with these two conflicting licenses but have not done so yet.

  • Greybird-Oracle
    Greybird-Oracle Member Posts: 2,690
    edited Jun 15, 2016 5:17PM

    Thanks for trying -XaddExports and letting us know.

    --mark

  • Greybird-Oracle
    Greybird-Oracle Member Posts: 2,690
    edited Jul 19, 2016 8:59AM

    FYI, we made a change that avoids having to add XaddExports. This will be in JE 7.2.

    --mark

This discussion has been closed.