logging-log4j-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Arthur Hsieh (JIRA)" <j...@apache.org>
Subject [jira] [Created] (LOG4J2-281) Log4j2 doesn't seem to be able to handle PSQLException
Date Wed, 12 Jun 2013 12:24:20 GMT
Arthur Hsieh created LOG4J2-281:
-----------------------------------

             Summary: Log4j2 doesn't seem to be able to handle PSQLException
                 Key: LOG4J2-281
                 URL: https://issues.apache.org/jira/browse/LOG4J2-281
             Project: Log4j 2
          Issue Type: Bug
          Components: Core
    Affects Versions: 2.0-beta7
         Environment: NetBeans IDE 7.3 (Build 201302132200)
Java: 1.6.0_45; Java HotSpot(TM) 64-Bit Server VM 20.45-b01-451
Runtime: Java(TM) SE Runtime Environment 1.6.0_45-b06-451-11M4406
System: Mac OS X version 10.8.4 running on x86_64; MacRoman; en_US (nb)
PostgreSQL Server: 9.2.4 on x86_64-apple-darwin
PostgreSQL JDBC Driver: postgresql-9.2-1002.jdbc4.jar
            Reporter: Arthur Hsieh


When trying to catch a PSQLException with logger.catching(), log4j2 seems unable to log exception.
 My simplified/pseudo code is below. 

private MessageExchange createOrder(String ordNo) {
   ...
   ...
   try {
      // code to execute an Insert SQL statement
   } catch (PSQLException ex) {
       logger.catching(ex);
       return new MessageExchange(false, ex.getMessage());
   }
}

The logger object throws below exception.  Note if i replace this with logger.error(ex) then
it works fine.


20:11:20.615 [AWT-EventQueue-0] ERROR com.asanga.erp.client.core.TestClient - catching
java.rmi.ServerError: Error occurred in server thread; nested exception is: 
	java.lang.ExceptionInInitializerError
	at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:331) ~[?:1.6.0_45]
	at sun.rmi.transport.Transport$1.run(Transport.java:159) ~[?:1.6.0_45]
	at java.security.AccessController.doPrivileged(Native Method) ~[?:1.6.0_45]
	at sun.rmi.transport.Transport.serviceCall(Transport.java:155) ~[?:1.6.0_45]
	at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:535) ~[?:1.6.0_45]
	at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:790) ~[?:1.6.0_45]
	at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:649) ~[?:1.6.0_45]
	at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:895) ~[?:1.6.0_45]
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:918) ~[?:1.6.0_45]
	at java.lang.Thread.run(Thread.java:680) ~[?:1.6.0_45]
	at sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(StreamRemoteCall.java:255)
~[?:1.6.0_45]
	at sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:233) ~[?:1.6.0_45]
	at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:142) ~[?:1.6.0_45]
	at java.rmi.server.RemoteObjectInvocationHandler.invokeRemoteMethod(RemoteObjectInvocationHandler.java:178)
~[?:1.6.0_45]
	at java.rmi.server.RemoteObjectInvocationHandler.invoke(RemoteObjectInvocationHandler.java:132)
~[?:1.6.0_45]
	at com.sun.proxy.$Proxy6.createOrd(Unknown Source) ~[?:?]
	at com.asanga.erp.client.core.TestClient.submitNL1_jButton1ActionPerformed(TestClient.java:551)
[classes/:?]
	at com.asanga.erp.client.core.TestClient.access$400(TestClient.java:23) [classes/:?]
	at com.asanga.erp.client.core.TestClient$5.actionPerformed(TestClient.java:414) [classes/:?]
	at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:2028) [?:1.6.0_45]
	at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2351) [?:1.6.0_45]
	at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:387) [?:1.6.0_45]
	at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:242) [?:1.6.0_45]
	at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:236)
