Wednesday, July 30, 2008

JSF 1.1 and JDK 6

Today I tried to run an application developed with JSF 1.1 on Tomcat 6 running over JDK 1.6.
When I started the application, I got the following exception:

javax.faces.FacesException: java.lang.ClassNotFoundException: [Ljava.lang.String;

After a short search in the Web, I found this thread on java.net foruns:

http://forums.java.net/jive/thread.jspa?threadID=15823

The proposed solution was put a -D argument on Java startup, as follows:

-Dsun.lang.ClassLoader.allowArraySyntax=true

If you're running your application on Eclipse, open "Run -> Open Run Dialog", and in the
Arguments tab of Apache Tomcat (or any other app server that you use), put the above parameter
in the field VM Arguments. The image below shows the configured Open Run Dialog:

Monday, July 14, 2008

VMWare and Ubuntu 64 bits

Hello everybody!

Just a quick note for those who installed VMWare 64 bits on Ubuntu Hardy 64 bits.
If you are trying to start a virtual machine and gets an error like this one: "Cannot connect to peer process" or something like this, try to run the following command:

sudo apt-get install ia32-libs

For some reason, VMWare wants to run something related to 32 bits libraries. This worked
fine for me, and now I can start virtual machines normally.

I think this solution works for any 64 bits distribution.

See you!

Saturday, January 05, 2008

Chaves e Certificados Digitais em Java

Sometimes we have to develop applications that works with digital certificates.
Java platform has a rich set of tools and APIs that makes our life easier when we have the need to create a new certificate, digital keys, cryptograph a file or simply sign a document. I am going to show you below some commands that you can use in Keytool, which is a program contained in JDK that helps you to create digital keys.

1) Creating a new keystore:

keytool -genkey -keyalg RSA -keysize 1024 -alias developer-validity 1000 -keystore mykeystore.ks

This command creates a file called "mykeystore.ks" on the same folder where it is executed.



2) Exporting a certificate:

keytool -export -alias developer -file developer.cer -keystore mykeystore.ks

This command creates a file called "developer.cer", which contains the digital certificate related to the alias "developer".



3) Importing a certificate created by another person:


keytool -import -trustcacerts -file patrick.cer -alias patrick -keystore mykeystore.ks

This command imports the certificate "patrick.cer" with the alias "patrick" to our keystore.

Thursday, December 27, 2007

JBoss 5 beta 3



After a long time using version 4.2.x of JBoss Application Server, finally we have a brand new version of this so good Java APP Server. Ok, it is still a beta version, but is a new version after months without an update.

Reading the release notes we can see that a final release is not far away: "This is the last Beta release of the JBoss 5.0.x series for the Java EE 5 codebase!".

You can find the download link in http://labs.jboss.com/jbossas/downloads/.