• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

source code question

 
Joe Stewart
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Andrew, the examples for your book don't compile with the files Server.java and RmiSocketExample.java.

Server.java gives a duplicate class error, and RmiSocketExample.java has numerous problems. Are these files just work product that you forgot to remove, or do you have a new RmiSocketExample.java?
[ December 31, 2005: Message edited by: Joe Stewart ]
 
Joe Stewart
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Andrew, I also notice that the DennysDVDs2.0 test harness code is missing from the source code archive. The book states that is should be in the directory src/sampleproject/test, but the directory does not exist.
[ December 31, 2005: Message edited by: Joe Stewart ]
 
Andrew Monkhouse
author and jackaroo
Marshal Commander
Pie
Posts: 11852
185
C++ Firefox Browser IntelliJ IDE Java Mac Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Joe,

Sorry - RmiSocketExample.java is not meant to be in that directory (I will have to check with my co-author, but I think that class is not meant to exist at all). Likewise Server.java should not exist either.

I will have to add a comment in the eratta that RmiProblem.java has a Server class, so you cannot have it compiled at the same time as compiling Server.java (however as previously mentioned, Server.java should not exist).

As for the test code - we had made a concious decision not to include test code in the book itself (long story), and I thought we had removed any statements suggesting that we would provide test code. I will have to check into this.

Regards, Andrew
 
Joe Stewart
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Andrew,

The file NotifyVersusNotifyAll.java included in the source archive differs from the code in the book, and does not behave as shown in the book. I changed line 25 to mutex.wait(2000); and then it works as shown.

It's not clear to me from your earlier reply why the test code wasn't included in the source archive. Is the code as shown in the book, chapter 9, for DBTester.java and DBTestRunner.java complete and correct? If I take the time to type it up myself, will it compile and run properly?
 
Andrew Monkhouse
author and jackaroo
Marshal Commander
Pie
Posts: 11852
185
C++ Firefox Browser IntelliJ IDE Java Mac Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Joe,

Sorry for the delay in responding to this.

A new version of the codebase should be uploaded in the next day or two. It will have the test package and corrections to the "src - examples" code.

Unfortunately changing line 25 to mutex.wait(2000) does not show the difference between notify() and notifyAll(). The code should read as:

Thanks for all your comments. Please let me know if you find more issues.

Regards, Andrew
[ January 12, 2006: Message edited by: Andrew Monkhouse ]
 
Joe Stewart
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Andrew,

Thanks. I get the following error when compiling the test package:

joe@notebook:~/scjd/src> javac sampleproject/test/*.java
sampleproject/test/DBTester.java:50: getRemote(java.lang.String,java.lang.String) in sampleproject.remote.DvdConnector cannot be applied to ()
db = DvdConnector.getRemote();
^
1 error

Also, what is the link to the current errata list? The only link I could find on the book's page is to a submission form.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic