activemq-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Gary Tully (JIRA)" <j...@apache.org>
Subject [jira] Resolved: (AMQ-2495) Issue with JMSAppender using Activemq
Date Wed, 23 Jun 2010 12:06:50 GMT

     [ https://issues.apache.org/activemq/browse/AMQ-2495?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Gary Tully resolved AMQ-2495.
-----------------------------

    Fix Version/s: 5.4.0
                       (was: 5.4.1)
       Resolution: Fixed

fix http://svn.apache.org/viewvc?rev=926165&view=rev resolved this.

This removes the logger from BrokerInfo which clashes with the logger init from ActiveMQConnection,
which allows log4j to initialise
stack trace from client before the exception{code}
log4j-jms:
     [echo] Running a Log4j JMS Appender example
     [java] starting
     [java] 2010-06-23 12:53:34
     [java] Full thread dump Java HotSpot(TM) Server VM (16.3-b01 mixed mode):
     [java] 
     [java] "InactivityMonitor WriteCheck" daemon prio=10 tid=0x089d9400 nid=0x5549 in Object.wait()
[0xa895c000]
     [java]    java.lang.Thread.State: TIMED_WAITING (on object monitor)
     [java] 	at java.lang.Object.wait(Native Method)
     [java] 	- waiting on <0xb2436458> (a java.util.TaskQueue)
     [java] 	at java.util.TimerThread.mainLoop(Timer.java:509)
     [java] 	- locked <0xb2436458> (a java.util.TaskQueue)
     [java] 	at java.util.TimerThread.run(Timer.java:462)
     [java] 
     [java] "InactivityMonitor ReadCheck" daemon prio=10 tid=0x08888400 nid=0x5548 in Object.wait()
[0xa89ad000]
     [java]    java.lang.Thread.State: TIMED_WAITING (on object monitor)
     [java] 	at java.lang.Object.wait(Native Method)
     [java] 	- waiting on <0xb2435fe8> (a java.util.TaskQueue)
     [java] 	at java.util.TimerThread.mainLoop(Timer.java:509)
     [java] 	- locked <0xb2435fe8> (a java.util.TaskQueue)
     [java] 	at java.util.TimerThread.run(Timer.java:462)
     [java] 
     [java] "ActiveMQ Transport: tcp://localhost/127.0.0.1:61616" prio=10 tid=0xa88b1c00 nid=0x5545
in Object.wait() [0xa89fe000]
     [java]    java.lang.Thread.State: RUNNABLE
     [java] 	at org.apache.log4j.LogManager.getLoggerRepository(LogManager.java:174)
     [java] 	at org.apache.log4j.LogManager.getLogger(LogManager.java:199)
     [java] 	at org.apache.log4j.Logger.getLogger(Logger.java:105)
     [java] 	at org.apache.commons.logging.impl.Log4JLogger.getLogger(Log4JLogger.java:283)
     [java] 	at org.apache.commons.logging.impl.Log4JLogger.<init>(Log4JLogger.java:108)
     [java] 	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
     [java] 	at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
     [java] 	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
     [java] 	at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
     [java] 	at org.apache.commons.logging.impl.LogFactoryImpl.newInstance(LogFactoryImpl.java:605)
     [java] 	at org.apache.commons.logging.impl.LogFactoryImpl.getInstance(LogFactoryImpl.java:333)
     [java] 	at org.apache.commons.logging.impl.LogFactoryImpl.getInstance(LogFactoryImpl.java:307)
     [java] 	at org.apache.commons.logging.LogFactory.getLog(LogFactory.java:645)
     [java] 	at org.apache.activemq.command.BrokerInfo.<clinit>(BrokerInfo.java:37)
     [java] 	at org.apache.activemq.openwire.v5.BrokerInfoMarshaller.createObject(BrokerInfoMarshaller.java:55)
     [java] 	at org.apache.activemq.openwire.OpenWireFormat.doUnmarshal(OpenWireFormat.java:358)
     [java] 	at org.apache.activemq.openwire.OpenWireFormat.unmarshal(OpenWireFormat.java:276)
     [java] 	at org.apache.activemq.transport.tcp.TcpTransport.readCommand(TcpTransport.java:211)
     [java] 	at org.apache.activemq.transport.tcp.TcpTransport.doRun(TcpTransport.java:203)
     [java] 	at org.apache.activemq.transport.tcp.TcpTransport.run(TcpTransport.java:186)
     [java] 	at java.lang.Thread.run(Thread.java:619)
     [java] 
     [java] "Low Memory Detector" daemon prio=10 tid=0x08896c00 nid=0x5540 runnable [0x00000000]
     [java]    java.lang.Thread.State: RUNNABLE
     [java] 
     [java] "CompilerThread1" daemon prio=10 tid=0x08895000 nid=0x553f waiting on condition
[0x00000000]
     [java]    java.lang.Thread.State: RUNNABLE
     [java] 
     [java] "CompilerThread0" daemon prio=10 tid=0x08893000 nid=0x553e waiting on condition
[0x00000000]
     [java]    java.lang.Thread.State: RUNNABLE
     [java] 
     [java] "Signal Dispatcher" daemon prio=10 tid=0x08891800 nid=0x553d waiting on condition
[0x00000000]
     [java]    java.lang.Thread.State: RUNNABLE
     [java] 
     [java] "Finalizer" daemon prio=10 tid=0x0887cc00 nid=0x553c in Object.wait() [0xa917c000]
     [java]    java.lang.Thread.State: WAITING (on object monitor)
     [java] 	at java.lang.Object.wait(Native Method)
     [java] 	- waiting on <0xb1860b10> (a java.lang.ref.ReferenceQueue$Lock)
     [java] 	at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:118)
     [java] 	- locked <0xb1860b10> (a java.lang.ref.ReferenceQueue$Lock)
     [java] 	at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:134)
     [java] 	at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:159)
     [java] 
     [java] "Reference Handler" daemon prio=10 tid=0x0887b400 nid=0x553b in Object.wait()
[0xa91cd000]
     [java]    java.lang.Thread.State: WAITING (on object monitor)
     [java] 	at java.lang.Object.wait(Native Method)
     [java] 	- waiting on <0xb1860a18> (a java.lang.ref.Reference$Lock)
     [java] 	at java.lang.Object.wait(Object.java:485)
     [java] 	at java.lang.ref.Reference$ReferenceHandler.run(Reference.java:116)
     [java] 	- locked <0xb1860a18> (a java.lang.ref.Reference$Lock)
     [java] 
     [java] "main" prio=10 tid=0x087fe000 nid=0x5535 waiting on condition [0xb6b56000]
     [java]    java.lang.Thread.State: WAITING (parking)
     [java] 	at sun.misc.Unsafe.park(Native Method)
     [java] 	- parking to wait for  <0xb241a4e8> (a java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject)
     [java] 	at java.util.concurrent.locks.LockSupport.park(LockSupport.java:158)
     [java] 	at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:1925)
     [java] 	at java.util.concurrent.ArrayBlockingQueue.take(ArrayBlockingQueue.java:317)
     [java] 	at org.apache.activemq.transport.FutureResponse.getResult(FutureResponse.java:40)
     [java] 	at org.apache.activemq.transport.ResponseCorrelator.request(ResponseCorrelator.java:87)
     [java] 	at org.apache.activemq.ActiveMQConnection.syncSendPacket(ActiveMQConnection.java:1262)
     [java] 	at org.apache.activemq.ActiveMQConnection.ensureConnectionInfoSent(ActiveMQConnection.java:1368)
     [java] 	- locked <0xb23dad48> (a java.lang.Object)
     [java] 	at org.apache.activemq.ActiveMQConnection.createSession(ActiveMQConnection.java:303)
     [java] 	at org.apache.activemq.ActiveMQConnection.createTopicSession(ActiveMQConnection.java:1065)
     [java] 	at org.apache.log4j.net.JMSAppender.activateOptions(JMSAppender.java:217)
     [java] 	at org.apache.log4j.config.PropertySetter.activate(PropertySetter.java:257)
     [java] 	at org.apache.log4j.config.PropertySetter.setProperties(PropertySetter.java:133)
     [java] 	at org.apache.log4j.config.PropertySetter.setProperties(PropertySetter.java:97)
     [java] 	at org.apache.log4j.PropertyConfigurator.parseAppender(PropertyConfigurator.java:689)
     [java] 	at org.apache.log4j.PropertyConfigurator.parseCategory(PropertyConfigurator.java:647)
     [java] 	at org.apache.log4j.PropertyConfigurator.configureRootCategory(PropertyConfigurator.java:544)
     [java] 	- locked <0xb1ea1260> (a org.apache.log4j.spi.RootLogger)
     [java] 	at org.apache.log4j.PropertyConfigurator.doConfigure(PropertyConfigurator.java:440)
     [java] 	at org.apache.log4j.PropertyConfigurator.doConfigure(PropertyConfigurator.java:476)
     [java] 	at org.apache.log4j.helpers.OptionConverter.selectAndConfigure(OptionConverter.java:471)
     [java] 	at org.apache.log4j.LogManager.<clinit>(LogManager.java:125)
     [java] 	at org.apache.log4j.Logger.getLogger(Logger.java:105)
     [java] 	at org.apache.commons.logging.impl.Log4JLogger.getLogger(Log4JLogger.java:283)
     [java] 	at org.apache.commons.logging.impl.Log4JLogger.<init>(Log4JLogger.java:108)
     [java] 	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
     [java] 	at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
     [java] 	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
     [java] 	at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
     [java] 	at org.apache.commons.logging.impl.LogFactoryImpl.createLogFromClass(LogFactoryImpl.java:1040)
     [java] 	at org.apache.commons.logging.impl.LogFactoryImpl.discoverLogImplementation(LogFactoryImpl.java:838)
     [java] 	at org.apache.commons.logging.impl.LogFactoryImpl.newInstance(LogFactoryImpl.java:601)
     [java] 	at org.apache.commons.logging.impl.LogFactoryImpl.getInstance(LogFactoryImpl.java:333)
     [java] 	at org.apache.commons.logging.impl.LogFactoryImpl.getInstance(LogFactoryImpl.java:307)
     [java] 	at org.apache.commons.logging.LogFactory.getLog(LogFactory.java:645)
     [java] 	at org.apache.activemq.ActiveMQPrefetchPolicy.<clinit>(ActiveMQPrefetchPolicy.java:38)
     [java] 	at org.apache.activemq.ActiveMQConnectionFactory.<init>(ActiveMQConnectionFactory.java:90)
     [java] 	at org.apache.activemq.ActiveMQConnectionFactory.<init>(ActiveMQConnectionFactory.java:131)
     [java] 	at Log4jJMSAppenderExample.<init>(Unknown Source)
     [java] 	at Log4jJMSAppenderExample.main(Unknown Source)
     [java] 
     [java] "VM Thread" prio=10 tid=0x08878c00 nid=0x553a runnable 
     [java] 
     [java] "GC task thread#0 (ParallelGC)" prio=10 tid=0x08805000 nid=0x5536 runnable 
     [java] 
     [java] "GC task thread#1 (ParallelGC)" prio=10 tid=0x08806800 nid=0x5537 runnable 
     [java] 
     [java] "VM Periodic Task Thread" prio=10 tid=0x08898c00 nid=0x5541 waiting on condition

     [java] 
     [java] JNI global references: 774
     [java] 
     [java] Heap
     [java]  PSYoungGen      total 18816K, used 13407K [0xb1860000, 0xb2d50000, 0xb39b0000)
     [java]   eden space 16192K, 82% used [0xb1860000,0xb2577c88,0xb2830000)
     [java]   from space 2624K, 0% used [0xb2ac0000,0xb2ac0000,0xb2d50000)
     [java]   to   space 2624K, 0% used [0xb2830000,0xb2830000,0xb2ac0000)
     [java]  PSOldGen        total 43008K, used 0K [0xad5b0000, 0xaffb0000, 0xb1860000)
     [java]   object space 43008K, 0% used [0xad5b0000,0xad5b0000,0xaffb0000)
     [java]  PSPermGen       total 16384K, used 4430K [0xa95b0000, 0xaa5b0000, 0xad5b0000)
     [java]   object space 16384K, 27% used [0xa95b0000,0xa9a03b10,0xaa5b0000)
     [java] 
     [java] log4j:ERROR Error while activating options for appender named [jms].
     [java] javax.jms.JMSException: Channel was inactive for too long: localhost/127.0.0.1:61616
     [java] 	at org.apache.activemq.util.JMSExceptionSupport.create(JMSExceptionSupport.java:49)
     [java] 	at org.apache.activemq.ActiveMQConnection.syncSendPacket(ActiveMQConnection.java:1273)
     [java] 	at org.apache.activemq.ActiveMQConnection.ensureConnectionInfoSent(ActiveMQConnection.java:1368)
     [java] 	at org.apache.activemq.ActiveMQConnection.createSession(ActiveMQConnection.java:303)
     [java] 	at org.apache.activemq.ActiveMQConnection.createTopicSession(ActiveMQConnection.java:1065)
     [java] 	at org.apache.log4j.net.JMSAppender.activateOptions(JMSAppender.java:217)
     [java] 	at org.apache.log4j.config.PropertySetter.activate(PropertySetter.java:257)
     [java] 	at org.apache.log4j.config.PropertySetter.setProperties(PropertySetter.java:133)
     [java] 	at org.apache.log4j.config.PropertySetter.setProperties(PropertySetter.java:97)
     [java] 	at org.apache.log4j.PropertyConfigurator.parseAppender(PropertyConfigurator.java:689)
     [java] 	at org.apache.log4j.PropertyConfigurator.parseCategory(PropertyConfigurator.java:647)
     [java] 	at org.apache.log4j.PropertyConfigurator.configureRootCategory(PropertyConfigurator.java:544)
     [java] 	at org.apache.log4j.PropertyConfigurator.doConfigure(PropertyConfigurator.java:440)
     [java] 	at org.apache.log4j.PropertyConfigurator.doConfigure(PropertyConfigurator.java:476)
     [java] 	at org.apache.log4j.helpers.OptionConverter.selectAndConfigure(OptionConverter.java:471)
     [java] 	at org.apache.log4j.LogManager.<clinit>(LogManager.java:125)
     [java] 	at org.apache.log4j.Logger.getLogger(Logger.java:105)
     [java] 	at org.apache.commons.logging.impl.Log4JLogger.getLogger(Log4JLogger.java:283)
     [java] 	at org.apache.commons.logging.impl.Log4JLogger.<init>(Log4JLogger.java:108)
     [java] 	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
     [java] 	at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
     [java] 	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
     [java] 	at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
     [java] 	at org.apache.commons.logging.impl.LogFactoryImpl.createLogFromClass(LogFactoryImpl.java:1040)
     [java] 	at org.apache.commons.logging.impl.LogFactoryImpl.discoverLogImplementation(LogFactoryImpl.java:838)
     [java] 	at org.apache.commons.logging.impl.LogFactoryImpl.newInstance(LogFactoryImpl.java:601)
     [java] 	at org.apache.commons.logging.impl.LogFactoryImpl.getInstance(LogFactoryImpl.java:333)
     [java] 	at org.apache.commons.logging.impl.LogFactoryImpl.getInstance(LogFactoryImpl.java:307)
     [java] 	at org.apache.commons.logging.LogFactory.getLog(LogFactory.java:645)
     [java] 	at org.apache.activemq.ActiveMQPrefetchPolicy.<clinit>(ActiveMQPrefetchPolicy.java:38)
     [java] 	at org.apache.activemq.ActiveMQConnectionFactory.<init>(ActiveMQConnectionFactory.java:90)
     [java] 	at org.apache.activemq.ActiveMQConnectionFactory.<init>(ActiveMQConnectionFactory.java:131)
     [java] 	at Log4jJMSAppenderExample.<init>(Unknown Source)
     [java] 	at Log4jJMSAppenderExample.main(Unknown Source)
     [java] Caused by: org.apache.activemq.transport.InactivityIOException: Channel was inactive
