lucene-general mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Romi <romijain3...@gmail.com>
Subject DataImportHandlerException when importing data from mysql to solr
Date Wed, 18 May 2011 13:33:34 GMT
I want to import data from database directly into the solr index I have a
problem to get this to work. I first set up a requestHandler like this
<requestHandler name="/dataimport"
class="org.apache.solr.handler.dataimport.DataImportHandler">
    <lst name="defaults">
        <str name="config">db-data-config.xml</str>
    </lst>
  </requestHandler>


data-config.xml:

<dataConfig>
    <dataSource type="JdbcDataSource" driver="org.gjt.mm.mysql.Driver"
url="jdbc:mysql://192.168.1.9:3306/angara" user="root" password="ampliflex"
/>
    <document>
         <entity name="id" query="select UID_PK from tdiamonds">
            <field column="UID_PK" name="name" />
          </entity>
    </document>
</dataConfig>



When I run full import I get several errors:

org.apache.solr.handler.dataimport.DataImportHandlerException: Exception
occurred while initializing context at
org.apache.solr.handler.dataimport.DataImporter.loadDataConfig(DataImporter.java:190)
at org.apache.solr.handler.dataimport.DataImporter.(DataImporter.java:101)
at
org.apache.solr.handler.dataimport.DataImportHandler.inform(DataImportHandler.java:113)
at
org.apache.solr.core.SolrResourceLoader.inform(SolrResourceLoader.java:486)
at org.apache.solr.core.SolrCore.(SolrCore.java:588) at
org.apache.solr.core.CoreContainer.create(CoreContainer.java:428) at
org.apache.solr.core.CoreContainer.load(CoreContainer.java:278) at
org.apache.solr.core.CoreContainer$Initializer.initialize(CoreContainer.java:117)
at
org.apache.solr.servlet.SolrDispatchFilter.init(SolrDispatchFilter.java:83)
at org.mortbay.jetty.servlet.FilterHolder.doStart(FilterHolder.java:99) at
org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:40) at
org.mortbay.jetty.servlet.ServletHandler.initialize(ServletHandler.java:594)
at org.mortbay.jetty.servlet.Context.startContext(Context.java:139) at
org.mortbay.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1218)
at org.mortbay.jetty.handler.ContextHandler.doStart(ContextHandler.java:500)
at org.mortbay.jetty.webapp.WebAppContext.doStart(WebAppContext.java:448) at
org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:40) at
org.mortbay.jetty.handler.HandlerCollection.doStart(HandlerCollection.java:147)
at
org.mortbay.jetty.handler.ContextHandlerCollection.doStart(ContextHandlerCollection.java:161)
at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:40)
at
org.mortbay.jetty.handler.HandlerCollection.doStart(HandlerCollection.java:147)
at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:40)
at org.mortbay.jetty.handler.HandlerWrapper.doStart(HandlerWrapper.java:117)
at org.mortbay.jetty.Server.doStart(Server.java:210) at
org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:40) at
org.mortbay.xml.XmlConfiguration.main(XmlConfiguration.java:929) at
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at
sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at
sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at
java.lang.reflect.Method.invoke(Unknown Source) at
org.mortbay.start.Main.invokeMain(Main.java:183) at
org.mortbay.start.Main.start(Main.java:497) at
org.mortbay.start.Main.main(Main.java:115) Caused by:
org.xml.sax.SAXParseException: Element type "dataSource" must be followed by
either attribute specifications, ">" or "/>". at
com.sun.org.apache.xerces.internal.parsers.DOMParser.parse(Unknown Source)
at com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl.parse(Unknown
Source) at
org.apache.solr.handler.dataimport.DataImporter.loadDataConfig(DataImporter.java:178)
... 32 more


any idea??

-----
Romi
--
View this message in context: http://lucene.472066.n3.nabble.com/DataImportHandlerException-when-importing-data-from-mysql-to-solr-tp2956947p2956947.html
Sent from the Lucene - General mailing list archive at Nabble.com.

Mime
View raw message