Access restriction: com.sun.management.OperatingSystemMXBean

1,569 views
Skip to first unread message

Konrad

unread,
Jan 22, 2011, 8:04:46 AM1/22/11
to orient-...@googlegroups.com
Hi,

When I'm building OrientDB from source (checked out from SVN) using Sun JDK 1.6.0 I get error compiling OGlobalConfiguration.java

Access restriction: The type OperatingSystemMXBean is not accessible due to restriction on required library C:\Program Files\Java\jdk1.6.0_18\jre\lib\rt.jar
OGlobalConfiguration.java com/orientechnologies/orient/core/config line 267 Java Problem

Do I need to build it against some other JDK or?


Regards,
Konrad

Luca Garulli

unread,
Jan 22, 2011, 10:22:15 AM1/22/11
to orient-database
Hi Konrad,
I've added a dependency with the com.sun.management.OperatingSystemMXBean class for auto-tuning the OrientDB engine, but you're using a Sun JDK, so it should works. Is it an error or a warning? Happens by compiling with the IDE or MAVEN/ANT? If it's the IDE, try to change its settings.

However I'm going to remove this dependency to use it at run-time if the class is available.

Lvc@

Konrad

unread,
Jan 22, 2011, 10:45:19 AM1/22/11
to orient-...@googlegroups.com
I was also thinking that it should be no problem since I'm using Sun JDK and they class you're using is a Sun specific class.

I'm compiling it in Eclipse and the JRE compiled against (JDK 1.6.0_18) is auto-found by Eclipse.
The "Access restriction" problem is displayed as severity "Error" in Eclipse

I'm wondering where the restrictions for the JRE library rt.jar is specified?

It's not a killer problem since I can choose to ignore the error and compile/run anyway but it kind of stands out as a ugly notification and warning-popup every time I try to run the code.

/Konrad

Tomas Fufa

unread,
Jan 22, 2011, 11:25:38 AM1/22/11
to orient-...@googlegroups.com, orient-...@googlegroups.com
Eclipse? Try window->preferences->Java -> Compiler -> Errors/warnings -
> deprecated and restricted api

And put all categories to "Warning"

Sent from my iPhone

Luca Garulli

unread,
Jan 22, 2011, 11:42:56 AM1/22/11
to orient-database
I've just committed the new version that try to use that class using the reflection avoiding compilation problem.

Lvc@

Konrad

unread,
Jan 22, 2011, 1:01:22 PM1/22/11
to orient-...@googlegroups.com
It's nicely gone from my Eclipse problem window now.

Ah, bless Reflection to hide these static warnings ;)


/Konrad
Reply all
Reply to author
Forward
0 new messages