I am trying to use Log4j JMSAppender using xml style configuration file, My log4j.xml is the same as https://code.google.com/p/log4j-jms-sample/source/browse/trunk/src/main/resources/log4j.xml except the topicName.
And the Test code is very simple:
public static void main(String[] args) throws Exception {
Logger logger = Logger.getLogger(Main.class);
logger.debug("Debug");
logger.info("Info");
logger.warn("Warn");
logger.error("Error");
logger.fatal("Fatal");
}
But I always got this error during testing:
javax.jms.JMSException: Wire format negotiation timeout: peer did not send his wire format.
at org.apache.activemq.util.JMSExceptionSupport.create(JMSExceptionSupport.java:62)
at org.apache.activemq.ActiveMQConnection.syncSendPacket(ActiveMQConnection.java:1395)
at org.apache.activemq.ActiveMQConnection.ensureConnectionInfoSent(ActiveMQConnection.java:1481)
at org.apache.activemq.ActiveMQConnection.createSession(ActiveMQConnection.java:323)
at org.apache.activemq.ActiveMQConnection.createTopicSession(ActiveMQConnection.java:1112)
My ActiveMQ is alive, but it gives a warn message every time when above exception occurred:
I have search for a whole afternoon to try to get solution but with no luck. This page gives me some hints and I also referenced this page, but they didn't help me solve my problem.
I know how to use log4j.properties instead of log4j.xml, but what I want to know is why this error occurs and how to solve it.
Hope some one could help me. Thanks a lot.
I'm using ActiveMQ-5.12.0, Log4j-1.2.17, Windows 7 platform.