Hello - The error "org.solrmarc.marc.MarcImporter - Error indexing: String index out of range: 38" means that your marc records are not formatted correctly.  That error is caused by not being able to read the 38th character of the 008 field in the MARC record.  Please ensure that your marc records are indeed in binary form and are only bib records and not holdings or any other type of MARC record.

Andrew

On Wed, Mar 25, 2009 at 3:20 AM, Pongtawat Chippimolchai <pongtawat.ait@gmail.com> wrote:
Hello,

I have try to import again with .mrc file (exported from Koha). But I
still get the following error:

2009-03-24 23:05:16,466 [main] ERROR main org.solrmarc.marc.MarcImporter
- Error indexing: String index out of range: 38
2009-03-24 23:05:16,467 [main] ERROR main org.solrmarc.marc.MarcImporter
- Control Number null
java.lang.StringIndexOutOfBoundsException: String index out of range: 38
       at java.lang.String.substring(String.java:1935)
       at
org.solrmarc.index.SolrIndexer.addSubfieldDataToSet(SolrIndexer.java:928)
       at org.solrmarc.index.SolrIndexer.getFieldList(SolrIndexer.java:695)
       at org.solrmarc.index.SolrIndexer.map(SolrIndexer.java:408)
       at org.solrmarc.marc.MarcImporter.addToIndex(MarcImporter.java:388)
       at org.solrmarc.marc.MarcImporter.importRecords(MarcImporter.java:348)
       at org.solrmarc.marc.MarcImporter.main(MarcImporter.java:632)

The test .mrc file is attached to this email.

Thank you,
Pongtawat

On Tue, 2009-03-24 at 10:59 +0100, Daniel Zimmel wrote:
> Pongtawat,
>
> as for 1.0 there is no direct import routine for MARCXML--
> we send MARCXML data through yaz and import the resulting MARC data, which works quite well.
> conversion process is quite straightforward and fast.
> usage: http://www.indexdata.com/yaz/doc/yaz-marcdump.tkl
>
> see older thread:
> http://www.nabble.com/Getting-MarcXML-into-SOLR-to21869659.html#a21871227
>
> the yaz packages came without xml support, so you might need to compile yaz from source by yourself
> (--with-xml2, --with-xslt)
> http://www.indexdata.com/yaz/doc/installation.tkl
>
>
> good luck, Daniel
>
> --
> Daniel Zimmel                              Tel. +49 228 91416-17
>
> Max-Planck-Institut zur
> Erforschung von Gemeinschaftsgütern, Bonn        ||/| Bibliothek
>
>
> > -----Original Message-----
> > From: Pongtawat Chippimolchai [mailto:pongtawat.ait@gmail.com]
> > Sent: Tuesday, March 24, 2009 8:25 AM
> > To: vufind-general@lists.sourceforge.net
> > Subject: [VuFind-General] Unable to import MARC records
> >
> > Hello all,
> >
> > I try to import records to my freshly installed VuFind 1.0RC1 without
> > any success.
> >
> > First I try to import MARCXML exported from Koha 3, but
> > import log say:
> >
> > "Error reading record: null".
> >
> > Then I try sample MARCXML file from:
> >
> >  http://www.loc.gov/standards/marcxml/xml/collection.xml
> >
> > But it can't be imported as well.
> >
> > Could anyone please tell me what went wrong?
> >
> > Import log files are attached with this email with their
> > excerpts below
> > in case attachment is not allowed.
> >
> > Thank you very much,
> > Pongtawat
> >
> > ---------------
> > solrmarc.log
> >
> > 2009-03-24 14:07:32,031 [main] INFO  main
> > org.solrmarc.marc.MarcImporter
> > - Starting SolrMarc indexing.
> > 2009-03-24 14:07:32,049 [main] INFO  main
> > org.solrmarc.marc.MarcImporter
> > - Loading properties from import/import.properties
> > 2009-03-24 14:07:32,290 [main] INFO  main
> > org.solrmarc.marc.MarcImporter
> > - Using the data directory of: /srv/vufind/solr/biblio
> > 2009-03-24 14:07:32,294 [main] INFO  main
> > org.solrmarc.marc.MarcImporter
> > - Using the multicore schema file at : /srv/vufind/solr/solr.xml
> > 2009-03-24 14:07:32,295 [main] INFO  main
> > org.solrmarc.marc.MarcImporter
> > - Using the biblio core
> > 2009-03-24 14:07:34,642 [main] DEBUG main
> > org.solrmarc.marc.MarcImporter
> > - Shutdown hook for Solr
> > 2009-03-24 14:07:34,648 [main] ERROR main
> > org.solrmarc.marc.MarcImporter
> > - Error reading record: null
> > 2009-03-24 14:07:34,649 [main] ERROR main
> > org.solrmarc.marc.MarcImporter
> > - Error reading record: null
> > ....
> > 2009-03-24 14:07:34,666 [main] ERROR main
> > org.solrmarc.marc.MarcImporter
> > - Error reading record: Premature end of file encountered
> > 2009-03-24 14:07:34,667 [main] INFO  main
> > org.solrmarc.marc.MarcImporter
> > - Calling commit
> > 2009-03-24 14:07:34,739 [main] INFO  main
> > org.solrmarc.marc.MarcImporter
> > - Done with the commit, closing Solr
> > 2009-03-24 14:07:34,830 [main] INFO  main
> > org.solrmarc.marc.MarcImporter
> > - Finished indexing in 0:00.00
> > 2009-03-24 14:07:34,830 [main] INFO  main
> > org.solrmarc.marc.MarcImporter
> > - Indexed 26 at a rate of about 140.0 per sec
> > 2009-03-24 14:07:34,831 [main] INFO  main
> > org.solrmarc.marc.MarcImporter
> > - Deleted 0 records
> > 2009-03-24 14:07:34,831 [Thread-1] INFO  Thread-1
> > org.solrmarc.marc.MarcImporter - Starting Shutdown hook
> > 2009-03-24 14:07:34,832 [Thread-1] INFO  Thread-1
> > org.solrmarc.marc.MarcImporter - Finished Shutdown hook
> >
> > ---------------
> > import-log
> >
> > Now Importing collection.xml ...
> >  INFO [main] (MarcImporter.java:600) - Starting SolrMarc indexing.
> >  INFO [main] (MarcImporter.java:610) - Loading properties from
> > import/import.properties
> >  INFO [main] (MarcImporter.java:98) - Using the data directory
> > of: /srv/vufind/solr/biblio
> >  INFO [main] (MarcImporter.java:101) - Using the multicore schema file
> > at : /srv/vufind/solr/solr.xml
> >  INFO [main] (MarcImporter.java:102) - Using the biblio core
> > DEBUG [main] (MarcImporter.java:625) - Shutdown hook for Solr
> > ERROR [main] (MarcImporter.java:374) - Error reading record: null
> > ...
> > INFO [main] (MarcImporter.java:646) - Finished indexing in 0:00.00
> >  INFO [main] (MarcImporter.java:655) - Indexed 26 at a rate of about
> > 140.0 per sec
> >  INFO [main] (MarcImporter.java:656) - Deleted 0 records
> >  INFO [Thread-1] (MarcImporter.java:570) - Starting Shutdown hook
> >  INFO [Thread-1] (MarcImporter.java:588) - Finished Shutdown hook
> >
> > ---------------
> > error-log
> > ...
> > Mar 24, 2009 2:07:34 PM org.apache.solr.core.CoreContainer register
> > INFO: registering core: stats
> > java.lang.NullPointerException
> >     at
> > org.marc4j.MarcPermissiveStreamReader.parseRecordLength(MarcPe
> > rmissiveStreamReader.java:1199)
> >     at
> > org.marc4j.MarcPermissiveStreamReader.next(MarcPermissiveStrea
> > mReader.java:261)
> >     at
> > org.solrmarc.marc.MarcImporter.importRecords(MarcImporter.java:345)
> >     at org.solrmarc.marc.MarcImporter.main(MarcImporter.java:632)
> > java.lang.NullPointerException
> >     at
> > org.marc4j.MarcPermissiveStreamReader.parseRecordLength(MarcPe
> > rmissiveStreamReader.java:1199)
> >     at
> > org.marc4j.MarcPermissiveStreamReader.next(MarcPermissiveStrea
> > mReader.java:261)
> >     at
> > org.solrmarc.marc.MarcImporter.importRecords(MarcImporter.java:345)
> >     at org.solrmarc.marc.MarcImporter.main(MarcImporter.java:632)
> > ...
> >
> >
>
>
> ------------------------------------------------------------------------------
> Apps built with the Adobe(R) Flex(R) framework and Flex Builder(TM) are
> powering Web 2.0 with engaging, cross-platform capabilities. Quickly and
> easily build your RIAs with Flex Builder, the Eclipse(TM)based development
> software that enables intelligent coding and step-through debugging.
> Download the free 60 day trial. http://p.sf.net/sfu/www-adobe-com
> _______________________________________________
> VuFind-General mailing list
> VuFind-General@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/vufind-general

------------------------------------------------------------------------------
Apps built with the Adobe(R) Flex(R) framework and Flex Builder(TM) are
powering Web 2.0 with engaging, cross-platform capabilities. Quickly and
easily build your RIAs with Flex Builder, the Eclipse(TM)based development
software that enables intelligent coding and step-through debugging.
Download the free 60 day trial. http://p.sf.net/sfu/www-adobe-com
_______________________________________________
VuFind-General mailing list
VuFind-General@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/vufind-general