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

When using lo4j, will offer a ClassNotFoundException: com.alibaba.com mon. Logging. The spi. Log4j. DailyRollingFileAppender #1209

Closed
crazyStar00 opened this issue Jun 1, 2022 · 2 comments
Labels
question Further information is requested wontfix This will not be worked on

Comments

@crazyStar00
Copy link
Contributor

Describe the bug

When using lo4j, will offer a ClassNotFoundException: com.alibaba.com mon. Logging. The spi. Log4j. DailyRollingFileAppender

A clear and concise description of what the bug is.

log4j:ERROR Could not create an Appender. Reported error follows.
java.lang.ClassNotFoundException: com.alibaba.common.logging.spi.log4j.DailyRollingFileAppender
	at java.net.URLClassLoader.findClass(URLClassLoader.java:382)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
	at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:349)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
	at java.lang.Class.forName0(Native Method)
	at java.lang.Class.forName(Class.java:264)
	at org.apache.log4j.helpers.Loader.loadClass(Loader.java:198)
	at org.apache.log4j.xml.DOMConfigurator.parseAppender(DOMConfigurator.java:247)
	at org.apache.log4j.xml.DOMConfigurator.findAppenderByName(DOMConfigurator.java:176)
	at org.apache.log4j.xml.DOMConfigurator.findAppenderByReference(DOMConfigurator.java:191)
	at org.apache.log4j.xml.DOMConfigurator.parseChildrenOfLoggerElement(DOMConfigurator.java:523)
	at org.apache.log4j.xml.DOMConfigurator.parseCategory(DOMConfigurator.java:436)
	at org.apache.log4j.xml.DOMConfigurator.parse(DOMConfigurator.java:1004)
	at org.apache.log4j.xml.DOMConfigurator.doConfigure(DOMConfigurator.java:872)
	at org.apache.log4j.xml.DOMConfigurator.doConfigure(DOMConfigurator.java:778)
	at com.alipay.sofa.common.log.factory.LoggerSpaceFactory4Log4jBuilder.doBuild(LoggerSpaceFactory4Log4jBuilder.java:69)
	at com.alipay.sofa.common.log.factory.AbstractLoggerSpaceFactoryBuilder.build(AbstractLoggerSpaceFactoryBuilder.java:67)
	at com.alipay.sofa.common.log.MultiAppLoggerSpaceManager.createILoggerFactory(MultiAppLoggerSpaceManager.java:319)
	at com.alipay.sofa.common.log.MultiAppLoggerSpaceManager.doInit(MultiAppLoggerSpaceManager.java:115)
	at com.alipay.sofa.common.log.MultiAppLoggerSpaceManager.init(MultiAppLoggerSpaceManager.java:90)
	at com.alipay.sofa.common.log.MultiAppLoggerSpaceManager.getILoggerFactoryBySpaceName(MultiAppLoggerSpaceManager.java:191)
	at com.alipay.sofa.common.log.MultiAppLoggerSpaceManager.getLoggerBySpace(MultiAppLoggerSpaceManager.java:177)
	at com.alipay.sofa.common.log.MultiAppLoggerSpaceManager.getLoggerBySpace(MultiAppLoggerSpaceManager.java:132)
	at com.alipay.sofa.common.log.LoggerSpaceManager.getLoggerBySpace(LoggerSpaceManager.java:44)
	at com.alipay.hessian.NameBlackListFilter.judgeLogger(NameBlackListFilter.java:68)
	at com.alipay.hessian.NameBlackListFilter.<clinit>(NameBlackListFilter.java:33)
	at com.alipay.hessian.ClassNameResolverBuilder.buildDefault(ClassNameResolverBuilder.java:37)
	at com.caucho.hessian.io.SerializerFactory.<init>(SerializerFactory.java:105)
	at com.alipay.sofa.rpc.codec.sofahessian.SingleClassLoaderSofaSerializerFactory.<init>(SingleClassLoaderSofaSerializerFactory.java:35)
	at com.alipay.sofa.rpc.codec.sofahessian.MultipleClassLoaderSofaSerializerFactory.<init>(MultipleClassLoaderSofaSerializerFactory.java:30)
	at com.alipay.sofa.rpc.codec.sofahessian.SofaHessianSerializer.getSerializerFactory(SofaHessianSerializer.java:123)
	at com.alipay.sofa.rpc.codec.sofahessian.SofaHessianSerializer.<init>(SofaHessianSerializer.java:93)
	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
	at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
	at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
	at com.alipay.sofa.rpc.common.utils.ClassUtils.newInstance(ClassUtils.java:149)
	at com.alipay.sofa.rpc.common.utils.ClassUtils.newInstanceWithArgs(ClassUtils.java:198)
	at com.alipay.sofa.rpc.ext.ExtensionClass.getExtInstance(ExtensionClass.java:107)
	at com.alipay.sofa.rpc.ext.ExtensionClass.getExtInstance(ExtensionClass.java:90)
	at com.alipay.sofa.rpc.codec.SerializerFactory$1.onLoad(SerializerFactory.java:59)
	at com.alipay.sofa.rpc.ext.ExtensionLoader.addListener(ExtensionLoader.java:504)
	at com.alipay.sofa.rpc.codec.SerializerFactory.buildLoader(SerializerFactory.java:55)
	at com.alipay.sofa.rpc.codec.SerializerFactory.<clinit>(SerializerFactory.java:51)
	at com.alipay.sofa.rpc.codec.bolt.SofaRpcSerialization.deserializeContent(SofaRpcSerialization.java:263)
	at com.alipay.remoting.rpc.protocol.RpcRequestCommand.deserializeContent(RpcRequestCommand.java:151)
	at com.alipay.remoting.rpc.RpcCommand.deserialize(RpcCommand.java:117)
	at com.alipay.remoting.rpc.RpcCommand.deserialize(RpcCommand.java:138)
	at com.alipay.remoting.rpc.protocol.RpcRequestProcessor.deserializeRequestCommand(RpcRequestProcessor.java:268)
	at com.alipay.remoting.rpc.protocol.RpcRequestProcessor.doProcess(RpcRequestProcessor.java:143)
	at com.alipay.remoting.rpc.protocol.RpcRequestProcessor$ProcessTask.run(RpcRequestProcessor.java:375)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
	at java.lang.Thread.run(Thread.java:748)

The reason for the error:
11

Expected behavior

Actual behavior

Steps to reproduce

Minimal yet complete reproducer code (or GitHub URL to code)

https://github.com/crazyStar00/sofa-log4j-error.git

Environment

  • SOFARPC version:
    5.8.2
  • JVM version (e.g. java -version):
    1.8.0_202
  • OS version (e.g. uname -a):
  • Darwin 192.168.0.101 19.6.0 Darwin Kernel Version 19.6.0: Thu Oct 29 22:56:45 PDT 2020; root:xnu-6153.141.2.2~1/RELEASE_X86_64 x86_64
  • Maven version:
    3.8.3
  • IDE version:
    idea-2021.3.3
@sofastack-bot sofastack-bot bot added the question Further information is requested label Jun 1, 2022
@JervyShi
Copy link
Member

JervyShi commented Jun 9, 2022

@crazyStar00 Thanks for your feedback, this is an issue in sofa-hessian and will be followed up in sofastack/sofa-hessian#77

@stale
Copy link

stale bot commented Aug 8, 2022

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the wontfix This will not be worked on label Aug 8, 2022
@stale stale bot closed this as completed Aug 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested wontfix This will not be worked on
Projects
None yet
Development

No branches or pull requests

2 participants