From: Dan M. <dan...@gm...> - 2014-07-08 12:35:23
|
Hello Wolfgang, Thank you for your quick response! Your comment that the *name()* function is the root cause of the problem seems to be correct. I only had a single place in the scripts that called it. Here is a summary of the offending line that was causing the Java Null Pointer Exception. What I was doing was looking through a library system EAD file "finding aids" for all elements that had the element name "corpname": * let $name-elements := collection('/db/apps/mnhs/data-ead')//*.*[name(.) = 'corpname']* what I realized was that the first period in the path expression included items that were not true XML "elements" but might also include document nodes, comments, PIs and other non-elements. So by changing the line to be the following: * let $name-elements := collection('/db/apps/mnhs/data-ead')//*[name(.) = 'corpname']* All the NPE errors immediately went away. This filtered out the non element nodes that correctly had names. I did have some data corruption but a reload seems to have fixed this. So all I did was replace the period after the "//" with a asterix which then ONLY selected elements, not other node types. Thanks! - Dan On Tue, Jul 8, 2014 at 1:36 AM, <wol...@ex...> wrote: > Hi Dan, > > > I am getting a strange Java Null Pointer Exception after I do a set up > update operations. The first set up updates seem to work but after that > they all seem to fail. > > Could you check if the parameter you pass to fn:name is a variable whose > value was assigned before the update? The variable may hold a reference to > a node which was moved or removed during the update and thus became > invalid. This would explain the issue (for sure it should not lead to a > NullPointer exception but yield an error). Could you send me the relevant > part of the query? > > Wolfgang -- Dan McCreary http://danmccreary.com Co-author: Making Sense of NoSQL <http://manning.com/mccreary> office: (952) 931-9198 cell: (612) 986-1552 skype: dmccreary47 |