<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/atom10full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><feed xmlns="http://www.w3.org/2005/Atom" xmlns:openSearch="http://a9.com/-/spec/opensearch/1.1/" xmlns:georss="http://www.georss.org/georss" xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr="http://purl.org/syndication/thread/1.0" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" gd:etag="W/&quot;A0EHQXg6eSp7ImA9WhRUFkg.&quot;"><id>tag:blogger.com,1999:blog-2648073517459434852</id><updated>2012-01-27T10:20:30.611Z</updated><category term="sdo" /><category term="jenkins" /><category term="soa" /><category term="maven" /><category term="jersey" /><category term="java xquery jsr225" /><category term="wsdl" /><category term="osx" /><category term="dogfood" /><category term="asynchronous webservices" /><category term="jdeveloper" /><category term="sentilla" /><category term="iphone" /><category term="javaone" /><category term="spring" /><category term="WeblogicSCA" /><category term="sca" /><category term="HATEOAS" /><category term="oauth" /><category term="jps" /><category term="motes" /><category term="review" /><category term="cometd" /><category term="jsr331" /><category term="jax-b" /><category term="annotation processor" /><category term="jax-ws" /><category term="wls" /><category term="promotion" /><category term="ramble" /><category term="abbot" /><category term="robomow" /><category term="jsf" /><category term="personal" /><category term="java" /><category term="REST" /><category term="otn" /><category term="webservices" /><category term="wadl" /><category term="security" /><category term="death to boilerplate" /><category term="effectivejava" /><category term="jax-rs" /><category term="apt" /><category term="hudson" /><category term="bluemotion" /><category term="policies" /><category term="oracle" /><category term="ukoug09" /><category term="adf" /><category term="x" /><category term="wlst" /><category term="http analyzer" /><category term="ukoug08" /><category term="polo" /><category term="jobs" /><category term="appengine" /><category term="weblogic" /><category term="lombok" /><category term="project-dogfood" /><category term="jazoon" /><category term="costello" /><title>Gerard Davison's Blog</title><subtitle type="html" /><link rel="http://schemas.google.com/g/2005#feed" type="application/atom+xml" href="http://kingsfleet.blogspot.com/feeds/posts/default" /><link rel="alternate" type="text/html" href="http://kingsfleet.blogspot.com/" /><link rel="next" type="application/atom+xml" href="http://www.blogger.com/feeds/2648073517459434852/posts/default?start-index=26&amp;max-results=25&amp;redirect=false&amp;v=2" /><author><name>Gerard Davison</name><uri>http://www.blogger.com/profile/16521924431312439170</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="28" height="32" src="http://1.bp.blogspot.com/_wg73kpMXUVw/SR2BnEFpCHI/AAAAAAAAAGU/lvJNPVj958I/s1600-R/10680.jpg" /></author><generator version="7.00" uri="http://www.blogger.com">Blogger</generator><openSearch:totalResults>212</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/atom+xml" href="http://feeds.feedburner.com/KingsfleetBlog" /><feedburner:info uri="kingsfleetblog" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><entry gd:etag="W/&quot;CEYGRHsyfSp7ImA9WhRUE0w.&quot;"><id>tag:blogger.com,1999:blog-2648073517459434852.post-4121732416066127312</id><published>2012-01-23T09:36:00.005Z</published><updated>2012-01-23T09:48:45.595Z</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2012-01-23T09:48:45.595Z</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="hudson" /><title>Off-loading test execution using Hudson part 2</title><content type="html">&lt;p&gt;Previously I have written about using Hudson to perform &lt;a href="/2011/07/off-loading-your-test-running-using.html"&gt;pre-flights using branches&lt;/a&gt; on source control systems; but sometimes you just have a patch file that you want to run your tests against.&lt;/p&gt;

&lt;p&gt;It turns out this can be quite simple, you just need to make use of a job parameter that takes a File as it's input, this is then written to the specified location in the workspace. In my example I have the following two parameters, the Title allow me to name the job and this property is picked up later by the job &lt;a href="http://wiki.hudson-ci.org/display/HUDSON/Description+Setter+Plugin"&gt;Description&lt;/a&gt; plugin.&lt;/p&gt;

&lt;p&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/-LlAecYyycjI/Tx0r1qzYaQI/AAAAAAAAAUU/HGszkrYUTeo/s1600/Screen%2BShot%2B2012-01-23%2Bat%2B09.39.49.jpeg"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 400px; height: 167px;" src="http://2.bp.blogspot.com/-LlAecYyycjI/Tx0r1qzYaQI/AAAAAAAAAUU/HGszkrYUTeo/s400/Screen%2BShot%2B2012-01-23%2Bat%2B09.39.49.jpeg" border="0" alt=""id="BLOGGER_PHOTO_ID_5700760904343775490" /&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Once you know where the patch is located you can just apply the patch before you perform the required build steps, here is an example using SVN so we use the unix patch command, git users can use the git command instead for this.&lt;/p&gt;

&lt;p&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/-BzfKZoNSp2g/Tx0shsWvHnI/AAAAAAAAAUg/dKc3iupE5Vc/s1600/Screen%2BShot%2B2012-01-23%2Bat%2B09.42.18.jpeg"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 400px; height: 153px;" src="http://1.bp.blogspot.com/-BzfKZoNSp2g/Tx0shsWvHnI/AAAAAAAAAUg/dKc3iupE5Vc/s400/Screen%2BShot%2B2012-01-23%2Bat%2B09.42.18.jpeg" border="0" alt=""id="BLOGGER_PHOTO_ID_5700761660674743922" /&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;And there you are, you can test a user submitted patch for testing without tying up your development machine. You can also run the tests more than once to check for any intermittent tests which can be very valuable in concurrent environments.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;script src="http://www.google-analytics.com/urchin.js" type="text/javascript"&gt;
&lt;/script&gt;
&lt;script type="text/javascript"&gt;
_uacct = "UA-2176345-1";
urchinTracker();
&lt;/script&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2648073517459434852-4121732416066127312?l=kingsfleet.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/KingsfleetBlog/~4/pd6NXTDR40U" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://kingsfleet.blogspot.com/feeds/4121732416066127312/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=2648073517459434852&amp;postID=4121732416066127312" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/2648073517459434852/posts/default/4121732416066127312?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/2648073517459434852/posts/default/4121732416066127312?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/KingsfleetBlog/~3/pd6NXTDR40U/off-loading-test-execution-using-hudson.html" title="Off-loading test execution using Hudson part 2" /><author><name>Gerard Davison</name><uri>http://www.blogger.com/profile/16521924431312439170</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="28" height="32" src="http://1.bp.blogspot.com/_wg73kpMXUVw/SR2BnEFpCHI/AAAAAAAAAGU/lvJNPVj958I/s1600-R/10680.jpg" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://2.bp.blogspot.com/-LlAecYyycjI/Tx0r1qzYaQI/AAAAAAAAAUU/HGszkrYUTeo/s72-c/Screen%2BShot%2B2012-01-23%2Bat%2B09.39.49.jpeg" height="72" width="72" /><thr:total>0</thr:total><feedburner:origLink>http://kingsfleet.blogspot.com/2012/01/off-loading-test-execution-using-hudson.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CEUNR3k7eSp7ImA9WhRREk4.&quot;"><id>tag:blogger.com,1999:blog-2648073517459434852.post-4264181106105244459</id><published>2011-11-25T11:28:00.007Z</published><updated>2011-11-25T14:44:56.701Z</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-11-25T14:44:56.701Z</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="x" /><category scheme="http://www.blogger.com/atom/ns#" term="jax-rs" /><category scheme="http://www.blogger.com/atom/ns#" term="jersey" /><title>x!, a very simple xml library</title><content type="html">&lt;p&gt;A couple of weeks ago, having gotten annoyed about the amount of boilerplate you need in Java in order to do some very simple XML actions I decided to put something in place that would get me close to the fluency of the Groovy and JScript XML extensions with a very small interface. Indeed the original proposal can be contained in a &lt;a href="http://is.gd/xspec"&gt;tweet&lt;/a&gt; and the only methods I have added since are parent() and prefix() which doesn't quite fit in the standard 140 characters.&lt;/p&gt;

&lt;p&gt;So there is basically only one class to worry about X, this allows you to read and write values, select children and perform the normal input and output operations. Everything throws unchecked exceptions, and where possible Attr and Elements are treated the same so for example set(val) and get() will work for both in a consistent manner.&lt;/p&gt;

&lt;p&gt;You can find simpler examples in the unit tests in the &lt;a href="https://github.com/kingsfleet/x-"&gt;github project&lt;/a&gt;, but the most interesting use cases for me are when used with JAX-RS to access and program REST resources that accept XML. XPath makes Duck Typing easy and if you are careful your code can ignore minor schema changes, this is in stark contrast to static JAX-B binding for example.&lt;/p&gt;

&lt;p&gt;Take this example, it looks at a remote resource and sets it as being offline using the Jersey client. In the simplest case you need to explicitly tell Jersey about the X message body readers and writers; but other than that the code is quite straight forward.&lt;/p&gt;

&lt;pre name="code" class="java"&gt;
   ClientConfig clientConfig = new DefaultClientConfig(
      XMessageBodyWriter.class,XMessageBodyReader.class);    
   Client client = Client.create(clientConfig);
   client.addFilter(new HTTPBasicAuthFilter(...));
        
   WebResource resource = client.resource("http://hudson...");

   resource.put(
      resource.get(X.class)
         .set("//n:offline", "true"));
        
   System.out.println(resource.get(X.class).get("//n:offline"));
&lt;/pre&gt;

&lt;p&gt;Note in the last line we use the pre-defined namespace prefix n which is always populated by the first node in the tree. You can also perform the select, or selectList for a list, explicitly to get hold of the value:&lt;/p&gt; 

&lt;pre name="code" class="java"&gt;
   resource.put(
      resource.get(X.class)
         .select("//n:offline").set("true"));
        
   System.out.println(resource.get(X.class)
     .select("//n:offline").get());
&lt;/pre&gt;


&lt;p&gt;You can also use x! in JAX-RS resources, here is a very simple hello world example using the same message body readers and writers as before. Since they are marked as @Provider your container should be able to pick them up for you.&lt;/p&gt;

&lt;pre name="code" class="java"&gt;
@Path("/hello")
public class HelloMessage {
    @POST
    @Produces("text/xml")
    @Consumes("text/xml")
    public X hello(X input) {

        String name = input.select("//name").get();

        X response = X.in("http://www.example.com", "message");
        response
            .children().create("name")
                .set(name).parent()  // Think of .parent() like a CR
            .children().create("message")
                .set("Hello " + name)
                .set("@lang", "en");

        return response;
    }
}
&lt;/pre&gt;

&lt;p&gt;I am not entirely sure about the flow to create new objects, feedback is always appreciated of course. The use of @ to set attributes is quick as internally this doesn't result in a XPath query. Currently you can only work on direct children when creating new attributes, for more complex paths you need to select the direct parent to create new attributes. You can still set values on attributes that do exist with complex xpath expressions though.&lt;/p&gt;

&lt;pre name="code" class="java"&gt;
    // @attr exists
    x.select("....@attr").set("value");
    or 
    s.set("...@attr", "value");
&lt;/pre&gt;

&lt;p&gt;Here is a simple request and response from this service just for comparison you can get the code to reflect the xml quite closely.&lt;/p&gt;

&lt;pre name="code" class="xml"&gt;
// Example input message
&amp;lt;message&gt;
   &amp;lt;name&gt;Bob&gt;&amp;lt;/name&gt;
&amp;lt;/message&gt;

// Example response

&amp;lt;message xmlns="http://www.example.com"&gt;
   &amp;lt;name&gt;Bob&gt;&amp;lt;/name&gt;
   &amp;lt;message lang="en"&gt;Hello Bob&gt;&amp;lt;/message&gt;
&amp;lt;/message&gt;
&lt;/pre&gt;

&lt;p&gt;This really was a thought experiment that got out of control; but I would welcome feedback, suggestions, and of course as it is on &lt;a href="https://github.com/kingsfleet/x-"&gt;GitHub patches&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;One interesting direction is replacing the current DOM implementation with a streaming version which might be possible for certain read and write options depending on the ordering of the data.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;script src="http://www.google-analytics.com/urchin.js" type="text/javascript"&gt;
&lt;/script&gt;
&lt;script type="text/javascript"&gt;
_uacct = "UA-2176345-1";
urchinTracker();
&lt;/script&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2648073517459434852-4264181106105244459?l=kingsfleet.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/KingsfleetBlog/~4/rGr8szUFiw4" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://kingsfleet.blogspot.com/feeds/4264181106105244459/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=2648073517459434852&amp;postID=4264181106105244459" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/2648073517459434852/posts/default/4264181106105244459?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/2648073517459434852/posts/default/4264181106105244459?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/KingsfleetBlog/~3/rGr8szUFiw4/x-or-very-simple-xml-library_25.html" title="x&amp;#33;, a very simple xml library" /><author><name>Gerard Davison</name><uri>http://www.blogger.com/profile/16521924431312439170</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="28" height="32" src="http://1.bp.blogspot.com/_wg73kpMXUVw/SR2BnEFpCHI/AAAAAAAAAGU/lvJNPVj958I/s1600-R/10680.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://kingsfleet.blogspot.com/2011/11/x-or-very-simple-xml-library_25.html</feedburner:origLink></entry><entry gd:etag="W/&quot;AkMGSX07fyp7ImA9WhdaEE8.&quot;"><id>tag:blogger.com,1999:blog-2648073517459434852.post-7349895584163656768</id><published>2011-10-19T13:25:00.005+01:00</published><updated>2011-10-19T13:47:08.307+01:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-10-19T13:47:08.307+01:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="wadl" /><category scheme="http://www.blogger.com/atom/ns#" term="REST" /><category scheme="http://www.blogger.com/atom/ns#" term="hudson" /><title>A little script to update job descriptions on Matrix jobs</title><content type="html">&lt;p&gt;We have started to use Matrix jobs in Hudson to try and reduce the amount of clutter on the front page; but we have run into problems in that the &lt;a href="http://wiki.hudson-ci.org/display/HUDSON/Description+Setter+Plugin"&gt;job description&lt;/a&gt; plugin we used to add the LABEL name to the job id only works for the &lt;a href="http://issues.hudson-ci.org/browse/HUDSON-9046"&gt;subordinate tasks&lt;/a&gt;. This leaves the top level job without a description.&lt;/p&gt;

&lt;p&gt;There are of course other ways you can do this; but since I was playing with the new REST api yesterday, I am going to use this. You could of course use the old RESTy API or indeed the command line tool to perform similar feats. This week I mostly just have a hammer.&lt;/p&gt;

&lt;p&gt;Before you use the proxy classes you need to first create a client with the right security credentials configured:&lt;/p&gt;

&lt;pre name="code" class="java"&gt;
   public static Client createClient() {
       Client client = Client.create();
       client.addFilter(new HTTPBasicAuthFilter("xxxxx@oracle.com","xxxxxxx"));
       return client;
   }
&lt;/pre&gt;

&lt;p&gt;The first part of the job is going to be to create proxies for both the parent project and of the child variant:&lt;/p&gt;

&lt;pre name="code" class="java"&gt;
   public static void main(String[] args) {

       if (args.length!=2) {
           System.err.println("Expecting two parameters project and variant");
       }

       String project = args[0];
       String variant = project + "%2F" + args[1]; 

       System.out.printf("Will copy missing description from %s to %s\n", variant, project);

       // Create a Jersey client
       Client client = createClient();

       // Create a suitable proxy using the client we configured
       Projects hudsonProjects = projects(client);

       // Handles to the right resources
       Projects.ProjectNameBuilds projectBuilds = hudsonProjects.projectNameBuilds(project);
       Projects.ProjectNameBuilds variantBuilds = hudsonProjects.projectNameBuilds(variant);
&lt;/pre&gt;

&lt;p&gt;Then we can make a quick map of the variant build number to descriptions by getting the first build object:&lt;/p&gt;

&lt;pre name="code" class="java"&gt;
       // Copy the descriptions out from the variant
       Map&amp;lt;Integer, String&gt; variantToDescription = new HashMap&amp;lt;Integer,String&gt;();
       BuildsDTO variantBuildsDTO = variantBuilds.getAsApplicationXml(BuildsDTO.class);
       for (BuildDTO build : variantBuildsDTO.getBuild()) {
           if (build.getDescription()!=null)
           {
               variantToDescription.put(
                   build.getNumber(), 
                   build.getDescription());
           }
       }
&lt;/pre&gt;

&lt;p&gt;Now it turns out that the current version of the API doesn't allow you to update build descriptions; but we can easily read them using this API and then update them using a simple form POST using the same client.&lt;/p&gt;

&lt;pre name="code" class="java"&gt;

       // Update the main project descriptions
       BuildsDTO projectBuildsDTO = projectBuilds.getAsApplicationXml(BuildsDTO.class);
       for (BuildDTO build : projectBuildsDTO.getBuild()) {

           String description = build.getDescription();
           // Update description if it has not already been set
           if (description == null || description.length()==0) {

               String variantDesc = variantToDescription.get(build.getNumber());
               if (variantDesc!=null &amp;&amp; variantDesc.length()!=0) {

                   // We need to set the description; but nothing in the REST API
                   // so we can use the url property to perform a form submit that will
                   // update the description for us.

                   MultivaluedMap map = new Form();
                   map.add("description", variantDesc);
                   map.add("Submit", "Submit");
                   WebResource buildResource = client.resource(
                       build.getUrl() + "submitDescription");
                   ClientResponse response = buildResource.type(MediaType.APPLICATION_FORM_URLENCODED_TYPE)
                       .post(ClientResponse.class, map);
                   System.out.printf("Updating build %d with description %s gave response %d\n",
                                     build.getNumber(), variantDesc, response.getStatus());

               }
           }
       }
&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;script src="http://www.google-analytics.com/urchin.js" type="text/javascript"&gt;
&lt;/script&gt;
&lt;script type="text/javascript"&gt;
_uacct = "UA-2176345-1";
urchinTracker();
&lt;/script&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2648073517459434852-7349895584163656768?l=kingsfleet.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/KingsfleetBlog/~4/50tZiIcXfo4" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://kingsfleet.blogspot.com/feeds/7349895584163656768/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=2648073517459434852&amp;postID=7349895584163656768" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/2648073517459434852/posts/default/7349895584163656768?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/2648073517459434852/posts/default/7349895584163656768?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/KingsfleetBlog/~3/50tZiIcXfo4/little-script-to-update-job.html" title="A little script to update job descriptions on Matrix jobs" /><author><name>Gerard Davison</name><uri>http://www.blogger.com/profile/16521924431312439170</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="28" height="32" src="http://1.bp.blogspot.com/_wg73kpMXUVw/SR2BnEFpCHI/AAAAAAAAAGU/lvJNPVj958I/s1600-R/10680.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://kingsfleet.blogspot.com/2011/10/little-script-to-update-job.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CEMHR3cycSp7ImA9WhdbGEs.&quot;"><id>tag:blogger.com,1999:blog-2648073517459434852.post-6142151236795779031</id><published>2011-10-17T14:17:00.006+01:00</published><updated>2011-10-17T15:40:36.999+01:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-10-17T15:40:36.999+01:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="wadl" /><category scheme="http://www.blogger.com/atom/ns#" term="jersey" /><category scheme="http://www.blogger.com/atom/ns#" term="hudson" /><title>Getting hold of the schemas for the Hudson REST API, and generating a client</title><content type="html">&lt;p&gt;I have been playing with the newish REST-like interface in Hudson 2.1.2 and I wanted to &lt;a href="http://wadl.java.net"&gt;generate a client&lt;/a&gt;; but as it only uses Jersey 1.5 so it doesn't contain my fix to publish and connect them up directly. Luckily you can just down load these files from the &lt;a href="https://github.com/hudson/hudson/tree/master/hudson-rest/hudson-rest-model/src/main/schema"&gt;github repository&lt;/a&gt;. You ideally want to add these to the wadl description of the service so download the root WADL using a tool such as wget from http://hudson.my.com/rest/application.wadl and then you can add the required imports.&lt;/p&gt;

&lt;pre name="code" class="xml"&gt;
&amp;lt;?xml version="1.0" encoding="UTF-8" standalone="yes"?&gt;
&amp;lt;application xmlns="http://research.sun.com/wadl/2006/10"&gt;
    &amp;lt;doc xmlns:jersey="http://jersey.dev.java.net/" jersey:generatedBy="Jersey: 1.5 01/14/2011 12:36 PM"/&gt;
    
    &amp;lt;grammars&gt;
      &amp;lt;include href="build.xsd" /&gt;
      &amp;lt;include href="common.xsd" /&gt;
      &amp;lt;include href="fault.xsd" /&gt;
      &amp;lt;include href="project.xsd" /&gt;
    &amp;lt;/grammars&gt;
    
    &amp;lt;resources base="http://hudson/rest/"&gt;

    ....
&lt;/pre&gt;

&lt;p&gt;Now you can either use the schemas as is and make sure you have &lt;a href="http://java.net/projects/annox"&gt;annox&lt;/a&gt; on your class path when you generate the model classes, or you can find and replace &lt;tt&gt;jaxb:extensionBindingPrefixes="xjc annox"&lt;/tt&gt; with &lt;tt&gt;jaxb:extensionBindingPrefixes="xjc"&lt;/tt&gt;. 

&lt;p&gt;This will give you a wadl that will generate the interface and the model classes in the same step; we will have to wait for &lt;a href="http://issues.hudson-ci.org/browse/HUDSON-9031"&gt;later version&lt;/a&gt; of Hudson to connect the types up to the methods. For the moment though if you have a quick look at the WADL it is relatively obvious which types are for which.&lt;/p&gt;

&lt;pre name="code" class="java"&gt;

/**
 *
 */
@Generated(value =
           { "wadl|file:/tmp/workspaceWorkDir5662539174912846886.abbot/Hudson/Hudson-WADL/src/wadl/application.wadl",
             "run|ca8e07f8-00d8-40ab-bde3-b15cee244091" }, comments = "wadl2java, http://wadl.java.net",
           date = "2011-10-17T14:31:17.818+01:00")
public class Hudson_Rest {


    public static void main(String[] args) {

        // Write out all projects status
        Hudson_Rest.Projects hudsonProjects = projects();
        ProjectsDTO projects = hudsonProjects.getAsApplicationXml(ProjectsDTO.class);
        for (ProjectDTO project : projects.getProject()) {
            System.out.printf("++++ %s +++++\n", project.getName());
            System.out.println(project.getHealth().getDescription());
        }

        // Query the enablement of one particular project
        Hudson_Rest.Projects.ProjectName hudsonAbbotSf = hudsonProjects.projectName("abbot_SF");
        ProjectDTO abbot_SF = hudsonAbbotSf.getAsApplicationJson(ProjectDTO.class);
        System.out.println("Abbot_SF is enabled " + abbot_SF.isEnabled());
   }

   ...
}
&lt;/pre&gt; 

&lt;p&gt;So this is a simple read operation, I will look at writing back through this API which will involve configuring the client for authentication in a later installment.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;script src="http://www.google-analytics.com/urchin.js" type="text/javascript"&gt;
&lt;/script&gt;
&lt;script type="text/javascript"&gt;
_uacct = "UA-2176345-1";
urchinTracker();
&lt;/script&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2648073517459434852-6142151236795779031?l=kingsfleet.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/KingsfleetBlog/~4/gHNZb9VOgWc" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://kingsfleet.blogspot.com/feeds/6142151236795779031/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=2648073517459434852&amp;postID=6142151236795779031" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/2648073517459434852/posts/default/6142151236795779031?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/2648073517459434852/posts/default/6142151236795779031?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/KingsfleetBlog/~3/gHNZb9VOgWc/getting-hold-of-schemas-for-hudson-rest.html" title="Getting hold of the schemas for the Hudson REST API, and generating a client" /><author><name>Gerard Davison</name><uri>http://www.blogger.com/profile/16521924431312439170</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="28" height="32" src="http://1.bp.blogspot.com/_wg73kpMXUVw/SR2BnEFpCHI/AAAAAAAAAGU/lvJNPVj958I/s1600-R/10680.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://kingsfleet.blogspot.com/2011/10/getting-hold-of-schemas-for-hudson-rest.html</feedburner:origLink></entry><entry gd:etag="W/&quot;Ak4HRHo6eyp7ImA9WhdbE0k.&quot;"><id>tag:blogger.com,1999:blog-2648073517459434852.post-3947482558956409252</id><published>2011-10-11T16:28:00.004+01:00</published><updated>2011-10-11T17:02:15.413+01:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-10-11T17:02:15.413+01:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="java" /><title>A few simple command line operations on zip files every java developer should know</title><content type="html">&lt;p&gt;Java developer spend a lot of time working with zip files it always surprises me that many reach for winzip when some really quite simple command line operation will do. These should all work fine on Unix or using Cygwin, I have consciously used unzip rather than jar as it is more readily available.&lt;/p&gt;

&lt;p&gt;First is a quite simple question, does this file file contain a particular file?&lt;/p&gt;

&lt;pre name="code" class="java"&gt;
unzip -l Example.jar | grep LookingFor.java
or the slightly prettier version with jar:
jar -tf Example.jar | grep LookingFor.java
&lt;/pre&gt;

&lt;p&gt;Second is that you want to look at the content of a file in the zip.&lt;/p&gt;

&lt;pre name="code" class="java"&gt;
unzip -pq Example.jar META-INF/MANIFEST.MF 
&lt;/pre&gt;

&lt;p&gt;Finally the last operation is that you want to be able to compare two zip files, if you have a some UI tools for this then great but this little script will give you a quick command line diff:&lt;/p&gt;

&lt;pre name="code" class="java"&gt;
#!/bin/bash

FIRST_DIR=`mktemp -d`
SECOND_DIR=`mktemp -d`

echo Unzipping $1 to ${FIRST_DIR}
unzip -q $1 -d ${FIRST_DIR}
echo Unzipping $2 to ${SECOND_DIR}
unzip -q $2 -d ${SECOND_DIR}

diff ${FIRST_DIR} ${SECOND_DIR} 

rm -rf ${FIRST_DIR}
rm -rf ${SECOND_DIR}
&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;script src="http://www.google-analytics.com/urchin.js" type="text/javascript"&gt;
&lt;/script&gt;
&lt;script type="text/javascript"&gt;
_uacct = "UA-2176345-1";
urchinTracker();
&lt;/script&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2648073517459434852-3947482558956409252?l=kingsfleet.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/KingsfleetBlog/~4/o1ZIDY2HYsA" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://kingsfleet.blogspot.com/feeds/3947482558956409252/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=2648073517459434852&amp;postID=3947482558956409252" title="1 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/2648073517459434852/posts/default/3947482558956409252?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/2648073517459434852/posts/default/3947482558956409252?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/KingsfleetBlog/~3/o1ZIDY2HYsA/few-simple-command-line-operations-on.html" title="A few simple command line operations on zip files every java developer should know" /><author><name>Gerard Davison</name><uri>http://www.blogger.com/profile/16521924431312439170</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="28" height="32" src="http://1.bp.blogspot.com/_wg73kpMXUVw/SR2BnEFpCHI/AAAAAAAAAGU/lvJNPVj958I/s1600-R/10680.jpg" /></author><thr:total>1</thr:total><feedburner:origLink>http://kingsfleet.blogspot.com/2011/10/few-simple-command-line-operations-on.html</feedburner:origLink></entry><entry gd:etag="W/&quot;A0UHR346fyp7ImA9WhdWGE4.&quot;"><id>tag:blogger.com,1999:blog-2648073517459434852.post-7005589159078212734</id><published>2011-09-12T15:47:00.002+01:00</published><updated>2011-09-12T15:53:56.017+01:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-09-12T15:53:56.017+01:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="jax-rs" /><category scheme="http://www.blogger.com/atom/ns#" term="jersey" /><title>Replacment for Endpoint.publish when using Jersey</title><content type="html">&lt;p&gt;Sometimes when working with JAX-WS services it is nice to be able to test the service without having to deploy to a heavyweight server. You can do this using the Endpoint.publish method and just pass in an instance of your server class.&lt;p&gt;

&lt;p&gt;There is something similar in Jersey, but it isn't part of the JAX-RS specification. So you can publish a single resource as follows:&lt;/p&gt;

&lt;pre name="name" class="java"&gt;
package client;


import com.sun.jersey.api.container.httpserver.HttpServerFactory;
import com.sun.jersey.api.core.ClassNamesResourceConfig;
import com.sun.net.httpserver.HttpServer;

import java.io.IOException;


public class Test {
    
    public static void main(String[] args) throws IOException {

        HttpServer create = HttpServerFactory.create(
            "http://localhost:9001/",new ClassNamesResourceConfig(Hello.class));
        create.start();
    }
}
&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;script src="http://www.google-analytics.com/urchin.js" type="text/javascript"&gt;
&lt;/script&gt;
&lt;script type="text/javascript"&gt;
_uacct = "UA-2176345-1";
urchinTracker();
&lt;/script&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2648073517459434852-7005589159078212734?l=kingsfleet.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/KingsfleetBlog/~4/WdQEFYF5CHE" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://kingsfleet.blogspot.com/feeds/7005589159078212734/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=2648073517459434852&amp;postID=7005589159078212734" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/2648073517459434852/posts/default/7005589159078212734?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/2648073517459434852/posts/default/7005589159078212734?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/KingsfleetBlog/~3/WdQEFYF5CHE/replacment-for-endpointpublish-when.html" title="Replacment for Endpoint.publish when using Jersey" /><author><name>Gerard Davison</name><uri>http://www.blogger.com/profile/16521924431312439170</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="28" height="32" src="http://1.bp.blogspot.com/_wg73kpMXUVw/SR2BnEFpCHI/AAAAAAAAAGU/lvJNPVj958I/s1600-R/10680.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://kingsfleet.blogspot.com/2011/09/replacment-for-endpointpublish-when.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CEICRnYzfip7ImA9WhdWFE0.&quot;"><id>tag:blogger.com,1999:blog-2648073517459434852.post-4398661497010432053</id><published>2011-09-07T13:23:00.002+01:00</published><updated>2011-09-07T14:36:07.886+01:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-09-07T14:36:07.886+01:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="wadl" /><category scheme="http://www.blogger.com/atom/ns#" term="jax-rs" /><category scheme="http://www.blogger.com/atom/ns#" term="jersey" /><title>Improvements in the WADL client generator</title><content type="html">&lt;p&gt;I have recently been working on bringing the useful &lt;a href="http://wadl.java.net"&gt;WADL client generator&lt;/a&gt; as originally penned by Marc Hadley more in line with currently technology. I have updated it so that it now uses the Jersey client and also I have made a few modifications to make it easier to use. There is plenty of documentation on the WADL site on how to run the tool in various configurations, but I thought it worth while just to show a simple example of what you might expect.&lt;/p&gt;

&lt;p&gt;You can download a snapshot of &lt;a href="https://maven.java.net/content/repositories/snapshots/org/jvnet/ws/wadl/wadl-dist/1.1-SNAPSHOT/"&gt;version 1.1 from here&lt;/a&gt;, and hopefully soon a &lt;a href="https://maven.java.net/content/repositories/releases/org/jvnet/ws/wadl/wadl-dist/"&gt;final version of 1.1 will be avaliable here&lt;/a&gt; if I have guessed the URL correctly. If you pick the version after the 6th of September it should contain all the bits your need.&lt;/p&gt;

&lt;p&gt;So as an example we have a really simple hello world service that has a path param to select the correct languauge, the WADL and the &lt;a href="/2011/07/auttomatic-xml-schema-generation-for.html"&gt;Schema generated in Jersey 1.9&lt;/a&gt; are as follows:&lt;/p&gt;

&lt;pre name="code" class="xml"&gt;

&amp;lt;!-- application.wadl --&gt;

&amp;lt;?xml version = '1.0' encoding = 'UTF-8' standalone = 'yes'?&gt;
&amp;lt;application xmlns="http://wadl.dev.java.net/2009/02"&gt;
    &amp;lt;doc xmlns:jersey="http://jersey.java.net/" jersey:generatedBy="Jersey: 1.9 09/02/2011 11:17 AM"/&gt;
    &amp;lt;grammars&gt;
        &amp;lt;include href="application.wadl/xsd0.xsd"&gt;
            &amp;lt;doc title="Generated" xml:lang="en"/&gt;
        &amp;lt;/include&gt;
    &amp;lt;/grammars&gt;
    &amp;lt;resources base="http://localhost:7101/cr/jersey/"&gt;
        &amp;lt;resource path="webservice"&gt;
            &amp;lt;resource path="{lang}"&gt;
                &amp;lt;param xmlns:xs="http://www.w3.org/2001/XMLSchema" name="lang" style="template" type="xs:string"/&gt;
                &amp;lt;resource path="greeting"&gt;
                    &amp;lt;method id="hello" name="GET"&gt;
                        &amp;lt;response&gt;
                            &amp;lt;representation xmlns:ns2="http://example.com/hello" element="ns2:bean" mediaType="*/*"/&gt;
                        &amp;lt;/response&gt;
                    &amp;lt;/method&gt;
                &amp;lt;/resource&gt;
            &amp;lt;/resource&gt;
        &amp;lt;/resource&gt;
    &amp;lt;/resources&gt;
&amp;lt;/application&gt;

&amp;lt;!-- application.wadl/xsd0.xsd --&gt;

&amp;lt;?xml version = '1.0' standalone = 'yes'?&gt;
&amp;lt;xs:schema version="1.0" targetNamespace="http://example.com/hello" xmlns:tns="http://example.com/hello" xmlns:xs="http://www.w3.org/2001/XMLSchema"&gt;

  &amp;lt;xs:element name="bean" type="tns:bean"/&gt;

  &amp;lt;xs:complexType name="bean"&gt;
    &amp;lt;xs:sequence&gt;
      &amp;lt;xs:element name="message" type="xs:string" minOccurs="0"/&gt;
    &amp;lt;/xs:sequence&gt;
  &amp;lt;/xs:complexType&gt;
&amp;lt;/xs:schema&gt;
&lt;/pre&gt;

&lt;p&gt;Running this through the wadl tool you end up with a java class that look like this along with the relevant JAX-B classes for the schema type Bean.&lt;/p&gt;

&lt;pre name="code" class="java"&gt;
package client;

import java.util.HashMap;

import javax.annotation.Generated;

import javax.ws.rs.core.UriBuilder;

import com.example.hello.Bean;

import com.sun.jersey.api.client.Client;
import com.sun.jersey.api.client.GenericType;
import com.sun.jersey.api.client.WebResource;


/**
 *
 */
@Generated(value = { "wadl|http://localhost:7101/cr/jersey/application.wadl" },
           comments = "wadl2java, http://wadl.java.net", date = "2011-09-07T11:53:39.206+01:00")
public class Localhost_CrJersey {


    public static Localhost_CrJersey.Webservice webservice(Client client) {
        return new Localhost_CrJersey.Webservice(client);
    }

    public static Localhost_CrJersey.Webservice webservice() {
        return webservice(Client.create());
    }

    public static class Webservice {

        private Client _client;
        private UriBuilder _uriBuilder;
        private HashMap&amp;lt;String, Object&gt; _templateAndMatrixParameterValues;

        /**
         * Create new instance using existing Client instance
         *
         */
        public Webservice(Client client) {
            _client = client;
            _uriBuilder = UriBuilder.fromPath("http://localhost:7101/cr/jersey/");
            _uriBuilder = _uriBuilder.path("webservice");
            _templateAndMatrixParameterValues = new HashMap&amp;lt;String, Object&gt;();
        }

        /**
         * Create new instance
         *
         */
        public Webservice() {
            this(Client.create());
        }

        public Localhost_CrJersey.Webservice.Lang lang(String lang) {
            return new Localhost_CrJersey.Webservice.Lang(_client, lang);
        }

        public static class Lang {

            private Client _client;
            private UriBuilder _uriBuilder;
            private HashMap&amp;lt;String, Object&gt; _templateAndMatrixParameterValues;

            /**
             * Create new instance using existing Client instance
             *
             */
            public Lang(Client client, String lang) {
                _client = client;
                _uriBuilder = UriBuilder.fromPath("http://localhost:7101/cr/jersey/");
                _uriBuilder = _uriBuilder.path("webservice");
                _uriBuilder = _uriBuilder.path("{lang}");
                _templateAndMatrixParameterValues = new HashMap&amp;lt;String, Object&gt;();
                _templateAndMatrixParameterValues.put("lang", lang);
            }

            /**
             * Create new instance
             *
             */
            public Lang(String lang) {
                this(Client.create(), lang);
            }

            /**
             * Get lang
             *
             */
            public String getLang() {
                return ((String)_templateAndMatrixParameterValues.get("lang"));
            }

            /**
             * Set lang
             *
             */
            public Localhost_CrJersey.Webservice.Lang setLang(String lang) {
                _templateAndMatrixParameterValues.put("lang", lang);
                return this;
            }

            public Localhost_CrJersey.Webservice.Lang.Greeting greeting() {
                return new Localhost_CrJersey.Webservice.Lang.Greeting(_client,
                                                                       ((String)_templateAndMatrixParameterValues.get("lang")));
            }

            public static class Greeting {

                private Client _client;
                private UriBuilder _uriBuilder;
                private HashMap&amp;lt;String, Object&gt; _templateAndMatrixParameterValues;

                /**
                 * Create new instance using existing Client instance
                 *
                 */
                public Greeting(Client client, String lang) {
                    _client = client;
                    _uriBuilder = UriBuilder.fromPath("http://localhost:7101/cr/jersey/");
                    _uriBuilder = _uriBuilder.path("webservice");
                    _uriBuilder = _uriBuilder.path("{lang}");
                    _uriBuilder = _uriBuilder.path("greeting");
                    _templateAndMatrixParameterValues = new HashMap&amp;lt;String, Object&gt;();
                    _templateAndMatrixParameterValues.put("lang", lang);
                }

                /**
                 * Create new instance
                 *
                 */
                public Greeting(String lang) {
                    this(Client.create(), lang);
                }

                /**
                 * Get lang
                 *
                 */
                public String getLang() {
                    return ((String)_templateAndMatrixParameterValues.get("lang"));
                }

                /**
                 * Set lang
                 *
                 */
                public Localhost_CrJersey.Webservice.Lang.Greeting setLang(String lang) {
                    _templateAndMatrixParameterValues.put("lang", lang);
                    return this;
                }

                public Bean getAsBean() {
                    UriBuilder localUriBuilder = _uriBuilder.clone();
                    WebResource resource =
                        _client.resource(localUriBuilder.buildFromMap(_templateAndMatrixParameterValues));
                    WebResource.Builder resourceBuilder = resource.getRequestBuilder();
                    resourceBuilder = resourceBuilder.accept("*/*");
                    return resourceBuilder.method("GET", Bean.class);
                }

                public &amp;lt;T&gt; T getAs(GenericType&amp;lt;T&gt; returnType) {
                    UriBuilder localUriBuilder = _uriBuilder.clone();
                    WebResource resource =
                        _client.resource(localUriBuilder.buildFromMap(_templateAndMatrixParameterValues));
                    WebResource.Builder resourceBuilder = resource.getRequestBuilder();
                    resourceBuilder = resourceBuilder.accept("*/*");
                    return resourceBuilder.method("GET", returnType);
                }

                public &amp;lt;T&gt; T getAs(Class&amp;lt;T&gt; returnType) {
                    UriBuilder localUriBuilder = _uriBuilder.clone();
                    WebResource resource =
                        _client.resource(localUriBuilder.buildFromMap(_templateAndMatrixParameterValues));
                    WebResource.Builder resourceBuilder = resource.getRequestBuilder();
                    resourceBuilder = resourceBuilder.accept("*/*");
                    return resourceBuilder.method("GET", returnType);
                }

            }

        }

    }

}
&lt;/pre&gt;

&lt;p&gt;This looks little bit wordy, but things become a little bit simpler if you just look at the interface that has been generated. For example you can now access each part of the path directly using the accessor methods. In this example we are asking for just the english version of the greeting:&lt;/p&gt;

&lt;pre name="code" class="java"&gt;
public class Test
{
   public static void main(String[] args) {
 
      Bean bean = Localhost_CrJersey.webservice().lang("en").greeting().getAsBean();
      System.out.println(bean.getMessage());

   }
}
&lt;/pre&gt;

&lt;p&gt;Finally for each method that returns a JAX-B element there are also two that take Class&lt;T&gt;.class or GenericType&lt;T&gt; as parameters. This allows the client to access the ClientResponse object, or any other mapping in a way that just wasn't possible in the old API:&lt;/p&gt;

&lt;pre name="code" class="java"&gt;
public class Test
{
   public static void main(String[] args) {
 
      ClientResponse response = Localhost_CrJersey.webservice().lang("en").greeting().getAs(ClientResponse.class);
      System.out.println(response.getStatus());

   }
}
&lt;/pre&gt;

&lt;p&gt;Now this client currently has limitations in that it doesn't know about HATEOAS and you can't control the URL with deployment descriptors; but it is a start that can hopefully evolve into a more generally useful tool. Also I have played with the constructors for &lt;a href="http://java.net/projects/wadl/sources/svn/content/trunk/wadl/wadl-core/src/main/java/org/jvnet/ws/wadl2java/Wadl2Java.java?rev=308"&gt;Wadl2Java&lt;/a&gt; a little bit to make easier to integrate into IDE tooling, it is the work of a couple of afternoons to wrap this up in a wizard and integrate this into your IDE of choice.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;script src="http://www.google-analytics.com/urchin.js" type="text/javascript"&gt;
&lt;/script&gt;
&lt;script type="text/javascript"&gt;
_uacct = "UA-2176345-1";
urchinTracker();
&lt;/script&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2648073517459434852-4398661497010432053?l=kingsfleet.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/KingsfleetBlog/~4/CC3lH8mvgd4" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://kingsfleet.blogspot.com/feeds/4398661497010432053/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=2648073517459434852&amp;postID=4398661497010432053" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/2648073517459434852/posts/default/4398661497010432053?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/2648073517459434852/posts/default/4398661497010432053?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/KingsfleetBlog/~3/CC3lH8mvgd4/improvements-in-wadl-client-generator.html" title="Improvements in the WADL client generator" /><author><name>Gerard Davison</name><uri>http://www.blogger.com/profile/16521924431312439170</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="28" height="32" src="http://1.bp.blogspot.com/_wg73kpMXUVw/SR2BnEFpCHI/AAAAAAAAAGU/lvJNPVj958I/s1600-R/10680.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://kingsfleet.blogspot.com/2011/09/improvements-in-wadl-client-generator.html</feedburner:origLink></entry><entry gd:etag="W/&quot;Dk4BQHs4eyp7ImA9WhdWEk8.&quot;"><id>tag:blogger.com,1999:blog-2648073517459434852.post-7145544912659717800</id><published>2011-07-13T11:47:00.006+01:00</published><updated>2011-09-05T13:15:51.533+01:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-09-05T13:15:51.533+01:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="jax-rs" /><category scheme="http://www.blogger.com/atom/ns#" term="jersey" /><title>Auttomatic XML Schema generation for Jersey WADLs</title><content type="html">&lt;p&gt;I have been doing a little bit of work recently on Jersey implementation and one of the precursors to this has been to try to get the WADL that Jersey will generation by default to contain just a little bit more information with regards to the data being transferred. This makes it possible to help the user when generating client code and running testing tools against resources.&lt;/p&gt;

&lt;p&gt;To this end I have put together a WADL generator decorator that examines all the JAX-B classes used by the -RS application and generates a bunch of XML Schema files. This is now in &lt;a href="http://download.java.net/maven/2/com/sun/jersey/jersey-archive/1.9-SNAPSHOT/"&gt;1.9-SNAPSHOT&lt;/a&gt; which you can download from the Jersey web site in the normal way. (If you want to use the JResponse part of this you will need a build after the 13th of July)&lt;/p&gt;

&lt;p&gt;This feature is not enabled by default in 1.9; but hopefully with some good feedback and a small amount of caching I might convince the Jersey bods to make this the default. For the moment you need to create and register a WsdlGeneratorConfig class to get this to work. So your class might look like this:&lt;/p&gt;

&lt;pre name="code" class="java"&gt;
package examples;

import com.sun.jersey.api.wadl.config.WadlGeneratorConfig;
import com.sun.jersey.api.wadl.config.WadlGeneratorDescription;
import com.sun.jersey.server.wadl.generators.WadlGeneratorJAXBGrammarGenerator;

import java.util.List;

public class SchemaGenConfig extends WadlGeneratorConfig {

    @Override
    public List&amp;lt;WadlGeneratorDescription&gt; configure() {
        return generator( 
                WadlGeneratorJAXBGrammarGenerator.class   ).descriptions();
    }
}
&lt;/pre&gt;

&lt;p&gt;You then need to make this part of the initialization of the Jersey servlet, so your web.xml might looks like this:&lt;/p&gt;

&lt;pre name="code" class="xml"&gt;
&amp;lt;?xml version = '1.0' encoding = 'windows-1252'?&gt;
&amp;lt;web-app xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
         version="2.5"&gt;
  &amp;lt;servlet&gt;
    &amp;lt;servlet-name&gt;jersey&amp;lt;/servlet-name&gt;
    &amp;lt;servlet-class&gt;com.sun.jersey.spi.container.servlet.ServletContainer&amp;lt;/servlet-class&gt;
    &amp;lt;init-param&gt;
      &amp;lt;param-name&gt;com.sun.jersey.config.property.WadlGeneratorConfig&amp;lt;/param-name&gt;
      &amp;lt;param-value&gt;examples.SchemaGenConfig&amp;lt;/param-value&gt;
    &amp;lt;/init-param&gt;
    &amp;lt;load-on-startup&gt;1&amp;lt;/load-on-startup&gt;
  &amp;lt;/servlet&gt;
  &amp;lt;servlet-mapping&gt;
    &amp;lt;servlet-name&gt;jersey&amp;lt;/servlet-name&gt;
    &amp;lt;url-pattern&gt;/jersey/*&amp;lt;/url-pattern&gt;
  &amp;lt;/servlet-mapping&gt;
&amp;lt;/web-app&gt;
&lt;/pre&gt;

&lt;p&gt;For the purposes of this blog I am just going to show the three basic references to entities that the code supports. So at the moment if will obviously process classes that are directly referenced and either a return value or as the entity parameter on a method. The code also supports the Jersey specific class &lt;a href="http://jersey.java.net/nonav/apidocs/latest/jersey/com/sun/jersey/api/JResponse.html"&gt;JResponse&lt;/a&gt;, which is a subclass of Response that can have a generic parameter. (Hopefully this oversight will be fixed in &lt;a href="http://java.net/jira/browse/JAX_RS_SPEC-108"&gt;JAX-RS 2.0&lt;/a&gt;)&lt;/p&gt;

&lt;pre name="code" class="java"&gt;
package examples;

import com.sun.jersey.api.JReponse;

import examples.types.IndirectReturn;
import examples.types.SimpleParam;
import examples.types.SimpleReturn;

import javax.ws.rs.Consumes;
import javax.ws.rs.GET;
import javax.ws.rs.PUT;
import javax.ws.rs.Path;
import javax.ws.rs.Produces;

@Path("/root")
public class RootResource {
    
    @GET
    @Produces("application/simple+xml")
    public SimpleReturn get() {
        return new SimpleReturn();
    }
    
    @GET
    @Produces("application/indrect+xml")
    public JResponse&amp;lt;IndirectReturn&gt; getIndirect() {
        return JResponse.ok(new IndirectReturn() )
            .type( "application/indrect+xml" ).build();
    }
    
    @PUT
    @Consumes("application/simple+xml")
    public void put(SimpleParam param) {
        
    }
        
}
&lt;/pre&gt;

&lt;p&gt;The type classes are all pretty trivial so I won't show them here. The only important factor is that they have the &lt;tt&gt;@XmlRootElement&lt;/tt&gt; annotation on them. Although not shown here you can also use the JAX-B annotation &lt;tt&gt;@XmlSeeAlso&lt;/tt&gt; on the resource classes to reference other classes that are not directly or indirectly referenced from the resource files. The most common use case for this is when you have a subtype of a class.&lt;/p&gt;

&lt;p&gt;So enough of the java code, lets see what the WADL that is generated looks like:&lt;/p&gt;

&lt;pre name="code" class="xml"&gt;
&amp;lt;?xml version="1.0" encoding="UTF-8"?&gt;
&amp;lt;application xmlns="http://wadl.dev.java.net/2009/02"&gt;
    &amp;lt;doc xmlns:jersey="http://jersey.java.net/" jersey:generatedBy="Jersey: 1.9-SNAPSHOT 07/13/2011 11:13 AM"/&gt;
    &amp;lt;grammars&gt;
        &amp;lt;include href="application.wadl/xsd0.xsd"&gt;
            &amp;lt;doc xml:lang="en" title="Generated"/&gt;
        &amp;lt;/include&gt;
    &amp;lt;/grammars&gt;
    &amp;lt;resources base="http://localhost:7101/JerseySchemaGen-Examples-context-root/jersey/"&gt;
        &amp;lt;resource path="/root"&gt;
            &amp;lt;method name="GET" id="get"&gt;
                &amp;lt;response&gt;
                    &amp;lt;representation xmlns:ns2="urn:example"
                        mediaType="application/simple+xml" element="ns2:simpleReturn"/&gt;
                &amp;lt;/response&gt;
            &amp;lt;/method&gt;
            &amp;lt;method name="PUT" id="put"&gt;
                &amp;lt;request&gt;
                    &amp;lt;representation xmlns:ns2="urn:example"
                        mediaType="application/simple+xml" element="ns2:simpleParam"/&gt;
                &amp;lt;/request&gt;
            &amp;lt;/method&gt;
            &amp;lt;method name="GET" id="getIndirect"&gt;
                &amp;lt;response&gt;
                    &amp;lt;representation xmlns:ns2="urn:example"
                        mediaType="application/indrect+xml" element="ns2:indirectReturn"/&gt;
                &amp;lt;/response&gt;
            &amp;lt;/method&gt;
        &amp;lt;/resource&gt;
    &amp;lt;/resources&gt;
&amp;lt;/application&gt;
&lt;/pre&gt;

&lt;p&gt;In this example there is only one schema in the grammar section; but the code supports multiple schemas being generated with references between them. Let look at the schema for this example, note I did say the classes were trivial!&lt;/p&gt;

&lt;pre name="code" class="xml"&gt;
&amp;lt;?xml version="1.0" encoding="UTF-8"?&gt;
&amp;lt;xs:schema version="1.0" targetNamespace="urn:example"
    xmlns:tns="urn:example" xmlns:xs="http://www.w3.org/2001/XMLSchema"&gt;
    &amp;lt;xs:element name="indirectReturn" type="tns:indirectReturn"/&gt;
    &amp;lt;xs:element name="simpleParam" type="tns:simpleParam"/&gt;
    &amp;lt;xs:element name="simpleReturn" type="tns:simpleReturn"/&gt;
    &amp;lt;xs:complexType name="indirectReturn"&gt;
        &amp;lt;xs:sequence/&gt;
    &amp;lt;/xs:complexType&gt;
    &amp;lt;xs:complexType name="simpleReturn"&gt;
        &amp;lt;xs:sequence/&gt;
    &amp;lt;/xs:complexType&gt;
    &amp;lt;xs:complexType name="simpleParam"&gt;
        &amp;lt;xs:sequence/&gt;
    &amp;lt;/xs:complexType&gt;
&amp;lt;/xs:schema&gt;
&lt;/pre&gt;

&lt;p&gt;There is still some internal work to be done on caching; but the basics are in place. Feedback would be appreciated, particularly in cases where the code doesn't see the referenced classes. Finally thanks to Pavel Bucek for being patient as I learned the ropes.&lt;/p&gt;

&lt;p&gt;&lt;b&gt;Update 5th September 2011&lt;/b&gt; This feature has been enabled by default so you no longer have to perform any of the WadlGeneration configuration when working with 1.9 final release of Jersey.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;script src="http://www.google-analytics.com/urchin.js" type="text/javascript"&gt;
&lt;/script&gt;
&lt;script type="text/javascript"&gt;
_uacct = "UA-2176345-1";
urchinTracker();
&lt;/script&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2648073517459434852-7145544912659717800?l=kingsfleet.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/KingsfleetBlog/~4/9yZghhYY1rk" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://kingsfleet.blogspot.com/feeds/7145544912659717800/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=2648073517459434852&amp;postID=7145544912659717800" title="6 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/2648073517459434852/posts/default/7145544912659717800?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/2648073517459434852/posts/default/7145544912659717800?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/KingsfleetBlog/~3/9yZghhYY1rk/auttomatic-xml-schema-generation-for.html" title="Auttomatic XML Schema generation for Jersey WADLs" /><author><name>Gerard Davison</name><uri>http://www.blogger.com/profile/16521924431312439170</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="28" height="32" src="http://1.bp.blogspot.com/_wg73kpMXUVw/SR2BnEFpCHI/AAAAAAAAAGU/lvJNPVj958I/s1600-R/10680.jpg" /></author><thr:total>6</thr:total><feedburner:origLink>http://kingsfleet.blogspot.com/2011/07/auttomatic-xml-schema-generation-for.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DkYDRXk9eyp7ImA9WhdTEU8.&quot;"><id>tag:blogger.com,1999:blog-2648073517459434852.post-6579599328606055107</id><published>2011-07-08T11:47:00.006+01:00</published><updated>2011-07-08T12:22:54.763+01:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-07-08T12:22:54.763+01:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="java" /><title>Slightly tidier version of super-type tokens without anonymous inner classes</title><content type="html">&lt;p&gt;If you have ever used or written a fluent API eventually you have to deal with the fact that in Java generic types are erased. For example in the current Jersey client API you find the following problems:&lt;/p&gt;

&lt;pre name="code" class="java"&gt;

   // Can't do generic class literals, compile error

   List&amp;lt;Employee&gt; result = resource.get(List&amp;lt;Employee&gt;.class);

   // Code won't function as it doesn't know the generic type

   List&amp;lt;Employee&gt; result = resource.get(List.class);

&lt;/pre&gt;

&lt;p&gt;Most API's solve this using &lt;a href="http://gafter.blogspot.com/2006/12/super-type-tokens.html"&gt;Grafter's Gadget&lt;/a&gt; which creates a class where a trivial subclass bakes in the generic type. For example in REST the class in called GenericType:&lt;/p&gt;

&lt;pre name="code" class="java"&gt;

   // Creates a anonymous instance of GenericType with the generic parameters
   // baked in

   List&amp;lt;Employee&gt; result = resource.get(new GenericType&amp;lt;List&amp;lt;Employee&gt;&gt;() {});

&lt;/pre&gt;

&lt;p&gt;I have never liked this because well it is just a little bit untidy for my liking, creating an inner class for this one time use doesn't feel right. You can of course extract this to a constant; but I was looking for a better way to define a literal. It turns out that with a big of playing about you can write code to do the following:&lt;/p&gt;

&lt;pre name="code" class="java"&gt;

   private static final GenericType&amp;lt;List&amp;lt;String&gt;&gt; LIST_STRING =
           GenericType.field();

&lt;/pre&gt;

&lt;p&gt;The trick here is to examine the calling stack when creating the GenericType instance to final the class that the field be being attached to. You can then go back and work out generic type of the field is when the constants is used. Here is a rough sketch of the code integrating with the Jersey GenericType:&lt;/p&gt;

&lt;pre name="code" class="java"&gt;


public class GenericType&amp;lt;T&gt; {

    public static final &amp;lt;U&gt; GenericType&amp;lt;U&gt; field()
    {
       return new FieldGenericType&amp;lt;U&gt;();
    }

    // Rest of GenericType implementation
    // .....
}



class FieldGenericType&amp;lt;T&gt;
      extends GenericType&amp;lt;T&gt; {

    // TODO if we are not allowed to create a security manager just
    // use new Exception().getStackTraceElement() and then get hold
    // of the string name of the class
    static class ModifiedSecurityManager extends SecurityManager {

        public Class[] getClassContext() {
            return super.getClassContext();
        }
    }
    static final ModifiedSecurityManager sm = new ModifiedSecurityManager();


    /**
     * Provide an adapted version of the paramaterized type based on the
     * value of the field.
     */

    static class AdaptedParameterizedType implements ParameterizedType {

            // Find the class that created us, a few steps up the stack
            private Class owningClass = sm.getClassContext()[4];
            // The owning instances, can't be set in the constructor
            private FieldGenericType instance;
            private ParameterizedType type;

            /** Lazily create the type **/
            private ParameterizedType getType() {

                // TODO make thread safe
                //

                if (type == null) {

                    // Look for a field of type GenericType which is the same
                    // references the "instance" of the FieldGenericType
                    //

                    found:
                    for (Field field : owningClass.getDeclaredFields()) {
                        final Class&amp;lt;?&gt; fieldType = field.getType();
                        if (GenericType.class.isAssignableFrom(fieldType))
                        {
                            try {
                                field.setAccessible(true);
                                if (field.get(owningClass) == instance) {
                                    // We need the generic parameter of the GenericType class
                                    //
                                    type = (ParameterizedType)
                                            ((ParameterizedType)field.getGenericType()).getActualTypeArguments()[0];
                                }
                            } catch (IllegalArgumentException ex) {
                                Logger.getLogger(Example.class.getName()).log(Level.SEVERE, null, ex);
                            } catch (IllegalAccessException ex) {
                                Logger.getLogger(Example.class.getName()).log(Level.SEVERE, null, ex);
                            }
                        }
                    }

                    //

                    throw new Error("Cannot find the related field");
                }

                return type;
            }

            public Type[] getActualTypeArguments() {
                return getType().getActualTypeArguments();
            }

            public Type getRawType() {
                return getType().getRawType();
            }

            public Type getOwnerType() {
                return getType().getOwnerType();
            }

            public String toString() {
                return getType().toString();
            }
        }     


    public FieldGenericType() {
        super(new AdaptedParameterizedType() );

        // Inject the this value, now it has been created
        ((AdaptedParameterizedType)getType()).instance = this;


    }
}

&lt;/pre&gt;

&lt;p&gt;Perhaps not that much tidier for day to day coding; but not using anonymous inner classes just feels like the right thing to do. I guess time will tell if I actually end up using it. I can see it being very useful when trying to generate boilerplate code in an IDE.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;script src="http://www.google-analytics.com/urchin.js" type="text/javascript"&gt;
&lt;/script&gt;
&lt;script type="text/javascript"&gt;
_uacct = "UA-2176345-1";
urchinTracker();
&lt;/script&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2648073517459434852-6579599328606055107?l=kingsfleet.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/KingsfleetBlog/~4/AqrCU3g_pVE" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://kingsfleet.blogspot.com/feeds/6579599328606055107/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=2648073517459434852&amp;postID=6579599328606055107" title="2 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/2648073517459434852/posts/default/6579599328606055107?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/2648073517459434852/posts/default/6579599328606055107?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/KingsfleetBlog/~3/AqrCU3g_pVE/slightly-tidier-version-of-super-type.html" title="Slightly tidier version of super-type tokens without anonymous inner classes" /><author><name>Gerard Davison</name><uri>http://www.blogger.com/profile/16521924431312439170</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="28" height="32" src="http://1.bp.blogspot.com/_wg73kpMXUVw/SR2BnEFpCHI/AAAAAAAAAGU/lvJNPVj958I/s1600-R/10680.jpg" /></author><thr:total>2</thr:total><feedburner:origLink>http://kingsfleet.blogspot.com/2011/07/slightly-tidier-version-of-super-type.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CkcFRHw7eip7ImA9WhZaF0Q.&quot;"><id>tag:blogger.com,1999:blog-2648073517459434852.post-8166412709692212885</id><published>2011-07-04T14:17:00.010+01:00</published><updated>2011-07-04T15:33:35.202+01:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-07-04T15:33:35.202+01:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="jenkins" /><category scheme="http://www.blogger.com/atom/ns#" term="hudson" /><category scheme="http://www.blogger.com/atom/ns#" term="abbot" /><title>Off-loading your test execution using Hudson</title><content type="html">&lt;p&gt;One of the annoyances if you have a load of tests for a particular project is that running them can tie up your machine for a while. There are also sometimes consistency issues when running on different machines with different window managers and operating system versions. One thing we do is for every main hudson job we create a copy just to run the tests for a particular developer. It solves the "it runs on my machine" dilemma and frees up the developer to get on with other work. In our part of the organization running the tests on another machine is a mandatory step before merging to main.&lt;/p&gt;

&lt;p&gt;This example uses subversion; but it most likely work equally well with any other source control system with a similar interface. It also assumes that all the developers are working on branches, you are doing this right?.&lt;/p&gt;

&lt;p&gt;First of all you take a copy of you original job, in my case I am running test for the abbot project so I am starting with "abbot_SF", and create a copy of this job with a suitable postfix. In our case the job is called "abbot_SF_TestTrans". You need to first disable any normal build triggers so this job only gets used when there is a manual action. We keep the results separate as it makes the normal build results much easier to interpret.&lt;/p&gt;

&lt;p&gt;So to this new job add a new Parameter "BRANCH" of type string and update the repository URL to contain this parameter, so in my case &lt;tt&gt;https://abbot.svn.sourceforge.net/svnroot/abbot/abbot/branches/$BRANCH&lt;/tt&gt;. You will also notice that I have the used the &lt;a href="http://wiki.hudson-ci.org/display/HUDSON/Description+Setter+Plugin"&gt;description setting plugin&lt;/a&gt; to capture the branch name automatically. (You could also just put the $BRANCH parameter in the description field and leave the RegEx blank). After you have finished you have something like this, ignore the red ink as that appears to be a local configuration issue.&lt;/p&gt;

&lt;p&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/-IaaRuIF9uB8/ThHEz6qvA6I/AAAAAAAAATU/s0KeoJqFbuo/s1600/TestTransConfiguration.png"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 230px; height: 400px;" src="http://2.bp.blogspot.com/-IaaRuIF9uB8/ThHEz6qvA6I/AAAAAAAAATU/s0KeoJqFbuo/s400/TestTransConfiguration.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5625493805763330978" /&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now if you click build on the job you get a nice interface where you can ask Hudson to build a particular branch, leaving the developer to get on with the next job while the build machine does it's business.&lt;/p&gt;

&lt;p&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/-tl1G3AuCZiQ/ThHFlxrKWLI/AAAAAAAAATc/Wio_s5Yaa4I/s1600/Build.png"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 400px; height: 159px;" src="http://1.bp.blogspot.com/-tl1G3AuCZiQ/ThHFlxrKWLI/AAAAAAAAATc/Wio_s5Yaa4I/s400/Build.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5625494662342662322" /&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Speaking of that, it looks like I have some bugs to fix...&lt;/p&gt;

&lt;p&gt;P.S. You might also want to tick the "Execute Concurrent Builds if necessary" flag so that if you have more than one developer you can make proper use of your farm.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;script src="http://www.google-analytics.com/urchin.js" type="text/javascript"&gt;
&lt;/script&gt;
&lt;script type="text/javascript"&gt;
_uacct = "UA-2176345-1";
urchinTracker();
&lt;/script&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2648073517459434852-8166412709692212885?l=kingsfleet.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/KingsfleetBlog/~4/l2xQhtL95zU" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://kingsfleet.blogspot.com/feeds/8166412709692212885/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=2648073517459434852&amp;postID=8166412709692212885" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/2648073517459434852/posts/default/8166412709692212885?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/2648073517459434852/posts/default/8166412709692212885?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/KingsfleetBlog/~3/l2xQhtL95zU/off-loading-your-test-running-using.html" title="Off-loading your test execution using Hudson" /><author><name>Gerard Davison</name><uri>http://www.blogger.com/profile/16521924431312439170</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="28" height="32" src="http://1.bp.blogspot.com/_wg73kpMXUVw/SR2BnEFpCHI/AAAAAAAAAGU/lvJNPVj958I/s1600-R/10680.jpg" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://2.bp.blogspot.com/-IaaRuIF9uB8/ThHEz6qvA6I/AAAAAAAAATU/s0KeoJqFbuo/s72-c/TestTransConfiguration.png" height="72" width="72" /><thr:total>0</thr:total><feedburner:origLink>http://kingsfleet.blogspot.com/2011/07/off-loading-your-test-running-using.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DU4EQHk7fCp7ImA9WhZbEUk.&quot;"><id>tag:blogger.com,1999:blog-2648073517459434852.post-1205649000398463126</id><published>2011-06-15T14:06:00.006+01:00</published><updated>2011-06-15T15:25:01.704+01:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-06-15T15:25:01.704+01:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="spring" /><category scheme="http://www.blogger.com/atom/ns#" term="WeblogicSCA" /><category scheme="http://www.blogger.com/atom/ns#" term="jdeveloper" /><category scheme="http://www.blogger.com/atom/ns#" term="http analyzer" /><title>Working around the need for a network connection in Spring and WebLogic SCA tooling in JDeveloper</title><content type="html">&lt;p&gt;Unfortunately the Spring tooling we have in JDeveloper 11.1.2 and PS5 contains a bug where it will try to access the network for a .dtd in order to validate the xml files. If you are running the HTTP Analyzer you might see something like the following:&lt;/p&gt;

&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/-YT6jQarhJh0/Tfi-f7ANvTI/AAAAAAAAATM/qyTfR57E3qw/s1600/1.%2BCaptureTraffic.png"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 400px; height: 250px;" src="http://3.bp.blogspot.com/-YT6jQarhJh0/Tfi-f7ANvTI/AAAAAAAAATM/qyTfR57E3qw/s400/1.%2BCaptureTraffic.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5618449990768508210" /&gt;&lt;/a&gt;

&lt;p&gt;This is fine if you have a network connection, if annoying, but with a timeout of 5 minutes in some cases it can be really annoying if you are trying to work where you cannot see the internet as a whole.&lt;/p&gt;

&lt;p&gt;We are going to use a feature of the HTTP Analyzer to use a recording of this response to pretend to be the service in question. For of all we need a log file that contains the response in question, so select the message and press the save button:&lt;/p&gt;

&lt;p&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/-qtQUJzy-VHo/Tfi-fpK5qnI/AAAAAAAAATE/-F5bPSYNNbI/s1600/2.%2BSave%2Blog%2Bfile.png"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 400px; height: 253px;" src="http://2.bp.blogspot.com/-qtQUJzy-VHo/Tfi-fpK5qnI/AAAAAAAAATE/-F5bPSYNNbI/s400/2.%2BSave%2Blog%2Bfile.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5618449985981491826" /&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Then we have to create a Tape Rule which allows the analyzer to respond using messages from a log file in response to request to a particular URL:&lt;/p&gt;

&lt;p&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/-8ss-3DT-t_E/Tfi-fb06MfI/AAAAAAAAAS8/src8urLlmFk/s1600/3.%2BCreate%2Btape%2BRule.png"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 400px; height: 252px;" src="http://2.bp.blogspot.com/-8ss-3DT-t_E/Tfi-fb06MfI/AAAAAAAAAS8/src8urLlmFk/s400/3.%2BCreate%2Btape%2BRule.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5618449982399590898" /&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;You need to set up the rule as follows, note the reference URL is not part of the definition; but can be used to validate the rule filter settings.&lt;/p&gt;

&lt;p&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/-fUAuUhN-hbE/Tfi-e6gJvdI/AAAAAAAAAS0/KgBu00rWk1Y/s1600/4.%2BRule%2Bsettings.png"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 400px; height: 175px;" src="http://3.bp.blogspot.com/-fUAuUhN-hbE/Tfi-e6gJvdI/AAAAAAAAAS0/KgBu00rWk1Y/s400/4.%2BRule%2Bsettings.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5618449973454159314" /&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;And you should be good to go, next time you start up JDeveloper start the HTTP Analyzer first, and you should see that the messages are being provided by the tape rule rather than the network.&lt;/p&gt;

&lt;p&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/-hquXmVRRRm8/Tfi-ekiGUwI/AAAAAAAAASs/r7MoqXXO6e8/s1600/5.%2BRule%2Bworking.png"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 400px; height: 250px;" src="http://3.bp.blogspot.com/-hquXmVRRRm8/Tfi-ekiGUwI/AAAAAAAAASs/r7MoqXXO6e8/s400/5.%2BRule%2Bworking.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5618449967556743938" /&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;We don't have a handy way to start the analyzer when the tool does; so you have to be careful not to have any open editors. But for some cases this is going to be a useful workaround.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;script src="http://www.google-analytics.com/urchin.js" type="text/javascript"&gt;
&lt;/script&gt;
&lt;script type="text/javascript"&gt;
_uacct = "UA-2176345-1";
urchinTracker();
&lt;/script&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2648073517459434852-1205649000398463126?l=kingsfleet.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/KingsfleetBlog/~4/pOJuIUK-yI8" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://kingsfleet.blogspot.com/feeds/1205649000398463126/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=2648073517459434852&amp;postID=1205649000398463126" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/2648073517459434852/posts/default/1205649000398463126?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/2648073517459434852/posts/default/1205649000398463126?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/KingsfleetBlog/~3/pOJuIUK-yI8/working-around-need-for-network.html" title="Working around the need for a network connection in Spring and WebLogic SCA tooling in JDeveloper" /><author><name>Gerard Davison</name><uri>http://www.blogger.com/profile/16521924431312439170</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="28" height="32" src="http://1.bp.blogspot.com/_wg73kpMXUVw/SR2BnEFpCHI/AAAAAAAAAGU/lvJNPVj958I/s1600-R/10680.jpg" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://3.bp.blogspot.com/-YT6jQarhJh0/Tfi-f7ANvTI/AAAAAAAAATM/qyTfR57E3qw/s72-c/1.%2BCaptureTraffic.png" height="72" width="72" /><thr:total>0</thr:total><feedburner:origLink>http://kingsfleet.blogspot.com/2011/06/working-around-need-for-network.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CE4AQns6eip7ImA9WhZVFE0.&quot;"><id>tag:blogger.com,1999:blog-2648073517459434852.post-3363760193726390165</id><published>2011-05-25T15:56:00.004+01:00</published><updated>2011-05-26T10:42:23.512+01:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-05-26T10:42:23.512+01:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="jax-rs" /><category scheme="http://www.blogger.com/atom/ns#" term="jersey" /><title>Jersey issue when running with ADF / Oracle XDK</title><content type="html">&lt;p&gt;We have discovered a late breaking bug in WLS that prevents Jersey applications from de-serializing XML and in some cases JSON documents. (So GET will work but PUT or POST will fail) This currently affects JDeveloper 11.1.1.5.0 aka PS4. You might see an exception that looks like this:&lt;/p&gt;

&lt;pre name="code" class="java"&gt;
javax.xml.parsers.FactoryConfigurationError: WebLogicSAXParser
cannot be created.SAX feature
&amp;#39;
http://xml.org/sax/features/external-general-entities'
not
supported.
at weblogic.xml.jaxp.RegistrySAXParser.&amp;lt;init&gt;(RegistrySAXParser.java:73)
at weblogic.xml.jaxp.RegistrySAXParser.&amp;lt;init&gt;(RegistrySAXParser.java:46)
at
weblogic.xml.jaxp.RegistrySAXParserFactory.newSAXParser(RegistrySAXParserFacto
ry.java:91) 
...
&lt;/pre&gt;

&lt;p&gt;When you create ADF components in an application you will find that at the .EAR level a weblogic-application.xml is created at deployment time which override the default WLS xml parser version to use the Oracle XDK version. You might see something like this:&lt;/p&gt;

