lucene-solr-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Boris Granveaud <bo...@granveaud.com>
Subject Re: Error in DIH after upgrading from 4.0 to 4.1
Date Fri, 25 Jan 2013 20:25:08 GMT
wow, I'm impressed: I have now 3 different solutions! Thank you for your
help.

Boris.



On Fri, Jan 25, 2013 at 7:54 PM, Walter Underwood <wunder@wunderwood.org>wrote:

> I do something similar, but without the placeholders in
> db-data-config.xml. You can define the entire datasource in solrconfig.xml,
> then leave out that element entirely in db-data-config.xml. It seems really
> odd, but that is how the code works.
>
> This is working for me in 4.1, so it might be a workaround for you.
>
> It looks like this:
>
>   <requestHandler name="/dataimport"
> class="org.apache.solr.handler.dataimport.DataImportHandler">
>     <lst name="defaults">
>       <str name="config">db-data-config.xml</str>
>       <lst name="datasource">
>         <str name="defType">JdbcDataSource</str>
>         <str name="driver">com.mysql.jdbc.Driver</str>
>         <str name="url">jdbc:mysql://${textbooks.dbhost:nohost}/xxxx</str>
>         <str name="user">${textbooks.dbuser:yyyyy}</str>
>         <str name="password">${textbooks.dbpass:zzzzzz}</str>
>         <str name="batchSize">-1</str>
>         <str name="readOnly">true</str>
>         <str name="onError">skip</str>
>         <str name="netTimeoutForStreamingResults">600</str>
>         <str name="zeroDateTimeBehavior">convertToNull</str>
>       </lst>
>     </lst>
>   </requestHandler>
>
> wunder
>
> On Jan 25, 2013, at 10:45 AM, Dyer, James wrote:
>
> > This is a bug.  Thank you for reporting it.  I opened this ticket:
> https://issues.apache.org/jira/browse/SOLR-4361
> >
> > Until there is a fix, here are two workarounds:
> >
> > 1. If you do not need any 4.1 DIH functionality, use the 4.0 DIH jar
> with your 4.1 Solr.
> > -or-
> > 2. Use request parameters without dots:  ex. "solrBceDSDriver" instead
> of "solr.bceDS.driver".
> >
> > James Dyer
> > E-Commerce Systems
> > Ingram Content Group
> > (615) 213-4311
> >
> >
> > -----Original Message-----
> > From: Boris Granveaud [mailto:boris@granveaud.com]
> > Sent: Friday, January 25, 2013 3:38 AM
> > To: solr-user@lucene.apache.org
> > Subject: Error in DIH after upgrading from 4.0 to 4.1
> >
> > Hello,
> >
> > I've just tried to upgrade from 4.0 to 4.1 and I have the following
> > exception when reindexing my data:
> >
> > Caused by: java.lang.UnsupportedOperationException
> > at java.util.Collections$UnmodifiableMap.put(Collections.java:1283)
> > at
> >
> org.apache.solr.handler.dataimport.VariableResolver.currentLevelMap(VariableResolver.java:204)
> > at
> >
> org.apache.solr.handler.dataimport.VariableResolver.resolve(VariableResolver.java:94)
> > at
> >
> org.apache.solr.handler.dataimport.VariableResolver.replaceTokens(VariableResolver.java:144)
> > at
> >
> org.apache.solr.handler.dataimport.ContextImpl.replaceTokens(ContextImpl.java:254)
> > at
> >
> org.apache.solr.handler.dataimport.JdbcDataSource.resolveVariables(JdbcDataSource.java:203)
> > at
> >
> org.apache.solr.handler.dataimport.JdbcDataSource.createConnectionFactory(JdbcDataSource.java:101)
> > at
> >
> org.apache.solr.handler.dataimport.JdbcDataSource.init(JdbcDataSource.java:62)
> > at
> >
> org.apache.solr.handler.dataimport.DataImporter.getDataSourceInstance(DataImporter.java:394)
> >
> > It seems to be related to the use of placeholders in data-config.xml:
> >
> > <dataConfig>
> >    <dataSource type="JdbcDataSource"
> >                name="bceDS"
> >                driver="${dataimporter.request.solr.bceDS.driver}"
> >                url="${dataimporter.request.solr.bceDS.url}"
> >                user="${dataimporter.request.solr.bceDS.user}"
> >                password="${dataimporter.request.solr.bceDS.password}"
> >                batchSize="-1"/>
> >
> > solrconfig.xml:
> >
> > <requestHandler name="/dataimport"
> > class="org.apache.solr.handler.dataimport.DataImportHandler">
> > <lst name="defaults">
> > <str name="config">data-config.xml</str>
> >
> > <!-- dataSource parameters for data-config.xml -->
> > <str name="solr.bceDS.driver">...</str>
> > <str name="solr.bceDS.url">...</str>
> > <str name="solr.bceDS.user">...</str>
> > <str name="solr.bceDS.password">...</str>
> > </lst>
> > </requestHandler>
> >
> > Did I miss something or is it a bug?
> >
> > Thanks,
> > Boris.
> >
>
> --
> Walter Underwood
> wunder@wunderwood.org
>
>
>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message