Feb
27
2008


In this blog i will show you, how easily you can create Web Services with NetBeans 6. In further postings i will discuss how to manipulate the SOAP Message before the Web Service Operation is called.
For this example i am using JAX-WS 2.1 with NetBeans 6.0 .
Web Services Description Language (WSDL)
There are many ways how to get starting with Web Services. One variant is beginning with the creation of the WSDL. First, you must know what the Web Service should do. You have to consider what is the input and output of each Web Service Operation. In our example we have only one Operation, named as “getcalculateValues“. The input are two numbers, the result is only the sum of both.
Technorati Tags: Java, NetBeans, soap, web services
Tags: Java, NetBeans, soap, web services
Feb
22
2008

In this blog-entry i will show you, how to open and work with existing NetBeans 6 -projects. I was forced to write this, because while most of my projects here are created with NetBeans 6. Now watch how easily you can use NetBeans 6 for being productive.
For example, i am using the project “Hibernate with Guice“, you can read this blog-entry here.
1. Installing NetBeans 6
NetBeans IDE is open-source and free and runs on Windows, Linux, Mac OS X and Solaris.
Download: http://www.netbeans.org/
Installation Instructions: http://www.netbeans.org/community/releases/60/install.html
2. Open an existing project
On the menu, navigate to File->Open Project

Choose the existing project and open it.

If you see the following error message, don’t get in panic, there are only missing references to needed libraries.

Click on close. Now let us fix this problem. Make a rightclick on the project-name and select Properties.

You will now see the Project Properties window. On the left side, navigate to Libraries. In the Compile-Tab, the missing libaries are now visible.

The next thing to do, is to clean up this mess. Just remove all libraries from the Compile-Tab. You can easily do this if you mark one library with the left mouse button and then press STRG + A together.

Hit the remove button to clear the list.

The next step is to add the missing libraries. If you have downloaded them, click on Add JAR/Folder, navigate to the directory where the JARs are located, and add them all.

Close the Project Properties Window. Everything just have to look fine. The Project-Name is now in bold black and not anymore in bold red. Expand the project, you can see all included packages and libraries.

3. Build and run the project
This is very easy. Make a rightclick on the projectname, choose Clean and Build.

You can see the generated Output in the Output-console.

Run the application by pressing F6 or make a rightclick on the project-name and choose Run

That’s it, you have successfully opened an existing project. 
3. Working with NetBeans
To explore the java-code, you can navigate through the projects-view or through the file-view.

To open a file, just doubleclick on the name.
You need more functions? Go to Tools->Plugins.

A huge list of available plugins appears. More plugins are available at http://plugins.netbeans.org/PluginPortal/

Enjoy playing around with NetBeans, you will see it makes fun to work with it.
All the SY0-101 and N10-003 professionals are of the view that before you write 642-812 or 70-431, you should figure out your preferences amongst 350-030 and 220-602.
Technorati Tags: Java, NetBeans, projects
Tags: Java, NetBeans, projects
Feb
21
2008

Welcome back to Part II about using Hibernate with Guice. If you just stepped in, i recommend first to read Part I here.
Part II – Adding Guice to the Hibernate-Application
This application uses Guice’s Dependency Injection to create the HibernateConnection-instance and the OrdersDAO-instance. You can see that HibernateUtil don’t need STATICs anymore. Access to HibernateUtil is wrapped through a HibernateConnection which is created in a ConnectionProvider as a Singleton. Providers are acting as Factories in creating and returning Objects.
Technorati Tags: google guice, Hibernate, Java, mysql, NetBeans
Tags: google guice, Hibernate, Java, mysql, NetBeans
Feb
21
2008

In this Blog you will see how to add Google-Guice functionality to a Hibernate-Application. In Part I i will introduce a simple Hibernate-Application. In Part II you can see how this Application will be transformed for using Guice.
Note:
This was my first attempt working with Guice, so i think there are many points which can be improved.
But first for these peoples who doesn’t know what is Guice, Guice is a new lightweight Java 5 Dependency Injection Framework. It is working with Annotations. You should not compare Guice with Spring. Guice focus is on Dependency Injection, where Spring has become popular in the Java community as an alternative, replacement, or even addition to the Enterprise JavaBean model. Google produced Guice for one of their biggest applications – AdWords!
Download-links to all files are available at the end of this posting. Comments are included in the source-listings.
Technorati Tags: google guice, Hibernate, Java, mysql, NetBeans
Tags: google guice, Hibernate, Java, mysql, NetBeans