LogUtils.log fails when trying to log an error with a question mark.
--------------------------------------------------------------------

                 Key: CXF-1420
                 URL: https://issues.apache.org/jira/browse/CXF-1420
             Project: CXF
          Issue Type: Bug
    Affects Versions: 2.0.4
            Reporter: aaron pieper
            Priority: Minor


One of my interceptors threw an exception which included a question mark in the 
message, something like "Uncategorized SQLException for SQL [{call FOO.ping(?, 
?)}]". CXF trapped this error and tried to log it with LogUtils. However, I 
guess LogUtils interprets the question marks in some special way, so instead of 
logging the exception properly, it fails with a different error.

java.lang.IllegalArgumentException: can't parse argument number FOO.ping(?
        at java.text.MessageFormat.makeFormat(MessageFormat.java:1330)
        at java.text.MessageFormat.applyPattern(MessageFormat.java:450)
        at java.text.MessageFormat.<init>(MessageFormat.java:350)
        at java.text.MessageFormat.format(MessageFormat.java:803)
        at org.apache.cxf.common.logging.LogUtils.log(LogUtils.java:256)
        at 
org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:221)
        at 
org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:77)
        at 
org.apache.cxf.transport.servlet.ServletDestination.doMessage(ServletDestination.java:79)
        at 
org.apache.cxf.transport.servlet.ServletController.invokeDestination(ServletController.java:264)
        at 
org.apache.cxf.transport.servlet.ServletController.invoke(ServletController.java:160)
        at 
org.apache.cxf.transport.servlet.AbstractCXFServlet.invoke(AbstractCXFServlet.java:170)
        at 
org.apache.cxf.transport.servlet.AbstractCXFServlet.doPost(AbstractCXFServlet.java:148)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
        at 
org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:487)
        at 
org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1093)
        at foo.impl.Myilter.doFilter(MyFilter.java:125)
        at 
org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1084)

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

Reply via email to