The Author Online Book Forums are Moving

The Author Online Book Forums will soon redirect to Manning's liveBook and liveVideo. All book forum content will migrate to liveBook's discussion forum and all video forum content will migrate to liveVideo. Log in to liveBook or liveVideo with your Manning credentials to join the discussion!

Thank you for your engagement in the AoF over the years! We look forward to offering you a more enhanced forum experience.

citu_adrian (17) [Avatar] Offline
#1
Listing xx "Bundle configuration by example" (page 72)

String port = context.getProperty();
should be
String port = context.getProperty("org.foo.shell.port");

and
String max = context.getProperty();
should be
String max = context.getProperty("org.foo.shell.connection.max");

Cheers,

Adrian
karl.pauls (3) [Avatar] Offline
#2
Re: Chapter 3: errata
Got it. Thanks.
ksangani (3) [Avatar] Offline
#3
Re: Chapter 3: errata
Look at the highlighted text which is either misspelled, missing or extra.

Page 69, paragraph 2
As we mentioned in chapter 2, the framework ensures all dependencies of a bundle are satisfied before the it can be used

Page 74, paragraph 3
Any exceptions throw from the activator will result in a failed attempt to start the bundle and

Page 78
Bundle id 4 is used in various commands while the listing shows the bundle id as 2.

Page 81, paragraph 2
In case you, your bundle may have difficulty dealing with the newer state formats, so it is probably the best if your implement your bundles to delete any existing state if they cannot understand it.

Page 90, paragraph 4
It's stop method would have been called so its

Page 98, paragraph 2
you will see how the bits and peaces fit together immediately.

Page 99, paragraph 2
If you remember, we really only need the to know
richard.hall (87) [Avatar] Offline
#4
Re: Chapter 3: errata
All fixed. Thanks.
schildmeijer (15) [Avatar] Offline
#5
Re: Chapter 3: errata
p.63
section 3.4 Using the lifecycle layer API
7th row
before: "single bunle JAR file"
after: "single bundle JAR file"
richard.hall (87) [Avatar] Offline
#6
Re: Chapter 3: errata
Looks like we already caught that one, but thanks for reporting it.
schildmeijer (15) [Avatar] Offline
#7
Re: Chapter 3: errata
p.80
row8
before: "This is because a bundle is not notified it is being uninstalled"
afger : "This is because a bundle is not notified if it is being uninstalled"
schildmeijer (15) [Avatar] Offline
#8
Re: Chapter 3: errata
p.80

The class Activator implements BundleContext. I think it should implement BundleActivator.
richard.hall (87) [Avatar] Offline
#9
Re: Chapter 3: errata
Thanks fixed them both.
schildmeijer (15) [Avatar] Offline
#10
Re: Chapter 3: errata
p.98
section 3.8 Activating paint program

"...easily reuse use the resulting bundle..."

remove use
richard.hall (87) [Avatar] Offline
#11
Re: Chapter 3: errata
Got it. Thanks.
asenft (5) [Avatar] Offline
#12
Re: Chapter 3: errata
I just spotted one small typo in chapter 3.1.2, last paragraph (p 81):
"Instead of “you get what you get”, wouldn't be great if you could
offer “you get what you need”?"

I guess it should be ... wouldn't it be great...
asenft (5) [Avatar] Offline
#13
Re: Chapter 3: errata
...and another one at the end of ch. 3.2.1 (p 84):

"Finally, in section 3.2.5 we will wrap up our top-down approach with a review the OSGi
lifecycle state diagram."

should be ... with a review of the...

Regards,
Andreas
serverdude (24) [Avatar] Offline
#14
Re: Chapter 3: errata
Section 3.2.1 page 82-83 The bundle IDs don't correspond to those of figure 3.2, nor do the filenames of the bundles. I get the bundle IDs corresponding to the image when installing the files from the telnet part.

e.g. "install file:../paint-example/bundles/paint-3.0.jar" Bundle: 2

This gives the 'start [id]' kind of a mismatch, which is kind of solved as the order of the 2 first bundles are different in the telnet and image parts.

---

Page 90 4th last line -"section [ref]" should point to section 2.5.2 "Bundle identification"

---

Some code listings are inconsistent with the sample code.
Listing 3.5 "Bundle configuration by example" p. 96-97 implementation differs slightly.

Listing 3.7 "Bundle start command" p. 99-100 'exec' signature differs

Listing 3.8 "Bundle stop command" p. 100-101, 'exec' signature and code due to the mentioned suicide issues. Code is remedied in listing 3.16 p. 112

Listing 3.9 "Bundle update command" p.101, same issues as 3.8

Listing 3.10 "Bundle uninstall command" p.102, same issues as 3.8

Listing 3.11 "Bundle information example" p.103, 'exec' signature

Listing 3.13 "Bundle persistent storage example" p.106, inconsitent with sample code

Listing 3.21 "Processing shapes in ShapeTracker", p.118 last 5 lines are superflous, seems like a paste error.
Dictionary dict = bundle.getHeaders();
String name = (String) dict.get(SimpleShape.NAME_PROPERTY);
if (name == null) {
return;
}

---

p.125, 2nd line of list item 1 at bottom of page, change "it" to "if"
"(or from all updated or uninstalled bundles it null is specified)"
"... bundles if null ..."
richard.hall (87) [Avatar] Offline
#15
Re: Chapter 3: errata
> ...and another one at the end of ch. 3.2.1 (p 84):
>
> "Finally, in section 3.2.5 we will wrap up our
> top-down approach with a review the OSGi
> lifecycle state diagram."
>
> should be ... with a review of the...

Thanks Andreas, I fixed the last typos you mentioned.
richard.hall (87) [Avatar] Offline
#16
Re: Chapter 3: errata
We'll look into the example to make sure the code is aligned. Although some of the difference may be due to the progression of the example. In other words, the actual code only shows the last state, while the examples in the book show how we progressed to that state. Thanks!
jpclouse (8) [Avatar] Offline
#17
Re: Chapter 3: errata
1. On page 91 pluralize the word "method" near the end of the sentence "As we cover most of these methods, we will see that most lifecycle operations are method on the Bundle object."
2. On page 97 is the sentence "However, the specification does require bundle configuration properties be backed by system properties, so you can still set use system properties in a pinch." Remove the word "set".
3. Where are the properties org.foo.shell.port and org.foo.shell.connection.max defined? I didn't see them among the source files.
4. On page 108 is the sentence "One tricky issues, though, is the update lifecycle operation may also be used
to downgrade a bundle." The word "issues" should be singular.
5. On page 110 the text "FrameworkEvent.Info" is a hyperlink but should not be.
6. On page 111 is the sentence "We've mentioned it numerous time: a bundle is not supposed to change its own state." Pluralize "time."
7. Many of the chapter 3 figure captions have a leading "Ch3."
8. Figure 3.12 shows two Square classes but no Triangle class.
9. The statement in Listing 3.20 that assigns a new Bundle[] is missing a right-paren just after the cast to Bundle[]: "Bundle[] bundles = (Bundle[]"
richard.hall (87) [Avatar] Offline
#18
Re: Chapter 3: errata
> 1. On page 91 pluralize the word "method" near the
> end of the sentence "As we cover most of these
> methods, we will see that most lifecycle operations
> are method on the Bundle object."
> 2. On page 97 is the sentence "However, the
> specification does require bundle configuration
> properties be backed by system properties, so you can
> still set use system properties in a pinch." Remove
> the word "set".
> 3. Where are the properties org.foo.shell.port and
> org.foo.shell.connection.max defined? I didn't see
> them among the source files.

These are just hard-coded constants. Not the best practice, perhaps.

> 4. On page 108 is the sentence "One tricky issues,
> though, is the update lifecycle operation may also be
> used
> to downgrade a bundle." The word "issues" should be
> singular.
> 5. On page 110 the text "FrameworkEvent.Info" is a
> hyperlink but should not be.

I don't see this in the source, must be a result of the PDF conversion.

> 6. On page 111 is the sentence "We've mentioned it
> numerous time: a bundle is not supposed to change its
> own state." Pluralize "time."
> 7. Many of the chapter 3 figure captions have a
> leading "Ch3."
> 8. Figure 3.12 shows two Square classes but no
> Triangle class.
> 9. The statement in Listing 3.20 that assigns a new
> Bundle[] is missing a right-paren just after the cast
> to Bundle[]: "Bundle[] bundles = (Bundle[]"

Everything else has been fixed. Thanks.
jpclouse (8) [Avatar] Offline
#19
Re: Chapter 3: errata
1. In the second bullet item on page 122, the is the clause "while other method inspect other types of dependencies we will not talk about until chapter 5." This doesn't make sense.
2. On page 124 is the sentence "Sometimes you need have the framework recalculate a bundle's dependencies." Add "to" between "need" and "have".
3. On page 125 change "...so bundles dependent on it..." to "...so bundles depending on it...."
4. On page 128 is the statement "At this point, we've achieved a lot in understanding our understanding of the lifecycle layer,...." "understanding" appears twice.
5. On page 128 is the sentence "With experience it became clear clear that the specified definition of update was insufficient." Remove the redundant "clear."
richard.hall (87) [Avatar] Offline
#20
Re: Chapter 3: errata
Fixed, thanks.
Jan_Goyvaerts (4) [Avatar] Offline
#21
Re: Chapter 3: errata
Figure 3.9 (Storing state internally) is printed over text.
Jan_Goyvaerts (4) [Avatar] Offline
#22
Re: Chapter 3: errata
And so is figure 3.11
richard.hall (87) [Avatar] Offline
#23
Re: Chapter 3: errata
Sorry about the figures...that is an OpenOffice issue. I assume [and hope] all of those issues will be addressed in final production.
Jan_Goyvaerts (4) [Avatar] Offline
#24
Re: Chapter 3: errata
Let's hope so indeed. smilie

What's quite frequent also:

* Text cut by a page break is often at a different ident after the page break than before.
* Words/individual letters in words are in a different typeface.