我正在尝试使用在MySQL 5.6上运行的Wordpress数据库设置Solr 4.3.1
但是在尝试完全导入时:
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 Workbench 6.06中执行了该语句,并且在那里工作。
数据-config.xml中
<dataConfig>
<dataSource type="JdbcDataSource" driver="com.mysql.jdbc.Driver" url="jdbc:mysql@localhost: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';
并将连接网址更改为jdbc:mysql@localhost: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:mysql@localhost: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 lockFactory=org.apache.lucene.store.SingleInstanceLockFactory@13396fa; 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="jdbc:mysql@localhost: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:mysql@localhost: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:mysql@localhost: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 lockFactory=org.apache.lucene.store.SingleInstanceLockFactory@1a1a366; 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 :(得分:0)
在此处找到:http://alvinalexander.com/java/jdbc-connection-string-mysql-postgresql-sqlserver(参见页面底部)
在我的连接字符串中,我必须使用@
而不是://
现在它有效:)