Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exception while attempting classfile rewrite #37

Open
adm351 opened this issue Apr 14, 2023 · 4 comments
Open

Exception while attempting classfile rewrite #37

adm351 opened this issue Apr 14, 2023 · 4 comments

Comments

@adm351
Copy link

adm351 commented Apr 14, 2023

Hi, I'm getting the following in the last two releases of luceedebug

[luceedebug] exception during attempted classfile rewrite
org/apache/felix/framework/Felix
java.lang.ClassCircularityError: org/apache/felix/framework/Felix

It looks like its trying to load the one wrapped here https://github.com/softwareCobbler/luceedebug/blob/master/luceedebug/src/main/java/luceedebug/instrumenter/Felix.java as well as the main one. I've tried ignoring the default one with my class loader without success.

@softwareCobbler
Copy link
Owner

Hi, sorry to hear it. Can you list your relevant configuration, which is a tuple of (os version, lucee version, jdk version, lucee config, jvm config)? The request for Lucee and JVM config is sort of handwavingly "stuff that might be a bit out of the ordinary", like other java agents also loaded, additional OSGi config, or whatever.

You don't happen to have a docker container that reproduces this, do you? That would make this easier to track down.

The issue is with "the last two releases", implying there is some commit which works, and then the subsequent commit fails. We don't really have a standardized release tagging strategy, so I'm not 100% certain which commits you are referring to -- can you specify the last known good commit on your end?

@adm351
Copy link
Author

adm351 commented Apr 17, 2023

Thanks for getting back to me. Its not that I have a working vs not working commit of luceedebug just that I tried multiple releases of luceedebug where the handling of Felix changed to see if it was a recent changed that caused the issue.

I can't share the Dockerfile unfortunately but its using:

  • amazonlinux
  • lucee 5.2.9.31
  • Corretto 1.8 JDK
  • Fusion Reactor 5.2.8
  • Tomcat 9.0.39

We are running standard Tomcat classloader etc.

I've checked, I only have org/apache/felix/framework/Felix and org/apache/felix/framework/FrameworkFactory classes in my loader within LuceeTransformer.transform()


Update: fusion reactor was also wrapping Felix and that's where the duplicate was coming from. Now I'm seeing that Felix isn't part of the URL class loader but I believe that's because it can't cast the wrapped Felix with what it expects. Ill investigate further. By the way, is there a minimum version of lucee supported by this plug-in?

@softwareCobbler
Copy link
Owner

softwareCobbler commented Apr 17, 2023

I think this is a conflict with FusionReactor. I was aware we both contend for JVMTI permissions, but it seems we also both do things that affect Felix. Can you give it a try without the FusionReactor agent?

(edit: ah, it seems you noticed this too)

RE: minimum Lucee version -- not sure, I develop this against 5.3.* though, which is what I use at $DAYJOB.

@carehart
Copy link

@adm351 Or try it without the agentpath arg that fr implements (or suggests you implement) but leave the javaagent.

I'm not saying I've tried this specifically with luceedebug, though I'm pretty sure I've had fr configured this way with ACF--where the agentpath for ACF's debugging feature was implemented (and not FR's, thus foregoing FR's debugger in favor of ACF's).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants