You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@struts.apache.org by Christian Stone <xt...@stonescape.net> on 2010/03/26 21:20:41 UTC

Current build of Struts 2...

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: dev-unsubscribe@struts.apache.org
For additional commands, e-mail: dev-help@struts.apache.org


Re: Current build of Struts 2...

Posted by Lukasz Lenart <lu...@googlemail.com>.
2010/4/8 Christian Stone <xt...@stonescape.net>:
> You should be able to reproduce by using the Struts showcase example, and remove Javaassist.jar from your classpath.
>
> The problem is that javaassist is not marked as a runtime dependency AND is a new requirement AND does not generate an error to inform the user what is actually an issue.  There is no missing class error, or any error that is of use to diagnose that in fact you need to include javaassist.jar.  I believe you will see a lot of traffic with deployment issues because people will not be aware of the new dependency, and their application will fail to deploy with the new builds without any proper error reporting for the fatal error.

It's a bit strange, I'm using maven to build war and with Javassist
marked as provided in OGNL I still got it in that war!?! Can someone
explain to me why is it happen that way?

I also made a test on WebLobic 10, manually removed javassist from war
and started the server - everything went smoothly :P Does WL has
javassist ???

I will try other way, but I'm still not able to reproduce that problem :-(


Best regards
-- 
Łukasz
http://www.lenart.org.pl/
Kapituła Javarsovia 2010
http://javarsovia.pl

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


Re: Current build of Struts 2...

Posted by Christian Stone <xt...@stonescape.net>.
You should be able to reproduce by using the Struts showcase example, and remove Javaassist.jar from your classpath.

The problem is that javaassist is not marked as a runtime dependency AND is a new requirement AND does not generate an error to inform the user what is actually an issue.  There is no missing class error, or any error that is of use to diagnose that in fact you need to include javaassist.jar.  I believe you will see a lot of traffic with deployment issues because people will not be aware of the new dependency, and their application will fail to deploy with the new builds without any proper error reporting for the fatal error.

-- Christian


On Apr 8, 2010, at 4:23 AM, Lukasz Lenart wrote:

> 2010/3/26 Christian Stone <xt...@stonescape.net>:
>> 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.
> 
> I imporved the log messages, but I'm not sure what is wrong with
> ContainerImpl at line 198, could you prepare some sample application
> and send it to me??
> 
> 
> Regards
> -- 
> Łukasz
> http://www.lenart.org.pl/
> Kapituła Javarsovia 2010
> http://javarsovia.pl
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
> For additional commands, e-mail: dev-help@struts.apache.org
> 

-- 
           _,--"
cws        `-._        ________-_______         "----
       _----'--'--------------------------------'--'----_
      //_| | \ Christian Stone, Software Engineer / | |_\\
     (_____|_|__=     xtian@stonescape.net     =__|_|_____)
     _\_____=__   http://xtian.stonescape.net/        ___/_
       \/-(o)-~~-(o)-~~-(o)-`------'-(o)-~~-(o)-~~-(o)-\/




Re: Current build of Struts 2...

Posted by Lukasz Lenart <lu...@googlemail.com>.
2010/3/26 Christian Stone <xt...@stonescape.net>:
> 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.

I imporved the log messages, but I'm not sure what is wrong with
ContainerImpl at line 198, could you prepare some sample application
and send it to me??


Regards
-- 
Łukasz
http://www.lenart.org.pl/
Kapituła Javarsovia 2010
http://javarsovia.pl

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