E-com DevBlog Spider-ball-vacuum

17Jun/110

CronMaker, your cron problems are over

I found a new tool and I am on blog posting kick so I thought I would share with everyone.  The tool is http://www.cronmaker.com/ and it helps with making cron expressions for use with quartz scheduling.  Now don't get me wrong the quartz is well documented and it is easy to build the expressions, but I always have to go look it up anyway.  This saves me a step.  Put in when you want it to run and bam! there is your expression. Don't forget to hit with your spice weasel.

Print This Post Print This Post
21Apr/100

Configuration is frozen

While in your Java development journey, if you find yourself getting an Error 500 NullPointerException and your console shows "IllegalStateException: Configuration is frozen", you could be the victim of what I experienced this week.

I wanted my forwarding to actually redirect to a new action so that the decorator would be applied to the new action instead of the current one, so I tried this approach:

forward = mapping.findForward("blahblah");
forward.setRedirect(true);

This doesn't work.  The reason is because the forward that you are using is defined in the struts config file, so you are attempting to modify an existing forward. This is not what you want to do because it will affect ALL future uses of that forward, hence the error. Here is the correct way to accomplish this:

forward = new ActionForward(mapping.findForward("blahblah"));
forward.setRedirect(true);

UPDATE: An astute reader pointed out that this is probably only an issue if you haven't set redirect="true" in your struts config, and that you should always set redirect to true if you are forwarding to another action anyway. Good catch Casey!

Print This Post Print This Post
Tagged as: , No Comments