Bugs item #619171, was opened at 2002-10-06 00:11
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=376685&aid=619171&group_id=22866

Category: JBossServer
Group: v3.0 Rabbit Hole
Status: Closed
>Resolution: Fixed
Priority: 5
Submitted By: Timur Zambalayev (timurz)
Assigned to: Scott M Stark (starksm)
Summary: Logging Deadlock 

Initial Comment:
What happens. Under certain circumstances JBoss can 
get into a deadlock.

How to repro (tried JBoss 3.0.3 on Win2k, also 
experienced it with JBoss 3.0.0 on Solaris 7).
1) Install JBoss 3.0.3.
2) Run "ant clean deploy" (see the attached zip).
3) Start JBoss.
4) Run "ant fooClient".
5) JBoss deadlocked (see below).

Workaround.
1) Don't configure log4j (e.g. BasicConfigurator.configure
()) inside the EJB server.
2) After that don't use System.out.println().

=============================
Found one Java-level deadlock:
=============================
"RMI TCP Connection(3)-192.168.2.10":
  waiting to lock monitor 0x8fe86c (object 0x2f15f28, a 
org.apache.log4j.spi.RootCategory),
  which is held by "RMI TCP Connection(2)-192.168.2.10"
"RMI TCP Connection(2)-192.168.2.10":
  waiting to lock monitor 0x8fe74c (object 0x30e0b08, a 
org.jboss.logging.util.CategoryStream),
  which is held by "RMI TCP Connection(3)-192.168.2.10"

Java stack information for the threads listed above:
=========================================
==========
"RMI TCP Connection(3)-192.168.2.10":
        at org.apache.log4j.Category.callAppenders
(Category.java:188)
        - waiting to lock <02F15F28> (a 
org.apache.log4j.spi.RootCategory)
        at org.apache.log4j.Category.forcedLog
(Category.java:375)
        at org.apache.log4j.Category.log
(Category.java:850)
        at org.jboss.logging.util.CategoryStream.write
(CategoryStream.java:133)
        - locked <030E0B08> (a 
org.jboss.logging.util.CategoryStream)
        at 
org.jboss.logging.util.CategoryStream.println
(CategoryStream.java:81)
        at FooBean.writeToSystemOut
(FooBean.java:34)
        at 
sun.reflect.NativeMethodAccessorImpl.invoke0(Native 
Method)
        at 
sun.reflect.NativeMethodAccessorImpl.invoke
(NativeMethodAccessorImpl.java:39)
        at 
