我正在努力跟上进度。这里提到的https://hursleyonwmq.wordpress.com/2007/05/29/simplest-sample-applications-using-websphere-mq-jms/ 但是通过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\u 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
1条答案
按热度按时间niknxzdl1#
是com.log4j.log4j\u helloworld实现appender接口吗
大多数情况下,我们来自appenderskeleton