small medium large xlarge

Errata for Modular Java

 

The latest version of the book is P1.0, released almost 7 years ago. If you've bought a PDF of the book and would like to upgrade it to this version (for free), visit your home page.

By default this page displays the errata for the latest version of the book. If you have a previous version, select it here:

If you've found a new error, please submit it.

  • Typo
  • Tech. error
  • Suggestion
  • Maybe next edition
  • Not a problem
  • Reported in: P1.0 (13-Jan-10)
  • Fixed: 13-Jun-10, awaiting book release
#42074
Paper page: 1
The examples do not build out of the box. The root pom.xml along with the hello modules all have various issues, most of which have been reported. P...more...
Michael Craig Walls says: A few things have changed since the examples were originally produced, such as some dependencies being removing from repositories and Pax Runner not starting the OSGi runtimes with the compendium bundle by default. The technology and tools moved while the printed book and published samples remained static. I will be providing a new zip file with current examples.
  • Reported in: P1.0 (13-Jan-10)
  • Fixed: 12-Jun-10, awaiting book release
#42075
Paper page: 1
Please update the book to include references to the source for the book. While it does mention it with "Download hello/src/main/..." What? seriousl...more...
Michael Craig Walls says: Addressed in 2nd printing
  • Reported in: P1.0 (19-Mar-10)
  • Fixed: 10-Jun-10, awaiting book release
#42469
Paper page: 24
The MANIFEST.MF file for the HelloWorld bundle should begin with: Manifest-Version: 1.0 When using Eclipse and exporting the HelloWord class as ...more...
Michael Craig Walls says: I do not believe that line is strictly required, but...if it makes things easier on Eclipse export, then I'll add it so that there's no confusion. Corrected for 2nd printing.
  • Reported in: P1.0 (06-Aug-09)
  • Fixed: 10-Jun-10, awaiting book release
#40359
Paper page: 32
To get the hello-service hello-consumer examples working, you have to do the following: In hello-service edit the pom.xml file and change the drone de...more...
Michael Craig Walls says: The Pax Drone dependencies should have never been there at all. In fact, they don't need to even be Pax Exam dependencies because that particular project never uses Pax Drone or Pax Exam. I've removed those dependencies in the latest example code that will soon be available for download (when I submit errata fixes for a 2nd printing). As for the mvn install steps...that is basic Maven stuff. For the hello-consumer to be able to resolve its dependencies, the hello-service needs to be in the local Maven repo. I've specified a bit more explicit instructions in the text of the 2nd printing.
  • Reported in: P1.0 (06-Aug-09)
  • Fixed: 10-Jun-10, awaiting book release
#40360
Paper page: 34
The example pom.xml file for hello-consumer is wrong. The correct dependencies section looks like this: <dependencies> <dependency> <...more...
Michael Craig Walls says: At one time the dependency was correct. But then I changed the service bundle's artifact and version. By that time I had the old version in my local Maven repo. So, when I forgot to change it in the consumer pom.xml it still worked because the old stuff was in my local repo. I've corrected this for the next distribution of the example code to go out along with the 2nd printing of the book.
  • Reported in: P1.0 (28-Jul-09)
  • Fixed: 10-Jun-10, awaiting book release
#40236
PDF page: 37
Examples doesn't work anymore due to inavailability of pax.drone. It seams, the latter has been renamed to pax.exam, but neither by maven nor by manua...more...
Michael Craig Walls says: I cannot find any references to Pax Drone anywhere in the book. I removed those references in favor of Pax Exam well before the book went to print. I do have some example code laying around that still has Pax Drone dependencies, however. If that code somehow made it into the downloadable examples, then I'll make sure that I remove it before packaging up any new examples for distribution.
  • Reported in: P1.0 (19-Dec-10)
#46052
PDF page: 40
The output examples from Equinox's console are not consistent with having followed the book's examples. The com.pragprog.HelloWorld_1.0.0 is in a RESO...more...
  • Reported in: P1.0 (07-Jul-09)
  • Fixed: 13-Jun-10, awaiting book release