&lt;pre name="code" class="xml"&gt;
&amp;lt;parser-factory&gt;
&amp;lt;saxparser-factory&gt;oracle.xml.jaxp.JXSAXParserFactory&amp;lt;/saxparser-factory&gt;
&amp;lt;document-builder-factory&gt;oracle.xml.jaxp.JXDocumentBuilderFactory&amp;lt;/document-builder-factory&gt;
&amp;lt;transformer-factory&gt;oracle.xml.jaxp.JXSAXTransformerFactory&amp;lt;/transformer-factory&gt;
&amp;lt;/parser-factory&gt;
&lt;/pre&gt;

&lt;p&gt;When Jersey tries to convert a document to JAX-B classes it sensible sets a feature on the XML parser that prevents resolving external entities to prevent certain security attacks. This code in SAXParserContentProvider does understand that some parser don't support this feature as you can see:&lt;/p&gt;

&lt;pre name="code" class="xml"&gt;
    @Override
    protected SAXParserFactory getInstance() {
        SAXParserFactory f = SAXParserFactory.newInstance();

        f.setNamespaceAware(true);
        
        if (!disableXmlSecurity) {
            try {
                f.setFeature("http://xml.org/sax/features/external-general-entities", Boolean.FALSE);
            } catch (Exception ex) {
                throw new RuntimeException("Security features for the SAX parser could not be enabled",  ex);
            }

            try {
                f.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, Boolean.TRUE);
            } catch (Exception ex) {
                LOGGER.log(Level.WARNING, 
                        "JAXP feature XMLConstants.FEATURE_SECURE_PROCESSING cannot be set on a SAXParserFactory. " +
                        "External general entity processing is disbaled but other potential securty related" +
                        " features will not be enabled.", 
                        ex);
            }
        }

        return f;
    }
&lt;/pre&gt;

&lt;p&gt;This would normally be the end of it if it was not for bug 12543845, where the invalid features is incorrectly stored prevent the future creation of any parsers.&lt;/p&gt;

&lt;p&gt;Luckily there is a workaround in Jersey, you can simply set this using a Servlet init param as follows:&lt;/p&gt;

&lt;pre name="code" class="xml"&gt;
  &amp;lt;servlet&gt;
    &amp;lt;servlet-name&gt;jersey&amp;lt;/servlet-name&gt;
    &amp;lt;servlet-class&gt;com.sun.jersey.
spi.container.servlet.ServletContainer&amp;lt;/servlet-class&gt;
   &amp;lt;init-param&gt;

&amp;lt;param-name&gt;com.sun.jersey.config.feature.DisableXmlSecurity&amp;lt;/param-name&gt;
      &amp;lt;param-value&gt;true&amp;lt;/param-value&gt;
    &amp;lt;/init-param&gt;
    &amp;lt;load-on-startup&gt;1&amp;lt;/load-on-startup&gt;
  &amp;lt;/servlet&gt; 
&lt;/pre&gt;

&lt;p&gt;Be careful not to apply this property when you are not using the XDK parser otherwise you might open yourself up to a range of attacks which is not going to be a good thing.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;script src="http://www.google-analytics.com/urchin.js" type="text/javascript"&gt;
&lt;/script&gt;
&lt;script type="text/javascript"&gt;
_uacct = "UA-2176345-1";
urchinTracker();
&lt;/script&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2648073517459434852-3363760193726390165?l=kingsfleet.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/KingsfleetBlog/~4/ymyLJuMcxQQ" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://kingsfleet.blogspot.com/feeds/3363760193726390165/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=2648073517459434852&amp;postID=3363760193726390165" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/2648073517459434852/posts/default/3363760193726390165?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/2648073517459434852/posts/default/3363760193726390165?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/KingsfleetBlog/~3/ymyLJuMcxQQ/jersey-issue-when-running-with-adf.html" title="Jersey issue when running with ADF / Oracle XDK" /><author><name>Gerard Davison</name><uri>http://www.blogger.com/profile/16521924431312439170</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="28" height="32" src="http://1.bp.blogspot.com/_wg73kpMXUVw/SR2BnEFpCHI/AAAAAAAAAGU/lvJNPVj958I/s1600-R/10680.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://kingsfleet.blogspot.com/2011/05/jersey-issue-when-running-with-adf.html</feedburner:origLink></entry><entry gd:etag="W/&quot;C0UCR3s5cCp7ImA9WhZWEE4.&quot;"><id>tag:blogger.com,1999:blog-2648073517459434852.post-2268103152952527308</id><published>2011-05-10T13:20:00.004+01:00</published><updated>2011-05-10T13:41:06.528+01:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-05-10T13:41:06.528+01:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="jax-ws" /><category scheme="http://www.blogger.com/atom/ns#" term="jdeveloper" /><category scheme="http://www.blogger.com/atom/ns#" term="webservices" /><title>JDeveloper, the Endorsed Directory, bootclasspath, and JAX-WS 2.2.x</title><content type="html">&lt;p&gt;I have been working with JAX-WS 2.2.x recently and one of problem you might fact whilst playing with a client is that it uses more recent version of the JAX-WS API than that supplied with JDK 1.6. This shouldn't be a problem normally but there are some issues that might get in your way when using JDeveloper.&lt;/p&gt;

&lt;p&gt;The first thing to note is that I am going to ignore the &lt;a href="http://download.oracle.com/javase/1.5.0/docs/guide/standards/index.html"&gt;standard advice&lt;/a&gt; to user the java.endorsed.dirs system property as it can only specify a directory and not individual  jar files. This is not always a problem; but if your jars are not packaged in a convenient way it means you have to move then to a new directory. Instead I am going for the slightly less standard -Xbootclasspath/p: property which prepends the jars to the boot classpath with much the same effect and I can specify the paths to individual jars. I will note with the screen grabs where you might go differently if you want to ignore this advice.&lt;/p&gt;

&lt;p&gt;First things first you need to configure the compiler otherwise when you try to compile a web services client, in this case, you find error messages relating to the constructors on the Service class. You can find these settings under project properties. You could use the -endorsedpath here if you wish. For my purposes I had to place both the jax-xml-bind.jar and jax-xml-ws.jar on the bootclasspath. Of course use you platform specific path separator between the two paths. (If you are doing JAX-WS you are going to need the matching version of JAX-B)&lt;/p&gt;

&lt;p&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/-no14Rmoz8YE/TckvxnmnOlI/AAAAAAAAASg/WHhzSBnmh_E/s1600/PathSettings.png"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 400px; height: 296px;" src="http://1.bp.blogspot.com/-no14Rmoz8YE/TckvxnmnOlI/AAAAAAAAASg/WHhzSBnmh_E/s400/PathSettings.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5605063740730325586" /&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Unfortunately you might find that this point that the project will fail to compile due to bug 12538161, there is a workaround which is to ask the compilation to happen as a separate process. This is going to be slightly slower; but in most cases you are not going to notice the difference.&lt;/p&gt; 

&lt;p&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/-_Un7gV8vsEU/TckvxVMDQII/AAAAAAAAASY/K8tkU9Rl_hk/s1600/OutOfProcess.png"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 400px; height: 297px;" src="http://4.bp.blogspot.com/-_Un7gV8vsEU/TckvxVMDQII/AAAAAAAAASY/K8tkU9Rl_hk/s400/OutOfProcess.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5605063735787077762" /&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Depending on your deployment context you might also like to update the run options for the your project, again I have used the bootclasspath but you could use the -Djava.endorsed.dirs depending on how you dependencies are laid out.&lt;/p&gt;

&lt;p&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/-Gd1U4-VWZvk/TckvxFq_J9I/AAAAAAAAASQ/jsUuWiUWJwk/s1600/RunOptions.png"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 400px; height: 295px;" src="http://3.bp.blogspot.com/-Gd1U4-VWZvk/TckvxFq_J9I/AAAAAAAAASQ/jsUuWiUWJwk/s400/RunOptions.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5605063731621865426" /&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;You can compile and run against the new API which will solve 99% of problem in the area. Fortunately only a few Java API's are packaged in this way. Hopefully in JDK 8 we can get the modularization sorted out so this sort of thing will be less of a problem.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;script src="http://www.google-analytics.com/urchin.js" type="text/javascript"&gt;
&lt;/script&gt;
&lt;script type="text/javascript"&gt;
_uacct = "UA-2176345-1";
urchinTracker();
&lt;/script&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2648073517459434852-2268103152952527308?l=kingsfleet.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/KingsfleetBlog/~4/c4I3F-jyG-M" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://kingsfleet.blogspot.com/feeds/2268103152952527308/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=2648073517459434852&amp;postID=2268103152952527308" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/2648073517459434852/posts/default/2268103152952527308?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/2648073517459434852/posts/default/2268103152952527308?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/KingsfleetBlog/~3/c4I3F-jyG-M/jdeveloper-endorsed-directory.html" title="JDeveloper, the Endorsed Directory, bootclasspath, and JAX-WS 2.2.x" /><author><name>Gerard Davison</name><uri>http://www.blogger.com/profile/16521924431312439170</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="28" height="32" src="http://1.bp.blogspot.com/_wg73kpMXUVw/SR2BnEFpCHI/AAAAAAAAAGU/lvJNPVj958I/s1600-R/10680.jpg" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://1.bp.blogspot.com/-no14Rmoz8YE/TckvxnmnOlI/AAAAAAAAASg/WHhzSBnmh_E/s72-c/PathSettings.png" height="72" width="72" /><thr:total>0</thr:total><feedburner:origLink>http://kingsfleet.blogspot.com/2011/05/jdeveloper-endorsed-directory.html</feedburner:origLink></entry><entry gd:etag="W/&quot;D0AERn86fip7ImA9WhZRFU4.&quot;"><id>tag:blogger.com,1999:blog-2648073517459434852.post-2456176081819410168</id><published>2011-04-11T15:58:00.007+01:00</published><updated>2011-04-11T16:28:27.116+01:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-04-11T16:28:27.116+01:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="jax-ws" /><category scheme="http://www.blogger.com/atom/ns#" term="jdeveloper" /><category scheme="http://www.blogger.com/atom/ns#" term="webservices" /><title>Generating an inline schema in JDeveloper</title><content type="html">&lt;p&gt;A question that comes up now and then is how to generate a WSDL with the Schema in-line rather than as a separate file. This is required for certain mobile platforms and in particular Siebel Tools. This feature wasn't added to the JAX-WS RI until version &lt;a href="http://java.net/jira/browse/JAX_WS-85"&gt;2.2.1&lt;/a&gt; which is ahead of the version use in JDeveloper. It is possible to get some integration using the external tools command to make use of a later version of this tool in JDeveloper.&lt;/p&gt;

&lt;p&gt;To get this to work you first need to download JAX-WS RI &lt;a href="http://jax-ws.java.net/2.2.1/"&gt;2.2.1&lt;/a&gt; or later. The configuration is similar to what we have used previously &lt;a href="/2008/05/running-wsgen-easily-from-within.html"&gt;on this blog&lt;/a&gt; with a few specific modifications.&lt;/p&gt;

&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/-KVbWHRJ6T-M/TaMZbrLSokI/AAAAAAAAAR4/H6Hk-S7TCaU/s1600/InlineSchema.png"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 400px; height: 294px;" src="http://2.bp.blogspot.com/-KVbWHRJ6T-M/TaMZbrLSokI/AAAAAAAAAR4/H6Hk-S7TCaU/s400/InlineSchema.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5594343125361533506" /&gt;&lt;/a&gt;

&lt;p&gt;The program executable is simply the location of the wsgen.sh or wsget.bat file that comes with the RI download. The second line is more complicated:&lt;/p&gt;

&lt;pre name="code" class="java"&gt;
-Xendorsed -d ${project.outputdirectory} -s ${project.outputdirectory} -cp ${project.outputdirectory};${project.classpath} ${target.class} -r ${file.dir} -wsdl  -inlineSchemas
&lt;/pre&gt;

&lt;p&gt;Reading left to right we are: making sure we used the endorsed property to use the updated API; specifying the project classes directory for any output; specifying the project classpath; the class name from the current selection; where the wsdl file should be written out, the same one as the java file; and finally that we want to generate a wsdl and that it should be inline.&lt;/p&gt;

&lt;p&gt;In the rest of the wizard you are likely to want to configure the tool to appear in the navigator and only appear for java source files. All pretty vanilla stuff. Once this is configured you should have a menu item you can invoke from the JDeveloper UI. After you invoke this action if you didn't check re-load external tools in the wizard you need to press the refresh button to see any changes.&lt;/p&gt;

&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/-TPJW5Wgneew/TaMaoi_ifZI/AAAAAAAAASA/HXFk5haFlJs/s1600/InlineSchema1.png"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 400px; height: 189px;" src="http://2.bp.blogspot.com/-TPJW5Wgneew/TaMaoi_ifZI/AAAAAAAAASA/HXFk5haFlJs/s400/InlineSchema1.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5594344446014684562" /&gt;&lt;/a&gt;

&lt;p&gt;There is one remaining manual step and that is to associate the wsdl with the source file, to do this you simply need to update the wsdlLocation attribute:&lt;/p&gt;

&lt;pre name="code" class="java"&gt;
package webservice;

import javax.jws.WebService;

@WebService(wsdlLocation = "/webservice/HelloService.wsdl")
public class Hello {
    public String hello(String name) {
        return "";
    }
}
&lt;/pre&gt;

&lt;p&gt;This will now deploy with the new compact all in one wsdl document. JDeveloper will notice you have a file and tell you if the files get out of sync; but you will of course need to use your external tool command otherwise you will loose your in-line schema.&lt;/p&gt;

&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/-CpvEXM1IS8s/TaMbk4J-VuI/AAAAAAAAASI/CcSO6h71gqc/s1600/InlineSchema2.png"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 400px; height: 135px;" src="http://3.bp.blogspot.com/-CpvEXM1IS8s/TaMbk4J-VuI/AAAAAAAAASI/CcSO6h71gqc/s400/InlineSchema2.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5594345482487748322" /&gt;&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;script src="http://www.google-analytics.com/urchin.js" type="text/javascript"&gt;
&lt;/script&gt;
&lt;script type="text/javascript"&gt;
_uacct = "UA-2176345-1";
urchinTracker();
&lt;/script&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2648073517459434852-2456176081819410168?l=kingsfleet.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/KingsfleetBlog/~4/pXTSF_SZQJ4" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://kingsfleet.blogspot.com/feeds/2456176081819410168/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=2648073517459434852&amp;postID=2456176081819410168" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/2648073517459434852/posts/default/2456176081819410168?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/2648073517459434852/posts/default/2456176081819410168?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/KingsfleetBlog/~3/pXTSF_SZQJ4/generating-inline-schema-in-jdeveloper.html" title="Generating an inline schema in JDeveloper" /><author><name>Gerard Davison</name><uri>http://www.blogger.com/profile/16521924431312439170</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="28" height="32" src="http://1.bp.blogspot.com/_wg73kpMXUVw/SR2BnEFpCHI/AAAAAAAAAGU/lvJNPVj958I/s1600-R/10680.jpg" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://2.bp.blogspot.com/-KVbWHRJ6T-M/TaMZbrLSokI/AAAAAAAAAR4/H6Hk-S7TCaU/s72-c/InlineSchema.png" height="72" width="72" /><thr:total>0</thr:total><feedburner:origLink>http://kingsfleet.blogspot.com/2011/04/generating-inline-schema-in-jdeveloper.html</feedburner:origLink></entry><entry gd:etag="W/&quot;AkQMRXY7fyp7ImA9Wx5QGEo.&quot;"><id>tag:blogger.com,1999:blog-2648073517459434852.post-6023462499394522018</id><published>2010-09-03T18:22:00.015+01:00</published><updated>2010-09-07T17:53:04.807+01:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-09-07T17:53:04.807+01:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="java" /><category scheme="http://www.blogger.com/atom/ns#" term="jdeveloper" /><title>Getting more out of your debugger with remote options</title><content type="html">&lt;p&gt;&lt;b&gt;Introduction&lt;/b&gt;&lt;/p&gt;

&lt;p&gt;I bet day to day most people use the built in direct debugger in your IDE. You press a button and everything is done for you. This won't help you if the start up configuration is non trivial, in the case of weblogic for example where you have to run a script, or the process has to run on another machine. In the remote section there are a number of options that are pretty interesting as far as dealing with certain corner cases. I had cause to use some of them recently to track down a particularly hard to reproduce bug and realized that some are actually applicable to day to day work.&lt;/p&gt;

&lt;p&gt;All the screen grabs are from JDeveloper; but the concepts should work equally well with other tools.&lt;/p&gt;

&lt;p&gt;&lt;b&gt;Normal remote debugging.&lt;/b&gt;&lt;/p&gt;

&lt;p&gt;JDeveloper at least doesn't come with a remote run profile configured by default but it is really quick to set one up from the project properties dialog. In the Run/Debug/Profile configuration page create a new entry:&lt;/p&gt;

&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_wg73kpMXUVw/TIY8rZ4jwfI/AAAAAAAAAQo/LkVA-vdFdBs/s1600/1.+Create+Debug+Run+Configuration.png"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 400px; height: 294px;" src="http://1.bp.blogspot.com/_wg73kpMXUVw/TIY8rZ4jwfI/AAAAAAAAAQo/LkVA-vdFdBs/s400/1.+Create+Debug+Run+Configuration.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5514161510141903346" /&gt;&lt;/a&gt;

&lt;p&gt;Then edit the properties so that JDeveloper knows you are doing remote debugging:&lt;/p&gt;

&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_wg73kpMXUVw/TIY8qiTpk7I/AAAAAAAAAQg/nMliGjj_Zko/s1600/2.+Configure+as+Remote.png"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 400px; height: 300px;" src="http://4.bp.blogspot.com/_wg73kpMXUVw/TIY8qiTpk7I/AAAAAAAAAQg/nMliGjj_Zko/s400/2.+Configure+as+Remote.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5514161495223145394" /&gt;&lt;/a&gt;

&lt;p&gt;Then you can select this profile to debug:&lt;/p&gt;

&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_wg73kpMXUVw/TIY8qWQzI0I/AAAAAAAAAQY/kBu8H_T27GU/s1600/3+Run+the+debugger.png"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 293px; height: 185px;" src="http://1.bp.blogspot.com/_wg73kpMXUVw/TIY8qWQzI0I/AAAAAAAAAQY/kBu8H_T27GU/s400/3+Run+the+debugger.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5514161491989963586" /&gt;&lt;/a&gt;

&lt;p&gt;The first time the debugger runs you will see this connect dialog, for most local debugging work the settings can stay the same so check the box so you don't get asked each time. You might want to consider increasing the timeout a little bit for convenience.&lt;/p&gt;

&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_wg73kpMXUVw/TIY8qAxqn9I/AAAAAAAAAQQ/9CyzFgnOgrw/s1600/3.+Connect+Dialog.png"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 400px; height: 294px;" src="http://3.bp.blogspot.com/_wg73kpMXUVw/TIY8qAxqn9I/AAAAAAAAAQQ/9CyzFgnOgrw/s400/3.+Connect+Dialog.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5514161486222237650" /&gt;&lt;/a&gt;

&lt;p&gt;So you need to run your java process with the, erm, simple command line option as follows. Not the easiest to remember string; but I guess "alias" is your friend.&lt;/p&gt;

&lt;pre name="code" class="java"&gt;java -agentlib:jdwp=transport=dt_socket,server=y,address=4000 ...&lt;/pre&gt;

&lt;p&gt;Right so that is the basics, lets try some of the more interesting options.&lt;/p&gt;

&lt;p&gt;&lt;b&gt;Start and connect later&lt;/b&gt;&lt;/p&gt;

&lt;p&gt;In the default mode for the debugger the debuggee process won't start until until the IDE tells it to, and will quit when the debugger stops. This is really annoying if you are trying to debug a remote instance of weblogic server and want to keep it running between sessions. (For example if you configured another server to use instead of the &lt;a href="/2009/02/configuring-jdeveloper-to-use-different.html"&gt;integrated one&lt;/a&gt;, I am looking at you Chris Muir) Or if you forget to start the debugger and everything is just sitting there waiting for you to wake up.&lt;/p&gt;

&lt;p&gt;So you can use the "suspend=n" flag, this means that the target task will start; but allow you to connect a debugger later:&lt;/p&gt;

&lt;pre name="code" class="java"&gt;java -agentlib:jdwp=transport=dt_socket,server=y,address=4000,suspend=n ...&lt;/pre&gt;


&lt;p&gt;You run the remote debugger in the normal way; but when you "Stop" the debugger you now have a choice to either let the process continue running or to kill it:&lt;/p&gt;

&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_wg73kpMXUVw/TIZBff4j_LI/AAAAAAAAAQw/TZVnhjaTwtM/s1600/5.+Terminate+Debugging+Session.png"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 400px; height: 369px;" src="http://1.bp.blogspot.com/_wg73kpMXUVw/TIZBff4j_LI/AAAAAAAAAQw/TZVnhjaTwtM/s400/5.+Terminate+Debugging+Session.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5514166803152239794" /&gt;&lt;/a&gt;

&lt;p&gt;This allows you to leave infrastructure running, most like a server, whilst still be able to connect on demand to debug.&lt;/p&gt;

&lt;p&gt;&lt;b&gt;Have debugger always running, get the debuggee to connect back&lt;/b&gt;&lt;/p&gt;

&lt;p&gt;The previous two configurations both require at least two step processes for each debugging session. You have to start the debugger and debuggee. This can be really annoying particularly if you are trying to debug a hard to reproduce problem that requires the target VM to be stopped and started many times.&lt;/p&gt;

&lt;p&gt;Luckily there is a setting that allows the debuggee to connect to the debugger at start up. The debugger on the IDE only needs to be started once to listen for events. This takes a bit more to set up so lets start at the IDE end and create a new Run/Debug/Remote entry:&lt;/p&gt;

&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_wg73kpMXUVw/TIZFjXLWY0I/AAAAAAAAARY/iq6hvNa_4M8/s1600/6.+Listen+run+configuration.png"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 400px; height: 292px;" src="http://4.bp.blogspot.com/_wg73kpMXUVw/TIZFjXLWY0I/AAAAAAAAARY/iq6hvNa_4M8/s400/6.+Listen+run+configuration.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5514171267581109058" /&gt;&lt;/a&gt;

&lt;p&gt;In the properties for "Remote - listener" change to be a JPDA listener rather than the normal attach mode:&lt;/p&gt;

&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_wg73kpMXUVw/TIZFjI0gcPI/AAAAAAAAARQ/IRtdDvOItJ4/s1600/7.+Configure+as+a+listener.png"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 400px; height: 337px;" src="http://1.bp.blogspot.com/_wg73kpMXUVw/TIZFjI0gcPI/AAAAAAAAARQ/IRtdDvOItJ4/s400/7.+Configure+as+a+listener.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5514171263727202546" /&gt;&lt;/a&gt;

&lt;p&gt;Also set the timeout to zero so it listens for-ever and use a different port so that it won't clash with normal debug sessions. (Minor mistake in screen grab, the combobox is showing the wrong value use the value in the previous grab)&lt;/p&gt;

&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_wg73kpMXUVw/TIZFi6I6kwI/AAAAAAAAARI/zKdxJpGqwmM/s1600/8.+Alter+port+number.png"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 400px; height: 286px;" src="http://2.bp.blogspot.com/_wg73kpMXUVw/TIZFi6I6kwI/AAAAAAAAARI/zKdxJpGqwmM/s400/8.+Alter+port+number.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5514171259786269442" /&gt;&lt;/a&gt;

&lt;p&gt;Now you just have to run this profile in the normal way, and instead of the debugger starting you should see this listener active in the Run Manager.&lt;/p&gt;

&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_wg73kpMXUVw/TIZFiqJLIqI/AAAAAAAAARA/prSeBROXyrw/s1600/9.+Debug+Listener+Started.png"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 365px; height: 241px;" src="http://2.bp.blogspot.com/_wg73kpMXUVw/TIZFiqJLIqI/AAAAAAAAARA/prSeBROXyrw/s400/9.+Debug+Listener+Started.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5514171255492387490" /&gt;&lt;/a&gt;

&lt;p&gt;So the next step to to run the task you want to debug notice the server flag has gone and we have specified the new port:&lt;/p&gt;

&lt;pre name="code" class="java"&gt;java -agentlib:jdwp=transport=dt_socket,address=localhost:5000 ...&lt;/pre&gt;

&lt;p&gt;In JDeveloper the debugger will start up and then run in the normal way:&lt;/p&gt;

&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_wg73kpMXUVw/TIZFiS0NbgI/AAAAAAAAAQ4/ZdT2JszbpQ4/s1600/10+Debugger+starts+automatically.png"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 400px; height: 247px;" src="http://3.bp.blogspot.com/_wg73kpMXUVw/TIZFiS0NbgI/AAAAAAAAAQ4/ZdT2JszbpQ4/s400/10+Debugger+starts+automatically.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5514171249230441986" /&gt;&lt;/a&gt;

&lt;p&gt;You can start multiple sessions at the same time with difference instances of the program you are trying to debug. It can get kind confusing though. It does mean that starting the debuggee is a one step process which seems to save me some vital thinking seconds that I could be applied to the problem in hand.&lt;/p&gt;

&lt;p&gt;At some point you may wish to shut down the listener, for completeness you can do this from the run manager:&lt;/p&gt;

&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_wg73kpMXUVw/TIZHo5gZ9DI/AAAAAAAAARg/ddG7Q-El-XE/s1600/11+Stopping+the+listener.png"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 400px; height: 287px;" src="http://1.bp.blogspot.com/_wg73kpMXUVw/TIZHo5gZ9DI/AAAAAAAAARg/ddG7Q-El-XE/s400/11+Stopping+the+listener.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5514173561718830130" /&gt;&lt;/a&gt;

&lt;p&gt;One little twist is like in normal mode you can use the "suspect=n" option to allow you to disconnect the debugger process. Helpful if you want to let a long running process run on I guess.&lt;/p&gt;

&lt;pre name="code" class="java"&gt;java -agentlib:jdwp=transport=dt_socket,address=localhost:5000,suspend=n ...&lt;/pre&gt;


&lt;p&gt;This is the mode that I am finding a valuable time saver day to day. It might only save a few seconds on each run; but over the last week it has proven to be a real time saver. Of course this is very dependent on just what and how you are debugging on whether you will find this useful.&lt;/p&gt;

&lt;p&gt;&lt;b&gt;More details&lt;/b&gt;&lt;/p&gt;

&lt;p&gt;For more details on the debugging options that a look a &lt;a href="http://download.oracle.com/javase/6/docs/technotes/guides/jpda/conninv.html"&gt;this &lt;strike&gt;sun&lt;/strike&gt; Oracle document.&lt;/a&gt; There are other options such as in memory transports and starting a debugger on an exception that are worth looking at.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;script src="http://www.google-analytics.com/urchin.js" type="text/javascript"&gt;
&lt;/script&gt;
&lt;script type="text/javascript"&gt;
_uacct = "UA-2176345-1";
urchinTracker();
&lt;/script&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2648073517459434852-6023462499394522018?l=kingsfleet.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/KingsfleetBlog/~4/iazblf4pj3E" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://kingsfleet.blogspot.com/feeds/6023462499394522018/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=2648073517459434852&amp;postID=6023462499394522018" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/2648073517459434852/posts/default/6023462499394522018?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/2648073517459434852/posts/default/6023462499394522018?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/KingsfleetBlog/~3/iazblf4pj3E/getting-more-out-of-your-debugger-with.html" title="Getting more out of your debugger with remote options" /><author><name>Gerard Davison</name><uri>http://www.blogger.com/profile/16521924431312439170</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="28" height="32" src="http://1.bp.blogspot.com/_wg73kpMXUVw/SR2BnEFpCHI/AAAAAAAAAGU/lvJNPVj958I/s1600-R/10680.jpg" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://1.bp.blogspot.com/_wg73kpMXUVw/TIY8rZ4jwfI/AAAAAAAAAQo/LkVA-vdFdBs/s72-c/1.+Create+Debug+Run+Configuration.png" height="72" width="72" /><thr:total>0</thr:total><feedburner:origLink>http://kingsfleet.blogspot.com/2010/09/getting-more-out-of-your-debugger-with.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CkcNQHs9eip7ImA9Wx5REkw.&quot;"><id>tag:blogger.com,1999:blog-2648073517459434852.post-2639406915064066784</id><published>2010-08-19T10:23:00.002+01:00</published><updated>2010-08-19T10:28:11.562+01:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-08-19T10:28:11.562+01:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="java" /><title>Can you see the problem with this code?</title><content type="html">&lt;p&gt;Just a little code quiz, can you spot the design problem with this API? Bonus points for come up with a plausible reason as to what the programmer was distracted with whilst working on this.&lt;/p&gt;

&lt;pre name="code" class="java"&gt;
    /** Load an integer from system properties, validating in a range */
    public static int getProperty(String name, int defValue, int min, int max){
        try {
            int value = Integer.getInteger(name, defValue).intValue();
            return Math.max(min, Math.min(max, value));
        }
        catch(NumberFormatException e) {
            return defValue;
        }
    }
    /** Load an long from system properties, validating in a range */
    public static long getProperty(String name, long min, long max, long defValue){
        try {
            long value = Long.getLong(name, defValue).longValue();
            return Math.max(min, Math.min(max, value));
        }
        catch(NumberFormatException e) {
            return defValue;
        }
    }
&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;script src="http://www.google-analytics.com/urchin.js" type="text/javascript"&gt;
&lt;/script&gt;
&lt;script type="text/javascript"&gt;
_uacct = "UA-2176345-1";
urchinTracker();
&lt;/script&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2648073517459434852-2639406915064066784?l=kingsfleet.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/KingsfleetBlog/~4/eb2QyK9JdJM" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://kingsfleet.blogspot.com/feeds/2639406915064066784/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=2648073517459434852&amp;postID=2639406915064066784" title="6 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/2648073517459434852/posts/default/2639406915064066784?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/2648073517459434852/posts/default/2639406915064066784?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/KingsfleetBlog/~3/eb2QyK9JdJM/can-you-see-problem-with-this-code.html" title="Can you see the problem with this code?" /><author><name>Gerard Davison</name><uri>http://www.blogger.com/profile/16521924431312439170</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="28" height="32" src="http://1.bp.blogspot.com/_wg73kpMXUVw/SR2BnEFpCHI/AAAAAAAAAGU/lvJNPVj958I/s1600-R/10680.jpg" /></author><thr:total>6</thr:total><feedburner:origLink>http://kingsfleet.blogspot.com/2010/08/can-you-see-problem-with-this-code.html</feedburner:origLink></entry><entry gd:etag="W/&quot;Ck4HR3o6fSp7ImA9WxFRFkk.&quot;"><id>tag:blogger.com,1999:blog-2648073517459434852.post-5362061153364252552</id><published>2010-04-30T14:24:00.009+01:00</published><updated>2010-04-30T16:22:16.415+01:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-04-30T16:22:16.415+01:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="spring" /><category scheme="http://www.blogger.com/atom/ns#" term="WeblogicSCA" /><category scheme="http://www.blogger.com/atom/ns#" term="sca" /><category scheme="http://www.blogger.com/atom/ns#" term="weblogic" /><title>Hello World using the Weblogic SCA support in JDeveloper 11.1.1.3.0</title><content type="html">&lt;p&gt;This is just a brief introduction to the newly added Weblogic SCA support that we have in the latest release of JDeveloper. Weblogic SCA allows you to take POJO classes and expose them as Web Services or EJB externally and use Spring internally to connect services together. You can find more on WebLogic SCA in the &lt;a href="http://download.oracle.com/docs/cd/E14571_01/web.1111/e15511/overview.htm#BABDICIA"&gt;primary documentation&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Before we get going you are going to need to download the "Spring &amp; Oracle WebLogic SCA" extension for JDeveloper as we don't ship it with the product. So as per normal Help-&gt;Check for Updates and select the matching extension:&lt;/p&gt;

&lt;p&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_wg73kpMXUVw/S9rb7Tl2bsI/AAAAAAAAAPw/Ifk2A1QL740/s1600/CheckForUpdates.png"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 400px; height: 300px;" src="http://4.bp.blogspot.com/_wg73kpMXUVw/S9rb7Tl2bsI/AAAAAAAAAPw/Ifk2A1QL740/s400/CheckForUpdates.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5465922909685313218" /&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Once this is installed and JDeveloper has restarted we need to perform an extra step to install the Weblogic SCA extension in the copy of WebLogic that comes with JDeveloper. In the context of a project select Run -&gt; Start Server Instance. Then on the WebLogic console, "http://localhost:7101/console", navigate to "Deployment" then select the "Install" action. You can find the shared library you need to install under %INSTALL_HOME%/wlserver_10.3/common/deployable-libraries/weblogic-sca-1.1.war.&lt;/p&gt;

&lt;p&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_wg73kpMXUVw/S9reeFM2UXI/AAAAAAAAAP4/oBgfMeb3sEo/s1600/InstallSharedLibrary.png"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 400px; height: 260px;" src="http://3.bp.blogspot.com/_wg73kpMXUVw/S9reeFM2UXI/AAAAAAAAAP4/oBgfMeb3sEo/s400/InstallSharedLibrary.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5465925706141028722" /&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;You need to just accept the defaults in the wizard and once finished we are almost ready to start writing code. If your are interested in taking this a little bit further you should go to Preferences -&gt; Extensions and enable the weblogic-sca and spring extension that provide extra monitoring capabilities. These require a server restart to fully enable.&lt;/p&gt;

&lt;p&gt;Heading back to JDeveloper now we are going to create a new project and then configure that project for as a Weblogic SCA project that is going to be deployed as a war file. (See documentation for more on deployment options).&lt;/p&gt;

&lt;p&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_wg73kpMXUVw/S9rfmk_ht0I/AAAAAAAAAQA/dgLPVLuaB-4/s1600/CreateConfigureWar.png"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 400px; height: 286px;" src="http://4.bp.blogspot.com/_wg73kpMXUVw/S9rfmk_ht0I/AAAAAAAAAQA/dgLPVLuaB-4/s400/CreateConfigureWar.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5465926951625668418" /&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This will give you an empty web.xml, an empty spring-context.xml and a weblogic.xml that sets up the dependency on the WebLogic SCA library. The final file looks a lot like this, in a more complicate environment you might need to specify the library version.&lt;/p&gt;

&lt;pre name="code" class="xml"&gt;
&amp;lt;?xml version = '1.0' encoding = 'windows-1252'?&gt;
&amp;lt;weblogic-web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.bea.com/ns/weblogic/weblogic-web-app http://www.bea.com/ns/weblogic/weblogic-web-app/1.0/weblogic-web-app.xsd" xmlns="http://www.bea.com/ns/weblogic/weblogic-web-app"&gt;
    &amp;lt;library-ref&gt;
        &amp;lt;library-name&gt;weblogic-sca&amp;lt;/library-name&gt;
    &amp;lt;/library-ref&gt;
&amp;lt;/weblogic-web-app&gt;
&lt;/pre&gt;

&lt;p&gt;We are going to create a few java classes to illustrate not just the publishing of a POJO as a service but also the wiring up of internal components using Spring. First lets define the service, you need a class and interface for SCA:&lt;/p&gt;

&lt;pre name="code" class="java"&gt;

// Interface

package hello;

public interface Hello {
    
    public String sayHello(String name, String langauge);
    
}

// Implementation

package hello;

import translation.Translator;

public class HelloImpl implements Hello {
    
    private Translator _translator;
    
    public void setTranslator(Translator t) {
        _translator = t;
    }
    
    public String sayHello(String name, String langauge) {
        String message = "Hello " + name;
        return _translator.translate(message, langauge);
    }
    
    
}
&lt;/pre&gt;

&lt;p&gt;For the purposes of the demo we are going to have to provide this Translator interface along with an dummy implementation again in separate files. The implementation could be from a JAX-WS proxy; but this is wired up in a different way from what we are showing today.&lt;/p&gt;

