solrmarc: null pointer exceptions benign?

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

solrmarc: null pointer exceptions benign?

Delis, Christopher
Just wondering:

I'm getting a bunch of these:

   Adding record 264531: 288969
java.lang.reflect.InvocationTargetException
        at sun.reflect.GeneratedMethodAccessor2.invoke(Unknown Source)
        at
        sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at
        org.solrmarc.index.SolrIndexer.handleCustom(SolrIndexer.java:433)
        at org.solrmarc.index.SolrIndexer.map(SolrIndexer.java:422)
        at
        org.solrmarc.marc.MarcImporter.addToIndex(MarcImporter.java:308)
        at
        org.solrmarc.marc.MarcImporter.importRecords(MarcImporter.java:281)
        at org.solrmarc.marc.MarcImporter.main(MarcImporter.java:524)
Caused by: java.lang.NullPointerException


which get thrown, presumably, from the getCallNumberLabel function.  I
notice the following comment within this method:

   //TODO: handle null point exceptions...

Is there a good way to do this?  Should I just trap the exceptions so
that I can reduce the signal to noise ratio in my output -- i.e.,
these frequent error messages keep me from noticing anything else.

Thanks,
Chris

-------------------------------------------------------------------------
Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW!
Studies have shown that voting for your favorite open source project,
along with a healthy diet, reduces your potential for chronic lameness
and boredom. Vote Now at http://www.sourceforge.net/community/cca08
_______________________________________________
Vufind-tech mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/vufind-tech
Reply | Threaded
Open this post in threaded view
|

Re: solrmarc: null pointer exceptions benign?

Wayne Graham
Chris,

You found my note to myself :) I noticed that late last week and I hadn't had a chance to decide how to fix it...It's on my list though.

Wayne


On Wed, Jul 2, 2008 at 5:49 PM, Chris Delis <[hidden email]> wrote:
Just wondering:

I'm getting a bunch of these:

  Adding record 264531: 288969
java.lang.reflect.InvocationTargetException
       at sun.reflect.GeneratedMethodAccessor2.invoke(Unknown Source)
       at
       sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
       at java.lang.reflect.Method.invoke(Method.java:597)
       at
       org.solrmarc.index.SolrIndexer.handleCustom(SolrIndexer.java:433)
       at org.solrmarc.index.SolrIndexer.map(SolrIndexer.java:422)
       at
       org.solrmarc.marc.MarcImporter.addToIndex(MarcImporter.java:308)
       at
       org.solrmarc.marc.MarcImporter.importRecords(MarcImporter.java:281)
       at org.solrmarc.marc.MarcImporter.main(MarcImporter.java:524)
Caused by: java.lang.NullPointerException


which get thrown, presumably, from the getCallNumberLabel function.  I
notice the following comment within this method:

  //TODO: handle null point exceptions...

Is there a good way to do this?  Should I just trap the exceptions so
that I can reduce the signal to noise ratio in my output -- i.e.,
these frequent error messages keep me from noticing anything else.

Thanks,
Chris

-------------------------------------------------------------------------
Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW!
Studies have shown that voting for your favorite open source project,
along with a healthy diet, reduces your potential for chronic lameness
and boredom. Vote Now at http://www.sourceforge.net/community/cca08
_______________________________________________
Vufind-tech mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/vufind-tech


-------------------------------------------------------------------------
Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW!
Studies have shown that voting for your favorite open source project,
along with a healthy diet, reduces your potential for chronic lameness
and boredom. Vote Now at http://www.sourceforge.net/community/cca08
_______________________________________________
Vufind-tech mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/vufind-tech
Reply | Threaded
Open this post in threaded view
|

Re: solrmarc: null pointer exceptions benign?

wsgrah
Administrator
In reply to this post by Delis, Christopher
Ok, can you 'svn up' and run ant to build the jar again? This should be
much better.

Wayne

Chris Delis wrote:

> Just wondering:
>
> I'm getting a bunch of these:
>
>    Adding record 264531: 288969
> java.lang.reflect.InvocationTargetException
>         at sun.reflect.GeneratedMethodAccessor2.invoke(Unknown Source)
>         at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>         at java.lang.reflect.Method.invoke(Method.java:597)
>         at
> org.solrmarc.index.SolrIndexer.handleCustom(SolrIndexer.java:433)
>         at org.solrmarc.index.SolrIndexer.map(SolrIndexer.java:422)
>         at
> org.solrmarc.marc.MarcImporter.addToIndex(MarcImporter.java:308)
>         at
> org.solrmarc.marc.MarcImporter.importRecords(MarcImporter.java:281)
>         at org.solrmarc.marc.MarcImporter.main(MarcImporter.java:524)
> Caused by: java.lang.NullPointerException
>
>
> which get thrown, presumably, from the getCallNumberLabel function.  I
> notice the following comment within this method:
>
>    //TODO: handle null point exceptions...
>
> Is there a good way to do this?  Should I just trap the exceptions so
> that I can reduce the signal to noise ratio in my output -- i.e.,
> these frequent error messages keep me from noticing anything else.
>
> Thanks,
> Chris
>
> -------------------------------------------------------------------------
> Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW!
> Studies have shown that voting for your favorite open source project,
> along with a healthy diet, reduces your potential for chronic lameness
> and boredom. Vote Now at http://www.sourceforge.net/community/cca08
> _______________________________________________
> Vufind-tech mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/vufind-tech
>
>  