#39860
Paper page: 49
Is the zip'd source code suppose to be fully functional or we need to modify it? Bundles are not configured correctly; i.e Missing imported package me...more...
Michael Craig Walls says: From the output shown here, it looks like the compass bundle wasn't installed. I can't say why exactly, as it installs fine for me. (I do have other issues with the downloaded code due to changes in Pax Runner since the book was published, but I do not have problems with the compass bundle not being loaded.) FWIW, I am working my way through the examples in the book step-by-step, as a reader would, noting all of the steps and output along the way. If I encounter a problem, I note it and document a resolution for it. Any changes necessary will be noted and fixed in a 2nd printing. So far, I've only encountered small issues stemming from a new version of Pax Runner starting the OSGi runtime without the compendium bundle. Aside from that, I've currently got the example working right up through the middle of chapter 5.
  • Reported in: P1.0 (19-Nov-09)
  • Fixed: 10-Jun-10, awaiting book release
#41558
Paper page: 54
first line says: dwmj% pax-create-bundle -p dwmj.domain -n domain \ -g com.dudewheresmyjar -v 1.0.0-SNAPSHOTs but later on this bundle is refe...more...
Michael Craig Walls says: Corrected for 2nd printing.
  • Reported in: P1.0 (11-Jun-10)
  • Fixed: 12-Jun-10, awaiting book release
#43718
Paper page: 54
Regarding the osgi.bnd file generated by pax-create-bundle, the book states "For the domain bundle, this file starts out empty." This is incorrect - t...more...
Michael Craig Walls says: Addressed for 2nd printing
  • Reported in: P1.0 (03-Jul-09)
  • Fixed: 10-Jun-10, awaiting book release
#39802
Paper page: 55
In page 55 after we run pax-create-bundle it is suggested to delete the example codes. I do that and continue on with creating the domain class (JarF...more...
Michael Craig Walls says: Good catch...I should have also mentioned that the activator entry should be removed from the osgi.bnd file. Fixed for the 2nd printing.
  • Reported in: B1.0 (04-Jun-09)
  • Fixed: 12-Jun-10, awaiting book release
#39314
PDF page: 55

For the footnote, Windows users can substitute a caret (^) in place of the Unix backslash to allow continuation of lines.--Tim Kuntz

Michael Craig Walls says: Addressed for 2nd printing.
  • Reported in: P1.0 (11-Jun-10)
  • Fixed: 12-Jun-10, awaiting book release
#43714
Paper page: 55

JarFile.java is missing import statements. The file contents should be:

package dwmj.domain

import java.util.Set;

public class JarFile {
...

Michael Craig Walls says: Addressed for 2nd printing.
  • Reported in: P1.0 (11-Jun-10)
  • Fixed: 12-Jun-10, awaiting book release
#43715
Paper page: 56
JarFile.java is missing imports statements (again). Should be: package dwmj.domain; import java.util.Set; import org.compass.annotations.*; ...more...
Michael Craig Walls says: Addressed for 2nd printing.
  • Reported in: P1.0 (11-Jun-10)
  • Fixed: 12-Jun-10, awaiting book release
#43716
Paper page: 59
The book describes how to use compass as a dependency, and then goes on to explain how to use PAX to add a repository. Adding the Compass project repo...more...
Michael Craig Walls says: When the chapter was originally written, the Compass dependencies were not in the central repo. Now they are. So, I recommended that this entire bit be removed for the 2nd printing. However, since this is a sizable change, there's no certainty that it will be removed. The best I could do is recommend it.
  • Reported in: P1.0 (23-Jul-09)
  • Fixed: 12-Jun-10, awaiting book release
#40158
PDF page: 61
pax-create-bundle created this line in osgi.bnd: Bundle-Activator: ${bundle.namespace}.internal.ExampleActivator but it needs to be removed to get t...more...
Michael Craig Walls says: Addressed for 2nd printing.
  • Reported in: B1.0 (02-Jun-09)
  • Fixed: 13-Jun-10, awaiting book release
#39301
PDF page: 63
I can't get pax-provision call to work. I'm working behind a proxy and read that equinox won't work... so predictably equinox fails on p. 56. Felix ge...more...
Michael Craig Walls says: I'd be interested to know what problems are being encountered here. I know I've run Equinox (via Pax Runner) behind a firewall before. I'm not living behind a corporate firewall these days, so I can't try it out right now. But I did run it several times today while disconnected from the internet altogether and had no troubles. So, I'm at a loss as to how to proceed on this issue. Are there specific errors that you're encountering?
  • Reported in: P1.0 (07-Aug-09)
  • Fixed: 12-Jun-10, awaiting book release
#40369
Paper page: 66
The instructions for setting up the pax-embed-jar process were confusing, in large part because of the figure at the bottom of page 66. What you ne...more...
Michael Craig Walls says: What you see there is an unfortunate artifact from how the book gets generated. The osgi-embedded.bnd file is really just a temporary duplicate of osgi.bnd so that I could have two versions side-by-side for book generation purposes. Don't concern yourself too much with what that means. Suffice it to say that there's no need for the osgi-embedded.bnd file in the real project. The change should only need to be made to osgi.bnd. I've noted that the header for the 1-line listing should be changed to "dwmj/domain/osgi.bnd" and this should be corrected in the 2nd printing.
  • Reported in: P1.0 (08-Nov-11)
#47917
Paper page: 78
I am following the book and everything works until I get to Page 78. I am getting the same error, as on Page 78 - Problem resolving project, when I tr...more...
  • Reported in: P1.0 (03-Dec-09)
  • Fixed: 12-Jun-10, awaiting book release
#41694
Paper page: 83
I am following dude, where is my jar! example. After importing pax-logging-api and pax-logging-service bundles, I was expecting to see the errors rela...more...
Michael Craig Walls says: An earlier version of Pax Runner started the OSGi runtime along with the OSGi compendium bundle in place. But the newest Pax Runner (which was released *after* the book was printed) does not install the compendium bundle, which the Pax Logging bundles depend upon. To fix the problem, you must simply install the compendium bundle with: pax-import-bundle -g org.osgi -a org.osgi.compendium -v 4.2.0 I've noted this change and will request that it be added to the 2nd printing.
  • Reported in: P1.0 (07-Oct-09)
  • Fixed: 12-Jun-10, awaiting book release
#40955
PDF page: 83
The pax-import-bundle here doesn't work, and the output in the book shows it too! It says "problem resolving project". I'm getting exactly the same ...more...
Michael Craig Walls says: The error shown in the book indicates that I had not yet built the wrapped compass bundle (the bundle produced in section 4.2 under "Wrapping JARs"). As long as I build that bundle, as recommended about 1/3 down the page on page 71), then I don't encounter the error. I have been reworking the examples by hand and will be submitting the results and output for a 2nd printing. The error that this issue describes should not have appeared in the printed book, as it represents a basic mistake that could have been avoided had I followed my own directions and built the wrapped compass bundle first. The 2nd printing should show the successful results. I also see that this issue speaks of version 2.2.0 of compass. While that may work, I used version 2.1.0, so your mileage will vary.
  • Reported in: P1.0 (15-Jul-09)
  • Fixed: 12-Jun-10, awaiting book release
#39997
Paper page: 85
Before importing ops4j pax logging bundles need to add repository $>pax-add-repository -i ops4j.releases -u <link http : // repository.ops4j.org/maven...more...
Michael Craig Walls says: Noted to be addressed for the 2nd printing.
  • Reported in: P1.0 (02-Jul-09)
  • Fixed: 12-Jun-10, awaiting book release
#39799
Paper page: 85
Hi, I followed the book to build the dudewheresmyjar project and when I reached page 85, I managed to get all modules installed and running but I got ...more...
Michael Craig Walls says: I'll address the exceptions separately for a different errata item that also describes them. However, the messages you see that show up periodically should cause no concern. They are simply debug messages indicating that Compass is optimizing itself. This is a good thing...not an error.
  • Reported in: P1.0 (13-Aug-09)
  • Fixed: 13-Jun-10, awaiting book release
#40442
Paper page: 85
I also get the infinite repetition issue with the pax-provision call on page 85. I cannot progress through Chapter 5 until this is explained. Here i...more...
Michael Craig Walls says: Notice that these stack traces are being logged at DEBUG level. They aren't a real problem...just an unfortunate way that Compass deals with a classloader gotcha. The gist of it is that Compass tries one approach to do its work, but that approach depends on classloader tricks that won't work in OSGi's locked-down classloading. So, Compass falls back on a different approach. But before it does the fallback, it logs the stack trace, giving the impression that something bad happened. I'll be recommending a change in the 2nd printing to alert the reader to this strange circumstance. In the meantime, it's easy enough to either ignore it or set the logging levels to ignore DEBUG logging from Compass.
  • Reported in: B1.0 (28-May-09)
  • Fixed: 13-Jun-10, awaiting book release
#39268
PDF page: 87
Have same problem described above. Getting NoClassDefFound errors from Compass. I'm haven't used Compass before, but what kind of demands is this m...more...
Michael Craig Walls says: See my comments on #40442.
  • Reported in: P1.0 (03-Sep-09)
  • Fixed: 13-Jun-10, awaiting book release
#40647
PDF page: 89
Having same problem as #39644, I applied advice given at #39997... and "ClassNotFoundException" on CompassConfiguration disappeared. My 2 cents.--...more...
Michael Craig Walls says: See my comment for #39997
  • Reported in: P1.0 (15-Sep-09)
  • Fixed: 13-Jun-10, awaiting book release
#40746
Paper page: 90
When creating the first test class to run with PAX Exam, it would be wise to stress that unlike normal JUnit tests, this one should not be put in a pa...more...
Michael Craig Walls says: I am recommending a footnote to be added in the 2nd edition that reads: It's important that IndexServiceBundleTest not be placed in the same package as the IndexService interface itself. Doing so would present a split-package situation where a package appears in multiple bundles--in this case, the index service bundle and the on-the-fly test bundle.
  • Reported in: B1.0 (28-May-09)
  • Fixed: 13-Jun-10, awaiting book release
#39269
PDF page: 90

Sorry, the errata above about NoClassDefFound errors should be for page 90, not 87. --Patrick Paulin

  • Reported in: P1.0 (25-Jun-09)
  • Fixed: 13-Jun-10, awaiting book release
#39644
PDF page: 90
Hello, For the index bundle, instead of having NoClassDefFoundError on IndexWriter I get NoClassDefFoundError on org.compass.core.config.CompassConf...more...
Michael Craig Walls says: See comments for #40647 and #39997
  • Reported in: P1.0 (29-Jul-09)
  • Fixed: 13-Sep-10, awaiting book release
#40251
Paper page: 92
I found that the tests wouldn't pass without making the following correction in IndexServiceBundleTest/configuration(): Was: mavenBundle().grou...more...
  • Reported in: P1.0 (07-Jul-09)
  • Fixed: 13-Jun-10, awaiting book release
#39859
Paper page: 92
running 'mvn test' from bundle-tests directory fails. I even tried from downloaded source code. Missing: ---------- 1) com.dudewheresmyjar.dude:...more...
Michael Craig Walls says: A last-minute decision was made to rename the "dude" directory to "dwmj". Apparently it was missed in a few places. I'll be distributing a new zip file with updated examples. I'll also be recommending changes for the 2nd printing to address these concerns.
  • Reported in: B1.0 (11-Jun-09)
  • Fixed: 13-Jun-10, awaiting book release
