It's not a bug, it's a feature :)
com.sun.management.HotSpotDiagnosticMXBean is a com.sun classes, so maybe not 
available anymore.

see https://wiki.openjdk.java.net/display/JDK8/Java+Dependency+Analysis+Tool

Rémi

----- Mail original -----
> De: "Uwe Schindler" <uschind...@apache.org>
> À: "Core-Libs-Dev" <core-libs-dev@openjdk.java.net>, "Rory O'Donnell" 
> <rory.odonn...@oracle.com>
> Envoyé: Jeudi 17 Mars 2016 17:03:25
> Objet: RE: JDK 9 build 109 -> Lucene's Ant build works again; still missing 
> Hotspot patches
> 
> Hi,
> 
> In fact, any static method on ManagementFactory fails with this trace. You
> cannot get any bean, not even runtime bean!
> 
> Uwe
> 
> -----
> Uwe Schindler
> uschind...@apache.org
> ASF Member, Apache Lucene PMC / Committer
> Bremen, Germany
> http://lucene.apache.org/
> 
> 
> > -----Original Message-----
> > From: core-libs-dev [mailto:core-libs-dev-boun...@openjdk.java.net] On
> > Behalf Of Uwe Schindler
> > Sent: Thursday, March 17, 2016 4:40 PM
> > To: 'Core-Libs-Dev' <core-libs-dev@openjdk.java.net>; 'Rory O'Donnell'
> > <rory.odonn...@oracle.com>
> > Subject: RE: JDK 9 build 109 -> Lucene's Ant build works again; still
> > missing
> > Hotspot patches
> > 
> > Hi,
> > 
> > Unfortunately we found a bug in build 110 - not as bad as the Ant one, but
> > the Gradle build system does no longer start! :(
> > 
> > The following fails:
> > 
> > C:\Users\Uwe Schindler\workspace-lucene\tester\src>cat Test.java
> > import java.lang.management.ManagementFactory;
> > import com.sun.management.HotSpotDiagnosticMXBean;
> > 
> > public final class Test {
> > 
> >  public static void main(String... args) throws Throwable {
> > 
> > ManagementFactory.getPlatformMXBean(HotSpotDiagnosticMXBean.class);
> >  }
> > 
> > }
> > 
> > C:\Users\Uwe Schindler\workspace-lucene\tester\src>javac Test.java
> > 
> > C:\Users\Uwe Schindler\workspace-lucene\tester\src>java Test
> > Exception in thread "main" java.util.ServiceConfigurationError:
> > sun.management.spi.PlatformMBeanProvider: Provider
> > jdk.management.cmm.i
> > nternal.PlatformMBeanProviderImpl not found
> >        at java.util.ServiceLoader.fail(ServiceLoader.java:237)
> >        at java.util.ServiceLoader.access$300(ServiceLoader.java:183)
> >        at
> > java.util.ServiceLoader$LazyIterator.nextService(ServiceLoader.java:370)
> >        at java.util.ServiceLoader$LazyIterator.next(ServiceLoader.java:402)
> >        at java.util.ServiceLoader$1.next(ServiceLoader.java:478)
> >        at java.lang.Iterable.forEach(Iterable.java:74)
> >        at
> > java.lang.management.ManagementFactory$PlatformMBeanFinder.lambda
> > $static$0(ManagementFactory.java:890)
> >        at java.security.AccessController.doPrivileged(Native Method)
> >        at
> >        
> > java.security.AccessController.doPrivileged(AccessController.java:428)
> >        at
> > java.lang.management.ManagementFactory$PlatformMBeanFinder.<clinit>(
> > ManagementFactory.java:886)
> >        at
> > java.lang.management.ManagementFactory.getPlatformMXBean(Managem
> > entFactory.java:649)
> >        at Test.main(Test.java:8)
> > 
> > 
> > Should I open an issue or can we do this through this mail?
> > 
> > This breaks several things:
> > 
> > - Grade fails to start
> > - One Lucene test, because it detects Oracle and 64 bits, but then finds
> > out
> > that we have no Hotspot bean
> > - The Lucene Test Runner cannot get the PID of a Process started
> > - Elasticsearch cannot find its own process ID because of this
> > 
> > Uwe
> > 
> > -----
> > Uwe Schindler
> > uschind...@apache.org
> > ASF Member, Apache Lucene PMC / Committer
> > Bremen, Germany
> > http://lucene.apache.org/
> > 
> > 
> > > -----Original Message-----
> > > From: Robert Muir [mailto:rcm...@gmail.com]
> > > Sent: Thursday, March 17, 2016 4:01 PM
> > > To: Uwe Schindler <uschind...@apache.org>
> > > Cc: Rory O'Donnell <rory.odonn...@oracle.com>; Core-Libs-Dev <core-libs-
> > > d...@openjdk.java.net>; Steve Drach <steve.dr...@oracle.com>; Alan
> > > Bateman <alan.bate...@oracle.com>; hotspot compiler <hotspot-
> > > compiler-...@openjdk.java.net>
> > > Subject: Re: JDK 9 build 109 -> Lucene's Ant build works again; still
> > > missing
> > > Hotspot patches
> > >
> > > On Thu, Mar 17, 2016 at 10:25 AM, Uwe Schindler
> > <uschind...@apache.org>
> > > wrote:
> > > >
> > > > My local tests showed that the MethodHandle-bug is solved, the other
> > one
> > > is hopefully fixed, too. Robert may have a way to quickly reproduce.
> > > >
> > >
> > > JDK-8150280 is fixed too, I just tested it. Thanks!
> 
> 

Reply via email to