Archive for June, 2011

Jackson JSON library now uses JAXB xml annotations to create JSON format responses!

Fantastic stuff!! http://wiki.fasterxml.com/JacksonDownload

RestClient is also useful java open source project for testing REST services alternative content negotiation….http://code.google.com/p/rest-client/

Experience Using JDAS with eclipse

I’m using eclipse (STS spring version) to prototype a new DAS Registry which will be more modular and more REST based.

The other aim is to use the new JDAS library (JAXB based rng-> XSD-> JAXB-> Java DAS objects) rather than the old Dasobert library (hand written handlers and objects).

steps to getting it into eclipseSTS:

add repository to the svn view.

checkout project (right click)

configure using the project wizard

choose normal Java Project as the type in the wizard

set the build path to get dependencies based on maven

right click on pom.xml and select maven install

right click on the project and select m2 maven then select maven dependency management (gets rid of any red errors remaining on classes so adds libraries to eclipse project classpath from the maven pom.xml)

My first issue came after getting the project from SVN when trying to install using the maven pom.xml. Errors occured and the project would not build in eclipse or Netbeans error:

[INFO] Error building POM (may not be this project's POM).
Project ID: org.apache.maven.plugins:maven-surefire-plugin
 POM Location: /homes/[jw12]/.m2/repository/org/apache/maven/plugins/maven-surefire-plugin/2.6/maven-surefire-plugin-2.6.pom
Reason: Not a v4.0.0 POM. for project org.apache.maven.plugins:maven-surefire-plugin at /homes/[jw12]/.m2/repository/org/apache/maven/plugins/maven-surefire-plugin/2.6/maven-surefire-plugin-2.6.pom
[INFO] ------------------------------------------------------------------------
 [INFO] For more information, run Maven with the -e switch
 [INFO] ------------------------------------------------------------------------
 [INFO] Total time: 1 second
 [INFO] Finished at: Thu Jun 30 10:31:15 BST 2011
 [INFO] Final Memory: 3M/81M
 [INFO] ------------------------------------------------------------------------

Changing the version tag from <version>2.6</version> of the surefire plugin solved this so it now looks like this:

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.4.2</version>
<configuration>
<forkMode>always</forkMode>
<parallel>methods</parallel>
<threadCount>10</threadCount>
</configuration>
</plugin>

so now right clicking on the pom in eclipse and selecting “maven install” succesfully installs the project getting all the dependencies.