Spring Framework Mentality

I am in the middle of adding features to a web application that uses the Spring Framework and since I have not had any training I am learning as we go. As much as I know better this is where I am anyway.

I have been fighting for a few days with a java.lang.NullPointer issue and it was driving me crazy. I knew that it was some small details that was escaping me but I just could not put my finger on it.

I got a breakthrough yesterday evening by re-reading a form post about the fact that you can’t use the new operator on objects that are wired by the Spring Framework. I was also missing the getter and setter method for that entity and then everything started to work. Small victory that certainly pleased me because it was starting to get to my self esteem.

I was a bit mad at myself for not understanding the tip that was given in the forum on the first read. I was looking for something else and the truth was starring me so obviously. The madness will certainly make sure I remember to pay attention to every recommendation experienced people make when answering other beginners like me.

Understanding how the framework does its things is starting to sink in and I am starting to see the full potential this framework has to quickly develop web application.

If I can just spend some time to read on it and understand all the libraries and a few more founding concepts I could stop wasting my time fighting with it.

Embedded Derby

The trivial issues are the one that drive you nuts because you waste too much time for something that should have taken 2 minutes at most.

Today I was fighting with a spring application that uses hibernate to talk to an embedded derby database.

So simple.

Because I am getting a java null pointer exception when I am trying to save an entity I decided to empty the embedded derby database directory so I could start fresh and make sure that this was not the issue. Again simple.

I started to have all sorts of issues in my spring application logs telling me that it could not create the database (I have the property for derby set to create=true).

All I needed to do was to the delete the directory itself and not just the content.

An hour wasted searching on Google and no one was as dumb as I and posted anything about this issue.