Friday, 30 May 2008

Welcome Sid as Our Newest Blogger

Siddharth Chhabra is our newest blogger and you can visit his blog here. He started with an introduction into the Log4J SMTPAppender which lets you send logging statements in an email. I hope you like it as much as I do and I am looking forward to read more from him.

Over the last few years I discovered that writing a technical blog is a good way to show one's knowledge as well as communication skills. At the beginning I blogged regularly at Java.net but then started to focus more on my own blog because it is time consuming to w  keep on reading here

Posted by schaefera at 11:11 PM in Personal

Wednesday, 21 May 2008

Another WTF Moment brought to you this time from Spring Framework

I had to configure some spring configuration files and one request was that the properties should be extracted into a separate properties file so that a user can change them without messing around with XML. Looking into Spring that seemed to be quite easily to achieve and so I started adjusting the configuration file which contained this snippet:


    <bean id="propertyPlaceholder"
        class="org.springframework.beans.\
            factory.config.PropertyPlaceholderConfigurer">
       <property name="location"
            value="classpath:ldap/authenticationConfiguration.properties"/>
    </bean>

  keep on reading here

Posted by schaefera at 8:04 PM in Java

Saturday, 17 May 2008

I joined Twitter

As you may noticed on the right hand side I joined Twitter and you can find me under Bad_Andy or Andy Schaefer if you join twitter and then search for me. You might even use the link at the bottom on the little Flash Widget on the right hand side which will post to you my latest update.

I hope to hear from you guys even more often - Andy

Posted by schaefera at 2:47 PM in Personal

Friday, 16 May 2008

Continuing NetBeans Problems

First and foremost I have to admit this is the first time I do a Swing Application with an IDE and therefore I could well be that the other IDEs like IntelliJ and Eclipse have their own share of problems. That said I find some of the nasty features of NetBeans quite appalling and they let me waste quite some time. Slowly I start to understand how it should be done and therefore can avoid some of the problems but most of these problems should not arise in the first place because it makes the developer's job more difficult than easier.

  keep on reading here

Posted by schaefera at 7:11 PM in Java

Tuesday, 13 May 2008

Custom Servlet Filter Chains Injection

Lately I had the task to add additional Java Servlet Filters at runtime to an existing Filter stack. Logically that sounds pretty simple but the implementation was not that simple and I had to use some Swiss ingenuity to make it work. A Filter has one important message called doFilter( Request, Response, Chain ). In order to make sure that the chain of filters is executed the Filter has in some place to call the method doFilter( Request, Response ) and the Filter Chain instance will then call the next filter in the chain or the target resource if there are no more filters. Because a filter has an in piece (the code before the chain.doFilter() call) and an out piece making it impossible to just loop through my own filters and then call the next through the filter chain. In addition the Filter Chain does not have any add/remove method to inject filters at runtime. Well, now what to do?

After a few minutes it finally dawned on my that I could replace the Filter Chain with my own one to make sure that my filters are included. But then what do I do with the remaining filters in the original filter chain. Well, I just do the same to it as the original filter chain does when it reached it end, I just call the target which in this case is the original filter chain. This led me to the ProxyFilterChain class that looks like that:

  keep on reading here
                                                                    

Posted by schaefera at 5:51 PM in Java

Thursday, 8 May 2008

Nothing Beats Persistence except you are a Wunderkind

If you are not lucky (or unlucky) enough to be a Wunderkind like Mozart or Einstein then you need persistence on way or the other. Well today I had to use persistence and patience to wade through the jungle called Spring Framework. In this case I was trying to setup the ACEGI security (now called Spring Security, go figure) without their Namespace Configuration. The NC might look nice and convenient but when you need to know how that thing is wired up and how to configure it to your special needs it   keep on reading here

Posted by schaefera at 9:57 PM in Java

Wednesday, 7 May 2008

Did I already say that I Hate NetBeans

Since four months I am using NetBeans on my daily job and things only went downhill from the beginning on. Today I ran into an issue which is particularly annoying because it is not a problem in NetBeans 6.0 and there was not trace whatsoever of what could be the reason for the failure. The implication was more or less that I could not develop anything using the NetBeans UI editor for my Swing application. Eventually the problem could be solved using a different version of the library (don't know what the difference is) but just the mere fact that I ran into an issue and NetBeans just silently ignores a library is dead wrong. Then I rather use a buggy IDE if it gives at least some hints how to resolve problems.

  keep on reading here

Posted by schaefera at 5:53 PM in Java

Saturday, 3 May 2008

Good Apple or Bad Apple?

Today I was in San Diego to visit the Zoo with our kids. Luckily for me there is an Apple Store fairly close by and so I went there to see what I can do with my broken power adapter for the older MacBook Pro laptop. Since a while my wife was complaining about the battery not being loaded over night and since a few day the light on the power adapter where it connects to the laptop was not glowing at all. Using another power adapter showed that it was not a problem with my laptop. Because I bought an extended warranty called Apple Care I thought I give it a chance to see if they are going to replace it and eventually they did.

  keep on reading here

Posted by schaefera at 7:44 PM in Mac

Friday, 2 May 2008

Dr. Phil and the A*hole TV

I know a few people how like to watch Dr. Phil but whenever I saw anything of his show it looked more like a circus to me than a serious self-help show: "And on the left we have the philandering husband with his wife how did not figure it out for twenty years and on the right we have a mother with her 150lb toddler and she thinks that is normal".

  keep on reading here

Posted by schaefera at 9:34 AM in Personal