簡體   English   中英

Solr DataImport從數據庫讀取數據時出錯(MySQL)

[英]Solr DataImport Error reading data from database (MySQL)

我已經安裝了Solr以及DataImport處理程序/插件...,經過一番嘗試和錯誤之后,我能夠使Solr連接到數據庫。

不幸的是,我不懂Java,下面的錯誤響應讓我很沮喪...

 {
   "responseHeader": {
   "status": 0,
   "QTime": 2682
 },
   "initArgs": [
   "defaults",
  [
  "config",
  "data-config.xml"
  ]
],
"command": "full-import",
"mode": "debug",
"documents": [],
"verbose-output": [
  "entity:product",
  [
  "document#1",
   [
    "query",
     "SELECT A.product_attribute_id, A.product_id, A.model, A.sku_code, A.status, A.image_filename, A.local_filename, A.width, A.width_final, A.length, A.length_final, A.msrp, A.map_price, A.sku_upc_code, A.url, A.discontinued, A.sq_foot, A.weight, A.rolled_length, A.rolled_width, A.rolled_height, A.lifestyle, A.detailed_color, A.bullet_point1, A.bullet_point2, A.bullet_point3, A.on_hand, A.eta_date, A.pile_height, A.eta_quantity, DATE_FORMAT(FROM_UNIXTIME(A.last_updated), '%e %b %Y') AS last_updated, P.sku_description, P.url as product_url, P.design, C.collection_id, C.collection_name, C.url as collection_url, M.manufacturer_name, M.url as manufacturer_url, O.origin_name, T.type_name, CO.content_name, S.style_name, COL.color_name, COL.color_id, PS.parentstyle_name, PC.parentcolor_name, SHA.shape_name, SA.sale_amount, DATE_FORMAT(FROM_UNIXTIME(SA.sale_start), '%e %b %Y') AS sale_start, DATE_FORMAT(FROM_UNIXTIME(SA.sale_end), '%e %b %Y') AS sale_end FROM tr_product_attributes as A INNER JOIN tr_products as P ON A.product_id = P.product_id INNER JOIN tr_collections as C ON P.collection = C.collection_id INNER JOIN tr_manufacturers as M ON P.manufacturer = M.manufacturer_id INNER JOIN tr_origins as O ON P.origin = O.origin_id INNER JOIN tr_types as T ON P.type = T.type_id INNER JOIN tr_contents as CO ON P.content = CO.content_id INNER JOIN tr_styles as S ON A.style = S.style_id INNER JOIN tr_parentstyles as PS ON A.parentstyle = PS.parentstyle_id INNER JOIN tr_colors as COL ON A.color = COL.color_id INNER JOIN tr_parentcolors as PC ON A.parentcolor = PC.parentcolor_id INNER JOIN tr_shapes as SHA ON A.shape = SHA.shape_id LEFT JOIN tr_sales as SA ON P.collection = SA.sale_collection_id WHERE A.status=1 AND A.url NOT LIKE '%http://www.XXXXXXX.com/rugs/rug/-///%' AND PC.parentcolor_name!='NA' AND A.active='Y' AND A.discontinued=0 AND A.local_filename LIKE '%jpg%' AND P.status=1 AND P.discontinued=0 AND C.status=1 AND C.discontinued=0 AND M.status=1",
    "time-taken",
    "0:0:2.652",
    "EXCEPTION",
    "org.apache.solr.handler.dataimport.DataImportHandlerException: Error reading data from database Processing Document # 1\n\tat org.apache.solr.handler.dataimport.DataImportHandlerException.wrapAndThrow(DataImportHandlerException.java:70)\n\tat org.apache.solr.handler.dataimport.JdbcDataSource$ResultSetIterator.getARow(JdbcDataSource.java:398)\n\tat org.apache.solr.handler.dataimport.JdbcDataSource$ResultSetIterator.access$600(JdbcDataSource.java:296)\n\tat org.apache.solr.handler.dataimport.JdbcDataSource$ResultSetIterator$1.next(JdbcDataSource.java:336)\n\tat org.apache.solr.handler.dataimport.JdbcDataSource$ResultSetIterator$1.next(JdbcDataSource.java:328)\n\tat org.apache.solr.handler.dataimport.EntityProcessorBase.getNext(EntityProcessorBase.java:133)\n\tat org.apache.solr.handler.dataimport.SqlEntityProcessor.nextRow(SqlEntityProcessor.java:74)\n\tat org.apache.solr.handler.dataimport.EntityProcessorWrapper.nextRow(EntityProcessorWrapper.java:243)\n\tat org.apache.solr.handler.dataimport.DocBuilder.buildDocument(DocBuilder.java:475)\n\tat org.apache.solr.handler.dataimport.DocBuilder.buildDocument(DocBuilder.java:414)\n\tat org.apache.solr.handler.dataimport.DocBuilder.doFullDump(DocBuilder.java:329)\n\tat org.apache.solr.handler.dataimport.DocBuilder.execute(DocBuilder.java:232)\n\tat org.apache.solr.handler.dataimport.DataImporter.doFullImport(DataImporter.java:416)\n\tat org.apache.solr.handler.dataimport.DataImporter.runCmd(DataImporter.java:480)\n\tat org.apache.solr.handler.dataimport.DataImportHandler.handleRequestBody(DataImportHandler.java:185)\n\tat org.apache.solr.handler.RequestHandlerBase.handleRequest(RequestHandlerBase.java:143)\n\tat org.apache.solr.core.SolrCore.execute(SolrCore.java:2064)\n\tat org.apache.solr.servlet.HttpSolrCall.execute(HttpSolrCall.java:654)\n\tat org.apache.solr.servlet.HttpSolrCall.call(HttpSolrCall.java:450)\n\tat org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilter.java:227)\n\tat org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilter.java:196)\n\tat org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1652)\n\tat org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:585)\n\tat org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143)\n\tat org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:577)\n\tat org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:223)\n\tat org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1127)\n\tat org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:515)\n\tat org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:185)\n\tat org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1061)\n\tat org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)\n\tat org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:215)\n\tat org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:110)\n\tat org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:97)\n\tat org.eclipse.jetty.server.Server.handle(Server.java:497)\n\tat org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:310)\n\tat org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:257)\n\tat org.eclipse.jetty.io.AbstractConnection$2.run(AbstractConnection.java:540)\n\tat org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:635)\n\tat org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:555)\n\tat java.lang.Thread.run(Thread.java:745)\nCaused by: java.sql.SQLException: Value '\u000535298\u000541486\u0010SE30 Gingerlilly\rSE30R024X036S\u00011E/img/RugImages/Vendors/Colonial Mills/Generation/SE30-gingerlilyl.jpg\u0014SE30-gingerlilyl.jpg\u00052.000\u00052' 0\"\u00053.000\u00053' 0\"\b119.0000\u000789.0000\f082262203658Zhttp://www.XXXXXXX.com/rugs/rug/colonial-mills-generation-seascape/gingerlilly/41486/35298\u00010\u00010\u00013\u00010\u00014\u00014\u0000\u0000\u0000\u0000\u0000\u00010\n0000-00-00\u00010\u00010\n1 Jan 1970\u0004NULLMhttp://www.XXXXXXX.com/rugs/rug/colonial-mills-generation-seascape-se30/41486\bSeascape\u0003347\u0013Generation-SeascapeOhttp://www.XXXXXXX.com/rugs/brands/colonial-mills/collection/generationseascape\u000eColonial Mills1http://www.XXXXXXX.com/rugs/brands/colonial-mills\u0003USA\u0007Braided\rPolypropylene\u0007Braided\u000bGingerlilly\u0003626\fTransitional\fGold, Yellow\tRectangle���\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000' can not be represented as java.sql.Date\n\tat com.mysql.jdbc.SQLError.createSQLException(SQLError.java:998)\n\tat com.mysql.jdbc.SQLError.createSQLException(SQLError.java:937)\n\tat com.mysql.jdbc.SQLError.createSQLException(SQLError.java:926)\n\tat com.mysql.jdbc.SQLError.createSQLException(SQLError.java:872)\n\tat com.mysql.jdbc.ResultSetRow.getDateFast(ResultSetRow.java:145)\n\tat com.mysql.jdbc.BufferRow.getDateFast(BufferRow.java:689)\n\tat com.mysql.jdbc.ResultSetImpl.getDate(ResultSetImpl.java:2012)\n\tat com.mysql.jdbc.ResultSetImpl.getDate(ResultSetImpl.java:1975)\n\tat com.mysql.jdbc.ResultSetImpl.getObject(ResultSetImpl.java:4587)\n\tat com.mysql.jdbc.ResultSetImpl.getObject(ResultSetImpl.java:4710)\n\tat org.apache.solr.handler.dataimport.JdbcDataSource$ResultSetIterator.getARow(JdbcDataSource.java:358)\n\t... 39 more\n"
  ]
]
],
"status": "idle",
"importResponse": "",
"statusMessages": {
"Time Elapsed": "0:0:2.667",
"Total Requests made to DataSource": "1",
"Total Rows Fetched": "0",
"Total Documents Processed": "0",
"Total Documents Skipped": "0",
"Full Dump Started": "2015-10-21 14:05:52",
"Full Import failed": "2015-10-21 14:05:55"
}
}

我認為我已將其范圍縮小到錯誤消息的此特定部分...

 Caused by: java.sql.SQLException: Value '\u000535298\u000541486\u0010SE30 Gingerlilly\rSE30R024X036S\u00011E/img/RugImages/Vendors/Colonial Mills/Generation/SE30-gingerlilyl.jpg\u0014SE30-gingerlilyl.jpg\u00052.000\u00052' 0\"\u00053.000\u00053' 0\"\b119.0000\u000789.0000\f082262203658Zhttp://www.XXXXXXX.com/rugs/rug/colonial-mills-generation-seascape/gingerlilly/41486/35298\u00010\u00010\u00013\u00010\u00014\u00014\u0000\u0000\u0000\u0000\u0000\u00010\n0000-00-00\u00010\u00010\n1 Jan 1970\u0004NULLMhttp://www.XXXXXXX.com/rugs/rug/colonial-mills-generation-seascape-se30/41486\bSeascape\u0003347\u0013Generation-SeascapeOhttp://www.XXXXXXX.com/rugs/brands/colonial-mills/collection/generationseascape\u000eColonial Mills1http://www.XXXXXXX.com/rugs/brands/colonial-mills\u0003USA\u0007Braided\rPolypropylene\u0007Braided\u000bGingerlilly\u0003626\fTransitional\fGold, Yellow\tRectangle���\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000' can not be represented as java.sql.Date

唯一的問題是在這組數據中沒有“日期”字段。 我有一些“時間戳”字段,但是當我為Solr編寫配置文件時,我將它們表示為數字或整數...或類似的東西。 不是日期字段。 另外,我暫時將“時間戳記”字段調整為VARCHAR 255,以查看是否會有所作為,但沒有。

任何幫助是極大的贊賞!

您可能在solr映射中有一些錯誤。 該錯誤表明,它希望將從數據庫中讀取的“ blah bla Gingerlilly blah”值轉換為Date並失敗。

如果能夠在選擇的輸出中找到在“ Gingerlilly”中包含哪些內容的列,那么您將可以很好地了解要檢查的配置。

我在從MySQL導入數據時遇到了完全相同的問題。 就我而言,問題是我試圖將零值傳遞給日期字段。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM