我正在努力遵循编程。这里提到http://examples.sencha.com/extjs/6.2.0/examples/kitchensink/#all但是通过log4j.properties文件检索队列,主机,端口等细节,下面是log4j.properties`中的条目
log4j.appender.JMS = com.log4j.Log4j_HelloWorld
log4j.appender.JMS.HostName=MQEEQS.ABC.COM
log4j.appender.JMS.Port=1414
log4j.appender.JMS.QueueManager=MQEEQS
log4j.appender.JMS.Channel=CLIENT.TO.MQEEQS
log4j.appender.JMS.QueueName=QA.M01.MR.NOTIFICATION.FEED.DEV
使用property.getProperty在我的java类 Log4j_HelloWorld 中获取这些属性,但在将其作为java应用程序运行时,我在控制台中收到以下错误 -
log4j:ERROR A "com.log4j.Log4j_HelloWorld" object is not assignable to a "org.apache.log4j.Appender" variable.
log4j:ERROR The class "org.apache.log4j.Appender" was loaded by
log4j:ERROR [sun.misc.Launcher$AppClassLoader@1a5d08] whereas object of type
log4j:ERROR "com.log4j.Log4j_HelloWorld" was loaded by [sun.misc.Launcher$AppClassLoader@1a5d08].
log4j:ERROR Could not instantiate appender named "JMS".
java.io.FileNotFoundException: log4j.properties (The system cannot find the file specified)
\nFAILURE\n
答案 0 :(得分:0)
是你的com.log4j.Log4j_HelloWorld实现了Appender接口
大多数情况下,我们派生自AppenderSkeleton