Monday, February 22, 2010

Grails and Xerces problem

Just fixed an annoyed bug with my grails project. I'm using openid4java (with spring security) and it required xerces, without it throws following error:

java.lang.ClassNotFoundException: org.openid4java.util.OpenID4JavaDOMParser


Class OpenID4JavaDOMParser is exists at classpath, of course. But it uses xerces, and if you just simple add maven dependency for xerces, the grails (version 1.2.1) fails with the following error:

java.lang.LinkageError: loader constraint violation: loader (instance of ) previously initiated loading for a different type with name "org/w3c/dom/NamedNodeMap"


After long investigations I found that it's because of xml-apis library. You need to exclude it from dependencies at your pom.xml as:

<exclusion>
<groupId>xml-apis</groupId>
<artifactId>xml-apis</artifactId>
</exclusion>


But remember that it declared as dependency for many libraries, like xercesImpl, openxri-client, nekohtml, etc. Check your maven dependencies by mvn dependency:tree to ensure there are no any xml-apis usage. And make a mvn clean after this.

I had spent about 3 days for this problem, and hope that this will help someone :)

Monday, December 21, 2009

Datasets Torrent Tracker

Last week i had launched Dataset Publisher site. It's a simple torrent tracker for public datasets. I think it will be helpfull for most of developers in area of data mining, text mining, etc.
When i was tried to find good datasets for my experiments, i hasn't found any good place where i can choose one for me.
About one month ago i took an interest in Google App Engine, and decided to make some experiments with it, make some simple web application using it with Django. And as a result a have made Dataset Publisher. Now it's an proof of concept, and there are many things to do, but it's working, and you can use it right now.

Thursday, October 8, 2009

GitHub as a next step for Open Source community

Recently I realized that GitHub is a next step for Open Source community. It like a Facebook, it makes collaboration easier, it's a "social development". If one developer want to add his own code/feature/extension/patch to some existing project, he can just do it with GitHub. Just make
his own fork of this project, with a few mouse clicks. Main authors can review this patch anytime, and merge to main codebase, if they wish. And if they don't done that, this developer can always use his own version, with his extension, without waiting for someone other who implement it in main project. And all of this are really easy.

I know, before GitHub there was many services for development collaboration,like a SourceForge, Google Code, and so on. But it's different model, in this case you need to make many other thing, like a joining to special group, maillist, irc, sending patches to maillists/owners or adding an issue to taskmanager, and so on. And it's a big problem for open source community, i think. There too many unnecesary things you need to do. But with GitHub you don't need anything like this, just write the code you want and use it.

Friday, October 2, 2009

How to run IntelliJ IDEA from Ubuntu Menu

After you had installed IntelliJ IDEA onto your PC with Ubuntu you probably want to add to it to Main Menu. But shortcut to
idea.sh
doesn't work as expected, you need command like this:
sh -c "export JDK_HOME=/usr/lib/jvm/java-6-sun && /path/to/idea/bin/idea.sh"
and all will be ok.

Wednesday, August 13, 2008

Hadoop HBase with Maven2

I'm using Maven2 now, but there was an problem with Hadoop HBase. It doesn't exists at any major Maven repository. If you want to use HBase with Maven 2, you need to deploy it into local repository by yourself. It's easy, just download this files:


Then configure HBASE_HOME enviroment variable:
export HBASE_HOME=/path/to/hbase

Run deploy-deps.sh and all done. After it you can use following dependency:

<dependency>
<groupid>org.apache.hadoop</groupid>
<artifactid>hbase</artifactid>
<version>0.1.3</version>
</dependency>


You can modify those files for your needs, if you wish.

Friday, July 11, 2008

Yet Another Java vs Erlang Comparison

When i meet the Erlang first time I ask myself "Can I write same applications using Java?" and answer was "Yes, of course, no problem". At those time Java was my favorite language, i know it very well, and don't understand what for and why i should use another programming language.
But the time is changing, now my answer is "It depends on tasks". You can write any program using any language, maybe it will be Java, C#, C, maybe some of Python or Ruby magic, and yes, you can always use Lisp, Erlang, Haskell, Q and any other Turing complete language.

All software you can done with Java you can rewrite with Erlang, and vice versa. The difference there is inside the conception, inside the main approach of architecture of this languages.

Java is easy to read, easy to write language, but totally overloaded language :( Do you remember this megabytes of simple classes with setters and getters only? All this deep hierarchy of interfaces, abstract classes and so on.
The big plus of Java that it have big army of developers, tons of books and gigabytes of additional libraries and frameworks. Some tasks you can do faster in comparison with any other programming language. It's easy to start project using java, it's enterprise standard, like COBOL was some time ago.

Erlang, in other hand, is harder to understand, because of different paradigm. But it requires less code for equal functionality, and less debug. With Erlang you just write what you want, just algorithm of your program, no more, forget about this classes, which you really don't need, just use tuples and lists where you need. And the main feature is not a concurrency, the main is a fault tolerance.

Okay, using any other programming language you can write fault tolerant system, but with Erlang you can't write weak and fragile code :) Of course using only Java you can write system better than written on Erlang, but Erlang just give right tool for doing that easier, and nothing more. It's the reason why sometimes Java equivalent of an Erlang system requires too much time to develop, and too much PC resources to run.

Choose programming language which best fits for your needs, for current tasks. If it's easier to use Java - use Java. If it best fits for Erlang - use Erlang. And remember that you can always mix both of them in one application.

Wednesday, June 25, 2008

Eclipse 3.4 Ganymede is out!

There are no download from official Eclipse site, only Eclipse "friends" can download it now.
But you can use this link instead:
http://ftp.heanet.ie/pub/eclipse//technology/epp/downloads/release/ganymede/R/