I just did a full build of Struts 2.  A few minor things of note...

First, Javassist is now a required jar.  However if you don't have it in your 
webapp the error reporting is basically nonexistent, it just fails and you are 
left scratching your head.  I needed to dig down with a debugger and find where 
the error was happening to locate the error.  Very difficult and should be 
addressed.  I think the error is caught but then thrown up the chain and 
swallowed starting with ConatinerImpl.java:198 inject(...) method.  The 
Exception says that can't find javassist.  But the RuntimeException that is 
thrown after that eventually becomes so generic that you lose the information 
you need to determine the issue.

Also I made a few fixes a while back, but the patch was never pushed.  Both 
fixes are error related, and provides more info. 
        FreemarkerDecoratorServlet - Correcting a log error where the 
parameters were not being handled right in the log.
        Dispatcher - let's you know what the URI is.  Very useful.

Please heed the javassist.jar lack of notification if javassist is going to be 
part of the project going forward (and not bundled in xwork).

I am not reporting an issue on this since it was closed as part of a number of 
other issues, and was just left out from the patch I delivered...

Thanks, and good work!

-- Christian Stone





Index: 
plugins/sitemesh/src/main/java/org/apache/struts2/sitemesh/FreemarkerDecoratorServlet.java
===================================================================
--- 
plugins/sitemesh/src/main/java/org/apache/struts2/sitemesh/FreemarkerDecoratorServlet.java
  (revision 927662)
+++ 
plugins/sitemesh/src/main/java/org/apache/struts2/sitemesh/FreemarkerDecoratorServlet.java
  (working copy)
@@ -195,7 +195,7 @@

            StringBuilder msgBuf = new StringBuilder("Error applying freemarker 
template to\n       request: ");
            msgBuf.append(req.getRequestURL());
-            if (req.getQueryString() == null) 
msgBuf.append("?").append(req.getQueryString());
+            if (req.getQueryString() != null) 
msgBuf.append("?").append(req.getQueryString());
            msgBuf.append(" with resultCode: 
").append(resultCode).append(".\n\n").append(x.getMessage());
            String msg = msgBuf.toString();
            LOG.error(msg, x);
Index: core/src/main/java/org/apache/struts2/dispatcher/Dispatcher.java
===================================================================
--- core/src/main/java/org/apache/struts2/dispatcher/Dispatcher.java    
(revision 927662)
+++ core/src/main/java/org/apache/struts2/dispatcher/Dispatcher.java    
(working copy)
@@ -495,7 +495,11 @@
        } catch (ConfigurationException e) {
                // WW-2874 Only log error if in devMode
                if(devMode) {
-                       LOG.error("Could not find action or result", e);
+                        String reqStr = request.getRequestURI();
+                        if (request.getQueryString() != null) {
+                           reqStr = reqStr+"?"+request.getQueryString();
+                        }
+                       LOG.error("Could not find action or result\n     
"+reqStr, e);
                }
                else {
                        LOG.warn("Could not find action or result", e);


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to