[jsword-devel] Newbie JSword Developer wishes to help

Joe Walker jsword-devel@crosswire.org
Mon, 23 Feb 2004 18:08:36 +0000


Hi,

DM Smith wrote:
> I do not have Sword or any Sword Modules installed.
> 
> 1) I tried the "Web-Demo" servlet interface on the web 
> (http://www.crosswire.org/jsword/demo.jsp) and it did not work.
> I got back a page from Tomcat server stating that the root cause was:
>    java.lang.NullPointerException
>     at org.crosswire.jsword.view.web.DemoServlet.init(DemoServlet.java:61)
> 
> It appears that the call to getBookMetaData can and did return null. The 
> call getBook() is chained to that call, which causes the NPE.
> 
> 2) I then tried the Web-Start interface from the web 
> (http://www.crosswire.org/jsword/jnlp.html)
> I clicked on the download button which downloaded 
> http:://www.crosswire.org/jsword/jnlp/jsword.jnlp.

Yes they are both broken.
There are 2 remaining jobs that need working on, one is small - wringing 
some sense out of JEditorPane for displaying text, and the other is 
making deployment easier.

> I have seen this problem before where the path in the jnlp file does not 
> match the path used to download the file.
> I think that changing
> <jnlp spec="1.0+" codebase="http://@HOSTNAME@/@WEBAPP@/" 
> href="jsword.jnlp">
> to
> <jnlp spec="1.0+" codebase="http://@HOSTNAME@/@WEBAPP@/" 
> href="jnlp/jsword.jnlp">
> will get past that problem.

Well I've changed that, and checked it in. The nightly build should put 
it live later.

> 4) I then tried the bat file and since it had "C:\Program Files" hard 
> coded, it did not work. I think that it should have a "pause" with a 
> "Hit any key to continue" when it can't find the program.

I don't have a good answer to the hard coded path problem. I took a look 
at the bat files for ant and tomcat and they both do similar things so I 
figured, if they haven't found a better solution...

The big difference between us and them is that JSword is not aimed at 
programmers so we can't expect our users to edit batch files.

> 5) So I tried to modify the bat file to point to the installed location. 
> The application came up but declared a NPE on line 58. It appears that 
> this is due to the fact that I have not installed modules. I think that 
> the application should come up with out error when Sword modules have 
> not been downloaded. From looking at the code a bit it seems that it 
> looks for books in the resources directory tree of the JSword install. A 
> bit of a "Catch 22"....

I've done a fair bit of work recently creating a module installer. 
Before that the approach I took was "module installation is your job", 
so I didn't worry too much about the zero modules problem.
There clearly are some zero module startup problems, which is funny 
because I thought I'd tested that.
There are several module drivers. The 'ser' driver uses serialized files 
and is supposed to be very quick looks in the resources tree. The Sword 
modules driver tries for a current C++ Sword installation, and a few 
other places.

> 6) So I loaded .9.6 into Eclipse and finally figured out how to get past 
> the error that I have to build to fix errors and that I had to tell ant 
> where tools.jar was. I then tried to run the application and did not 
> have much success. So at the prompting of the mailing list, I deleted 
> the project and connected to CVS.

CVS is the right way to go for sure - it has changed a lot since 0.9.6, 
as soon as I've killed the install bugs I need to do another release.

> 7) I ran the current code and I encountered a significant problem. I get 
> an error dialog before the main windo comes up, but the dialog is modal 
> and it is covered by the main window. The problem is that the main 
> window is unresponsive to the mouse and it looks like the program froze. 
> The only give away that it has not froze is that it repaints. I then had 
> to "Alt-Tab" to get to the dialog window to dismiss it.

Oh dear.
I recently changed code in ExceptionPane (see the comments on line 246) 
in an attempt to fix a problem along these lines elsewhere.
I think the problem is partly that we are doing some guessing as to how 
to parent the dialog and getting it wrong.
Do you know if there is a way to go from a window to find if there are 
any modal dialogs that are hanging off it?

> I have not worked in a CVS environment before (I used RCS, Sablime and 
> ClearCase) so I am not sure what the workflow model is or how the owners 
> of JSword wish me to participate.

The easiest thing for me would be for you to send me a patch file. It's 
easy using eclipse - just right click on the project and select "create 
patch ..."
A recursive, new files inclusive, unified (see the options in the 
wizard) patch is the right way to go.

I'm helping to organize a study weekend which is going to keep me from 
devoting any serious time to JSword for the next 3 weeks, but I should 
be able to look at installation after then.

Hope this helps.

Joe.