small medium large xlarge

22 Apr 2009, 21:57
Dan Haywood (133 posts)

Hi, I’m Dan Haywood, the author of this book. Thanks for your interest in the book, in DDD, and in Naked Objects. And if you’re reading the beta, then thanks also for helping me improve the content.

If you have any questions or suggestions, please post them here, and I’ll do my best to respond promptly.

Cheers Dan

08 May 2009, 02:01
Alexander Krasnukhin (8 posts)

Hi, Dan

Im really enjoying reading your book. But sometimes I feel puzzled how information is given there. Maybe Im wrong reader but anyway you asked for suggestions :)

For example at page 44 there is no word about icons, only about persistor store or @Named. I turn next page 45 and reading “An Icon?! Now?!” and feel surpised. Really surprised because I have no idea what icons you are talking about - there wasn’t any word about them till now! Only after Ive explored page I understood everything. But I swear Ive read gray box three times! And only then realised that I should pass it first time and return to the top of the page only after reading its bottom!

You think its OK? No, I solved this mini puzzle as Ive already know what icons you are about. But what about readers that hadn’t used Naked Objects before?

PS Im talking about beta2

08 May 2009, 09:33
Dan Haywood (133 posts)

Hi the.malkolm, Glad to hear you’re enjoying the book! And thanks for this feedback, really appreciate it.

To answer your point: because this is a beta, there hasn’t been any fine-tuning of the location of sidebars and figures; so they come out in approximately the right place. Which means the top of the page where I wrote the sidebar. So, yes, this sidebar should probably appear at the top of page 46 to avoid confusion.

I’ll add a note to the manuscript to make sure we adjust this when we get to final typesetting (though I think it’ll get picked up anyway).

In the meantime, you might well notice slightly misplaced sidebars elsewhere. Don’t get hung up on it, skip on a few paragraphs and the reason for the sidebar ought to become clear.

Cheers Dan

27 Jul 2009, 22:40
Niall Barry (1 post)

Hi, Dan

I thought I’d work through the book even though it’s been a long time since I developed anything and I haven’t a clue about the ‘open source environment’. A few comments for what they’re worth (only got through the first two chapters so far):

Biggest issue I have so far is setting up dev environment (though I don’t think there’s anything you can/should do about that) in Vista. Book says use JRE or JDK - Eclipse/Maven doesn’t seem to like JRE (lots of warning msgs, although everything so far eventually works). I had to set up environment variables as System before they’d work.

P29 says enter any Group ID - I think this gives problems for next projects, which seem to need same Group ID (though maybe I just need to run Eclipse as Admin)

P31 says navigate to http://localhost:8080/ - took me a while to figure out I needed there too.

p35 DDD Box belongs in the next page (I know you said not to worry about this but just in case)

Ch2 setup of carserv project failed but seemed to work when I used the same groupID as first proj

p41 path should read Window (not ‘Windows’)

p44 first time I came across template (nop) so took me a while to figure it out but I presume others will be more familiar with environment

p45 typo “framework will called them”

p50 typo in box “we were asked us all” (btw, I like boxes)

p51 refers to “nakedobjects-icons archetype” - the one I picked up had a different name

p53 I had to import org.nakedobjects.applib.annotation.* to make @Named and @DescribedAs annotations work.

I don’t know whether any of the above is of any use but it’s been fun so far - best of luck with the book.


13 Aug 2009, 19:05
Dan Haywood (133 posts)

Hi Niall, Sorry for not replying back sooner … been in the midst of getting the next (final) beta ready.

