log4j:ERROR A "org.jboss.logging.appender.FileAppender" object is not assignable to a "org.apache.log4j.Appender" variable.
jboss部署專案中遇到如下錯誤資訊:
- 09:12:54,062 ERROR [STDERR] log4j:ERROR A "org.jboss.logging.appender.FileAppender" object is not assignable to a "org.apache.log4j.Appender" variable.
- 09:12:54,062 ERROR [STDERR] log4j:ERROR The class "org.apache.log4j.Appender" was loaded by
- 09:12:54,062 ERROR [STDERR] log4j:ERROR [WebappClassLoader
- delegate: false
- repositories:
- /WEB-INF/classes/
- ----------> Parent Classloader:
- org.jboss.mx.loading.UnifiedClassLoader3@17c50b9{ url=file:/D:/jboss-4.2.3.GA/server/default/deploy/jboss-web.deployer/ ,addedOrder=6}
- ] whereas object of type
- 09:12:54,062 ERROR [STDERR] log4j:ERROR "org.jboss.logging.appender.FileAppender" was loaded by [org.jboss.system.server.NoAnnotationURLClassLoader@1292d26].
- 09:12:54,062 ERROR [STDERR] log4j:ERROR Could not instantiate appender named "FILE".
從錯誤資訊中可知,原因是jboss的日誌jar包和專案中新增的日誌jar包衝突,解決方法很簡單,找到專案中的log4j.jar和commons-logging.jar刪除即可。
新問題出現:
以上處理方式發現另外一個問題,專案在console輸出的一些資訊丟失。需要找到更好的方式解決。
以上問題解決方法:
無需刪除專案中的log4j.jar和commons-logging.jar的方法,將jboss/lib中的jboss-common.jar包複製到專案的lib中即可。這樣就可以讓專案中的日誌和jboss中的日誌一起工作。
相關文章
- Array type xxx is not assignable
- 完美解決stack Error: Can‘t find Python executable “python“, you can set the PYTHON env variable.ErrorPython
- Error message Object BOM does not allow filter on MAST.STLNRErrorObjectFilterAST
- Error: Expected ref to be a function, a string, an object returned by React.createRef(), or null.ErrorFunctionObjectReactNull
- log4j教程
- Can't connect to X11 window server using ':0.0' as the value of the DISPLAY variable.Server
- Syntax Error: ValidationError: Invalid options object. Stylus Loader has been initialized using anErrorObjectZed
- Uncaught TypeError: Object [object Object] has no method 'xxx'ErrorObject
- log4j 詳解
- objectObject
- log4j:WARN Please initialize the log4j system properly解決辦法
- error while loading shared libraries: libgsl.so.27: cannot open shared objectErrorWhileObject
- 介面返回[object,Object]解決方法Object
- Effective Object C 2.0 『熟悉Object C』Object
- Spring整合log4jSpring
- Spring配置log4jSpring
- log4j使用總結
- log4j入門(轉)
- log4j使用示例 (轉)
- log4j配置詳解
- exclude Log4j print Log
- ES7 Object.keys,Object.values,Object.entriesObject
- Object被其他的Object引用的SQLObjectSQL
- OBJECT_ID和DATA_OBJECT_IDObject
- Failed to load libGL.so error libGL.so: cannot open shared object file: No such file or directoryAIErrorObject
- error while loading shared libraries: libmysqlclient.so.16: cannot open shared object file: No suchErrorWhileIBMMySqlclientObject
- Object流Object
- 其它 ObjectObject
- object in javascriptObjectJavaScript
- Authorization ObjectObject
- object類Object
- Differences between DATA_OBJECT_ID and OBJECT_IDObject
- object_id 及 data_object_id (oracle)ObjectOracle
- Log4j漏洞原始碼分析原始碼
- 日誌log4j的配置
- log4j日誌級別
- Spring MVC整合 Log4jSpringMVC
- log4j配置檔案示例