--
/**
  * Wayne Graham
  * Earl Gregg Swem Library
  * PO Box 8794
  * Williamsburg, VA 23188
  * 757.221.3112
  * http://swem.wm.edu/blogs/waynegraham/
  */



-------------------------------------------------------------------------
Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW!
Studies have shown that voting for your favorite open source project,
along with a healthy diet, reduces your potential for chronic lameness
and boredom. Vote Now at http://www.sourceforge.net/community/cca08
_______________________________________________
Vufind-tech mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/vufind-tech
Reply | Threaded
Open this post in threaded view
|

thanks -- btw: there's another small problem in Utils (was Re: solrmarc: null pointer exceptions benign?)

Delis, Christopher
On Thu, Jul 03, 2008 at 09:56:09AM -0400, Wayne Graham wrote:
> Ok, can you 'svn up' and run ant to build the jar again? This should be
> much better.

Thanks -- it's much cleaner now.

BTW, I noticed just a few ArrayIndexOutOfBounds exceptions in
Utils.cleanData.  I simply put in test for length > 0 and that seems
to alleviate my troubles.  I'll supply the one-liner patch.  If
there's a better way of fixing this, by all means... :-)

Chris


>
> Wayne
>
> Chris Delis wrote:
> >Just wondering:
> >
> >I'm getting a bunch of these:
> >
> >   Adding record 264531: 288969
> >java.lang.reflect.InvocationTargetException
> >        at sun.reflect.GeneratedMethodAccessor2.invoke(Unknown Source)
> >        at
> > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> >        at java.lang.reflect.Method.invoke(Method.java:597)
> >        at
> > org.solrmarc.index.SolrIndexer.handleCustom(SolrIndexer.java:433)
> >        at org.solrmarc.index.SolrIndexer.map(SolrIndexer.java:422)
> >        at
> > org.solrmarc.marc.MarcImporter.addToIndex(MarcImporter.java:308)
> >        at
> > org.solrmarc.marc.MarcImporter.importRecords(MarcImporter.java:281)
> >        at org.solrmarc.marc.MarcImporter.main(MarcImporter.java:524)
> >Caused by: java.lang.NullPointerException
> >
> >
> >which get thrown, presumably, from the getCallNumberLabel function.  I
> >notice the following comment within this method:
> >
> >   //TODO: handle null point exceptions...
> >
> >Is there a good way to do this?  Should I just trap the exceptions so
> >that I can reduce the signal to noise ratio in my output -- i.e.,
> >these frequent error messages keep me from noticing anything else.
> >
> >Thanks,
> >Chris
> >
> >-------------------------------------------------------------------------
> >Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW!
> >Studies have shown that voting for your favorite open source project,
> >along with a healthy diet, reduces your potential for chronic lameness
> >and boredom. Vote Now at http://www.sourceforge.net/community/cca08
> >_______________________________________________
> >Vufind-tech mailing list
> >[hidden email]
> >https://lists.sourceforge.net/lists/listinfo/vufind-tech
> >
> >  
>
> --
> /**
>  * Wayne Graham
>  * Earl Gregg Swem Library
>  * PO Box 8794
>  * Williamsburg, VA 23188
>  * 757.221.3112
>  * http://swem.wm.edu/blogs/waynegraham/
>  */
>
>

-------------------------------------------------------------------------
Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW!
Studies have shown that voting for your favorite open source project,
along with a healthy diet, reduces your potential for chronic lameness
and boredom. Vote Now at http://www.sourceforge.net/community/cca08
_______________________________________________
Vufind-tech mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/vufind-tech