Many thanks for the numerous points you’ve raised, and all have been addressed in aforesaid beta. If you hit any other minor errata then perhaps you could raise them on the errata page (

Meanwhile, you might want to know that in the next beta I’ve beefed up the section on “the DSFA Naked Objects app” in the last section (anyone else reading this: Niall is the CIO for the big flagship project we have at the DSFA, ie the Social Welfare department for the Irish government), and - I presume you don’t mind since it’s already on public record - I’ve quoted your comment from a few years back about how happy you were with the system.

In the meantime, good luck with your domain-driven development!

Cheers Dan

05 Jan 2010, 07:18
Desai Sweta Y. (14 posts)

Hi Dan,

I am using the REST provided in startobjects. I have installed it successfully. The testapp coming with the distribution is working fine with the REST viewer. But then when I tried the code of the carserv-restful in case study in the downloadable code from this site, it is giving me the following error.

0 [main] INFO org.starobjects.restful.applib.AbstractRestfulClient - getting from ‘http://localhost:8080/services’ Exception in thread “main” org.starobjects.restful.applib.RestfulClientException: Connection refused: connect at org.starobjects.restful.applib.AbstractRestfulClient.get( at com.pragprog.dhnako.carserv.restful.FindCustomer.findCustomer( at com.pragprog.dhnako.carserv.restful.FindCustomer.main( Caused by: Connection refused: connect at Method) at at at at at at at at at at at at at at at at at org.starobjects.restful.applib.UrlConnectionUtils.readDocFromConnectionInputStream( at org.starobjects.restful.applib.AbstractRestfulClient.get( ... 2 more

Can you please help me understand what the problem is and what is that I am making wrong?

Thanks in advance, Sweta.

05 Jan 2010, 18:26
Dan Haywood (133 posts)

Hi Sweta,, That looks like you aren’t running the server.

In the carserv/commandline/ide/eclipse/launch there is the exploration#viewer_restful.launch launch configuration. This will run up the server in a jetty servlet container.

Then (as you’ve found), in carserv-restful/ide/eclipse/launch there are the various client launch configurations.

Hope that helps, Dan

06 Jan 2010, 04:50
Desai Sweta Y. (14 posts)

Thanks for the very quick response Dan,

That helped. Actually the problem was, the launch configuration file in carserv application for restful is named exploration#viewer_restful.launch0000064, therefore the ide wasnt showing this in the option.. renaming it.. it atleast showed me the glimpse of starting the jetty server.. but then it is again giving the error as mentioned below..

Exception in thread “main” java.lang.NoClassDefFoundError: javax/ws/rs/core/Application at java.lang.ClassLoader.defineClass1(Native Method) at java.lang.ClassLoader.defineClass( at at at$000( at$ at Method) at at java.lang.ClassLoader.loadClass( at sun.misc.Launcher$AppClassLoader.loadClass( at java.lang.ClassLoader.loadClass( at java.lang.ClassLoader.loadClassInternal( at java.lang.ClassLoader.defineClass1(Native Method) at java.lang.ClassLoader.defineClass( at at at$000( at$ at Method) at at java.lang.ClassLoader.loadClass( at sun.misc.Launcher$AppClassLoader.loadClass( at java.lang.ClassLoader.loadClass( at java.lang.ClassLoader.loadClassInternal( at org.starobjects.restful.viewer.embedded.EmbeddedWebViewerRestful.getWebAppSpecification( at org.nakedobjects.runtime.NakedObjects$1.evaluate( at org.apache.commons.collections.CollectionUtils.filter( at org.nakedobjects.runtime.NakedObjects.findWebViewers( at org.nakedobjects.runtime.NakedObjects.bootstrapViewers( at org.nakedobjects.runtime.NakedObjects.bootstrapNakedObjects( at at org.nakedobjects.runtime.NakedObjects.main( Caused by: java.lang.ClassNotFoundException: at$ at Method) at at java.lang.ClassLoader.loadClass( at sun.misc.Launcher$AppClassLoader.loadClass( at java.lang.ClassLoader.loadClass( at java.lang.ClassLoader.loadClassInternal( … 32 more

Is this jdk version problem?

Hope you will help again, Sweta.

06 Jan 2010, 06:22
Desai Sweta Y. (14 posts)

Hi Dan,

Thank you so much for the help. The problem I just mentioned in the previous post is been solved. The application was running short of important jars in the classpath.

Thanks a lot Dan, Sweta.

02 Feb 2010, 06:53
Desai Sweta Y. (14 posts)

Hi Again,

I have successfully created the RESTful HotelBooking application. In that I have an action called checkAvailability(java.lang.String,org.hotel_booking.roomtype.RoomType,org.nakedobjects.applib.value.Date,org.nakedobjects.applib.value.Date) on Customer object. Now as this is having for parameters to be passed.. whenever I invoke the service from the REST viewer the URL turns out to be.. http://localhost:8080/object/OID:27/action/checkAvailability(java.lang.String,org.hotel_booking.roomtype.RoomType,org.nakedobjects.applib.value.Date,org.nakedobjects.applib.value.Date)

But when i m invoking the same URL in the client to use this service. Its giving me the error as i m not passing the parameters it seems. I am unaware how do i pass parameters to the function checkAvailability from my client application.

Please help, Sweta

02 Feb 2010, 07:54
Dan Haywood (133 posts)

Hi Desai,

First, could you create a new thread for new questions? It makes it easier for others browsing the forum to see when there’s new content.

Second, though, to answer your question. For the String and Dates, these are value types and so are parseable from string formats. Whatever format works in the DnD viewer should also work for the Restful viewer.

For the RoomType, this is (I presume) not a value type, instead it is a reference to a RoomType entity. So you need to provide the (string format of the ) OID of this object. Note that the OID is created ultimately by the Object Store, so the precise format will depend on which object store you are running with.

These values are all passed as parameters named arg0, arg1, arg2 etc. So for example you would have: * arg0=valueOfFirstStringArg * arg1=oidOfRoomType * arg2=valueOfFirstDateArg * arg3=valueOfSecondDateArg

Lastly, when you invoke the URI you should perform a POST.

There is some further detail in the online user guide, see (It doesn’t, admittedly, describe the format of the arguments, though … I must fix that).


  You must be logged in to comment