-
Notifications
You must be signed in to change notification settings - Fork 325
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
IndyBootstrapDispatcher
cannot be properly loaded in the Resin environment
#3807
Comments
I tried reproducing with your instructions, unfortunately I couldn't get resin to work quickly (likely due to MacOs / some env requirements). It would be best if you could provide a github repo with a dockerfile as a self contained and portable way to reproduce. Alternatively we could start out by you provding us the logs here, maybe this already helps me spot the issue. |
Yes, but when I mentioned the system-classloader, I was referring to Resin's specific implementation. It doesn't seem to follow the parent delegation principle. As a result, when it attempts to load I’ve created a Dockerfile to reproduce this issue, and you can download it directly for testing. When the java.lang.BootstrapMethodError: java.lang.NoClassDefFoundError: java/lang/IndyBootstrapDispatcher. Here’s the log output I observed in my environment (in case it helps):
|
In Resin version
|
Describe the bug
When starting Resin 3 using the provided startup script ($RESIN_HOME/bin/httpd.sh), the runtime is unable to load
java.lang.IndyBootstrapDispatcher
via theDynamicClassLoader
.After some investigation, I found that the startup script ultimately calls the
com.caucho.boot.WatchdogProcess#createProcess
method (located in resin.jar) to launch Resin. This method hardcodes the startup argument-Djava.system.class.loader=com.caucho.loader.SystemClassLoader
, which replaces the default system class loader.As a result, when Resin tries to load
IndyBootstrapDispatcher
, the DynamicClassLoader delegates the loading to SystemClassLoader, which is unable to load it. In Resin 3, theresin.conf
file provides atree-node
element to configure special JAR file paths, allowing SystemClassLoader to access the target files. However, the internal implementation is hardcoded to fetch the target entry from the JAR file, likeconfiguredJars.getJarEntry("java/lang/IndyBootstrapDispatcher.class")
.The issue is that Elastic has shaded the class, and its actual resource path is represented as
agent/bootstrap/java/lang/IndyBootstrapDispatcher.esclazz
. This mismatch causes the class loading to fail, leading to malfunctioning agent functionality.All the above is specific to Resin 3. Resin 4 might have the same problem, but I haven't tested it yet.
Steps to reproduce
$RESIN_HOME/webapps
$RESIN_HOME/bin/httpd.sh start
http://localhost:7040/vulns
through your browserThe text was updated successfully, but these errors were encountered: