2013-12-20 274 views
1

我想設置的Solr 4.3.1在MySQL 5.6org.apache.solr.handler.dataimport.DataImportHandlerException:無法執行查詢

運行WordPress的數據庫,但在嘗試完全導入: http://localhost:8983/solr/tv-wordpress/dataimport?command=full-import&debug=true

的錯誤是: org.apache.solr.handler.dataimport.DataImportHandlerException: Unable to execute query SELECT * FROM wp_posts WHERE post_status='publish'

我執行的語句在MySQL工作臺6.06,有它的工作原理。

數據-config.xml中

<dataConfig> 
<dataSource type="JdbcDataSource" driver="com.mysql.jdbc.Driver" url="jdbc:[email protected]:3306/wptalkman" user="root" password="****" /> 
    <document name="articles"> 
     <entity pk="id" name="article" query="SELECT * FROM wp_posts WHERE post_status='publish';">  
      <field name="id" column="ID" /> 
      <field name="post_title" column="post_title" /> 
      <field name="post_author" column="post_author" />   
     </entity> 
    </document> 
</dataConfig> 

我也試過,包括在SQL語句中的數據庫名稱:

SELECT * FROM wptalkman.wp_posts WHERE post_status='publish'; 

並更改連接的URL jdbc:[email protected]:3306

也試過加入logtransformer:

<entity pk="ID" name="article" query="SELECT * FROM wptalkman.wp_posts WHERE post_status='publish'" 
      transformer="LogTransformer" logTemplate="The name is ${e.name}" logLevel="debug" >     

控制檯輸出

13420 [qtp16103450-12] INFO org.apache.solr.handler.dataimport.SimpleProperties 
Writer û Read dataimport.properties 
13506 [qtp16103450-12] INFO org.apache.solr.handler.dataimport.JdbcDataSource 
û Creating a connection for entity article with URL: jdbc:[email protected]:3306/w 
ptalkman 
13510 [qtp16103450-12] INFO org.apache.solr.handler.dataimport.JdbcDataSource 
û Time taken for getConnection(): 4 
13510 [qtp16103450-12] ERROR org.apache.solr.handler.dataimport.DocBuilder û Ex 
ception while processing: article document : SolrInputDocument[]:org.apache.solr 
.handler.dataimport.DataImportHandlerException: Unable to execute query: SELECT 
* FROM wptalkman.wp_posts WHERE post_status='publish' Processing Document # 1 
     at org.apache.solr.handler.dataimport.DataImportHandlerException.wrapAnd 
Throw(DataImportHandlerException.java:71) 
     at org.apache.solr.handler.dataimport.JdbcDataSource$ResultSetIterator.< 
init>(JdbcDataSource.java:253) 
     at org.apache.solr.handler.dataimport.JdbcDataSource.getData(JdbcDataSou 
rce.java:210) 
     at org.apache.solr.handler.dataimport.JdbcDataSource.getData(JdbcDataSou 
rce.java:38) 
     at org.apache.solr.handler.dataimport.SqlEntityProcessor.initQuery(SqlEn 
tityProcessor.java:59) 
     at org.apache.solr.handler.dataimport.SqlEntityProcessor.nextRow(SqlEnti 
tyProcessor.java:73) 
     at org.apache.solr.handler.dataimport.EntityProcessorWrapper.nextRow(Ent 
ityProcessorWrapper.java:243) 
     at org.apache.solr.handler.dataimport.DocBuilder.buildDocument(DocBuilde 
r.java:465) 
     at org.apache.solr.handler.dataimport.DocBuilder.buildDocument(DocBuilde 
r.java:404) 
     at org.apache.solr.handler.dataimport.DocBuilder.doFullDump(DocBuilder.j 
ava:319) 
     at org.apache.solr.handler.dataimport.DocBuilder.execute(DocBuilder.java 
:227) 
     at org.apache.solr.handler.dataimport.DataImporter.doFullImport(DataImpo 
rter.java:422) 
     at org.apache.solr.handler.dataimport.DataImporter.runCmd(DataImporter.j 
ava:487) 
     at org.apache.solr.handler.dataimport.DataImportHandler.handleRequestBod 
y(DataImportHandler.java:179) 
     at org.apache.solr.handler.RequestHandlerBase.handleRequest(RequestHandl 
erBase.java:135) 
     at org.apache.solr.core.SolrCore.execute(SolrCore.java:1820) 
     at org.apache.solr.servlet.SolrDispatchFilter.execute(SolrDispatchFilter 
.java:656) 
     at org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilte 
r.java:359) 
     at org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilte 
r.java:155) 
     at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(Servlet 
Handler.java:1307) 
     at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java 
:453) 
     at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.j 
ava:137) 
     at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.jav 
a:560) 
     at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandl 
er.java:231) 
     at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandl 
er.java:1072) 
     at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java: 
382) 
     at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandle 
r.java:193) 
     at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandle 
r.java:1006) 
     at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.j 
ava:135) 
     at org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(Cont 
extHandlerCollection.java:255) 
     at org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerColl 
ection.java:154) 
     at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper 
.java:116) 
     at org.eclipse.jetty.server.Server.handle(Server.java:365) 
     at org.eclipse.jetty.server.AbstractHttpConnection.handleRequest(Abstrac 
tHttpConnection.java:485) 
     at org.eclipse.jetty.server.BlockingHttpConnection.handleRequest(Blockin 
gHttpConnection.java:53) 
     at org.eclipse.jetty.server.AbstractHttpConnection.headerComplete(Abstra 
ctHttpConnection.java:926) 
     at org.eclipse.jetty.server.AbstractHttpConnection$RequestHandler.header 
Complete(AbstractHttpConnection.java:988) 
     at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:635) 
     at org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:235) 

     at org.eclipse.jetty.server.BlockingHttpConnection.handle(BlockingHttpCo 
nnection.java:72) 
     at org.eclipse.jetty.server.bio.SocketConnector$ConnectorEndPoint.run(So 
cketConnector.java:264) 
     at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPoo 
l.java:608) 
     at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool 
.java:543) 
     at java.lang.Thread.run(Unknown Source) 
Caused by: java.lang.NullPointerException 
     at org.apache.solr.handler.dataimport.JdbcDataSource$ResultSetIterator.< 
init>(JdbcDataSource.java:241) 
     ... 42 more 

13546 [qtp16103450-12] INFO org.apache.solr.update.processor.LogUpdateProcessor 
    û [tv-wordpress] webapp=/solr path=/dataimport params={command=full-import&deb 
ug=true} {} 0 150 
13546 [qtp16103450-12] ERROR org.apache.solr.handler.dataimport.DataImporter û 
Full Import failed:java.lang.RuntimeException: java.lang.RuntimeException: org.a 
pache.solr.handler.dataimport.DataImportHandlerException: Unable to execute quer 
y: SELECT * FROM wptalkman.wp_posts WHERE post_status='publish' Processing Docum 
ent # 1 
     at org.apache.solr.handler.dataimport.DocBuilder.execute(DocBuilder.java 
:266) 
     at org.apache.solr.handler.dataimport.DataImporter.doFullImport(DataImpo 
rter.java:422) 
     at org.apache.solr.handler.dataimport.DataImporter.runCmd(DataImporter.j 
ava:487) 
     at org.apache.solr.handler.dataimport.DataImportHandler.handleRequestBod 
y(DataImportHandler.java:179) 
     at org.apache.solr.handler.RequestHandlerBase.handleRequest(RequestHandl 
erBase.java:135) 
     at org.apache.solr.core.SolrCore.execute(SolrCore.java:1820) 
     at org.apache.solr.servlet.SolrDispatchFilter.execute(SolrDispatchFilter 
.java:656) 
     at org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilte 
r.java:359) 
     at org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilte 
r.java:155) 
     at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(Servlet 
Handler.java:1307) 
     at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java 
:453) 
     at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.j 
ava:137) 
     at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.jav 
a:560) 
     at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandl 
er.java:231) 
     at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandl 
er.java:1072) 
     at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java: 
382) 
     at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandle 
r.java:193) 
     at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandle 
r.java:1006) 
     at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.j 
ava:135) 
     at org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(Cont 
extHandlerCollection.java:255) 
     at org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerColl 
ection.java:154) 
     at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper 
.java:116) 
     at org.eclipse.jetty.server.Server.handle(Server.java:365) 
     at org.eclipse.jetty.server.AbstractHttpConnection.handleRequest(Abstrac 
tHttpConnection.java:485) 
     at org.eclipse.jetty.server.BlockingHttpConnection.handleRequest(Blockin 
gHttpConnection.java:53) 
     at org.eclipse.jetty.server.AbstractHttpConnection.headerComplete(Abstra 
ctHttpConnection.java:926) 
     at org.eclipse.jetty.server.AbstractHttpConnection$RequestHandler.header 
Complete(AbstractHttpConnection.java:988) 
     at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:635) 
     at org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:235) 

     at org.eclipse.jetty.server.BlockingHttpConnection.handle(BlockingHttpCo 
nnection.java:72) 
     at org.eclipse.jetty.server.bio.SocketConnector$ConnectorEndPoint.run(So 
cketConnector.java:264) 
     at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPoo 
l.java:608) 
     at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool 
.java:543) 
     at java.lang.Thread.run(Unknown Source) 
Caused by: java.lang.RuntimeException: org.apache.solr.handler.dataimport.DataIm 
portHandlerException: Unable to execute query: SELECT * FROM wptalkman.wp_posts 
WHERE post_status='publish' Processing Document # 1 
     at org.apache.solr.handler.dataimport.DocBuilder.buildDocument(DocBuilde 
r.java:406) 
     at org.apache.solr.handler.dataimport.DocBuilder.doFullDump(DocBuilder.j 
ava:319) 
     at org.apache.solr.handler.dataimport.DocBuilder.execute(DocBuilder.java 
:227) 
     ... 33 more 
Caused by: org.apache.solr.handler.dataimport.DataImportHandlerException: Unable 
to execute query: SELECT * FROM wptalkman.wp_posts WHERE post_status='publish' 
Processing Document # 1 
     at org.apache.solr.handler.dataimport.DataImportHandlerException.wrapAnd 
Throw(DataImportHandlerException.java:71) 
     at org.apache.solr.handler.dataimport.JdbcDataSource$ResultSetIterator.< 
init>(JdbcDataSource.java:253) 
     at org.apache.solr.handler.dataimport.JdbcDataSource.getData(JdbcDataSou 
rce.java:210) 
     at org.apache.solr.handler.dataimport.JdbcDataSource.getData(JdbcDataSou 
rce.java:38) 
     at org.apache.solr.handler.dataimport.SqlEntityProcessor.initQuery(SqlEn 
tityProcessor.java:59) 
     at org.apache.solr.handler.dataimport.SqlEntityProcessor.nextRow(SqlEnti 
tyProcessor.java:73) 
     at org.apache.solr.handler.dataimport.EntityProcessorWrapper.nextRow(Ent 
ityProcessorWrapper.java:243) 
     at org.apache.solr.handler.dataimport.DocBuilder.buildDocument(DocBuilde 
r.java:465) 
     at org.apache.solr.handler.dataimport.DocBuilder.buildDocument(DocBuilde 
r.java:404) 
     ... 35 more 
Caused by: java.lang.NullPointerException 
     at org.apache.solr.handler.dataimport.JdbcDataSource$ResultSetIterator.< 
init>(JdbcDataSource.java:241) 
     ... 42 more 

13568 [qtp16103450-12] INFO org.apache.solr.update.UpdateHandler û start rollb 
ack{} 
13569 [qtp16103450-12] INFO org.apache.solr.update.DefaultSolrCoreState û Crea 
ting new IndexWriter... 
13569 [qtp16103450-12] INFO org.apache.solr.update.DefaultSolrCoreState û Wait 
ing until IndexWriter is unused... core=tv-wordpress 
13589 [qtp16103450-12] INFO org.apache.solr.core.SolrCore û SolrDeletionPolicy 
.onInit: commits:num=1 
     commit{dir=NRTCachingDirectory(org.apache.lucene.store.SimpleFSDirectory 
@C:\Dropbox\Databases\solr-4.3.1\example\example-DIH\solr\tv-wordpress\data\inde 
x [email protected]396fa; maxCach 
eMB=48.0 maxMergeSizeMB=4.0),segFN=segments_3l,generation=129,filenames=[_3o.nvd 
, _3o_Lucene41_0.tim, _3o.fnm, _3o.nvm, _3o_Lucene41_0.tip, _3o.fdt, _3o_Lucene4 
1_0.pos, segments_3l, _3o.fdx, _3o_Lucene41_0.doc, _3o.si] 
13590 [qtp16103450-12] INFO org.apache.solr.core.SolrCore û newest commit = 12 
9[_3o.nvd, _3o_Lucene41_0.tim, _3o.fnm, _3o.nvm, _3o_Lucene41_0.tip, _3o.fdt, _3 
o_Lucene41_0.pos, segments_3l, _3o.fdx, _3o_Lucene41_0.doc, _3o.si] 
13591 [qtp16103450-12] INFO org.apache.solr.update.DefaultSolrCoreState û New 
IndexWriter is ready to be used. 
13591 [qtp16103450-12] INFO org.apache.solr.update.UpdateHandler û end_rollbac 
k 

更新:在JDBC連接字符串

添加記錄器有了這個URL url="jdbc:[email protected]:3306/wptalkman?logger=com.mysql.jdbc.log.Log4JLogger&profileSQL=true;"

我得到: Data Config problem: The reference to entity "profileSQL" must end with the ';' delimiter.

這個網址:url="jdbc:[email protected]:3306/wptalkman?logger=com.mysql.jdbc.log.Log4JLogger"

我得到這個控制檯:

5696 [qtp16103450-11] INFO org.apache.solr.handler.dataimport.JdbcDataSource û 
Creating a connection for entity article with URL: jdbc:[email protected]:3306/wp 
talkman?logger=com.mysql.jdbc.log.Log4JLogger 
5700 [qtp16103450-11] INFO org.apache.solr.handler.dataimport.JdbcDataSource û 
Time taken for getConnection(): 4 
5700 [qtp16103450-11] ERROR org.apache.solr.handler.dataimport.DocBuilder û Exc 
eption while processing: article document : SolrInputDocument[]:org.apache.solr. 
handler.dataimport.DataImportHandlerException: Unable to execute query: SELECT * 
FROM wptalkman.wp_posts WHERE post_status='publish' Processing Document # 1 
     at org.apache.solr.handler.dataimport.DataImportHandlerException.wrapAnd 
Throw(DataImportHandlerException.java:71) 
     at org.apache.solr.handler.dataimport.JdbcDataSource$ResultSetIterator.< 
init>(JdbcDataSource.java:253) 
     at org.apache.solr.handler.dataimport.JdbcDataSource.getData(JdbcDataSou 
rce.java:210) 
     at org.apache.solr.handler.dataimport.JdbcDataSource.getData(JdbcDataSou 
rce.java:38) 
     at org.apache.solr.handler.dataimport.SqlEntityProcessor.initQuery(SqlEn 
tityProcessor.java:59) 
     at org.apache.solr.handler.dataimport.SqlEntityProcessor.nextRow(SqlEnti 
tyProcessor.java:73) 
     at org.apache.solr.handler.dataimport.EntityProcessorWrapper.nextRow(Ent 
ityProcessorWrapper.java:243) 
     at org.apache.solr.handler.dataimport.DocBuilder.buildDocument(DocBuilde 
r.java:465) 
     at org.apache.solr.handler.dataimport.DocBuilder.buildDocument(DocBuilde 
r.java:404) 
     at org.apache.solr.handler.dataimport.DocBuilder.doFullDump(DocBuilder.j 
ava:319) 
     at org.apache.solr.handler.dataimport.DocBuilder.execute(DocBuilder.java 
:227) 
     at org.apache.solr.handler.dataimport.DataImporter.doFullImport(DataImpo 
rter.java:422) 
     at org.apache.solr.handler.dataimport.DataImporter.runCmd(DataImporter.j 
ava:487) 
     at org.apache.solr.handler.dataimport.DataImportHandler.handleRequestBod 
y(DataImportHandler.java:179) 
     at org.apache.solr.handler.RequestHandlerBase.handleRequest(RequestHandl 
erBase.java:135) 
     at org.apache.solr.core.SolrCore.execute(SolrCore.java:1820) 
     at org.apache.solr.servlet.SolrDispatchFilter.execute(SolrDispatchFilter 
.java:656) 
     at org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilte 
r.java:359) 
     at org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilte 
r.java:155) 
     at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(Servlet 
Handler.java:1307) 
     at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java 
:453) 
     at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.j 
ava:137) 
     at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.jav 
a:560) 
     at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandl 
er.java:231) 
     at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandl 
er.java:1072) 
     at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java: 
382) 
     at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandle 
r.java:193) 
     at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandle 
r.java:1006) 
     at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.j 
ava:135) 
     at org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(Cont 
extHandlerCollection.java:255) 
     at org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerColl 
ection.java:154) 
     at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper 
