Home > JAVA > CzJUG Jersey: RESTful Web Services part [1] – IDE NB setup

CzJUG Jersey: RESTful Web Services part [1] – IDE NB setup

Martin Matula, Jakub Podlesak and Pavel Bucek were starring on this JUG session. Martin presented general overview and Jersey project status as his being the manager. It was interesting but as he has mentioned, project is still missing wide support and implementation. Jakub advised attendants over their difficulties with examples. The most interesting example was for me the second one.  I’m gonna skip Hello world! app I guess it’s pretty easy to find it somewhere using google.

This blog post is focused on NB IDE configuration. As Jakub and Martin mentioned similar session has been presented as  hands-on LAB during JavaONE. Let’s follow these points:

  1. Java JDK 1.6 and latter (I have 1.6.0_16)
  2. Maven 2.0.9 and latter ( mine is maven 2.2.1)
  3. NetBeans 6.7.1 ( It works also on NB 6.8)
  4. Firefox 3.5 and letter
  5. Download the Lab Zip-file from Here or from Hands-on LAB

To get much better impression from examples it’s smart to have Poster add-on installed in the Firefox! This is really cool feature to controll HTTP requests  …

  • Let’s setup Maven with NetBeans IDE. [Tools->Options->Miscallaneous-Maven].
  • Open Project from downloaded zip file [restwebservice/solutions/exercise2/jerseyservice_solution2]
  • Just Build it. Then only wait! if you are running maven for the first time. It has to build all and also download dependencies.
  • In the New Project wizard, select Maven->Maven Project and click Next. Here is another delay because of “Archetypes from Remote Maven Repositories
  • Under “Archetypes from Remote Maven Repositories find “Jersey Archetype: Web App with WAR packaging“, expand it and select “Jersey Archetype: Web App with WAR packaging (1.1.4.1)”, then click Next.
  • Click FINISH
  • You have New Project created. Now it’s time to DELETE. Just do it.. This is because of cashing all necessary libraries to your local maven repository
  • Glassfish V2 (v2.1) is necessary to have installed to. But maybe you can try new release of GF V3

I received only one issue during all examples with Glassfish server/NetBeans. It crashed and was impossible to deploy anything into over NB. After while I realized that I did install new version of NB IDE over my old one. I didn’t delete anything.  So this problem could be probably caused by NetBeans IDE. I stopped all app. servers and NB. After restart everything worked fine then

Congratulation you have it. Let’s move to the part 2.

Advertisements
Categories: JAVA
  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: