ayld / multiverse

Automatically exported from code.google.com/p/multiverse
Other
0 stars 0 forks source link

Registration of MBeans in GlobalStmInstance fails due to instrumentation errors #174

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Attempt to run the SleepingBarberTest with the following code in 
GlobalStmInstance's static initializer:

static {
  ...
  if (instance instanceof ProfilerAware) {
      ProfilePublisher publisher = ...
      String mBeanName = JmxUtils.registerMBean(publisher);
      ...
  }

What is the expected output? What do you see instead?

Code should run and succesfully register an MBean. Instead, instrumentation 
fails with the following warning:

SEVERE: Transformer 'JSRInlineTransformer' failed while instrumenting class 
'com/sun/jmx/mbeanserver/JmxMBeanServer'. It is not possible to abort the 
instrumentation process, so the JVM is going to continue, but since this 
class is partially instrumented, all bets are off.
java.lang.ClassCircularityError: com/sun/jmx/mbeanserver/JmxMBeanServer
and a similar warning on javax/management/StandardMBean.

If the JSRInlineTransformer is disabled a different instrumentation error 
is indicated, i.e. it does not appear to fix the problem.

Of course, it is quite possible that the call to JmxUtils shouldn't be 
happening in GlobalStmInstance in the first place, but there doesn't seem 
to be any other really logical place for MV-wide initialization that's not 
specific to a certain implementation.

Original issue reported on code.google.com by sharedo...@gmail.com on 19 Nov 2009 at 9:47

GoogleCodeExporter commented 8 years ago
Added the following exceptions to AbstractClassFileTransformer.isIgnoredPackage:

className.startsWith("com/sun/jmx/")
className.startsWith("javax/management/") 

This fixes the problem, so if that's an acceptable solution please close the 
issue.

Original comment by sharedo...@gmail.com on 27 Nov 2009 at 12:10

GoogleCodeExporter commented 8 years ago

Original comment by sharedo...@gmail.com on 27 Nov 2009 at 12:10