Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6725839
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T09:51:17+00:00 2026-05-26T09:51:17+00:00

public byte[] transform(ClassLoader loader, String className, Class<?> clazz, ProtectionDomain domain, byte[] bytes) throws IllegalClassFormatException

  • 0
public byte[] transform(ClassLoader loader, String className, Class<?> clazz,
            ProtectionDomain domain, byte[] bytes)
    throws IllegalClassFormatException {
        return inspectClass(className, clazz, bytes);
}

private byte[] inspectClass(String name, Class<?> clazz, byte[] b) {
        System.out.println("here"); //OK I see this print
        ClassPool pool = ClassPool.getDefault();
        System.out.println("inclass"); //can't see it !!
}

What can happen in ClassPool.getDefault();?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T09:51:18+00:00Added an answer on May 26, 2026 at 9:51 am

    I had the same problem, and found ClassPool.getDefault was not throwing Exception, but Throwable.
    In fact, it was throwing java.lang.NoClassDefFoundError.
    In my manifest, I had:

    Premain-Class: timing.TimingTransform
    Boot-Class-Path: lib/javassist.jar
    

    You likely just need to point the Boot-Class-Path to the javassist.jar file.
    In my case, with the Boot-Class-Path above, I needed a lib directory with javassist.jar in it.

    The mistake I made initially was putting javassist.jar inside the agent jar file
    (THE FOLLOWING IS INCORRECT, FOR DEMONSTRATION PURPOSES ONLY):

         0 Mon Oct 24 16:58:14 MST 2011 META-INF/
       146 Mon Oct 24 16:58:14 MST 2011 META-INF/MANIFEST.MF
         0 Thu Oct 20 14:58:06 MST 2011 timing/
      2482 Mon Oct 24 16:58:06 MST 2011 timing/TimingStats.class
      8360 Mon Oct 24 16:58:06 MST 2011 timing/TimingTransform.class
         0 Tue Oct 18 17:28:24 MST 2011 lib/
    645252 Fri Jul 08 18:24:58 MST 2011 lib/javassist.jar
    

    Rather than putting javassist.jar inside the agent jar file, I put it in an external directory accessible to the program. After that change, it worked fine.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

public class b { public static void main(String[] args) { byte b = 1;
I have the below methods: public static byte[] ConvertFileToBytes(string filePath) { var fInfo =
I have the following function: public static byte[] StringToByte(string str) { int length =
public Image Base64ToImage(string base64String) { // Convert Base64 String to byte[] byte[] imageBytes =
Suppose I have a method like so: public byte[] GetThoseBytes() { using (System.IO.MemoryStream ms
I am trying to encrypt some data with the following code: public static byte[]
Just noticed in ByteArrayOutputStream , the toByteArray() is declared as, public synchronized byte toByteArray()[];
Let's consider the following enum in C# public enum ScrollMode : byte { None
Given the following information Public Enum Request As Byte None = 0 Identity =
i have a structure public struct SERVER_USB_DEVICE { USB_HWID usbHWID; byte status; bool bExcludeDevice;

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.