From owner-freebsd-java@FreeBSD.ORG Thu Jun 20 08:18:56 2013 Return-Path: Delivered-To: freebsd-java@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id AF2C8B4E; Thu, 20 Jun 2013 08:18:56 +0000 (UTC) (envelope-from ronald-freebsd8@klop.yi.org) Received: from smarthost1.greenhost.nl (smarthost1.greenhost.nl [195.190.28.81]) by mx1.freebsd.org (Postfix) with ESMTP id 45D7E1231; Thu, 20 Jun 2013 08:18:55 +0000 (UTC) Received: from smtp.greenhost.nl ([213.108.104.138]) by smarthost1.greenhost.nl with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.69) (envelope-from ) id 1Upa4z-0001se-RA; Thu, 20 Jun 2013 10:18:54 +0200 Received: from [81.21.138.17] (helo=ronaldradial.versatec.local) by smtp.greenhost.nl with esmtpsa (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.72) (envelope-from ) id 1Upa50-00085Q-82; Thu, 20 Jun 2013 10:18:54 +0200 Content-Type: text/plain; charset=us-ascii; format=flowed; delsp=yes To: "Jason Helfman" Subject: Re: thread support References: Date: Thu, 20 Jun 2013 10:18:51 +0200 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: "Ronald Klop" Message-ID: In-Reply-To: User-Agent: Opera Mail/12.15 (Win32) X-Virus-Scanned: by clamav at smarthost1.samage.net X-Spam-Level: / X-Spam-Score: -0.0 X-Spam-Status: No, score=-0.0 required=5.0 tests=BAYES_40 autolearn=disabled version=3.3.1 X-Scan-Signature: 2d0a7f6a049cc125cd28f2ceffdc0173 Cc: freebsd-java@freebsd.org X-BeenThere: freebsd-java@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Porting Java to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Jun 2013 08:18:56 -0000 On Thu, 20 Jun 2013 10:06:25 +0200, Jason Helfman wrote: > On Thu, Jun 20, 2013 at 12:25 AM, Ronald Klop > wrote: > >> On Thu, 20 Jun 2013 02:03:15 +0200, Jason Helfman >> wrote: >> >> On Wed, Jun 19, 2013 at 5:02 PM, Jason Helfman wrote: >>> >>> Hi, >>>> >>>> I have a new port that I am maintaining, and I wanted to try a >>>> feature of >>>> it, but get the following error: >>>> >>>> Exception in thread "main" java.lang.**UnsupportedOperationException: >>>> Thread >>>> CPU Time Measurement is not supported. >>>> >>>> Any thoughts/ideas on this? >>>> >>>> Thanks! >>>> -jgh >>>> >>>> -- >>>> Jason Helfman | FreeBSD Committer >>>> jgh@FreeBSD.org | http://people.freebsd.org/~jgh | The Power to >>>> Serve >>>> >>>> >>> I am using openjdk6. >>> >>> -jgh >>> >> >> >> Do you have the complete stacktrace? >> >> Ronald. >> >> > Exception in thread "main" java.lang.UnsupportedOperationException: > Thread CPU Time Measurement is not supported. > at sun.management.ThreadImpl.getThreadCpuTime(ThreadImpl.java:214) > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > at > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) > at > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) > at java.lang.reflect.Method.invoke(Method.java:616) > at > com.sun.jmx.mbeanserver.ConvertingMethod.invokeWithOpenReturn(ConvertingMethod.java:180) > at > com.sun.jmx.mbeanserver.MXBeanIntrospector.invokeM2(MXBeanIntrospector.java:114) > at > com.sun.jmx.mbeanserver.MXBeanIntrospector.invokeM2(MXBeanIntrospector.java:51) > at > com.sun.jmx.mbeanserver.MBeanIntrospector.invokeM(MBeanIntrospector.java:226) > at com.sun.jmx.mbeanserver.PerInterface.invoke(PerInterface.java:138) > at com.sun.jmx.mbeanserver.MBeanSupport.invoke(MBeanSupport.java:251) > at javax.management.StandardMBean.invoke(StandardMBean.java:405) > at > com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:857) > at > com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:795) > at > javax.management.remote.rmi.RMIConnectionImpl.doOperation(RMIConnectionImpl.java:1475) > at > javax.management.remote.rmi.RMIConnectionImpl.access$300(RMIConnectionImpl.java:97) > at > javax.management.remote.rmi.RMIConnectionImpl$PrivilegedOperation.run(RMIConnectionImpl.java:1316) > at > javax.management.remote.rmi.RMIConnectionImpl.doPrivilegedOperation(RMIConnectionImpl.java:1408) > at > javax.management.remote.rmi.RMIConnectionImpl.invoke(RMIConnectionImpl.java:838) > at sun.reflect.GeneratedMethodAccessor24.invoke(Unknown Source) > at > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) > at java.lang.reflect.Method.invoke(Method.java:616) > at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:322) > at sun.rmi.transport.Transport$1.run(Transport.java:177) > at java.security.AccessController.doPrivileged(Native Method) > at sun.rmi.transport.Transport.serviceCall(Transport.java:173) > at > sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:553) > at > sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:808) > at > sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:667) > at > java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110) > at > java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603) > > at java.lang.Thread.run(Thread.java:679) > > -jgh I already expected JMX was in it. I'm not a developer of the jdk ports for FreeBSD, but not all JMX interfaces are implemented. (They are not used that often. I think mostly in development tools, like debuggers/profilers.) You could try implementing sun.management.ThreadImpl.getThreadCpuTime. Maybe first a dummy one which always returns the same value to get your port going. If it is implemented in openjdk7 it might be easy to copy to openjdk6. Maybe other people on the list can help you more with the internals of openjdk. Regards, Ronald.