Monday, December 20, 2010

AWS Toolkit for Eclipse Note.

If you happen to stumble upon a "No contents found at given site" message (or something like that) when trying to install the AWS Toolkit in Eclipse (from update site url ) , make all the upgrades you can to your plugins. If I remember correctly, the last plugins I had to update before being able to install where the maven and subversion integration ones.

Now, I'm ready to start playing with AWS from Eclipse Helios! :)

Friday, August 27, 2010

Sneaky Tomcat

Ubuntu's Update Manager insisted for days and days that I needed to upgrade Tomcat's manager due to security patches. I should have just ignored it (just kidding).  After I went ahead with the update, I've spent hours and hours trying to resurrect the webapps installed in Tomcat before realizing what was actually going on. Reminder for next time: check which config settings did the upgrade changed, paying particular attention to how JAVA_HOME is being set and what are the new memory usage limits (for Tomcat6/Ubuntu this settings can be found in /etc/init.d/tomcat). More info can be found at Installing Tomcat 6 in Ubuntu. One more tip: after the settings have being fixed, Tomcat might still have trouble bringing back "online" all the webapps at once, so the option here is to let Tomcat bring them back one by one by moving the apps folders out of /tomcat/webapps.

Thursday, August 19, 2010

I used to like Cascades

Oooch! Ooooch! Oooooch! Hibernate is being a pain to grasp for me :'( .... Actually, at least in this case, the JPA/Hibernate combo was the one kicking my rear this time. Turns out that there are two "flavors" of CascadeTypes: JPA's and Hibernate's. Oh!, and don't you dare ignoring the Hibernate ones if you are using it as your persistence "back-end' :-P


I cannot thank mkyong enough for saving me from spending many more hours digging around and "experimenting" to solve foreign key constraint issues with his post on Cascade – JPA & Hibernate annotation common mistake. I have just one comment to add to what he posted: for the Hibernate CascadeType to "kick in", I still needed to specify the JPA one in my entity. Per Hibernate's documentation on cascading this is recommended, but in my case it seems to be actually required :|

Friday, July 16, 2010

End the JVM winner is...!

Tip for when Maven is unhappy with you because you don't give it enough tools(.jar)... Check which "flavor" of Java is your system defaulting to. You can change this setting by re-linking to your preferred Java install by following Changing Java Versions in Ubuntu. I think, in my case, it got changed inadvertently while installing some new programs.

Wednesday, June 16, 2010

Tip for Installing Hudson to Running Tomcat

Keeping the development environment restoration theme, today was the turn for Hudson which I don't wanted to let run standalone. Crucial point for integrating Hudson to a running Tomcat (gotten with Debian): set HUDSON_HOME to the CATALINA_OPT in the tomcat file. Follow Tomcat for Debian instructions in Tomcat - Hudson Wiki which apply to Tomcat6 too.

Tuesday, June 15, 2010

Restoring Nexus to new Ubuntu Installation

I'm enjoying a lot my just installed Ubuntu 10.04. Lucid is really pretty and it's flying but that doesn't change the fact that it is painful to recover the previous state of my development environment.

I spent at least a couple of hours working on recovering my Nexus local install. I had Nexus running standalone before but this time I'm trying to avoid having n thousand tomcats running (my computer is memory max out at 8GB :(  ) so Nexus is going on the Tomcat6 installed from Synaptic. I wasn't being able to login because Nexus couldn't generate the timeline file. The fact that the application itself was running really didn't help to speed the discovery of the solution :| The quick and dirty tip here is: check that the user that is running the web app has the correct privileges setup on the sonatype-work (the dir containing Nexus configuration Check this post on backing up Nexus ). 

Tuesday, June 1, 2010

Battle for the right to write (to my own DB)

I wanna shoot myself. I've been struggling trying to fix a "org.springframework.dao.InvalidDataAccessApiUsageException: Write operations are not allowed in read-only mode (FlushMode.NEVER/MANUAL)". I know that I'm a total newbie with Spring and Hibernate (and not really experienced on the inner workings of transaction management) but this is evil if you really don't understand how Spring works.

I don't think the Spring Framework documentation emphasizes it enough: "The most important concepts to grasp with regard to the Spring Framework's declarative transaction support are that this support is enabled via AOP proxies" (Spring's Declarative Transaction Management documentation). I know, I know! It's all my fault but even when I read those lines it really didn't "click": I thought that I was having issues because I've decided to use the OpenSessionInView pattern and believed that I needed to add transaction management to my newest Manager class. So, I've spent more than a day trying to figuring out how to fix this issue when the functionality was there all along. The deal was that my manager wasn't being proxied because it was defined as an inner bean (which can be a good practice in some cases but totally not when you want your bean to be proxied [Spring Best Practices]) :|