cleanDataException.patch (1K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: thanks -- btw: there's another small problem in Utils (was Re: solrmarc: null pointer exceptions benign?)

Delis, Christopher
On Thu, Jul 03, 2008 at 03:48:13PM -0500, Chris Delis wrote:

> On Thu, Jul 03, 2008 at 09:56:09AM -0400, Wayne Graham wrote:
> > Ok, can you 'svn up' and run ant to build the jar again? This should be
> > much better.
>
> Thanks -- it's much cleaner now.
>
> BTW, I noticed just a few ArrayIndexOutOfBounds exceptions in
> Utils.cleanData.  I simply put in test for length > 0 and that seems
> to alleviate my troubles.  I'll supply the one-liner patch.  If
> there's a better way of fixing this, by all means... :-)

Please ignore the reference to rev. 464; this is my local version (I
put the solrmarc project into my own svn environment as a "vendor
branch").

Chris



>
> Chris
>
>
> >
> > Wayne
> >
> > Chris Delis wrote:
> > >Just wondering:
> > >
> > >I'm getting a bunch of these:
> > >
> > >   Adding record 264531: 288969
> > >java.lang.reflect.InvocationTargetException
> > >        at sun.reflect.GeneratedMethodAccessor2.invoke(Unknown Source)
> > >        at
> > > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> > >        at java.lang.reflect.Method.invoke(Method.java:597)
> > >        at
> > > org.solrmarc.index.SolrIndexer.handleCustom(SolrIndexer.java:433)
> > >        at org.solrmarc.index.SolrIndexer.map(SolrIndexer.java:422)
> > >        at
> > > org.solrmarc.marc.MarcImporter.addToIndex(MarcImporter.java:308)
> > >        at
> > > org.solrmarc.marc.MarcImporter.importRecords(MarcImporter.java:281)
> > >        at org.solrmarc.marc.MarcImporter.main(MarcImporter.java:524)
> > >Caused by: java.lang.NullPointerException
> > >
> > >
> > >which get thrown, presumably, from the getCallNumberLabel function.  I
> > >notice the following comment within this method:
> > >
> > >   //TODO: handle null point exceptions...
> > >
> > >Is there a good way to do this?  Should I just trap the exceptions so
> > >that I can reduce the signal to noise ratio in my output -- i.e.,
> > >these frequent error messages keep me from noticing anything else.
> > >
> > >Thanks,
> > >Chris
> > >
> > >-------------------------------------------------------------------------
> > >Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW!
> > >Studies have shown that voting for your favorite open source project,
> > >along with a healthy diet, reduces your potential for chronic lameness
> > >and boredom. Vote Now at http://www.sourceforge.net/community/cca08
> > >_______________________________________________
> > >Vufind-tech mailing list
> > >[hidden email]
> > >https://lists.sourceforge.net/lists/listinfo/vufind-tech
> > >
> > >  
> >
> > --
> > /**
> >  * Wayne Graham
> >  * Earl Gregg Swem Library
> >  * PO Box 8794
> >  * Williamsburg, VA 23188
> >  * 757.221.3112
> >  * http://swem.wm.edu/blogs/waynegraham/
> >  */
> >
> >

> Index: src/org/solrmarc/tools/Utils.java
> ===================================================================
> --- src/org/solrmarc/tools/Utils.java (revision 464)
> +++ src/org/solrmarc/tools/Utils.java (working copy)
> @@ -82,18 +82,20 @@
>                      newData = newData.substring(0, newData.length()-1);
>
>                  }
>
>              }
>
> -            if (newData.charAt(0) == '[' && newData.endsWith("]"))
>
> -            {
>
> -                newData = newData.substring(1, newData.length()-1);
>
> -            }
>
> -            else if (newData.charAt(0) == '[' && newData.indexOf(']') == -1)
>
> -            {
>
> -                newData = newData.substring(1);                
>
> -            }
>
> -            else if (newData.endsWith("]") && newData.indexOf('[') == -1)
>
> -            {
>
> -                newData = newData.substring(0, newData.length()-1);                
>
> -            }
>
> +            if (newData.length() > 0) {
>
> +               if (newData.charAt(0) == '[' && newData.endsWith("]"))
>
> +               {
>
> +                   newData = newData.substring(1, newData.length()-1);
>
> +               }
>
> +               else if (newData.charAt(0) == '[' && newData.indexOf(']') == -1)
>
> +               {
>
> +                   newData = newData.substring(1);                
>
> +               }
>
> +               else if (newData.endsWith("]") && newData.indexOf('[') == -1)
>
> +               {
>
> +                   newData = newData.substring(0, newData.length()-1);                
>
> +               }
>
> +           }
>
>          } while (! newData.equals(oldData));
>
>  //        if (!newData.equals(data))  
>
>  //        {
>

> -------------------------------------------------------------------------
> Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW!
> Studies have shown that voting for your favorite open source project,
> along with a healthy diet, reduces your potential for chronic lameness
> and boredom. Vote Now at http://www.sourceforge.net/community/cca08
> _______________________________________________
> Vufind-tech mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/vufind-tech


-------------------------------------------------------------------------
Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW!
Studies have shown that voting for your favorite open source project,
along with a healthy diet, reduces your potential for chronic lameness
and boredom. Vote Now at http://www.sourceforge.net/community/cca08
_______________________________________________
Vufind-tech mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/vufind-tech