Got this error - “Execution failed:java.io.IOException: CreateProcess: jarsigner.exe -keystore”

With my new project I tried compiling codes using Ant build tool in Eclipse and got this error when building the build.xml file…

Execute failed: java.io.IOException: CreateProcess: jarsigner.exe -keystore [keystore_path] -storepass [store_password] [path_of_jar_to_be_signed] [alias] error=2

I asked my colleague about this problem but unfortunately they didn’t know the solution either. :(

So I turn to my bestfriend Google… oppss our best friend rather. :)

I found out that this is only a Path problem and you need to add the JDK bin in your Path. For Windows, go to Control Panel >> System >> Advanced Tab >> Environment Variables and for linux just add the JDK bin in the Path declaration in /etc/profile.

Note: You need to start Eclipse to make this work.

Here is another good reference. :)

Automatic login using SSH

I tried this one using my account on our server and here are the steps…

Step 1: Create public/private key pair with ssh-keygen.

baldoza@ubuntu:~$ ssh-keygen -t dsa
Generating public/private dsa key pair.
Enter file in which to save the key (/home/baldoza/.ssh/id_dsa):
Created directory ‘/home/baldoza/.ssh’.
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /home/baldoza/.ssh/id_dsa.
Your public key has been saved in /home/baldoza/.ssh/id_dsa.pub.
The key fingerprint is:
89:c0:4a:a2:9f:58:f7:28:e4:e4:4e:2a:33:7e:fb:0c baldoza@ubuntu
baldoza@ubuntu:~$

Step 2: Upload your public key to your home directory on cvs.colibria.com: (Note that this file may contain multiple keys, so you might have to append to it, also ensure that mask is 600, using “chmod 600 .ssh/authorized_keys2″. If you have to create the .ssh folder, make sure its mask is 700.)

baldoza@ubuntu:~$ scp .ssh/id_dsa.pub baldoza@[server_address]:/home/users/baldoza/.ssh/authorized_keys2
baldoza@[server_address] password:
id_dsa.pub

Step 3: Test setup by logging in to server without giving password:

baldoza@ubuntu:~$ ssh [server_address]
Passphrase:
baldoza@ubuntu:~$

Step 4 (optional): let ssh-add give away your passhrase upon query:

baldoza@ubuntu:~$ ssh-add
Enter passphrase for /home/baldoza/.ssh/id_dsa:
baldoza@ubuntu:~$

If this doesn’t work you may follow the steps on this site.

Cheers! :)

First open source Java code promised for October

By : Tom Sanders at Linuxworld in San Francisco, vnunet.com 15 Aug 2006

Source

Sun Microsystems plans to publish the first open source Java code by October this year, the company has revealed.

Laurie Tolson, vice president of developer programmes and products at Sun, said at a company event that the first components include Java C and the Hotspot VM. The remainder of the code will be open sourced by the end of 2007.

Sun first announced that it would release the Java source code under an open source licence at JavaOne in May.

The company is still considering the licence under which it will release the technology, and has launched a special website, Open Sourcing the JDK, soliciting feedback from developers.

“Our primary focus is to be compatible, putting programmes in place that people can rely on for compatible implementations of Java,” said Tolson.

Sun has also expanded its open source Java initiative with the Java ME technology that allows mobile phones to run Java code. It has not been made clear whether the mobile version of Java would be included in the open source initiative.

There is, however, a clear trend towards the use of open source software on mobile phones, according to Alan Brenner, vice president of mobile and embedded devices at Sun.

Brenner pointed at the consortium set up in June by Motorola, NEC, Panasonic, Samsung, NTT DoCoMo and Vodafone which seeks to create a standard version of mobile Linux.

“So far we have clearly seen that going in an OS direction for Java ME is the right and logical choice at this point. We really do want to lead and establish that direction in the market,” said Brenner.

He added that “most” of Java ME will be released under an open source licence by the end of 2006.

Learn Spring in 4 Steps

If you want to learn Spring MVC framework in just a day or maybe half-day, here is a good tutorial.

Spring MVC step-by-step

I find this tutorial interesting and easy to understand. After you finish the tutorial you will have an idea of the following…

Kudos to open sources and because of this tutorial, I made two pet projects for my company. ;)

Spring and EJB 3 Compared

Posted by : Floyd Marinescu @ http://www.infoq.com

http://www.infoq.com/news/spring-ejb-3-compared

devx is hosting an article comparing Spring 2 and EJB 3 focusing on support for persistence, transaction management, and statefulness. For each it examines code samples and also makes nonfunctional comparisons.

On persistence and transaction management, the article shows the two as nearly equivalent, with EJB being simpler for simple cases and Spring allowing more options over all due to wider third party framework/product support and more configuration options. The article compares Spring+Hibernate with EJB JPA. As reported by InfoQ in Spring+JPA to be the next popular stack?, Spring 2.0 now provides the complete EJB container contract for JPA, allowing JPA to be used under a Spring managed services layer (with all the AOP and DI richness of Spring) in any environment. Debates are already beginning about whether the next defacto stack will be EJB, Spring+Hibernate, or Spring + JPA. By implementing the ejb container contract, Spring allows the injection of the persistence context across components in the same transaction, as well as the ability to have components join transactions and also support for extended persistence context (which the article didn’t mention - instead suggesting that only open session in view is supported). Spring 2 thus allows the use of JPA with all the features supported within a container.

The main difference the article found was in approaches to state management - both support it (EJB 3 via stateful session beans, Spring via prototype beans and also request, session, and global session scoping), but concluded that a bit more work needs to be done in the Spring case to replicate the capabilities of SFSB’s, possibly making EJB a better choice.

Missing from the article was a comparison of dependency injection and aspect oriented features. EJB 3 supports injection of primitive types (see resource injection in the Java EE platform) and Spring supporting injection of anything. EJB allows injecting EJB’s, whereas Spring 2 allows injection of any domain objects using the features of AspectJ. On the Aspects front - EJB 3 supports interceptors, while Spring is tightly integrated with AspectJ with all of it’s features.

As InfoQ will report on this coming monday, Spring 2 final has been delayed to Sept 26th to work on additional features, including final support for JPA. When comparing Spring to EJB 3, JPA can almost be factored out due to the strong support inherent in both, the remaining feature to compare then is the programming model surrounding session beans (the services layer) an area in which EJB 3 itself has been catching up to Spring on. On a similar note, Corby Page made an interesting anecdote in a TSS thread covering this same subject:

Two years ago, EJB2 was the complex, overfeatured monster, and Spring brought elegance and simplicity to the development process. Now, EJB3 brings a basic, ‘good-enough-for-most-jobs’ implementation of component management. Spring 2.0 offers a lot more power and customization, but the use of AspectJ actually makes the learning curve steeper.

In some ways Spring and EJB 3 are being seen in the community as competing standards for the enterprise programming model of choice, with JBoss SEAM (see Seam, re-thinking web application architecture) as another stack with the closely related Web Beans standard approved for development in the JCP as well. Spring and EJB 3 comparisons are likely to be made many more times as Spring 2 finalizes and EJB 3 implementations become available.