我在dataconfig_1.xml中有以下内容
<?xml version="1.0" encoding="UTF-8"?> <dataConfig> <dataSource batchSize="-1" convertType="true" driver="com.mysql.jdbc.Driver" password="solrpw" url="jdbc:mysql://127.0.0.1/solrDB" user="solruser"/> <document name="items"> <entity name="root" pk="id" preImportDeleteQuery="data_source:1" query="select a.id, a.body, a.headline title ,a.date datecreated, a.title_id ,t.name publisher_name from article as a inner join title as t on t.id=a.title_id" transformer="TemplateTransformer" deltaImportQuery="select a.id, a.body, a.headline title ,a.date datecreated, a.title_id ,t.name publisher_name from article as a inner join title as t on t.id=a.title_id where last_update_time > '${dataimporter.last_index_time}'" deltaQuery="select id from article where last_update_time > '${dataimporter.last_index_time}'"> <field column="data_source" template="1"/> <field column="data_source_type" template="Jdbc"/> <field column="data_source_name" template="syndigate_solr"/> </entity> </document> </dataConfig>
,在dataimport_1.properties中我有
#Tue Aug 02 06:53:21 UTC 2011 last_index_time=2011-08-02 06\:52\:51 root.last_index_time=2011-08-02 06\:52\:51
现在每当我运行deltaimport
http://myip:8888/solr/collection1/dataimport_1?command=delta-import
我收到了以下回复
<response> <lst name="responseHeader"> <int name="status">0</int> <int name="QTime">8</int> </lst> <lst name="initArgs"> <lst name="defaults"> <str name="config">dataconfig_1.xml</str> </lst> </lst> <str name="command">delta-import</str> <str name="status">idle</str> <str name="importResponse"/> <lst name="statusMessages"> <str name="Time Elapsed">0:0:1.552</str> <str name="Total Requests made to DataSource">2</str> <str name="Total Rows Fetched">18954</str> <str name="Total Documents Processed">0</str> <str name="Total Documents Skipped">0</str> <str name="Delta Dump started">2011-08-02 09:35:52</str> <str name="Identifying Delta">2011-08-02 09:35:52</str> <str name="Deltas Obtained">2011-08-02 09:35:52</str> <str name="Building documents">2011-08-02 09:35:52</str> <str name="Total Changed Documents">18954</str> <str name="">Indexing failed. Rolled back all changes.</str> <str name="Rolledback">2011-08-02 09:35:52</str> </lst> <str name="WARNING"> This response format is experimental. It is likely to change in the future. </str> </response>
我对错误的看法? 谢谢你的帮助
答案 0 :(得分:5)
我调试jdbc导入错误的方法是使用log4jdbc library。我在data-config.xml
中创建了一个新的数据源<dataSource name="logMe" driver="net.sf.log4jdbc.DriverSpy" user="myUserName" password="myPassword" type="JdbcDataSource" url="jdbc:log4jdbc:mysql://myServer:3306/myDB" />
并设置所有实体以使用此新数据源。
然后我会运行导入。之后,我会查看名为sql.log的日志文件。在文件的底部,它通常会告诉我jdbc在哪里停止以及出现了什么错误。
答案 1 :(得分:1)
此外,如果您从命令行运行jetty服务器,其日志记录将显示在控制台中。查找标记为SEVERE或ERROR的任何内容,然后读到“由...引起”。