[
http://jira.dspace.org/jira/browse/DS-636?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=11739#action_11739
]
Tim Donohue commented on DS-636:
--------------------------------
Was discussed during DSpace Devel Mtg on Oct 6 2010:
[20:10] <tdonohue> Error Check Needed for handle.prefix in Dspace.cfg :
http://jira.dspace.org/jira/browse/DS-636
[20:10] <tdonohue> (mdiggory -- yea, that is true -- metadata librarians are
adamant about that)
[20:11] <stuartlewis> No harm in adding that - a small tweak that might help
someone.
[20:11] <tdonohue> what do folks think about DS-636 -- should we add in this
simple error check to see if 'handle.prefix' is set in dspace.cfg?
[20:12] <mhwood> At least it should not NPE.
[20:12] <mdiggory> agree
[20:12] <PeterDietz> would we default to 123456789?
[20:12] <stuartlewis> But it won't stop the NPE, just report on it.
[20:13] <tdonohue> sounds like we have a consensus on some sort of check. Does
someone want to take lead on it?
[20:13] <richardrodgers> +1 should be logged
[20:13] <stuartlewis> Or should we default to something like
"missing.handle.prefix"?
[20:14] <tdonohue> I'm fine with just logging it, and potentially just adding a
'throw new Exception()' in there that says it is missing.
[20:14] <mdiggory> tbh, the handle prefix really is a critical design flaw with
DSpace....
[20:14] <mhwood> Have configuration manager check it at startup and exit if
missing?
[20:14] <mdiggory> what if you do not want to have /handle/123456..../1
[20:15] <mdiggory> what if your not using handles?
[20:15] <tdonohue> mdiggory -- that's a bigger flaw in DSpace which will take
longer to resolve. Right now, don't we *require* a handle prefix?
[20:15] <mdiggory> what should the default value be there, and shouldn' it be
something agnostic to hadles
[20:15] <mhwood> dspace.example.com
[20:15] <mdiggory> how would there "not" be one
[20:16] <mdiggory> maybe there should be a hardcoded default rather than
working about NPE and wanrings
[20:17] <mdiggory> working = worrying .... wanrings = warnings
[20:17] <mhwood> I don't think it should be a warning; it should either default
or quit cleanly.
[20:17] <tdonohue> sounds like either mhwood or mdiggory is about to volunteer
:)
[20:18] <tdonohue> I think we just need a volunteer to propose a well-tested
solution, that we can approve. anyone?
[20:19] <mhwood> Any consensus on default/quit/keep NPE?
[20:19] <PeterDietz> I'm in favor of having the code default to default of
123456789
[20:20] <tdonohue> technically we already default to 123456789 in dspace.cfg --
this only happens, if you explicitly clear out that default
[20:20] <keithgilbertson> warn if no value, but default
[20:20] <mdiggory> I love that ConfigurationManager has no method....
getProperty("key", "default");
[20:20] <richardrodgers> I'm not crazy about default values - too much risk of
mis-assigning lots of items...
[20:20] <stuartlewis> Yes, so defaulting to the same value in two places might
make it harder to track down
[20:20] <mdiggory> but tons of other convenience methods
[20:21] <tdonohue> yea, i'd rather throw an error here, or refuse to startup
(quit), since we already have a default elsewhere
[20:22] <keithgilbertson> I guess so. Why run the hdl server at all if you're
not using a real prefix
[20:22] <keithgilbertson> maybe best to quit
[20:22] <mdiggory> but the value is also used in the interface and all the
local URL
[20:23] <mdiggory> so if I do not want to run a handle service, why would I
suggest I am publishing handles by using a handle prefix?
[20:24] <stuartlewis> Is this bit of code in handlemanager, in which case is it
only invoked it your are using handles?
[20:24] <mdiggory> Thats conflated
[20:24] <PeterDietz> its also in ItemUpdate
[20:24] <mdiggory> you have to use Handlemanager as its hardcoded
[20:25] <tdonohue> so -- no agreement here? not even on just the 'quit' option?
It seems like the way DSpace currently behaves, we are *requiring* that
handle.prefix has a value (even if it's a dummy value).
[20:25] <mhwood> Sounds like we need two tickets: this one, to fix the crash,
and another to revamp the guts of DSpace so that Handles can be replaced with
something else, or nothing.
[20:26] <mdiggory> HandleManager is used within DSpace as a means to resolve
any /handle/xxxx value to an Object
[20:26] <mhwood> If no one else wants it, I will fix to complain and exit.
[20:27] <tdonohue> ok, assign DS-636 to mhwood. We may also want to open a new
ticket to look into making DSpace less dependent on Handles (a larger project)
[20:27] <mdiggory> agreed
...
[20:30] <PeterDietz> Whats the solution to DS-636, add log / error reporting /
quit... or set default value?
[20:30] <mhwood> I was going to have it quit with a clear error
[20:30] <mdiggory> Define quit?
[20:31] <richardrodgers> System.exit
[20:31] <mhwood> Good point, I have to see where-all it is used.
[20:31] <mhwood> Can't System.exit in a webapp.
[20:31] <mhwood> Well, you *can*....
[20:31] <tdonohue> I'd suggest for DS-636, mhwood investigate the best way to
'quit' and log an error, and make a suggestion for an appropriate fix
[20:32] <mhwood> Will do.
[20:32] <mdiggory> Calling System.exit in our code, even in the cli is bad
[20:33] <mdiggory> I recommend just setting a default... the code replacement
would be minimal and it would assure that the system is running always in the
expected state
> Error Check Needed for handle.prefix in Dspace.cfg
> --------------------------------------------------
>
> Key: DS-636
> URL: http://jira.dspace.org/jira/browse/DS-636
> Project: DSpace 1.x
> Issue Type: Bug
> Components: DSpace API
> Affects Versions: 1.6.0
> Reporter: Tim Donohue
> Assignee: Mark Wood
> Priority: Minor
>
> This was reported to the old SourceForge Bug Tracker (now closed down), by
> Jason (zenthanian):
> v1.60
> /dspace-api/src/main/java/org/dspace/handle/HandleManager.java
> needs to handle missing "hande.prefix" in dspace.cfg
> if not there the following line results in a null value
> String handlePrefix =
> ConfigurationManager.getProperty("handle.prefix");
> then the following line bombs with a nullpointer exception.
> return new StringBuffer().append(handlePrefix).append(
> handlePrefix.endsWith("/") ? "" : "/").append(id).toString();
> suggest to insert the following between the two lines
> if (handlePrefix == null)
> {
> log.warning("handle.prefix not set in config file.")
> }
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://jira.dspace.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
------------------------------------------------------------------------------
Beautiful is writing same markup. Internet Explorer 9 supports
standards for HTML5, CSS3, SVG 1.1, ECMAScript5, and DOM L2 & L3.
Spend less time writing and rewriting code and more time creating great
experiences on the web. Be a part of the beta today.
http://p.sf.net/sfu/beautyoftheweb
_______________________________________________
Dspace-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/dspace-devel