[jsword-devel] jnlp/jsword.jar/Books does not have installed() method

DM Smith jsword-devel@crosswire.org
Mon, 29 Mar 2004 15:50:07 -0500


Norbert, I found a couple of things:

Books does have a static method called installed().

The name of the bible has to be the same as the Description in the *.conf. 
In the case of GerSch, it would be:
German Schlachter Bibel (1951)

There is a race condition in the code and I am not sure how to fix it 
without doing some experimenting and some reading on synchronization. The 
problem is that the RegisterRunnable.run() gets there late if I run the 
program, but if I debug and step then it gets there early. If it is late 
then getBookMetaData(BIBLE_NAME) gets there late.

As a hack until the race condition is fixed, you can add the following to 
the beginning of the readPlainText method (This may cause a different race 
condition, with a book exception elsewhere, but it worked for me).
try
{
    BookDriver driver = new SwordBookDriver();
    Books.registerDriver(driver);
}
catch (BookException e)
{
    System.err.println("Driver was already installed");
}

I am assuming that you are also using (you can get these from the same 
directory where you got jsword.jar):
jsword-osis.jar
resource.jar
jaxb-api.jar
jaxb-libs.jar
jaxb-ri.jar
jdom.jar
log4j-1.2.7.jar
tar.jar
These are very static and you should only need to download them once.

You should not need:
jsword-gui.jar (may be renamed to jsword-swing.jar)
lucene-1.3-final.jar
winlaf-0.4.jar

Norbert Plött wrote:
>
>Hey Joe,
>
>so I today I got
>
>    http://www.crosswire.org/jsword/jnlp/jsword.jar
>
>assuming that this would  reflect the status of the nightly build, and the
>status of the changes you described:
>
> > There are instructions on how to do this on the website. You example you
> > cite has changed:
> >
> >     public void readPlainText() throws BookException, 
>NoSuchVerseException
> >     {
> >         Passage ref = PassageFactory.createPassage("Mat 1 1");
> >         Book bible =
> > Books.installed().getBookMetaData(BIBLE_NAME).getBook();
> >
> >         BookData data = bible.getData(ref);
> >         String text = data.getPlainText();
> >
> >         System.out.println("The plain text of Mat 1:1 is "+text);
> >     }
> >
> > There are 2 main changes - firstly I changed Books to be a singleton
> > (accessed using Books.installed) rather than the collection of static
> > methods that it was previously.
> > This enabled us to have collections of Books that were other than the
> > installed ones (useful for the book installation system)
> > Secondly I didn't like the way Defaults worked (or more accurately
> > didn't work) so I added a method on the BookList interface to get a book
> > by name.
>
>I pasted this into my example and got the following compiler errors:
>
>de/nops/BibleStat/Gui/BibleStatGui.java [146:1] cannot resolve symbol
>symbol  : method installed ()
>location: class org.crosswire.jsword.book.Books
>             Book bible =
>Books.installed().getBookMetaData("GerSch").getBook();
>                               ^
>de/nops/BibleStat/Gui/BibleStatGui.java [147:1]
>getData(org.crosswire.jsword.book.Key) in org.crosswire.jsword.book.Book
>cannot be applied to (org.crosswire.jsword.passage.Passage)
>             BookData data = bible.getData(ref);
>                                  ^
>I looked into the jsword.jar and found, that Books actually does not have a
>method installed().
>Does this mean that I cannot the current jsword.jar directly but have to 
>use
>the webstart page DM Smith wrote about?
>
> > The WebStart page now downloads the nightly build. I am not sure that 
>this
> > will continue once the next release happens. The download will be about 
>5M
> > initially. After that it will only get the changes (provided the nightly
> > does not do a clean build, but an incremental). You will need to dig on 
>your
> > machine to find the jar files. For me they were installed at (on Windows
> > XP):
>
>I am using SuSE Linux, KDE Desktop, so I'd have to figure myself where the
>jars go?
>Or what happened?
>
>Bye Norbert
>
>_______________________________________________
>jsword-devel mailing list
>jsword-devel@crosswire.org
>http://www.crosswire.org/mailman/listinfo/jsword-devel

_________________________________________________________________
Get rid of annoying pop-up ads with the new MSN Toolbar – FREE! 
http://toolbar.msn.com/go/onm00200414ave/direct/01/