.java:116) 
     at org.eclipse.jetty.server.Server.handle(Server.java:365) 
     at org.eclipse.jetty.server.AbstractHttpConnection.handleRequest(Abstrac 
tHttpConnection.java:485) 
     at org.eclipse.jetty.server.BlockingHttpConnection.handleRequest(Blockin 
gHttpConnection.java:53) 
     at org.eclipse.jetty.server.AbstractHttpConnection.headerComplete(Abstra 
ctHttpConnection.java:926) 
     at org.eclipse.jetty.server.AbstractHttpConnection$RequestHandler.header 
Complete(AbstractHttpConnection.java:988) 
     at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:635) 
     at org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:235) 

     at org.eclipse.jetty.server.BlockingHttpConnection.handle(BlockingHttpCo 
nnection.java:72) 
     at org.eclipse.jetty.server.bio.SocketConnector$ConnectorEndPoint.run(So 
cketConnector.java:264) 
     at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPoo 
l.java:608) 
     at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool 
.java:543) 
     at java.lang.Thread.run(Unknown Source) 
Caused by: java.lang.NullPointerException 
     at org.apache.solr.handler.dataimport.JdbcDataSource$ResultSetIterator.< 
init>(JdbcDataSource.java:241) 
     ... 42 more 

5714 [qtp16103450-11] INFO org.apache.solr.update.processor.LogUpdateProcessor 
û [tv-wordpress] webapp=/solr path=/dataimport params={command=full-import&debu 
g=true} {} 0 122 
5715 [qtp16103450-11] ERROR org.apache.solr.handler.dataimport.DataImporter û F 
ull Import failed:java.lang.RuntimeException: java.lang.RuntimeException: org.ap 
ache.solr.handler.dataimport.DataImportHandlerException: Unable to execute query 
: SELECT * FROM wptalkman.wp_posts WHERE post_status='publish' Processing Docume 
nt # 1 
     at org.apache.solr.handler.dataimport.DocBuilder.execute(DocBuilder.java 
:266) 
     at org.apache.solr.handler.dataimport.DataImporter.doFullImport(DataImpo 
rter.java:422) 
     at org.apache.solr.handler.dataimport.DataImporter.runCmd(DataImporter.j 
ava:487) 
     at org.apache.solr.handler.dataimport.DataImportHandler.handleRequestBod 
y(DataImportHandler.java:179) 
     at org.apache.solr.handler.RequestHandlerBase.handleRequest(RequestHandl 
erBase.java:135) 
     at org.apache.solr.core.SolrCore.execute(SolrCore.java:1820) 
     at org.apache.solr.servlet.SolrDispatchFilter.execute(SolrDispatchFilter 
.java:656) 
     at org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilte 
r.java:359) 
     at org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilte 
r.java:155) 
     at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(Servlet 
Handler.java:1307) 
     at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java 
:453) 
     at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.j 
ava:137) 
     at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.jav 
a:560) 
     at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandl 
er.java:231) 
     at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandl 
er.java:1072) 
     at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java: 
382) 
     at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandle 
r.java:193) 
     at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandle 
r.java:1006) 
     at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.j 
ava:135) 
     at org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(Cont 
extHandlerCollection.java:255) 
     at org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerColl 
ection.java:154) 
     at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper 
.java:116) 
     at org.eclipse.jetty.server.Server.handle(Server.java:365) 
     at org.eclipse.jetty.server.AbstractHttpConnection.handleRequest(Abstrac 
tHttpConnection.java:485) 
     at org.eclipse.jetty.server.BlockingHttpConnection.handleRequest(Blockin 
gHttpConnection.java:53) 
     at org.eclipse.jetty.server.AbstractHttpConnection.headerComplete(Abstra 
ctHttpConnection.java:926) 
     at org.eclipse.jetty.server.AbstractHttpConnection$RequestHandler.header 
Complete(AbstractHttpConnection.java:988) 
     at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:635) 
     at org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:235) 

     at org.eclipse.jetty.server.BlockingHttpConnection.handle(BlockingHttpCo 
nnection.java:72) 
     at org.eclipse.jetty.server.bio.SocketConnector$ConnectorEndPoint.run(So 
cketConnector.java:264) 
     at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPoo 
l.java:608) 
     at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool 
.java:543) 
     at java.lang.Thread.run(Unknown Source) 
Caused by: java.lang.RuntimeException: org.apache.solr.handler.dataimport.DataIm 
portHandlerException: Unable to execute query: SELECT * FROM wptalkman.wp_posts 
WHERE post_status='publish' Processing Document # 1 
     at org.apache.solr.handler.dataimport.DocBuilder.buildDocument(DocBuilde 
r.java:406) 
     at org.apache.solr.handler.dataimport.DocBuilder.doFullDump(DocBuilder.j 
ava:319) 
     at org.apache.solr.handler.dataimport.DocBuilder.execute(DocBuilder.java 
:227) 
     ... 33 more 
Caused by: org.apache.solr.handler.dataimport.DataImportHandlerException: Unable 
to execute query: SELECT * FROM wptalkman.wp_posts WHERE post_status='publish' 
Processing Document # 1 
     at org.apache.solr.handler.dataimport.DataImportHandlerException.wrapAnd 
Throw(DataImportHandlerException.java:71) 
     at org.apache.solr.handler.dataimport.JdbcDataSource$ResultSetIterator.< 
init>(JdbcDataSource.java:253) 
     at org.apache.solr.handler.dataimport.JdbcDataSource.getData(JdbcDataSou 
rce.java:210) 
     at org.apache.solr.handler.dataimport.JdbcDataSource.getData(JdbcDataSou 
rce.java:38) 
     at org.apache.solr.handler.dataimport.SqlEntityProcessor.initQuery(SqlEn 
tityProcessor.java:59) 
     at org.apache.solr.handler.dataimport.SqlEntityProcessor.nextRow(SqlEnti 
tyProcessor.java:73) 
     at org.apache.solr.handler.dataimport.EntityProcessorWrapper.nextRow(Ent 
ityProcessorWrapper.java:243) 
     at org.apache.solr.handler.dataimport.DocBuilder.buildDocument(DocBuilde 
r.java:465) 
     at org.apache.solr.handler.dataimport.DocBuilder.buildDocument(DocBuilde 
r.java:404) 
     ... 35 more 
Caused by: java.lang.NullPointerException 
     at org.apache.solr.handler.dataimport.JdbcDataSource$ResultSetIterator.< 
init>(JdbcDataSource.java:241) 
     ... 42 more 

5737 [qtp16103450-11] INFO org.apache.solr.update.UpdateHandler û start rollba 
ck{} 
5738 [qtp16103450-11] INFO org.apache.solr.update.DefaultSolrCoreState û Creat 
ing new IndexWriter... 
5739 [qtp16103450-11] INFO org.apache.solr.update.DefaultSolrCoreState û Waiti 
ng until IndexWriter is unused... core=tv-wordpress 
5776 [qtp16103450-11] INFO org.apache.solr.core.SolrCore û SolrDeletionPolicy. 
onInit: commits:num=1 
     commit{dir=NRTCachingDirectory(org.apache.lucene.store.SimpleFSDirectory 
@C:\Dropbox\Databases\solr-4.3.1\example\example-DIH\solr\tv-wordpress\data\inde 
x [email protected]1a366; maxCach 
eMB=48.0 maxMergeSizeMB=4.0),segFN=segments_3l,generation=129,filenames=[_3o.nvd 
, _3o_Lucene41_0.tim, _3o.fnm, _3o.nvm, _3o_Lucene41_0.tip, _3o.fdt, _3o_Lucene4 
1_0.pos, segments_3l, _3o.fdx, _3o_Lucene41_0.doc, _3o.si] 
5777 [qtp16103450-11] INFO org.apache.solr.core.SolrCore û newest commit = 129 
[_3o.nvd, _3o_Lucene41_0.tim, _3o.fnm, _3o.nvm, _3o_Lucene41_0.tip, _3o.fdt, _3o 
_Lucene41_0.pos, segments_3l, _3o.fdx, _3o_Lucene41_0.doc, _3o.si] 
5777 [qtp16103450-11] INFO org.apache.solr.update.DefaultSolrCoreState û New I 
ndexWriter is ready to be used. 
5778 [qtp16103450-11] INFO org.apache.solr.update.UpdateHandler û end_rollback 
+0

直接連接到你的mysql並運行你的選擇*從wp_posts WHERE post_status ='發佈',看看它是否有任何數據並確保它有ID,post_title和post _author作爲開始的列。 – Arun

+0

我試着從MySQL Workbench和控制檯運行語句,並且語句執行成功(必須使保留字變爲大寫,但會改變我的文章)。但仍然會發生同樣的錯誤。 – Flo

+0

您可以記錄JDBC連接以獲取有關正在發生的更多詳細信息嗎? http://stackoverflow.com/a/13025521/816584 –

回答