sun.reflect.DelegatingMethodAccessorImpl.invoke
(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke
(Method.java:324)
        at 
org.jboss.ejb.StatelessSessionContainer$ContainerInterc
eptor.invoke(StatelessSessionContainer.java:660)
        at 
org.jboss.resource.connectionmanager.CachedConnectio
nInterceptor.invoke
(CachedConnectionInterceptor.java:186)
        at 
org.jboss.ejb.plugins.StatelessSessionInstanceIntercept
or.invoke(StatelessSessionInstanceInterceptor.java:77)
        at 
org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext
(AbstractTxInterceptor.java:107)
        at 
org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransacti
ons(TxInterceptorCMT.java:178)
        at 
org.jboss.ejb.plugins.TxInterceptorCMT.invoke
(TxInterceptorCMT.java:60)
        at 
org.jboss.ejb.plugins.SecurityInterceptor.invoke
(SecurityInterceptor.java:130)
        at org.jboss.ejb.plugins.LogInterceptor.invoke
(LogInterceptor.java:203)
        at 
org.jboss.ejb.StatelessSessionContainer.invoke
(StatelessSessionContainer.java:313)
        at org.jboss.ejb.Container.invoke
(Container.java:712)
        at 
org.jboss.mx.server.MBeanServerImpl.invoke
(MBeanServerImpl.java:517)
        at 
org.jboss.invocation.jrmp.server.JRMPInvoker.invoke
(JRMPInvoker.java:381)
        at 
sun.reflect.NativeMethodAccessorImpl.invoke0(Native 
Method)
        at 
sun.reflect.NativeMethodAccessorImpl.invoke
(NativeMethodAccessorImpl.java:39)
        at 
sun.reflect.DelegatingMethodAccessorImpl.invoke
(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke
(Method.java:324)
        at sun.rmi.server.UnicastServerRef.dispatch
(UnicastServerRef.java:261)
        at sun.rmi.transport.Transport$1.run
(Transport.java:148)
        at java.security.AccessController.doPrivileged
(Native Method)
        at sun.rmi.transport.Transport.serviceCall
(Transport.java:144)
        at 
sun.rmi.transport.tcp.TCPTransport.handleMessages
(TCPTransport.java:460)
        at 
sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.r
un(TCPTransport.java:701)
        at java.lang.Thread.run(Thread.java:536)
"RMI TCP Connection(2)-192.168.2.10":
        at java.io.PrintStream.flush
(PrintStream.java:135)
        - waiting to lock <030E0B08> (a 
org.jboss.logging.util.CategoryStream)
        at 
sun.nio.cs.StreamEncoder$CharsetSE.implFlush
(StreamEncoder.java:408)
        at sun.nio.cs.StreamEncoder.flush
(StreamEncoder.java:150)
        - locked <02A91868> (a 
java.io.OutputStreamWriter)
        at java.io.OutputStreamWriter.flush
(OutputStreamWriter.java:213)
        at org.apache.log4j.helpers.QuietWriter.flush
(QuietWriter.java:49)
        at 
org.apache.log4j.WriterAppender.subAppend
(WriterAppender.java:311)
        at org.apache.log4j.WriterAppender.append
(WriterAppender.java:150)
        at 
org.apache.log4j.AppenderSkeleton.doAppend
(AppenderSkeleton.java:222)
        - locked <02A90198> (a 
org.apache.log4j.ConsoleAppender)
        at 
org.apache.log4j.helpers.AppenderAttachableImpl.appen
dLoopOnAppenders(AppenderAttachableImpl.java:57)
        at org.apache.log4j.Category.callAppenders
(Category.java:190)
        - locked <02F15F28> (a 
org.apache.log4j.spi.RootCategory)
        at org.apache.log4j.Category.forcedLog
(Category.java:375)
        at org.apache.log4j.Category.log
(Category.java:850)
        at org.jboss.logging.Logger.info
(Logger.java:149)
        at FooBean.writeToLogger(FooBean.java:40)
        at 
sun.reflect.NativeMethodAccessorImpl.invoke0(Native 
Method)
        at 
sun.reflect.NativeMethodAccessorImpl.invoke
(NativeMethodAccessorImpl.java:39)
        at 
sun.reflect.DelegatingMethodAccessorImpl.invoke
(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke
(Method.java:324)
        at 
org.jboss.ejb.StatelessSessionContainer$ContainerInterc
eptor.invoke(StatelessSessionContainer.java:660)
        at 
org.jboss.resource.connectionmanager.CachedConnectio
nInterceptor.invoke
(CachedConnectionInterceptor.java:186)
        at 
org.jboss.ejb.plugins.StatelessSessionInstanceIntercept
or.invoke(StatelessSessionInstanceInterceptor.java:77)
        at 
org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext
(AbstractTxInterceptor.java:107)
        at 
org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransacti
ons(TxInterceptorCMT.java:178)
        at 
org.jboss.ejb.plugins.TxInterceptorCMT.invoke
(TxInterceptorCMT.java:60)
        at 
org.jboss.ejb.plugins.SecurityInterceptor.invoke
(SecurityInterceptor.java:130)
        at org.jboss.ejb.plugins.LogInterceptor.invoke
(LogInterceptor.java:203)
        at 
org.jboss.ejb.StatelessSessionContainer.invoke
(StatelessSessionContainer.java:313)
        at org.jboss.ejb.Container.invoke
(Container.java:712)
        at 
org.jboss.mx.server.MBeanServerImpl.invoke
(MBeanServerImpl.java:517)
        at 
org.jboss.invocation.jrmp.server.JRMPInvoker.invoke
(JRMPInvoker.java:381)
        at 
sun.reflect.NativeMethodAccessorImpl.invoke0(Native 
Method)
        at 
sun.reflect.NativeMethodAccessorImpl.invoke
(NativeMethodAccessorImpl.java:39)
        at 
sun.reflect.DelegatingMethodAccessorImpl.invoke
(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke
(Method.java:324)
        at sun.rmi.server.UnicastServerRef.dispatch
(UnicastServerRef.java:261)
        at sun.rmi.transport.Transport$1.run
(Transport.java:148)
        at java.security.AccessController.doPrivileged
(Native Method)
        at sun.rmi.transport.Transport.serviceCall
(Transport.java:144)
        at 
sun.rmi.transport.tcp.TCPTransport.handleMessages
(TCPTransport.java:460)
        at 
sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.r
un(TCPTransport.java:701)
        at java.lang.Thread.run(Thread.java:536)

Found 1 deadlock.


----------------------------------------------------------------------

>Comment By: Scott M Stark (starksm)
Date: 2002-10-30 15:39

Message:
Logged In: YES 
user_id=175228

Ok, I've been convinced that this occurs independent of 
applications overriding the server logging setup. The real 
issue is the synchronization on the CategoryStream.write 
method. Removing this avoids the deadlock.

----------------------------------------------------------------------

Comment By: Scott M Stark (starksm)
Date: 2002-10-28 17:30

Message:
Logged In: YES 
user_id=175228

The only problem is the use of the BasicConfigurator which 
interferes with the server logging setup. You cannot override 
the server log4j config this way. You either need to create a 
seperate LoggerRepository or use the server log4j 
configuration. In a future version we may provide a 
LoggerRepository per application context.

----------------------------------------------------------------------

Comment By: Jerome Lacoste (lacostej)
Date: 2002-10-15 01:59

Message:
Logged In: YES 
user_id=81510

patch in bug 623223

----------------------------------------------------------------------

Comment By: Jerome Lacoste (lacostej)
Date: 2002-10-14 14:18

Message:
Logged In: YES 
user_id=81510

Heu. Spoken too fast. Fix not coming. 


----------------------------------------------------------------------

Comment By: Jerome Lacoste (lacostej)
Date: 2002-10-14 13:55

Message:
Logged In: YES 
user_id=81510

duplicate of bug 623223. Fix coming.


----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=376685&aid=619171&group_id=22866


-------------------------------------------------------
This sf.net email is sponsored by: Influence the future 
of Java(TM) technology. Join the Java Community 
Process(SM) (JCP(SM)) program now. 
http://ads.sourceforge.net/cgi-bin/redirect.pl?sunm0004en
_______________________________________________
Jboss-development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development

Reply via email to