#39418
PDF page: 94
Hi, All over the book you can't seem to make up your mind over package name, some places you have it com.dudewheresmyjar.dude where as other places ...more...
Michael Craig Walls says: I couldn't find any mismatched packages anywhere in the book, with the exception of a few non-central examples. There may, however, have been some of the example code left inconsistent with the last-minute decision to go from "dude" to "dwmj". In any event, I'll be distributing a new set of example code for download as well as recommending some changes for the 2nd printing to address these concerns.
  • Reported in: P1.0 (19-Nov-09)
  • Fixed: 10-Jun-10, awaiting book release
#41563
Paper page: 95

Section 5.3, 1st paragraph, 4th line: ".. to look search for JAR files .." should either be "to look for" or "to search for"

--Per Holst

Michael Craig Walls says: Fixed for 2nd printing
  • Reported in: P1.0 (16-Sep-09)
  • Fixed: 13-Jun-10, awaiting book release
#40753
Paper page: 99
The code example for the SpiderActivator class uses an array of MavenSpider instances that is being looped through in the stop() method. This array is...more...
Michael Craig Walls says: Addressed for the 2nd printing.
  • Reported in: P1.0 (16-Sep-09)
  • Fixed: 13-Jun-10, awaiting book release
#40754
Paper page: 100
The "Deploying the Spider Bundle" paragraph speaks of the 'pax-add-dependency' script, yet it should be the 'pax-import-bundle' script, as there is no...more...
Michael Craig Walls says: Fixed for 2nd printing.
  • Reported in: P1.0 (17-Sep-09)
  • Fixed: 13-Jun-10, awaiting book release
#40763
Paper page: 101
I had to also add the wrapped compass depdendency to get spider to compile. spider% pax-import-bundle -g com.dudewheresmyjar.dwmj -a org.compass-pr...more...
Michael Craig Walls says: I'm not sure why you had to do that, as importing the domain bundle should have pulled the compass bundle in transitively. In fact, I have just run through the examples again (by hand) and had no trouble building the spider bundle, so long as I added the domain and index bundles.
  • Reported in: P1.0 (22-Dec-09)
  • Fixed: 13-Jun-10, awaiting book release
#41890
PDF page: 104
The actual code for Maven Spider, from a synchronized threading perspective, is potentially broken. public void run() { try { a...more...
Michael Craig Walls says: Fixed as I work through stuff for a 2nd printing. This actual code doesn't appear in the book, but I will make a new download available with this fix in place.
  • Reported in: P1.0 (12-Aug-10)
  • Fixed: 15-Aug-10, awaiting book release
#44580
Paper page: 112
The Spring version has changed in the maven repository. 1.2.0 is not more accessible. Changing 1.2.0 by 1.2.6 works fine. Maybe this has already be f...more...
Michael Craig Walls says: I'm not sure why you had trouble with 1.2.0...I just tried that for myself and it worked fine. 1.2.6 is not even a valid Spring-DM version (1.2.1 is the latest GA version for Spring-DM).
  • Reported in: P1.0 (16-Jul-09)
#40012
Paper page: 112
Need to add repository for spring bundles before importing the bundles. pax-add-repository -i com.springsource.repository.bundles.external -u <link...more...
Michael Craig Walls says: You may be right about this, but I need to dig into it a bit further to be sure that I'm not missing something else. (FWIW, I tried it without doing that and it worked fine, but I need to do more research to be sure).
  • Reported in: P1.0 (08-Jul-09)
  • Fixed: 13-Jun-10, awaiting book release
#39882
Paper page: 112
As the book enters the portion for Spring DM and its setup it asks to perform a pax-import-bundle from dwmjs. There are no prior references to this di...more...
Michael Craig Walls says: I had used a separate dwmjs directory for the Spring version of the project. I'm recommending that all occasions of "dwmjs" be changed to "dwmj" for the 2nd printing.
  • Reported in: P1.0 (12-Aug-10)
  • Fixed: 15-Aug-10, awaiting book release
#44581
Paper page: 118
Both ss and bundle outputs are different. Especially there is no entry under registered service ... No sure it is a technical error. 3 ACTI...more...
Michael Craig Walls says: If you see no published services under the index service bundle, then it's clear that something went wrong. That bundle should publish a service. I can't say for certain what went wrong...but if you "ss" commend lists a different set of bundles, that's probably it. In fact, looking at the list of bundles you have installed, I don't see the Spring-DM bundles...so that'd certainly explain why your service isn't published. Now, the question is...why were the Spring-DM bundles installed for you? I can't say, as I don't know what steps you followed up to this point. But page 112 shows what you need to do to get the Spring-DM bundles installed. I also see that you tried version 1.2.0 and had trouble, so you switched to 1.2.6. I'm not so sure that's the right answer. I just tried it with 1.2.0 and it worked for me. 1.2.6 is not even a valid Spring-DM version number (the latest GA version is 1.2.1).
  • Reported in: P1.0 (23-Nov-09)
  • Fixed: 10-Jun-10, awaiting book release
#41599
Paper page: 166

Same as #39847 (for PDF) Bundle IDs are referenced as 32 and 33 when they are listed as 35 and 36 respectively.--Per Holst

Michael Craig Walls says: Fixed for 2nd printing.
  • Reported in: P1.0 (07-Jul-09)
  • Fixed: 10-Jun-10, awaiting book release
#39847
PDF page: 168
Hi, thanks for a well-written book. Just like to highlight that web bundle and UI fragment ids should be 35 and 36 respectively instead of 32 and ...more...
Michael Craig Walls says: Fixed for 2nd printing
  • Reported in: P1.0 (23-Nov-09)
  • Fixed: 10-Jun-10, awaiting book release
#41601
Paper page: 192

index-context.xml has the "</beans>" tag in bold--Per Holst

Michael Craig Walls says: Fixed for 2nd printing.
  • Reported in: P1.0 (23-Nov-09)
  • Fixed: 10-Jun-10, awaiting book release
#41602
Paper page: 193

index-osgi.xml has the "</beans:beans>" tag in bold--Per Holst

Michael Craig Walls says: Fixed for 2nd printing