for too long: localhost/127.0.0.1:61616
     [java] 	at org.apache.activemq.transport.InactivityMonitor$4.run(InactivityMonitor.java:174)
     [java] 	at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
     [java] 	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
     [java] 	at java.lang.Thread.run(Thread.java:619)
{code}

> Issue with JMSAppender using Activemq 
> --------------------------------------
>
>                 Key: AMQ-2495
>                 URL: https://issues.apache.org/activemq/browse/AMQ-2495
>             Project: ActiveMQ
>          Issue Type: Bug
>          Components: JMS client
>    Affects Versions: 5.3.0
>         Environment: jdk1.6, log4j 1.2.15, activemq 5.3.0
>            Reporter: Jeffrey Yin
>             Fix For: 5.4.0
>
>
> Tried to use JMSAppender with Activemq 5.3.0. The program stucked at line: 
> topicSession = topicConnection.createTopicSession(false, Session.AUTO_ACKNOWLEDGE); 
> Even the default example (Log4jJMSAppenderExample.java) comes with the activemq 5.3 has
the same problem. 
>  Below is the output when I run the default example with the log4j.debug flag on:
> After start the activemq server, I tried to run the jmsappender example comes with activemq
version 5.3. The program hangs, below is the debug info: 
> C:\apache\apache-activemq-5.3.0\example>ant log4j-jms 
> Buildfile: build.xml 
> init: 
> compile: 
> log4j-jms: 
>      [echo] Running a Log4j JMS Appender example 
>      [java] log4j: Trying to find [log4j-jms.properties] using context classloader sun.misc.Launcher$AppClassLoader@11b86e7.

