↓ Skip to main content

Java

It's alive !

·549 words·3 mins
I was aching to blog about this since December 18th, when our system quietly and gently slipped into public visibility. Marked as Beta (thanks, Google for making this a legitimate way how to go live) it comfortably made it through Christmas shopping season into 2009. Now when the site has been announced and mentioned few times in the media, I guess it's OK to mention it here too. What is "it" ? A new, fresh eCommerce site selling music. A lots of really good music. Without any DRM or any other nonsense, as plain good high quality (mostly 320 kps) MP3's. The selection is actually very good - starting from several hundred thousands in December to several few million songs when full catalog is loaded. More great music being added every week.

After the Spring Storm

·970 words·5 mins
Few days ago, I have received an email asking to attend the SpringSource conference and offering $300 discount if I decide to buy before end of month. The timining was pretty ironical, considering the recent contraversy about SpringSource Entreprise Maintenance policy change. The was a heated discussion on TheServerside.com and even FAQ was compiled by Rod Johnson to explain the whole thing. So what is the issue: SpringSource, commercial entity behind community driven Spring Framework decided to capitalize on the investment and push the community toward paid service suport contract. Whether or not it was related to funding round and VC's entering the game, is not important. Unfortunately, the terms were not really well explained and SpringSource did initially very poor job explaining and communicating the actual change. The community overreacted and lot of people started to call for code fork, project Summer or similar - or switching to different framework.

Trying out Groovy with Oracle database

·815 words·4 mins
There is a saying that necessity is the mother of invention. Such necessity happened last week and forced me to try out the Groovy language. The trigger was need for creating good data set for testing changes in a full text search. I had to locate few hundred of obsolete technical documents to be used as test data, dump the metadata as well as the BLOB data to disc, create INSERT sql scripts and loader that would from Ant pre-load the database with the test set and insert the BLOB's. It is fairly simple task, the issue were boundary conditions:

Showstopper issue with JRuby ?

·606 words·3 mins
After some break, I dusted off the Ruby to try out one interesting idea Peter presented yesterday that literally ASKS for Rails. So I grabbed the latest and greatest RubyNetBeans from Ruby Hudson. For some reason it stopped updates on January 26th so the latest version I have got was build 6327. It is bundled with JRuby 1.1RC1 and the Rails version that comes preinstalled is 1.2.6. Using the menu Tools -> Ruby Gems, they can be easily upgraded to latest and greatest 2.0.2.

Versioning with Spring and Ant

·439 words·3 mins
This is post is NOT about version control in the sense of source code control. It addresses the issue how to easily tell which version of the Web application is running as well make sure that the same version is reflected in the snapshots performed by Ant. We have used this approach on several applications and found it quite useful. The version I talk about is not the automatically generated version from VCS system (such as SVN revision). The version number is set manually.

iBatis, Date null values and Oracle

·360 words·2 mins
I better blog this before I forget what was the issue :-). During daily run of unit tests, I started to receive this (very well explained) exception: [sourcecode language='xml'] org.springframework.jdbc.UncategorizedSQLException: SqlMapClient operation; uncategorized SQLException for SQL []; SQL state [null]; error code [17004]; --- The error occurred while applying a parameter map. --- Check the APPROVAL_TASK.insert-InlineParameterMap. --- Check the parameter mapping for the 'scheduledDate' property. --- Cause: java.sql.SQLException: Invalid column type; nested exception is com.ibatis.common.jdbc.exception.NestedSQLException: --- The error occurred while applying a parameter map. --- Check the APPROVAL_TASK.insert-InlineParameterMap. --- Check the parameter mapping for the 'scheduledDate' property. --- Cause: java.sql.SQLException: Invalid column type at org.springframework.jdbc.support.SQLStateSQLExceptionTranslator.translate(SQLStateSQLExceptionTranslator.java:121) at org.springframework.jdbc.support.SQLErrorCodeSQLExceptionTranslator.translate(SQLErrorCodeSQLExceptionTranslator.java:322) at org.springframework.orm.ibatis.SqlMapClientTemplate.execute(SqlMapClientTemplate.java:212) at org.springframework.orm.ibatis.SqlMapClientTemplate.insert(SqlMapClientTemplate.java:397) ... [/sourcecode] Now the problem was that scheduledDate was null. Here is partial SQL map used: [sourcecode language='xml']

How to generate and send emails using Spring and Velocity

·1049 words·5 mins
Testing applications that communicate using email is more challenging than e.g. testing database access. Thanks to GMail and Spring, it can be done pretty easily. Here is the scoop: I need to generate email notifying users about business events and after sending the email, store the content in the database. In real environment you will use corporate SMTP server and real email addresses of real people. For development we can avoid bothering and spamming our customers by few simple tricks.

Spring PropertyPlaceholderConfigurer with Velocity

·171 words·1 min
Part of the configuration magic is (one of several) Spring post-processors, that allows load the property file or files and refer to the values in these files inside XML configuration files. The rationale behind these is that property files are much easier to edit that possibly huge XML config file and using property values prevents repeating same value over and over again. With this approach, the following configuration: [sourcecode language='xml']

Oracle SQLDeveloper and mystery of the missing host

·193 words·1 min
If you work with Oracle database, a very good tool you should not ignore is the Oracle SQL Developer. It gives you much more power when it comes to manipulating data or managing database. I use most of the time MyEclipseIDE plugins, but when I need e.g. export data, the SQLDeveloper is way to go. Today I tried it for first time on the Mac. I started to configure and database connection and was completely confused by the error message "Port must contain numerical value". Here was the dialog box:

Book recommendation: Java Concurrency in Practice

·90 words·1 min
After long time, I stumbled upon something that is both educational and practical. Since Doug Lea's classic, this is very readworthy work on concurrency in Java world. It focuses on Java 5 features and addresses both Web applications as well as GUI apps - each group having their own share of concurrency related problems Here is the Amazon page for the book - check the reviews. There is also a sample chapter available on the book's website. If you have Safari subscription, you can read it there as well.