[?:1.6.0_45]
	at java.awt.Component.processMouseEvent(Component.java:6382) [?:1.6.0_45]
	at javax.swing.JComponent.processMouseEvent(JComponent.java:3275) [?:1.6.0_45]
	at java.awt.Component.processEvent(Component.java:6147) [?:1.6.0_45]
	at java.awt.Container.processEvent(Container.java:2083) [?:1.6.0_45]
	at java.awt.Component.dispatchEventImpl(Component.java:4744) [?:1.6.0_45]
	at java.awt.Container.dispatchEventImpl(Container.java:2141) [?:1.6.0_45]
	at java.awt.Component.dispatchEvent(Component.java:4572) [?:1.6.0_45]
	at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4619) [?:1.6.0_45]
	at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4280) [?:1.6.0_45]
	at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4210) [?:1.6.0_45]
	at java.awt.Container.dispatchEventImpl(Container.java:2127) [?:1.6.0_45]
	at java.awt.Window.dispatchEventImpl(Window.java:2489) [?:1.6.0_45]
	at java.awt.Component.dispatchEvent(Component.java:4572) [?:1.6.0_45]
	at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:710) [?:1.6.0_45]
	at java.awt.EventQueue.access$400(EventQueue.java:82) [?:1.6.0_45]
	at java.awt.EventQueue$2.run(EventQueue.java:669) [?:1.6.0_45]
	at java.awt.EventQueue$2.run(EventQueue.java:667) [?:1.6.0_45]
	at java.security.AccessController.doPrivileged(Native Method) [?:1.6.0_45]
	at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:87)
[?:1.6.0_45]
	at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:98)
[?:1.6.0_45]
	at java.awt.EventQueue$3.run(EventQueue.java:683) [?:1.6.0_45]
	at java.awt.EventQueue$3.run(EventQueue.java:681) [?:1.6.0_45]
	at java.security.AccessController.doPrivileged(Native Method) [?:1.6.0_45]
	at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:87)
[?:1.6.0_45]
	at java.awt.EventQueue.dispatchEvent(EventQueue.java:680) [?:1.6.0_45]
	at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:296) [?:1.6.0_45]
	at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:211) [?:1.6.0_45]
	at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:201) [?:1.6.0_45]
	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:196) [?:1.6.0_45]
	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:188) [?:1.6.0_45]
	at java.awt.EventDispatchThread.run(EventDispatchThread.java:122) [?:1.6.0_45]
Caused by: java.lang.ExceptionInInitializerError
	at org.apache.logging.log4j.core.impl.Log4jLogEvent.<init>(Log4jLogEvent.java:110)
~[log4j-core-2.0-beta7.jar:2.0-beta7]
	at org.apache.logging.log4j.core.impl.Log4jLogEvent.<init>(Log4jLogEvent.java:81) ~[log4j-core-2.0-beta7.jar:2.0-beta7]
	at org.apache.logging.log4j.core.config.LoggerConfig.createEvent(LoggerConfig.java:422) ~[log4j-core-2.0-beta7.jar:2.0-beta7]
	at org.apache.logging.log4j.core.config.LoggerConfig.log(LoggerConfig.java:343) [log4j-core-2.0-beta7.jar:2.0-beta7]
	at org.apache.logging.log4j.core.Logger.log(Logger.java:108) [log4j-core-2.0-beta7.jar:2.0-beta7]
	at org.apache.logging.log4j.spi.AbstractLogger.catching(AbstractLogger.java:167) [log4j-api-2.0-beta7.jar:2.0-beta7]
	at org.apache.logging.log4j.spi.AbstractLogger.catching(AbstractLogger.java:155) [log4j-api-2.0-beta7.jar:2.0-beta7]
	at com.asanga.erp.server.core.ProductImpl.createOrder(ProductImpl.java:207) ~[?:?]
	at com.asanga.erp.server.core.ProductImpl.createOrd(ProductImpl.java:153) ~[?:?]
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.6.0_45]
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) ~[?:1.6.0_45]
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
~[?:1.6.0_45]
	at java.lang.reflect.Method.invoke(Method.java:597) ~[?:1.6.0_45]
	at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:303) ~[?:1.6.0_45]
	at sun.rmi.transport.Transport$1.run(Transport.java:159) ~[?:1.6.0_45]
	at java.security.AccessController.doPrivileged(Native Method) ~[?:1.6.0_45]
	at sun.rmi.transport.Transport.serviceCall(Transport.java:155) ~[?:1.6.0_45]
	at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:535) ~[?:1.6.0_45]
	at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:790) ~[?:1.6.0_45]
	at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:649) ~[?:1.6.0_45]
	at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:895) ~[?:1.6.0_45]
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:918) ~[?:1.6.0_45]
	at java.lang.Thread.run(Thread.java:680) ~[?:1.6.0_45]
