Build a RESTful Webservice in less than 5 minutes

There are quite some tutorials around about building and exposing a RESTful Webservice, but some of them are outdated and make you wade through complex dependencies and tinkering with deployment descriptors and web.xml files. But using RESTeasy, the JBoss implementation that is fully compliant with the JAX-RS 2.0 JCP specification, and Eclipse you can build a simple webservice (“hello world”) with less than 10 lines of sourceode with annotations and no web.xml used in a few minutes and run it on Wildfly.

Lets build a webservice that creates random numbers.

Continue reading

Advertisements

Create a JIRA client application with Netbeans

I want to embed the creation of JIRA issues into my web application. There are 2 option, as XML-RPC or SOAP client. I decide for the latter one as being the more-up-to-date technology.

Using Netbeans it is usually quite simple to create a WS client, just give the WSDL address and NB will create all required code for you. Btw, you need to install the JAX-RPC plugin, NB out-of-the-box only supports JAX-WS.
Add the “latest” build to your Netbeans plugin settings and you will find the plugin. (http://deadlock.netbeans.org/hudson/job/nbms-and-javadoc/lastStableBuild/artifact/nbbuild/nbms/updates.xml.gz)

Update Center

JAX-RPC Webservices

But in the case of the JIRA WSDL (you can test with http://jira.atlassian.com/rpc/soap/jirasoapservice-v2?wsdl or your own JIRA server) it fails.
While creating the WS client code it duplicates a number of variables.

/media/NetbeansProjects/Webservices/JiraDemo/build/generated-sources/jax-rpc/jiraws/JiraSoapService_deletePermissionScheme_Fault_SOAPSerializer.java:30: ns1_fault_QNAME is already defined in jiraws.JiraSoapService_deletePermissionScheme_Fault_SOAPSerializer
private static final javax.xml.namespace.QName ns1_fault_QNAME = new QName("http://xxxxxxx/rpc/soap/jirasoapservice-v2", "fault");

Errors

My temporary workaround: I create the Java application in Eclipse, add the WS there and import the project afterwards into NB. This works, but you loose the extra functions to handle WS in Netbeans. So on the long way, I hope someone can fix the plugin.

JIRA WS in Eclipse

JIRA WS in Eclipse

JIRA WS in Netbeans

WS Client

I recommend playing with the sample code from below references.

References:

 

 

Android Samsung Galaxy Tab Alternative

I believe it makes no sense to buy a ~ 900.- SGD (3g, GPS), respectively a 500.- SGD (wifi only) device running Android 2.2 without any chance even to update to 2.3, such as the Galaxy Tab, the same time Galaxy is releasing already the new 3.0 based models. So how to find a cheap device that can compete with the Galaxy Tab ?
After buying one Android 10″ Tablet from DHGate.com without problems I decided to look for a second one, a 7″ device. Certainly not easy to find a good device among the many offers on the trading platform, but I was lucky enough to choose this PC-7006 1Ghz device for 223.- U$ (incl. shipping) from the dealer avatar2012:

Android MID 7"

Continue reading

Going Flex 4 with Linux

I am evaluating a few RIA options to create front-ends that go beyond swing applications and can live outside a browser, but still being cross-platform. I focused on JavaFX for a while, but the agenda by Oracle was changed and they abandoned they JavaFX scripting and working on a new roadmap (more info here). Though it looks promising, we need to wait until 2011 to see the release 2.0.
Looking at alternatives I only see Flash/Flex/Air (all by Adobe), with Flex as a product that can be “enterprise’d”, means run with a JEE backend. Unfortunately Adobe forgot to keep Linux users on board with their latest version, Flashbuilder 4. The commercial product only runs on Mac and Windows, forcing the Linux community to connect the free SDK to another IDE or rather implementing their own plugin. To quote Adobe

Adobe will no longer be investing in the  development of a version of Adobe® Flex® Builder™ or
Adobe Flash®  Builder™ that runs on Linux operating systems.

I can highlight this blog with a summary as per March 2010.

Otherwise I summarise what I did to get it running with Eclipse Galileo on Ubuntu following the creator of the axdt plugin:

Comments:

  • I cant judge beyond this gettings-started level. Just getting my hands wet with FLEX.
  • There is a a Netbeans plugin running on 6.5, but the project seems to be abandoned.

 

 

Debug Android Nexus One with Eclipse

Using Ubuntu and Eclipse you follow the instructions here:

  • Create  the file /etc/udev/rules.d/51-android.rules
  • Change the rights chmod a+r /etc/udev/rules.d/51-android.rules
  • and add the line  SUBSYSTEM==”usb”, SYSFS{idVendor}==”0bb4″, MODE=”0666″
  • but running adb devices gets you a bunch of ???? and ‘no permission‘ and you cant connect from Eclipse.

The proper vendor id for HTC Nexus One is 18d1

SUBSYSTEM==”usb”, SYSFS{idVendor}==”18d1″, MODE=”0666″

(No clue why they never updated the docs)

Eclipse throws ‘Debug Certificate Expired’

Suddenly Eclipse started throwing this error at me while doing Android development.

Error generating final archive: Debug Certificate expired on 7/10/10 4:34 PM AndroTest Unknown Android Packaging Problem

The Android SDK generates a debug certificate which is only valid for 365 days, not quite what that is for, but to get rid of the problem:

Delete the file ~/home/.android/debug.keystore


Plus clean your project (Project|Clean..)

Afterwards you should be fine and also find a new debug.keystore (for the next 365 days)