• Bug
  • Status: Closed
  • 2 Major
  • Resolution: Fixed
  • DSO:L1
  • hhuynh
  • Reporter: teck
  • June 21, 2007
  • 0
  • Watchers: 0
  • June 29, 2007
  • June 21, 2007

Description

We can potentially set the thread context loader to null when loading/initializing user land classes. Under JBoss (at least version 4.0.5-GA), there is a bug in their in-house fork of commons-loggging.

http://jira.jboss.com/jira/browse/JBAS-4437

java.lang.ExceptionInInitializerError at sun.reflect.GeneratedSerializationConstructorAccessor60.newInstance(Unknown Source) at java.lang.reflect.Constructor.newInstance(Constructor.java:494) at com.tc.object.TCObjectFactoryImpl.getNewPeerObject(TCObjectFactoryImpl.java:77) at com.tc.object.TCObjectFactoryImpl.getNewPeerObject(TCObjectFactoryImpl.java:65) at com.tc.object.ClientObjectManagerImpl.createNewPeer(ClientObjectManagerImpl.java:1064) at com.tc.object.ClientObjectManagerImpl.createNewPeer(ClientObjectManagerImpl.java:1025) at com.tc.object.TCObjectImpl.createPeerObjectIfNecessary(TCObjectImpl.java:166) at com.tc.object.TCObjectImpl.hydrate(TCObjectImpl.java:101) at com.tc.object.ClientObjectManagerImpl.lookup(ClientObjectManagerImpl.java:511) at com.tc.object.ClientObjectManagerImpl.lookupObject(ClientObjectManagerImpl.java:409) at com.tc.object.ClientObjectManagerImpl.lookupObject(ClientObjectManagerImpl.java:402) at com.tc.object.bytecode.ManagerImpl.lookupObject(ManagerImpl.java:605) at com.tc.object.bytecode.ManagerUtil.lookupObject(ManagerUtil.java:161) at java.util.HashMap.lookUpAndStoreIfNecessary(Unknown Source) at java.util.HashMap.get(Unknown Source) <snip – application code> Caused by: org.apache.commons.logging.LogConfigurationException: java.lang.NullPointerException (Caused by java.lang.NullPointerException) at org.apache.commons.logging.impl.LogFactoryImpl.newInstance(LogFactoryImpl.java:538) at org.apache.commons.logging.impl.LogFactoryImpl.getInstance(LogFactoryImpl.java:235) at org.apache.commons.logging.impl.LogFactoryImpl.getInstance(LogFactoryImpl.java:209) at org.apache.commons.logging.LogFactory.getLog(LogFactory.java:353) at XXX-APPLICATION-CODE.(Workflow.java:40) ... 84 more Caused by: java.lang.NullPointerException at org.apache.commons.logging.impl.Log4jProxy$1.run(Log4jProxy.java:66) at java.security.AccessController.doPrivileged(Native Method) at org.apache.commons.logging.impl.Log4jProxy.threadContextClassLoader(Log4jProxy.java:88) at org.apache.commons.logging.impl.Log4jProxy.(Log4jProxy.java:94) at org.apache.commons.logging.impl.Log4JLogger.(Log4JLogger.java:39) at sun.reflect.GeneratedConstructorAccessor23.newInstance(Unknown Source) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27) at java.lang.reflect.Constructor.newInstance(Constructor.java:494) at org.apache.commons.logging.impl.LogFactoryImpl.newInstance(LogFactoryImpl.java:529) ... 88 more

Comments

Tim Eck 2007-06-21

We should only adjust the thread context loader if the current thread is not an application thread (another way to say that is that we should only adjust it if the current thread is a terracotta thread)

Fiona OShea 2007-06-25

verify fixed in 2.4 branch

Sreenivasan Iyer 2007-06-29

issue resurfaced with the TC thread throwing the exception now - seems Tim patched it again to ensure that thread context classloader is set to system classloader (if it is not a terracotta thread) - is this correct tim ?