Caused by: java.security.AccessControlException: access denied (java.lang.RuntimePermission
getClassLoader)
	at java.security.AccessControlContext.checkPermission(AccessControlContext.java:374) ~[?:1.6.0_45]
	at java.security.AccessController.checkPermission(AccessController.java:549) ~[?:1.6.0_45]
	at java.lang.SecurityManager.checkPermission(SecurityManager.java:532) ~[?:1.6.0_45]
	at java.lang.ClassLoader.getParent(ClassLoader.java:1257) ~[?:1.6.0_45]
	at org.apache.logging.log4j.core.helpers.Loader.isChild(Loader.java:239) ~[log4j-core-2.0-beta7.jar:2.0-beta7]
	at org.apache.logging.log4j.core.helpers.Loader.getClassLoader(Loader.java:230) ~[log4j-core-2.0-beta7.jar:2.0-beta7]
	at org.apache.logging.log4j.core.helpers.Loader.getClassLoader(Loader.java:254) ~[log4j-core-2.0-beta7.jar:2.0-beta7]
	at org.apache.logging.log4j.core.impl.ThrowableProxy.setupCallerCheck(ThrowableProxy.java:483)
~[log4j-core-2.0-beta7.jar:2.0-beta7]
	at org.apache.logging.log4j.core.impl.ThrowableProxy.<clinit>(ThrowableProxy.java:57)
~[log4j-core-2.0-beta7.jar:2.0-beta7]
	at org.apache.logging.log4j.core.impl.Log4jLogEvent.<init>(Log4jLogEvent.java:110)
~[log4j-core-2.0-beta7.jar:2.0-beta7]
	at org.apache.logging.log4j.core.impl.Log4jLogEvent.<init>(Log4jLogEvent.java:81) ~[log4j-core-2.0-beta7.jar:2.0-beta7]
	at org.apache.logging.log4j.core.config.LoggerConfig.createEvent(LoggerConfig.java:422) ~[log4j-core-2.0-beta7.jar:2.0-beta7]
	at org.apache.logging.log4j.core.config.LoggerConfig.log(LoggerConfig.java:343) ~[log4j-core-2.0-beta7.jar:2.0-beta7]
	at org.apache.logging.log4j.core.Logger.log(Logger.java:108) ~[log4j-core-2.0-beta7.jar:2.0-beta7]
	at org.apache.logging.log4j.spi.AbstractLogger.catching(AbstractLogger.java:167) ~[log4j-api-2.0-beta7.jar:2.0-beta7]
	at org.apache.logging.log4j.spi.AbstractLogger.catching(AbstractLogger.java:155) ~[log4j-api-2.0-beta7.jar:2.0-beta7]
	at com.asanga.erp.server.core.ProductImpl.createOrder(ProductImpl.java:207) ~[?:?]
	at com.asanga.erp.server.core.ProductImpl.createOrd(ProductImpl.java:153) ~[?:?]
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.6.0_45]
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) ~[?:1.6.0_45]
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
~[?:1.6.0_45]
	at java.lang.reflect.Method.invoke(Method.java:597) ~[?:1.6.0_45]
	at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:303) ~[?:1.6.0_45]
	at sun.rmi.transport.Transport$1.run(Transport.java:159) ~[?:1.6.0_45]
	at java.security.AccessController.doPrivileged(Native Method) ~[?:1.6.0_45]
	at sun.rmi.transport.Transport.serviceCall(Transport.java:155) ~[?:1.6.0_45]
	at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:535) ~[?:1.6.0_45]
	at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:790) ~[?:1.6.0_45]
	at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:649) ~[?:1.6.0_45]
	at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:895) ~[?:1.6.0_45]
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:918) ~[?:1.6.0_45]
	at java.lang.Thread.run(Thread.java:680) ~[?:1.6.0_45]



--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-dev-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-dev-help@logging.apache.org


Mime
View raw message