简体   繁体   中英

Solr 4.3.0 Http Status 500

OS: Ubuntu 12.04

I just upgraded my system from using Solr 1.4 to Solr 4.3.0 and can't seem to get the MySQL driver to work (or so I suspect). Solr seems to work fine (accessing it through the browser, etc) until I add the following lines to the solrconfig.xml

    <requestHandler name="/dataimport" class="org.apache.solr.handler.dataimport.DataImportHandler">
      <lst name="defaults">
        <str name="config">/opt/solr/core01/conf/data-config.xml</str>
      </lst>
    </requestHandler>

After adding those lines into the config, restart Tomcat7 and refreshing my localhost:8080/solr, I get the following error:

    HTTP Status 500 - {msg=SolrCore 'core01' is not available due to init failure: org/apache/solr/util/plugin/SolrCoreAware,trace=org.apache.solr.common.SolrException: 
    SolrCore 'core01' is not available due to init failure: org/apache/solr/util/plugin/SolrCoreAware at 

And then a bunch of misc. filters, etc. I only see this error via the browser - I can't seem to find it in any of the logs for Tomcat.

Another thing to note is that I have included the required JAR files for the:

    solr-dataimporthandler-extras-4.3.0.jar
    solr-dataimporthandler-4.3.0.jar

as they seem to not come with the download for Solr 4.3.0

This problem has caused so much time to be wasted so hopefully someone on here can lend a hand and see what is wrong.

Thanks in advance!

EDIT:

This is what my data-config.xml looks like

    <?xml version="1.0" encoding="UTF-8"?>
    <dataConfig>
      <dataSource type="JdbcDataSource" driver="com.mysql.jdbc.Driver" url="jdbc:mysql://localhost/db_name" user="db_user" password="db_password" />
      <document>
        <entity name="table" query="SELECT * FROM table">
          <field column="id" name="id" />
          <field column="name" name="name" />
        </entity>
      </document>
    </dataConfig>

With the obvious variables replaced with real data.

After looking at the DIHQuickStart page and looking at the error meessage, you might want to remove the path from your config setting, as Solr will look in the conf folder of the core where you have defined the DIH first by default. So change it to:

 <str name="config">data-config.xml</str>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM