2009/7/2 Halliday, James Leonard <[email protected]> > > > I have a similar problem, but no newly defined field: I can't browse > > by author or subject, as I get a java.lang.NullPointerException very > > similar (or so it seems to me) to Lyn's error. (I've included the > > cocoon and java stacktraces below.) > > The same thing happened to me when I was implementing Embargoes (Author and > Subject browse stopped working), and here is the problem that I uncovered; > hopefully the same fix will work for you. (Note: I have only worked with the > 1.5.1 patch, but presumably the same fix will work for you.) I don't think > it's related to patching an existing database vs. using a fresh one, because > the error happens even on a fresh database, once you add data that includes > subject or author information. > > Your patch file is not patching the DSpace code correctly. Check the > dspace-api/src/main/java/org/dspace/browse/BrowseEngine.java class and the > patch file. It looks like the patch file is patching the BrowseByValue > method, instead of patching the BrowseByItem method, which it should be > patching. The two methods look very similar, so the patch is getting > confused. Double-check that class against the patch file manually, and make > sure the appropriate changes are being made. Once I did that, all of my > browsing problems were fixed. > > Another note: this bug is hard to find because the stack trace is coming from > the wrong place. There is a bug in the core DSpace class > org.dspace.app.xmlui.aspect.artifactbrowser.ConfigurableBrowse.java, in the > getValidity() method that is causing a null pointer exception when the > validity should be null (the last line for logging should include a null > pointer check). > > Jim Halliday
Ugh! Reading Java makes my brain hurt. You do appear to be correct! The patched dspace-api/src/main/java/org/dspace/browse/BrowseEngine.java has the embargo stuff in the browseByValue method from line 536 (of the patched file). I've copied those lines (536-566) to a similar spot in the preceding browseByItem method (line 366) and commented them out in the browseByValue method. I can now browse by Author, Subject as well as Titles. Thank you Jim! Sean -- Sean Carte esAL Library Systems Manager +27 72 898 8775 +27 31 373 2490 fax: 0866741254 http://esal.dut.ac.za/ ------------------------------------------------------------------------------ _______________________________________________ DSpace-tech mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/dspace-tech