>      [java] log4j: Using URL [file:/C:/apache/apache-activemq-5.3.0/example/target/classes/log4j-jms.properties]
for automatic log4j configuration. 
>      [java] log4j: Reading configuration from URL file:/C:/apache/apache-activemq-5.3.0/example/target/classes/log4j-jms.properties

>      [java] log4j: Parsing for [root] with value=[INFO, stdout, jms]. 
>      [java] log4j: Level token is [INFO]. 
>      [java] log4j: Category root set to INFO 
>      [java] log4j: Parsing appender named "stdout". 
>      [java] log4j: Parsing layout options for "stdout". 
>      [java] log4j: Setting property [conversionPattern] to [%d %-5p %c - %m%n]. 
>      [java] log4j: End of parsing for "stdout". 
>      [java] log4j: Parsed "stdout" options. 
>      [java] log4j: Parsing appender named "jms". 
>      [java] log4j: Setting property [initialContextFactoryName] to [org.apache.activemq.jndi.ActiveMQInitialContextFactory].

>      [java] log4j: Setting property [topicBindingName] to [logTopic]. 
>      [java] log4j: Setting property [topicConnectionFactoryBindingName] to [ConnectionFactory].

>      [java] log4j: Setting property [providerURL] to [tcp://localhost:61616]. 
>      [java] log4j: Getting initial context. 
>      [java] log4j: Looking up [ConnectionFactory] 
>      [java] log4j: About to create TopicConnection. 
>      [java] log4j: Creating TopicSession, non-transactional, in AUTO_ACKNOWLEDGE mode.

> No error or exception showed, the program just hangs over here.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message