Вы находитесь на странице: 1из 5

Known Errors

"Distributed Computing", first edition, by M. L.


Liu
as of January 30, 2004

Although every effort was made to minimize the errors in the book, they manage to crop up inevitably. I
apologize for their presence.
As one who has toiled over the manuscript for so long, I am afraid I have lost my ability to spot errors in
the book. Your kind input to alert me to corrections will be truly appreciated; please do not hesitate to
write me at mliu@csc.calpoly.edu . Many thanks.

Known errors
Acknowledgements
1. I regret that I inadvertently left out the following name among the students to whom I
acknowledged my gratitude: Ching Kang Cheng.
2. A big thank-you is in order to Dr. Timothy Rolfe of the Eastern Washington University, who
kindly provided feedback on numerous errors and inconsistencies in the first edition.
Chapter 1
3. Page 7, "WHERE IT GOES" insert:
1. "Buth the information must still pass through many different companies and types of
equipment for everything to work properly." should read "But the information must still
pass through many different companies and types of equipment for everything to work
properly."
2. The label "Many mirrored font-end servers" should read "Many mirrored front-end
servers".
4. Page 13, Figure 1.5:

Although the caption of the figure promises "a stand-alone Java application (top) and the
code that activates it (bottom)", only the code for the application is shown --- there is no code
to activate it.
5. Page 14, Figured 1.6 (bottom):
The last line of code "<a href=" Hello.java">The source.</a>" should read "<a
href="MyApplet.java">The source.</a>" .
Note that there should be no blank(space) character in the file name
6. Page 15, Figure 1.7:
Although the caption of the figure promises "a servlet (top) and the code that activates it
(bottom)", only the code for the servlet is shown --- the code to activate it is missing.
Details on how to activate a servlet are provided in chapter 11.
7. Page 41, bottom figure in exercise d: A better coding style for the catch block following the
try block to be defined as follows:
catch (Exception e ){ /* error occurred with the sleep call */ e.printStackTrace( ); }
Chapter 4
8.
9.
10.
11.
12.
13.
14.
15.
16.
17.

Page 105, Figure 4.8, line 24: "getByName (args 0])" should read " getByName (args[0]) ".
Page 106, Figure 4.9,line 36: " mysocket.close( ); " should read " "mySocket.close( ); "
Page 108, Figure 4.11, line 37: " ex.printstackTrace(); " should read " ex.printStackTrace(); "
Page 116, Example 4 text, third line: " A Serversocket objct ... " should read " A ServerSocket
object ... "
Page 117: In the right-hand-side box, the arrow should go from BEFORE "close the data
socket." to BEFORE "write to the stream;"
Page 117, Figure 4.19, line 19: " This program requires three command line arguments. "
should read " This program requires two command line arguments. "
Page 122, Figure 4.22, lines 53-56 should be omitted.
Page 122, Figure 4.23, line 19: " This program requires three command line arguments. "
should read " This program requires two command line arguments. "
Page 131, Exercise 8.d: " printlin() " should read " println() "
Page 132, exercise 8e: " Modify Example5*.java so that the ConnectionAcceptor process
becomes the message sender and the ConnectionRequestor the message receiver. " should
read " becomes the message receiver and the ConnectionRequestor the message sender. " "

Chapter 5
18. Page 143, Figure 5.7, line 20 - in two places: " MyDatagramSocket " should read "
MyClientDatagramSocket
19. Page144, Figure 5.8, line 9 and line 11: " MyDatagramSocket " should read "
MyClientDatagramSocket "
20. Page 158, Figure 5.20, line 30: " if ((message.trim()).equals endMessage) " should read " if
((message.trim()).equals(endMessage)) "
21. Page 164, Figure 5.26, line 25: " Daytime server " should read " Echo server "
22. Page 170, Figure 5.31, line 12: " into " should read " int "
23. Page 170, Figure 5.31, line 30: " No " should read " Now "
24. Page 171, Figure 5.32, line 13: " Welcome to the Daytime client " should read " Welcome to
the Counter client "
25. Page 172, Figure 5.33, line 22, in two places: " MyDatagramSocket " should read "
MyClientDatagramSocket "
Chapter 6
26. Page 189, section 6.5, second paragraphline 3 : " three major classes in the API, the first
three ... " should read " three major classes in the API, the first two ... "

27. Page 191,line 2: " will make use of the static addres 224.0.0.1 ... " should read " will often
make use of the static addres 224.0.0.1 ... "
28. Page 191, code fragment in the middle of page :
29.
30.

// join a Multicast group at IP address 239.1.2.3 and port 3456


InetAddress group = InetAddress.getByName("239.1.2.3");

should read

// join a multicast group at IP address 224.0.0.1 and port 3456


InetAddress group = InetAddress.getByName("224.0.0.1");

31. Page 199, exercise 1b: the word casually should spell causally instead.
Chapter 7
32. Page 220, Figure 7.8,line 16: " throws java.rmi.RemoteException; " should read " throws
RemoteException; "
33. Page 221, Figure 7.13,line 19: " return "Hello, World!" + name; " should read " return
"Hello," + name + "!"; "
34. Page 222, Figure 7.14,line 63: There should be a semicolon at the end of the line.
35. Page 223, Figure 7.15,line 19: " namer " should read " name "
Chapter 8
36. Page 233, 7th line up from the bottom: " and most processes particiapting in a real-time
online auction are to be notified " should read " and processes particiapting in a real-time
online auction must be notified "
37. Page 234, 7th line from top: " while (!(h.HasBiddingStarted( )) {;} " should read " while (!
(h.HasBiddingStarted( )) {... Thread.sleep(5000); ...} "
38. Page 236, 9th line in code fragment: " public string notifyMe(String message) " should read "
public String notifyMe(String message) "
39. Page 237, Figure 8.3, line 17: " public void notifyMe(String message) " should read " public
String notifyMe(String message) "
40. Page 238, Figure 8.4, line 17 : " public string notifyMe(String message) " should read " public
String notifyMe(String message) "
41. Page 238, Figure 8.5, line 26 : " host namer " should read " host name "
42. Page 239, Figure 8.5, line 37 : " "rmi://localhost" + portNum + "/callback"; " should read "
"rmi://" + hostName + ":" + portNum + "/callback"; "
43. Page 239, Figure 8.5, line 44 : " CallbackClientInterface " should read " CallbackClientImpl
"
44. Page 239, Figure 8.5, line 49-55:
try {
Thread.sleep(time * 1000);
}
catch (InterruptedException ex) { // sleep over
h.unregisterForCallback(callbackObj);
System.out.println("Unregistered for callback.");
}

should be replaced with

Thread.sleep(time * 1000);
h.unregisterForCallback(callbackObj);
System.out.println("Unregistered for callback.");

45. Page 241, Figure 8.7, lines 23, 29, 44, 53 : " java.rmi.RemoteException " should read "
RemoteException "
46. Page 241, Figure 8.7, line 49 : " clientwasn't " should read " client wasn't "
47. Page 242, Figure 8.8, line 36 : " HelloServer.main " should read " CallbackServer.main "
48. Page 251, Figure 8.12,line 22: " namer " should read " name "
49. Page 251, Figure 8.12,line 34: " "rmi://localhost" + portNum + "/callback"; " should read "

"rmi://" + hostName + ":" + portNum + "/callback"; "


50. Page 251, 6th and 7th lines from the bottom of the page:
//permission java.net.SocketPermission "*:1024-65535",
//
"connect, accept, resolve";

should read

permission java.net.SocketPermission "*:1024-65535",


"connect, accept, resolve";

51. Page 252, in the "Specifying Stub Downloading and a Security Policy File" section, the
command for activating the server:
java -Djava.rmi.server.codbase=

should read

java -Djava.rmi.server.codebase=

52. Page 253, Figure 8.13, box for HTTP Server: " SomeImpl_stub.class " should read "
SomeImpl_Stub.class "
Chapter 9
53. Page 261, Figure 9.2,line 9: " <IMG SRC="/images/myPhoto.gif"> " should read " <IMG
SRC="images/myPhoto.gif"> " (Note: It is more common to use a relative path, assuming
that there is a subdirectory named "images" in the current directory.)
54. Page 261, Figure 9.2,line 13: " <IMG SRC="/doc/myResume.html"> " should read " <IMG
SRC="doc/myResume.html"> " (Note: It is more common to use a relative path, assuming
that there is a subdirectory named "doc" in the current directory.)
55. Page 269, Figure 9.6,line 2: " import MyStreamSocket " should be replaced with a blank line.
56. Page 269, Figure 9.6,line 21-22:
InetAddress host =
InetAddress.getByName(args[0]);

should read

String host =
args[0]);

57. Page 269, Figure 9.6,line 2.6; for consistency:


"GET " + fileName + " HTTP/1.0\n\n";

should read

"GET " + fileName + " HTTP/1.0\r\n";

58. Page 271, Figure 9.7,line 24:


URL theURL = new URL("http", host, port);

should read

URL theURL = new URL(URLString);

Chapter 10
59. Page 314, Figure 10.4: the rightmost box on the second tier should have a subscript of n
instead of 2 .
60. Page 314, Figure 10.4: the rightmost box on the third tier should have a subscript of n instead
of 2 .
61. Page 328, Figure 10.14,lines 6-11:
import
import
import
import
import
import

should read

HelloApp.*;
org.omg.CosNaming.*;
org.omg.CosNaming.NamingContextPackage.*;
org.omg.CORBA.*;
org.omg.PortableServer.*;
org.omg.PortableServer.POA;

import HelloApp.*;

import org.omg.CORBA.*;

62. Page 329, Figure 10.15,line 1 should be followed by these lines:


import
import
import
import

HelloApp.*;
org.omg.CosNaming.*;
org.omg.CORBA.*;
org.omg.PortableServer.*;

Chapter 11
63. Page 369, Figure 11.30,line 9: " m:getStateNam eResponse ... " should read "
m:getStateNameResponse ... "
64. Page 371, Figure 11.11,line 4: " This method is invoked by a client to seee ... " should read "
This method is invoked by a client to see ... "
65. Page 373, 15 lines from bottom : " where URL refers to an object of the Java URL class, "
should read " where url refers to an object of the Java URL class, "
66. Page 374, Figure 11.34,line 13:
"http://services.xmethods.com:80/soap/servlet/rpcrouter"

should read

"http://services.xmethods.com:80/soap/servlet/rpcrouter");

67. Page 374, Figure 11.34,line 52:


throw new Exception( );

should read

throw new Exception(f.getFaultString());

Chapter 12
68. Page 397, Figure 12.9,line 43:
" at " + thisHost + " completed ";

should read

" at " + thisHost + " completed ");

69. Page 398, Figure 12.11,line 27:


String myName = "server" + args[0];

should read be followed by these comment lines:


// Note that the servers are expected to be each started
// with a command line argument of 1, 2, and 3 respectively.

Acknowledgement
Please allow me to thank the following individuals for sending in errors that they spotted:
Dr. Timothy Rolfe, Professor, Computer Science Department, Eastern Washington University

Вам также может понравиться