Package java.lang.instrument

Examples of java.lang.instrument.IllegalClassFormatException


    try {
      return instrumenter.instrument(classfileBuffer);
    } catch (Throwable t) {
      final String msg = "Error while instrumenting class %s.";
      final IllegalClassFormatException ex = new IllegalClassFormatException(
          format(msg, classname));
      // Report this, as the exception is ignored by the JVM:
      logger.logExeption(ex);
      throw (IllegalClassFormatException) ex.initCause(t);
    }
  }
View Full Code Here


    try {
      return classTransformer.transform( loader, className, classBeingRedefined,
          protectionDomain, classfileBuffer );
    }
    catch (Exception e) {
      throw new IllegalClassFormatException( e.getMessage() );
    }
  }
View Full Code Here

    try {
      return instrumenter.instrument(classfileBuffer);
    } catch (Throwable t) {
      final String msg = "Error while instrumenting class %s.";
      final IllegalClassFormatException ex = new IllegalClassFormatException(
          format(msg, classname));
      // Report this, as the exception is ignored by the JVM:
      logger.logExeption(ex);
      throw (IllegalClassFormatException) ex.initCause(t);
    }
  }
View Full Code Here

    try {
      return instrumenter.instrument(classfileBuffer);
    } catch (Throwable t) {
      final Long id = Long.valueOf(CRC64.checksum(classfileBuffer));
      final String msg = "Error while instrumenting class %s (id=0x%x).";
      final IllegalClassFormatException ex = new IllegalClassFormatException(
          format(msg, classname, id));
      ex.initCause(t);
      // Force some output, as the exception is ignored by the JVM:
      ex.printStackTrace();
      throw ex;
    }
  }
View Full Code Here

    try {
      return instrumenter.instrument(classfileBuffer);
    } catch (Throwable t) {
      final String msg = "Error while instrumenting class %s.";
      final IllegalClassFormatException ex = new IllegalClassFormatException(
          format(msg, classname));
      ex.initCause(t);
      // Report this, as the exception is ignored by the JVM:
      logger.logExeption(ex);
      throw ex;
    }
  }
View Full Code Here

        // reference as probes might have changed.
        runtime.disconnect(classBeingRedefined);
      }
      return instrumenter.instrument(classfileBuffer);
    } catch (final Exception ex) {
      final IllegalClassFormatException wrapper = new IllegalClassFormatException(
          format("Error while instrumenting class %s.", classname));
      // Report this, as the exception is ignored by the JVM:
      logger.logExeption(wrapper);
      throw (IllegalClassFormatException) wrapper.initCause(ex);
    }
  }
View Full Code Here

                    }
                }
            }
        } catch (Exception e) {
            LOG.error(e);
            throw new IllegalClassFormatException("Unable to mark " + convertedClassName + " as transformed.");
        }
       
        // We don't need to transform anything, so we'll return null
        return null;
    }
View Full Code Here

                os.close();

                return bos.toByteArray();
            } catch(Exception ex) {
                ex.printStackTrace();
                throw new IllegalClassFormatException("Unable to convert " + convertedClassName + " to a SingleTable inheritance strategy: " + ex.getMessage());
            }
        } else {
            return null;
        }
    }
View Full Code Here

                }
                return bs.toByteArray();
            }
        } catch (IOException e) {
            e.printStackTrace();
            throw new IllegalClassFormatException(e.getMessage());
        } catch (Throwable e) {
            e.printStackTrace();
            throw new RuntimeException(e);
        }
    }
View Full Code Here

    /**
     * @tests serialization/deserialization compatibility.
     */
    public void test_serialization() throws Exception {
        IllegalClassFormatException object = new IllegalClassFormatException();
        SerializationTest.verifySelf(object);
    }
View Full Code Here

TOP

Related Classes of java.lang.instrument.IllegalClassFormatException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.