Javamex

Java discussion forum to accompany the Javamex web site.

Hi Neil,

I would really love to use the classmexer agent. When running it from a standalone application, things work great for me. When I include the file in my web application, deployed to oc4j, I get an IllegalAccessError. I believe this error is caused because your jar file contains classes other than the one that is defined by the bootstrap class loader for the purpose of instrumentation. I.e. you have 2 classes in the jar not one. From the instrumentation javadoc:

...


The agent should take care to ensure that the JAR does not contain any
classes or resources other than those to be defined by the bootstrap
class loader for the purpose of instrumentation.
Failure to observe this warning could result in unexpected
behaviour that is difficult to diagnose. For example, suppose there is a
loader L, and L's parent for delegation is the bootstrap class loader.
Furthermore, a method in class C, a class defined by L, makes reference to
a non-public accessor class C$1. If the JAR file contains a class C$1 then
the delegation to the bootstrap class loader will cause C$1 to be defined
by the bootstrap class loader. In this example an IllegalAccessError
will be thrown that may cause the application to fail. One approach to
avoiding these types of issues, is to use a unique package name for the
instrumentation classes.

...

Anyway, I would love to try the classmexer with both class files merged into one and see if that would help but do not have access to the source. Is the source code available? If not, could you do this for me and package it in to a jar so I could test?

Thanks,

Cory

Views: 225

Reply to This

Replies to This Discussion

Yes this tool would be much more valuable (for instance as a learning tool) if the source where available. I am also curious what license these program have? Can I freely use it as part of a commercial application? What does "copyright" of a binary distribution mean?

Reply to Discussion

RSS

© 2020   Created by Neil Coffey.   Powered by

Badges  |  Report an Issue  |  Terms of Service