I have a multi module Maven based web application project with a hibernate-annotations dependency that was failing to compile. I was getting the compilation error below:

[INFO] ------------------------------------------------------------------------
[INFO] Compilation failure
Failure executing javac, but could not parse the error:
An exception has occurred in the compiler (1.6.0_22). Please file a bug at the Java Developer Connection (http://java.sun.com/webapps/bugreport) after checking the Bug Parade for duplicates. Include your program and the following diagnostic in your report. Thank you.
com.sun.tools.javac.code.Symbol$CompletionFailure: class file for org.hibernate.annotations.CacheConcurrencyStrategy not found
[INFO] ------------------------------------------------------------------------
[INFO] For more information, run Maven with the -e switch
[INFO] ------------------------------------------------------------------------

Changing the dependency scope from provided to compile fixed the issue, but that would add unnecessary jars in the EAR that are already provided by the server, causing classloading errors on JBoss.

It turns out maven-compiler-plugin 2.3.2 has a bug, switching to 2.1 solves the issue.

Other modules that depend on the module with hibernate-annotations dependency will also have to explicity add hibernate-annotation dependency as provided.


Installing Postgres on Ubuntu 10.10

Installing postgres on Ubuntu 10.10

sudo apt-get install postgres pgadmin3

Now try to connect to postgres Applications > Programming > pgAdmin III

You will get the error below.

Postgres login error

It turns out Postgres setup is not complete yet. In MySQL you will be ready to go, root with an empty password, certainly not good for security

Switch to postgres and set the password

sipatha@lpt1:~$ sudo -u postgres psql
psql (8.4.5)
Type "help" for help.

postgres=# \password postgres
Enter new password:
Enter it again:
postgres=# \q

Now try again logging in using pgAdmin III

We good to go!

Tagged with:  
© 2011 - Pass me the Mic