&lt;pre name="code" class="java"&gt;

package translation;

public interface Translator {
    
    public String translate(String text, String langauge) ;
    
}

// Dummy Implementation

package translation;

public class DummyTranslator implements Translator {

    public String translate(String text, String langauge) {
        if ("fr".equals(langauge)) {
            return text.replace("Hello", "Salut! ");
        }
        else if ("de".equals(langauge)) {
            return text.replace("Hello", "Guten Tag");
        }
        else {
           return "DT " + langauge + " " + text;
        }
    }
}
&lt;/pre&gt;

&lt;p&gt;So we are going to need two entries in spring-context.xml, the first is to wire the dummy translator up to HelloImpl:&lt;/p&gt;

&lt;pre name="code" class="xml"&gt;
  &amp;lt;bean id="translator" class="translation.DummyTranslator" /&gt;
  &amp;lt;bean id="hello" class="hello.HelloImpl"&gt;
     &amp;lt;property name="translator" ref="translator" /&gt;
  &amp;lt;/bean&gt;
&lt;/pre&gt;

&lt;p&gt;One difference you might notice from the previous spring extensions is that the bean names and class names are now connected up to the Refactoring framework. So you can "Rename", "Find Usages" and "Go to Declaration" on most of the entries in this file.&lt;/p&gt;

&lt;p&gt;The next entry in this file exposes the HelloImp as a web service using the binding.ws elements. So the final spring-context.xml becomes:&lt;/p&gt;

&lt;pre name="code" class="xml"&gt;
&amp;lt;?xml version="1.0" encoding="windows-1252" ?&gt;
&amp;lt;beans xmlns="http://www.springframework.org/schema/beans"
       xmlns:util="http://www.springframework.org/schema/util"
       xmlns:jee="http://www.springframework.org/schema/jee"
       xmlns:lang="http://www.springframework.org/schema/lang"
       xmlns:aop="http://www.springframework.org/schema/aop"
       xmlns:tx="http://www.springframework.org/schema/tx"
       xmlns:sca="http://xmlns.oracle.com/weblogic/weblogic-sca"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-2.5.xsd http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.5.xsd http://www.springframework.org/schema/jee http://www.springframework.org/schema/jee/spring-jee-2.5.xsd http://www.springframework.org/schema/lang http://www.springframework.org/schema/lang/spring-lang-2.5.xsd http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-2.5.xsd http://www.springframework.org/schema/tool http://www.springframework.org/schema/tool/spring-tool-2.5.xsd http://xmlns.oracle.com/weblogic/weblogic-sca META-INF/weblogic-sca.xsd"&gt;
  &amp;lt;!--Spring Bean definitions go here--&gt;
  
  &amp;lt;bean id="translator" class="translation.DummyTranslator" /&gt;
  &amp;lt;bean id="hello" class="hello.HelloImpl"&gt;
     &amp;lt;property name="translator" ref="translator" /&gt;
  &amp;lt;/bean&gt;
  
  &amp;lt;!--Service definitions --&gt;
  
  &amp;lt;sca:service name="helloService" target="hello" type="hello.Hello"&gt;
    &amp;lt;binding.ws xmlns="http://xmlns.oracle.com/weblogic/weblogic-sca-binding"
                port="hello" uri="/hello" soapVersion="1.1" name="hello"
                location="HelloLocation"/&gt;
  &amp;lt;/sca:service&gt;
  
  
&amp;lt;/beans&gt;
&lt;/pre&gt;

&lt;p&gt;So you can right click and "Run" spring-context.xml and everything gets deployed to the local application server. The easiest way to test the service is View -&gt; Application Server Navigator and then select the deploy service from the "Web Services" node.&lt;/p&gt;

&lt;p&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_wg73kpMXUVw/S9r0joxWJ7I/AAAAAAAAAQI/5qjRteLaxhk/s1600/RunService.png"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 400px; height: 390px;" src="http://1.bp.blogspot.com/_wg73kpMXUVw/S9r0joxWJ7I/AAAAAAAAAQI/5qjRteLaxhk/s400/RunService.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5465949990844508082" /&gt;&lt;/a&gt;&lt;/p&gt; 

&lt;p&gt;And then you will see the test page for this service, just a quick overview but enough to get starting with this new area of functionality. Note that unlike full SOA this feature is part of the standard WebLogic license. Also that if you have SOA tooling installed you will see more integration with tools such as the composite editor which "knows" about Spring SCA beans.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;script src="http://www.google-analytics.com/urchin.js" type="text/javascript"&gt;
&lt;/script&gt;
&lt;script type="text/javascript"&gt;
_uacct = "UA-2176345-1";
urchinTracker();
&lt;/script&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2648073517459434852-5362061153364252552?l=kingsfleet.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/KingsfleetBlog/~4/-H7GyA6ptrU" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://kingsfleet.blogspot.com/feeds/5362061153364252552/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=2648073517459434852&amp;postID=5362061153364252552" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/2648073517459434852/posts/default/5362061153364252552?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/2648073517459434852/posts/default/5362061153364252552?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/KingsfleetBlog/~3/-H7GyA6ptrU/hello-world-using-weblogic-sca-support.html" title="Hello World using the Weblogic SCA support in JDeveloper 11.1.1.3.0" /><author><name>Gerard Davison</name><uri>http://www.blogger.com/profile/16521924431312439170</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="28" height="32" src="http://1.bp.blogspot.com/_wg73kpMXUVw/SR2BnEFpCHI/AAAAAAAAAGU/lvJNPVj958I/s1600-R/10680.jpg" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://4.bp.blogspot.com/_wg73kpMXUVw/S9rb7Tl2bsI/AAAAAAAAAPw/Ifk2A1QL740/s72-c/CheckForUpdates.png" height="72" width="72" /><thr:total>0</thr:total><feedburner:origLink>http://kingsfleet.blogspot.com/2010/04/hello-world-using-weblogic-sca-support.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DUEBRXk4cCp7ImA9WxFSE0k.&quot;"><id>tag:blogger.com,1999:blog-2648073517459434852.post-5394640777505429041</id><published>2010-04-15T16:54:00.005+01:00</published><updated>2010-04-15T17:07:34.738+01:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-04-15T17:07:34.738+01:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="adf" /><category scheme="http://www.blogger.com/atom/ns#" term="jsf" /><category scheme="http://www.blogger.com/atom/ns#" term="dogfood" /><title>ADF/JSF Invoking a method on a backing bean before the page is shown</title><content type="html">&lt;p&gt;In a couple of cases in our application we really needed to run a little section of code before the page was displayed. We tried a bunch of ways of doing this until we got a tip from Ducan Mills that we could consider abusing "Bookmark" feature in adfc-config.xml. This is normally just for accepting query parameters; but it turns out that the method is executed before the page is rendered so it can be useful it you need to do some minor configuration in advance.&lt;/p&gt;

&lt;p&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_wg73kpMXUVw/S8c4Cp6CNfI/AAAAAAAAAPo/cE1LhpBi3Yk/s1600/BookmarkImage.png"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 400px; height: 222px;" src="http://2.bp.blogspot.com/_wg73kpMXUVw/S8c4Cp6CNfI/AAAAAAAAAPo/cE1LhpBi3Yk/s400/BookmarkImage.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5460394691470177778" /&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Note that this only applies to unbounded task flows, bounded task flows can't be made book markable. Also the parameters are optional, the code will fire even if none are defined as they are in this example. (We are using the code to force some initial selections in this case.)&lt;/p&gt;

&lt;p&gt;I am not convinced it is a good idea in many cases; it was really helpful in solve our particular problem. I would be interested to hear if there is a more JSF way of doing this.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;script src="http://www.google-analytics.com/urchin.js" type="text/javascript"&gt;
&lt;/script&gt;
&lt;script type="text/javascript"&gt;
_uacct = "UA-2176345-1";
urchinTracker();
&lt;/script&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2648073517459434852-5394640777505429041?l=kingsfleet.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/KingsfleetBlog/~4/Qvb80lokUX4" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://kingsfleet.blogspot.com/feeds/5394640777505429041/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=2648073517459434852&amp;postID=5394640777505429041" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/2648073517459434852/posts/default/5394640777505429041?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/2648073517459434852/posts/default/5394640777505429041?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/KingsfleetBlog/~3/Qvb80lokUX4/adfjsf-invoking-method-on-backing-bean.html" title="ADF/JSF Invoking a method on a backing bean before the page is shown" /><author><name>Gerard Davison</name><uri>http://www.blogger.com/profile/16521924431312439170</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="28" height="32" src="http://1.bp.blogspot.com/_wg73kpMXUVw/SR2BnEFpCHI/AAAAAAAAAGU/lvJNPVj958I/s1600-R/10680.jpg" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://2.bp.blogspot.com/_wg73kpMXUVw/S8c4Cp6CNfI/AAAAAAAAAPo/cE1LhpBi3Yk/s72-c/BookmarkImage.png" height="72" width="72" /><thr:total>0</thr:total><feedburner:origLink>http://kingsfleet.blogspot.com/2010/04/adfjsf-invoking-method-on-backing-bean.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DEMDQXw5cSp7ImA9WxFSE0k.&quot;"><id>tag:blogger.com,1999:blog-2648073517459434852.post-3788429388945146858</id><published>2010-04-15T16:32:00.002+01:00</published><updated>2010-04-15T16:47:50.229+01:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-04-15T16:47:50.229+01:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="jdeveloper" /><category scheme="http://www.blogger.com/atom/ns#" term="dogfood" /><title>Forgotten JDeveloper feature : The bytecode debugger</title><content type="html">&lt;p&gt;I am pretty lucky in my day to day work that I have access to nearly all of the source code for the software I work with. (Even the close hold Java security code which is very useful when working on the HTTP Analyzer). Sometimes you run across a snippet of code that for whatever reason you don't have the source code to hand. JDeveloper will generate you a stub; but that is not so useful when you want to know what is going on.&lt;/p&gt;

&lt;p&gt;There is a kind-of hidden feature in JDeveloper called the bytecode debugger that you can enable by selecting "Show Bytecode":&lt;/p&gt;

&lt;p&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_wg73kpMXUVw/S8cxoOTfMNI/AAAAAAAAAPg/7qmdMHYFuyw/s1600/ShowByteCode.png"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 400px; height: 217px;" src="http://1.bp.blogspot.com/_wg73kpMXUVw/S8cxoOTfMNI/AAAAAAAAAPg/7qmdMHYFuyw/s400/ShowByteCode.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5460387640314376402" /&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This will show you the method in question in terms of bytecodes, and you can use the new extra pink toolbar icons to step at the bytecode level or just use the normal ones to step in at the java method level.&lt;/p&gt;

&lt;p&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_wg73kpMXUVw/S8cxnpAlVoI/AAAAAAAAAPY/sVzUwgp0h9c/s1600/ByteCodeShown.png"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 400px; height: 210px;" src="http://1.bp.blogspot.com/_wg73kpMXUVw/S8cxnpAlVoI/AAAAAAAAAPY/sVzUwgp0h9c/s400/ByteCodeShown.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5460387630302975618" /&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Very useful when you are stuck and for very good legal reasons cannot make use of java dissembly tools.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;script src="http://www.google-analytics.com/urchin.js" type="text/javascript"&gt;
&lt;/script&gt;
&lt;script type="text/javascript"&gt;
_uacct = "UA-2176345-1";
urchinTracker();
&lt;/script&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2648073517459434852-3788429388945146858?l=kingsfleet.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/KingsfleetBlog/~4/D7ZIuwbg7jo" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://kingsfleet.blogspot.com/feeds/3788429388945146858/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=2648073517459434852&amp;postID=3788429388945146858" title="2 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/2648073517459434852/posts/default/3788429388945146858?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/2648073517459434852/posts/default/3788429388945146858?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/KingsfleetBlog/~3/D7ZIuwbg7jo/forgotten-jdeveloper-feature-bytecode.html" title="Forgotten JDeveloper feature : The bytecode debugger" /><author><name>Gerard Davison</name><uri>http://www.blogger.com/profile/16521924431312439170</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="28" height="32" src="http://1.bp.blogspot.com/_wg73kpMXUVw/SR2BnEFpCHI/AAAAAAAAAGU/lvJNPVj958I/s1600-R/10680.jpg" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://1.bp.blogspot.com/_wg73kpMXUVw/S8cxoOTfMNI/AAAAAAAAAPg/7qmdMHYFuyw/s72-c/ShowByteCode.png" height="72" width="72" /><thr:total>2</thr:total><feedburner:origLink>http://kingsfleet.blogspot.com/2010/04/forgotten-jdeveloper-feature-bytecode.html</feedburner:origLink></entry><entry gd:etag="W/&quot;AkYHR347cCp7ImA9WxFSEkk.&quot;"><id>tag:blogger.com,1999:blog-2648073517459434852.post-1976170162795824117</id><published>2010-04-14T13:06:00.008+01:00</published><updated>2010-04-14T13:28:56.008+01:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-04-14T13:28:56.008+01:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="otn" /><category scheme="http://www.blogger.com/atom/ns#" term="dogfood" /><title>Making OTN documents more readible</title><content type="html">&lt;p&gt;There is a lot of good information on OTN; but I like a certain subset of other people find the color scheme hard to read. For example I find the &lt;a href="http://www.oracle.com/technology/oramag/oracle/09-jan/o19frame.html"&gt;this page&lt;/a&gt; by Steve really hard to read because of the large amount of bold text:&lt;/p&gt;

&lt;p&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_wg73kpMXUVw/S8WwvmmDP-I/AAAAAAAAAO4/BaFwRoLETcA/s1600/TooMuchBold.png"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 400px; height: 202px;" src="http://1.bp.blogspot.com/_wg73kpMXUVw/S8WwvmmDP-I/AAAAAAAAAO4/BaFwRoLETcA/s400/TooMuchBold.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5459964455117078498" /&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;To me I can only focus on the bold text and the rest just kind of swims around. This might be because I might be slightly dyslexic, never confirmed, or just my eyes are tired this week. Either way it means I have to print everything on OTN in order to be able to read it.&lt;/p&gt;

&lt;p&gt;The author of this page suggested I hack the .css using firebug; but I wanted a more automatic option so after discarding GreaseMonkey and being too much hassle for this work I settled on a addon called &lt;a href="https://addons.mozilla.org/en-US/firefox/addon/2108/developers/post_install?confirmed=true"&gt;Stylish&lt;/a&gt;. This simply allows you to override .css settings for particular websites. Once installed, and restarted, you invoke it from the icon that gets installed at the bottom left of Firefox window:&lt;/p&gt;

&lt;p&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_wg73kpMXUVw/S8WyJtBUqkI/AAAAAAAAAPA/2uGLPq68UH4/s1600/StartStyle.png"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 345px; height: 284px;" src="http://2.bp.blogspot.com/_wg73kpMXUVw/S8WyJtBUqkI/AAAAAAAAAPA/2uGLPq68UH4/s400/StartStyle.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5459966003030305346" /&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;You can then play with the .css to you hearts content using the style editor dialog:&lt;/p&gt;

&lt;p&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_wg73kpMXUVw/S8Wy3aykj4I/AAAAAAAAAPI/rot6izIxKY0/s1600/NewStyle.png"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 400px; height: 369px;" src="http://1.bp.blogspot.com/_wg73kpMXUVw/S8Wy3aykj4I/AAAAAAAAAPI/rot6izIxKY0/s400/NewStyle.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5459966788410576770" /&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The style I am using removes a lot of the bold text and gives me a nice yellow background color this I find easier to read on. I would be interested to see what other people choose, I know there have been some moans about the new red/black color scheme on dev.java.net.&lt;/p&gt;

