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

SandboxClassLoader的parent为AppClassLoader导致的logback加载问题 #14

Closed
diecui1202 opened this issue Dec 22, 2017 · 2 comments
Closed
Assignees
Labels

Comments

@diecui1202
Copy link

diecui1202 commented Dec 22, 2017

SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/Users/zhuyong/.m2/repository/ch/qos/logback/logback-classic/1.1.11/logback-classic-1.1.11.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/Users/zhuyong/github/jvm-sandbox/target/sandbox/lib/../lib/sandbox-core.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
SLF4J: Actual binding is of type [ch.qos.logback.classic.util.ContextSelectorStaticBinder]
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/Users/zhuyong/.m2/repository/ch/qos/logback/logback-classic/1.1.11/logback-classic-1.1.11.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/var/folders/_8/t39d5h3s6ql89cqwy7j470sc0000gn/T/sandbox_module_jar_5526050970864565436.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
SLF4J: Actual binding is of type [ch.qos.logback.classic.util.ContextSelectorStaticBinder]

当应用AppClassLoader中有logback时,sandbox启动时,会在应用的控制台日志中输出如上的信息,原因是SandboxClassLoader的parent为AppClassLoader,Slf4j在初始化时会扫描classpath下的实现类,这时会加载到应用中的资源;

建议是将SandboxClassLoader的parent设置为ext classloader。

@dongchenxu
Copy link
Collaborator

确认问题,多谢指正。我在下一个版本迭代中修复这个问题

@dongchenxu dongchenxu self-assigned this Dec 24, 2017
@dongchenxu dongchenxu added the bug label Dec 24, 2017
@oldmanpushcart
Copy link
Collaborator

已经发布解决,版本1.0.16

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

No branches or pull requests

3 participants