&lt;pre name="code" class="css"&gt;
@namespace url(http://www.w3.org/1999/xhtml);

@-moz-document domain("www.oracle.com") {


.boldbodycopy {font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 14px; font-weight: normal !important; color: #000000 ; text-decoration: none; }

.boldbodycopy2 {font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 14px; font-weight: normal !important; color: #999999 ; text-decoration: none; }

.boldbodycopy3 {font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 14px; font-weight: normal !important; color: #666666 ; text-decoration: none; }

html, body {
  background: none !important;
  background: #ffffcc !important;
}

}
&lt;/pre&gt;

&lt;p&gt;It seems that you have to use the "!important" modifier in order for the changes to really work. Here is what the text in the original document looks like after these changes:&lt;/p&gt;

&lt;p&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_wg73kpMXUVw/S8WzynYOEhI/AAAAAAAAAPQ/TD0DAczJC0Y/s1600/MuchLessBold.png"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 400px; height: 206px;" src="http://4.bp.blogspot.com/_wg73kpMXUVw/S8WzynYOEhI/AAAAAAAAAPQ/TD0DAczJC0Y/s400/MuchLessBold.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5459967805401993746" /&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;script src="http://www.google-analytics.com/urchin.js" type="text/javascript"&gt;
&lt;/script&gt;
&lt;script type="text/javascript"&gt;
_uacct = "UA-2176345-1";
urchinTracker();
&lt;/script&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2648073517459434852-1976170162795824117?l=kingsfleet.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/KingsfleetBlog/~4/8sJyuClyrKQ" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://kingsfleet.blogspot.com/feeds/1976170162795824117/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=2648073517459434852&amp;postID=1976170162795824117" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/2648073517459434852/posts/default/1976170162795824117?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/2648073517459434852/posts/default/1976170162795824117?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/KingsfleetBlog/~3/8sJyuClyrKQ/making-otn-documents-more-readible.html" title="Making OTN documents more readible" /><author><name>Gerard Davison</name><uri>http://www.blogger.com/profile/16521924431312439170</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="28" height="32" src="http://1.bp.blogspot.com/_wg73kpMXUVw/SR2BnEFpCHI/AAAAAAAAAGU/lvJNPVj958I/s1600-R/10680.jpg" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://1.bp.blogspot.com/_wg73kpMXUVw/S8WwvmmDP-I/AAAAAAAAAO4/BaFwRoLETcA/s72-c/TooMuchBold.png" height="72" width="72" /><thr:total>0</thr:total><feedburner:origLink>http://kingsfleet.blogspot.com/2010/04/making-otn-documents-more-readible.html</feedburner:origLink></entry><entry gd:etag="W/&quot;A04DQng_eip7ImA9WxFTFkk.&quot;"><id>tag:blogger.com,1999:blog-2648073517459434852.post-496669967353342478</id><published>2010-04-01T16:26:00.003+01:00</published><updated>2010-04-07T15:19:33.642+01:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-04-07T15:19:33.642+01:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="java" /><title>Composite Annotations</title><content type="html">&lt;p&gt;This is draft for comment of a project coin proposal to allow language level composite annotations to the JDK. This should make it easier for annotation rich frameworks to provide stereotypes that represent common combinations. This came out of a discussion on the atmosphere mailing list.&lt;/p&gt;

&lt;p&gt;PROJECT COIN SMALL LANGUAGE CHANGE PROPOSAL FORM v1.0&lt;/p&gt;

&lt;p&gt;AUTHOR(S): Gerard Davison&lt;/p&gt;

&lt;p&gt;OVERVIEW&lt;/p&gt;
&lt;p&gt;Provide a two sentence or shorter description of these five aspects of 
the feature:&lt;/p&gt;

&lt;p&gt;FEATURE SUMMARY: Should be suitable as a summary in a language tutorial.&lt;/p&gt;

&lt;p&gt;Add the ability to compose existing annotations as meta annotations to be able to easily create stereotypes for common combinations.&lt;/p&gt;

&lt;p&gt;MAJOR ADVANTAGE: What makes the proposal a favorable change?&lt;/p&gt;

&lt;p&gt;Libraries can provide common "stereotype" made up of sensible default combinations of annotations.&lt;/p&gt;

&lt;p&gt;MAJOR BENEFIT: Why is the platform better if the proposal is adopted?&lt;/p&gt;

&lt;p&gt;Potentially shallower learning curve for annotation based frameworks.&lt;/p&gt;

&lt;p&gt;MAJOR DISADVANTAGE: There is always a cost.&lt;/p&gt;

&lt;p&gt;It is possible that by hiding configuration behind stereotypes that the code becomes harder to diagnose. This can be ameliorated to some extent with tool support and suitable naming conventions.&lt;/p&gt;

&lt;p&gt;ALTERNATIVES: Can the benefits and advantages be had some way without a language change?&lt;/p&gt;

&lt;p&gt;Yes, it is possible for each and every framework to introduce there own Composite marker annotation and processor. For example spring has something quite similar in there meta annotations:&lt;/p&gt;

&lt;p&gt;http://blog.springsource.com/2009/05/06/spring-framework-30-m3-released/&lt;/p&gt;

&lt;p&gt;Each implementation would be different then as not as easily accessible as a language feature would be.&lt;/p&gt;

&lt;p&gt;EXAMPLES Show us the code!&lt;/p&gt;

&lt;p&gt;SIMPLE EXAMPLE: Show the simplest possible program utilizing the new feature.&lt;/p&gt;

&lt;pre name="code" class="java"&gt;

package java.lang.annotation;

@Rentention(SOURCE)
@Target(ANNOTATION_TYPE)
public @interface Composite
{
}


package x;

@Composite
@SuppressWarnings({"unchecked"})
@Target(METHOD)
public @interface SuppressUnchecked
{
}

package y;

public class ExampleService
{
   @SupressUnchecked
   public void methodWithOddCast()
   {
       ...
   }
}
&lt;/pre&gt;

&lt;p&gt;ADVANCED EXAMPLE: Show advanced usage(s) of the feature.&lt;/p&gt;

&lt;pre name="code" class="java"&gt;
@Composite
@WebService
@Binding(SOAPBinding.SOAP_12_BINDING)
@Addressing
@Target(CLASS)
public @interface SOAP12AddressingWebService
{
}

@SOAP12AddressingWebService
public class ExampleService
{
   ...
}
&lt;/pre&gt;

&lt;p&gt;DETAILS SPECIFICATION: Describe how the proposal affects the grammar, type system, and meaning of expressions and statements in the Java Programming Language as well as any other known impacts.&lt;/p&gt;

&lt;p&gt;The lexical grammar is unchanged. The type system is unchanged. The annotation type section is modified (JLS ?.?) so that an annotation can be applied to composite annotation if that annotation is tagged with @Composite and the target and retention matches that of the composite annotation. This prevents all annotations having to be modified with the ANNOTATION_TYPE modifier.&lt;/p&gt;

&lt;p&gt;COMPILATION: How would the feature be compiled to class files?&lt;/p&gt;

&lt;p&gt;This feature modifies the process which is used to gather the annotation properties. In general the rule is that values directly applied to class will override values provided by composite annotations. So the process for building the values for a particular class should be:&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;For each annotation attached to the class that isn't marked as @Composite store the values for this class. Once defined the value will not change.&lt;/li&gt;
  &lt;li&gt;For each annotation attached to the class in source order that is marked as @Composite apply any values that have not been previously defined. Recursively apply the values for any attached composite annotations.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The compilation should fail if there is a loop of @Composite annotations. (QUERY should we allow multi-level or is one turtle enough.)&lt;/p&gt;

&lt;p&gt;For a client reading the class using the reflective API it should appear as if the annotations provided by the composite annotations were applied to the class directly. (QUERY should the composite annotations be erased at runtime?)&lt;/p&gt;

&lt;p&gt;TESTING: How can the feature be tested?&lt;/p&gt;

&lt;p&gt;It should be a matter of generating various simple cases with differing levels of composite annotations. Corner cases should be provided with inconsistent target or retention policies.&lt;/p&gt;

&lt;p&gt;LIBRARY SUPPORT: Are any supporting libraries needed for the feature?&lt;/p&gt;
 
&lt;p&gt;REFLECTIVE APIS: Do any of the various and sundry reflection APIs need 
to be updated? This list of reflective APIs includes but is not limited 
to core reflection (java.lang.Class and java.lang.reflect.*), 
javax.lang.model.*, the doclet API, and JPDA.&lt;/p&gt;

&lt;p&gt;As the annotations are unwound at compile time this won't affect any reflective API that works from a class file. It is going to pose a question of what is the correct thing to do when looking at a source file.  (QUERY not sure what the best thing is to do)&lt;/p&gt;

&lt;p&gt;OTHER CHANGES: Do any other parts of the platform need be updated too? 
Possibilities include but are not limited to JNI, serialization, and 
output of the javadoc tool.&lt;/p&gt;

&lt;p&gt;Yes, the javadoc tool should show both the composite and the applied annotations in some way.&lt;/p&gt;

&lt;p&gt;MIGRATION: Sketch how a code base could be converted, manually or 
automatically, to use the new feature.&lt;/p&gt;

&lt;p&gt;Roll up some application to use stereotypes as applicable.&lt;/p&gt;

&lt;p&gt;COMPATIBILITY BREAKING CHANGES: Are any previously valid programs now invalid? If so, list one.&lt;/p&gt;

&lt;p&gt;All existing programs remain valid.&lt;/p&gt;

&lt;p&gt;EXISTING PROGRAMS: How do source and class files of earlier platform 
versions interact with the feature? Can any new overloadings occur? Can 
any new overriding occur?&lt;/p&gt;

&lt;p&gt;The semantics of existing class files and legal source files and are 
unchanged by this feature.&lt;/p&gt;

&lt;p&gt;REFERENCES EXISTING BUGS: Please include a list of any existing Sun bug ids related to this proposal.&lt;/p&gt;

&lt;p&gt;None&lt;/p&gt;

&lt;p&gt;URL FOR PROTOTYPE (optional):&lt;/p&gt;

&lt;p&gt;No prototype at this time.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;script src="http://www.google-analytics.com/urchin.js" type="text/javascript"&gt;
&lt;/script&gt;
&lt;script type="text/javascript"&gt;
_uacct = "UA-2176345-1";
urchinTracker();
&lt;/script&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2648073517459434852-496669967353342478?l=kingsfleet.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/KingsfleetBlog/~4/paO0WAUB-l0" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://kingsfleet.blogspot.com/feeds/496669967353342478/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=2648073517459434852&amp;postID=496669967353342478" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/2648073517459434852/posts/default/496669967353342478?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/2648073517459434852/posts/default/496669967353342478?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/KingsfleetBlog/~3/paO0WAUB-l0/composite-annotations.html" title="Composite Annotations" /><author><name>Gerard Davison</name><uri>http://www.blogger.com/profile/16521924431312439170</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="28" height="32" src="http://1.bp.blogspot.com/_wg73kpMXUVw/SR2BnEFpCHI/AAAAAAAAAGU/lvJNPVj958I/s1600-R/10680.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://kingsfleet.blogspot.com/2010/04/composite-annotations.html</feedburner:origLink></entry><entry gd:etag="W/&quot;Ck4FQ3k9eCp7ImA9WxBbE0w.&quot;"><id>tag:blogger.com,1999:blog-2648073517459434852.post-367057747299530726</id><published>2010-03-11T12:33:00.002Z</published><updated>2010-03-11T12:35:12.760Z</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-03-11T12:35:12.760Z</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="jax-rs" /><category scheme="http://www.blogger.com/atom/ns#" term="jersey" /><title>Jersey 1.1.5.1 released</title><content type="html">&lt;p&gt;There is a &lt;a href="http://blogs.sun.com/sandoz/entry/jersey_1_1_5_1"&gt;minor point release&lt;/a&gt; of Jersey that includes a pair of significant bug fixes for weblogic and JDeveloper users. Worth using in preference to 1.1.5. Thanks a lot to Paul for putting this one together.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;script src="http://www.google-analytics.com/urchin.js" type="text/javascript"&gt;
&lt;/script&gt;
&lt;script type="text/javascript"&gt;
_uacct = "UA-2176345-1";
urchinTracker();
&lt;/script&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2648073517459434852-367057747299530726?l=kingsfleet.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/KingsfleetBlog/~4/Qn7CdYUi7FE" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://kingsfleet.blogspot.com/feeds/367057747299530726/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=2648073517459434852&amp;postID=367057747299530726" title="2 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/2648073517459434852/posts/default/367057747299530726?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/2648073517459434852/posts/default/367057747299530726?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/KingsfleetBlog/~3/Qn7CdYUi7FE/jersey-1151-released.html" title="Jersey 1.1.5.1 released" /><author><name>Gerard Davison</name><uri>http://www.blogger.com/profile/16521924431312439170</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="28" height="32" src="http://1.bp.blogspot.com/_wg73kpMXUVw/SR2BnEFpCHI/AAAAAAAAAGU/lvJNPVj958I/s1600-R/10680.jpg" /></author><thr:total>2</thr:total><feedburner:origLink>http://kingsfleet.blogspot.com/2010/03/jersey-1151-released.html</feedburner:origLink></entry><entry gd:etag="W/&quot;AkAESX84eCp7ImA9WxBUFUk.&quot;"><id>tag:blogger.com,1999:blog-2648073517459434852.post-438808515068608474</id><published>2010-03-02T16:50:00.002Z</published><updated>2010-03-02T16:51:48.130Z</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-03-02T16:51:48.130Z</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="ramble" /><title>Normal comment service is now resumed</title><content type="html">&lt;p&gt;I have been fairly remiss in responding to comments, I have just worked my way though the backlog and now up to date. yay&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;script src="http://www.google-analytics.com/urchin.js" type="text/javascript"&gt;
&lt;/script&gt;
&lt;script type="text/javascript"&gt;
_uacct = "UA-2176345-1";
urchinTracker();
&lt;/script&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2648073517459434852-438808515068608474?l=kingsfleet.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/KingsfleetBlog/~4/TfVl7yJkExU" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://kingsfleet.blogspot.com/feeds/438808515068608474/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=2648073517459434852&amp;postID=438808515068608474" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/2648073517459434852/posts/default/438808515068608474?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/2648073517459434852/posts/default/438808515068608474?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/KingsfleetBlog/~3/TfVl7yJkExU/normal-comment-service-is-now-resumed.html" title="Normal comment service is now resumed" /><author><name>Gerard Davison</name><uri>http://www.blogger.com/profile/16521924431312439170</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="28" height="32" src="http://1.bp.blogspot.com/_wg73kpMXUVw/SR2BnEFpCHI/AAAAAAAAAGU/lvJNPVj958I/s1600-R/10680.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://kingsfleet.blogspot.com/2010/03/normal-comment-service-is-now-resumed.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CkYDSXg9eSp7ImA9WxFQFU0.&quot;"><id>tag:blogger.com,1999:blog-2648073517459434852.post-3738433105378462479</id><published>2010-03-02T11:38:00.005Z</published><updated>2010-05-10T15:02:58.661+01:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-05-10T15:02:58.661+01:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="jax-rs" /><category scheme="http://www.blogger.com/atom/ns#" term="jersey" /><title>Building and testing Jersey</title><content type="html">&lt;p&gt;So I was playing with a patch Building an testing to Jersey but I was having trouble building and running the tests. It seems that there are problems if you don't have the same specific version of Maven, (2.0.9), once that is solved you might run across another issue as the default memory given to Maven will not be enough for all the test to succeed.&lt;/p&gt;

&lt;p&gt;The way to track the correct values is to take a look at "hudson/jersey.sh" and this will set the MAVEN_OPTS to:&lt;/p&gt;

&lt;pre name="code" class="java"&gt;
export MAVEN_OPTS="-Xms512m -Xmx1024m -XX:PermSize=256m -XX:MaxPermSize=512m"
&lt;/pre&gt;

&lt;p&gt;This it turns out isn't sufficient if you are running behind a firewall, at least on Linux, and you need to specify the web proxy as well for some tests:&lt;/p&gt;

&lt;pre name="code" class="java"&gt;
export MAVEN_OPTS="-Xms512m -Xmx1024m -XX:PermSize=256m -XX:MaxPermSize=512m -Dhttp.proxyHost=proxy -Dhttp.noProxyHosts=localhost"
&lt;/pre&gt;

&lt;p&gt;With that resolved I can build and test all of Jersey in a relatively small amount of time. Although it does seem you need an active network connection which is a shame.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;script src="http://www.google-analytics.com/urchin.js" type="text/javascript"&gt;
&lt;/script&gt;
&lt;script type="text/javascript"&gt;
_uacct = "UA-2176345-1";
urchinTracker();
&lt;/script&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2648073517459434852-3738433105378462479?l=kingsfleet.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/KingsfleetBlog/~4/qLJ3dcp8eTw" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://kingsfleet.blogspot.com/feeds/3738433105378462479/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=2648073517459434852&amp;postID=3738433105378462479" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/2648073517459434852/posts/default/3738433105378462479?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/2648073517459434852/posts/default/3738433105378462479?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/KingsfleetBlog/~3/qLJ3dcp8eTw/building-and-testing-jersey.html" title="Building and testing Jersey" /><author><name>Gerard Davison</name><uri>http://www.blogger.com/profile/16521924431312439170</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="28" height="32" src="http://1.bp.blogspot.com/_wg73kpMXUVw/SR2BnEFpCHI/AAAAAAAAAGU/lvJNPVj958I/s1600-R/10680.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://kingsfleet.blogspot.com/2010/03/building-and-testing-jersey.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CE8HQ307eyp7ImA9WxBWEE8.&quot;"><id>tag:blogger.com,1999:blog-2648073517459434852.post-1465238774202479211</id><published>2010-02-01T10:49:00.006Z</published><updated>2010-02-01T11:13:52.303Z</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-02-01T11:13:52.303Z</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="ramble" /><title>iPad fashion dilemma</title><content type="html">&lt;p&gt;We had a debate in the office about how the apple iPad would affect male fashion choices. You had to store it somewhere on your person and is just too big for a normal pocket. I don't see man-bags becoming that fashionable so we had to think out of the box. Jon Russell our local artist, talented cartoonist and now fashion designer took inspiration from both Celtic and Rustic trad to produce his new iPad supporting range....&lt;/p&gt;

&lt;p&gt;&lt;a title="iPad-ta-noo and the iPad-bubba" onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_wg73kpMXUVw/S2a1vMFFm0I/AAAAAAAAAOw/I0ctWA2ow3o/s1600-h/ipad.png"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 400px; height: 380px;" src="http://2.bp.blogspot.com/_wg73kpMXUVw/S2a1vMFFm0I/AAAAAAAAAOw/I0ctWA2ow3o/s400/ipad.png" border="0" alt="iPad-ta-noo and the iPad-bubba" id="BLOGGER_PHOTO_ID_5433229822770125634" /&gt;&lt;/a&gt;&lt;/p&gt;


&lt;p&gt;I do hope that Steve Jobs approves of the new look for apple users '10/'11&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;script src="http://www.google-analytics.com/urchin.js" type="text/javascript"&gt;
&lt;/script&gt;
&lt;script type="text/javascript"&gt;
_uacct = "UA-2176345-1";
urchinTracker();
&lt;/script&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2648073517459434852-1465238774202479211?l=kingsfleet.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/KingsfleetBlog/~4/etl-V0VMpec" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://kingsfleet.blogspot.com/feeds/1465238774202479211/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=2648073517459434852&amp;postID=1465238774202479211" title="2 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/2648073517459434852/posts/default/1465238774202479211?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/2648073517459434852/posts/default/1465238774202479211?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/KingsfleetBlog/~3/etl-V0VMpec/ipad-fashion-dilemma.html" title="iPad fashion dilemma" /><author><name>Gerard Davison</name><uri>http://www.blogger.com/profile/16521924431312439170</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="28" height="32" src="http://1.bp.blogspot.com/_wg73kpMXUVw/SR2BnEFpCHI/AAAAAAAAAGU/lvJNPVj958I/s1600-R/10680.jpg" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://2.bp.blogspot.com/_wg73kpMXUVw/S2a1vMFFm0I/AAAAAAAAAOw/I0ctWA2ow3o/s72-c/ipad.png" height="72" width="72" /><thr:total>2</thr:total><feedburner:origLink>http://kingsfleet.blogspot.com/2010/02/ipad-fashion-dilemma.html</feedburner:origLink></entry></feed>

