0

我尝试在 solandra 平台上使用 json api 上传文档。

为了做到这一点,我用来上传文档的命令是这样的

curl http://localhost:8983/solandra/wikassandra/update/json 
           -H 'Contednt-type:application/json' -d '
{
 "add": {"doc": 
          {"url" : "TestDoc1", 
           "title" : "test1", 
           "text" : "sdkfjw", 
           "category" : "dskfj"} }
}'

我得到了这个错误

 INFO 02:57:56,170 JNDI not configured for solr (NoInitialContextEx)
 INFO 02:57:56,171 solr home defaulted to 'solr/' (could not find system property or JNDI)
 INFO 02:57:56,171 Solr home set to 'solr/'
 INFO 02:57:56,174 row was marked empty: [Row(key=DecoratedKey(155949571512290652274890255161558562273, 313535393439353731353132323930363532323734383930323535313631353538353632323733efbfbf7265736f7572636573), cf=null)]
 INFO 02:57:56,192 Adding specified lib dirs to ClassLoader
 INFO 02:57:56,223 Using Lucene MatchVersion: LUCENE_24
 WARN 02:57:56,254 Deprecated syntax found. <highlighting/> should move to <searchComponent/>
 INFO 02:57:56,258 Loaded SolrConfig: solrconfig.xml
 INFO 02:57:56,258 Reading Solr Schema
ERROR 02:57:56,260 Exception during parsing file: schema:org.xml.sax.SAXParseException; lineNumber: 1; columnNumber: 1; Content is not allowed in prolog.
    at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerWrapper.java:198)
    at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.fatalError(ErrorHandlerWrapper.java:177)
    at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:391)
    at com.sun.org.apache.xerces.internal.impl.XMLScanner.reportFatalError(XMLScanner.java:1391)
    at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl$PrologDriver.next(XMLDocumentScannerImpl.java:1014)
    at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:625)
    at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:488)
    at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:819)
    at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:748)
    at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:123)
    at com.sun.org.apache.xerces.internal.parsers.DOMParser.parse(DOMParser.java:239)
    at com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl.parse(DocumentBuilderImpl.java:288)
    at org.apache.solr.core.Config.<init>(Config.java:159)
    at org.apache.solr.schema.IndexSchema.readSchema(IndexSchema.java:420)
    at org.apache.solr.schema.IndexSchema.<init>(IndexSchema.java:125)
    at org.apache.solr.core.SolandraCoreContainer.readSchema(SolandraCoreContainer.java:165)
    at org.apache.solr.core.SolandraCoreContainer.getCore(SolandraCoreContainer.java:100)
    at org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilter.java:194)
    at solandra.SolandraDispatchFilter.doFilter(SolandraDispatchFilter.java:137)
    at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1212)
    at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:399)
    at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:182)
    at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:766)
    at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
    at org.mortbay.jetty.Server.handle(Server.java:326)
    at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:542)
    at org.mortbay.jetty.HttpConnection$RequestHandler.content(HttpConnection.java:945)
    at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:756)
    at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:218)
    at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:404)
    at org.mortbay.jetty.bio.SocketConnector$Connection.run(SocketConnector.java:228)
    at org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:582)

ERROR 02:57:56,261 org.apache.solr.common.SolrException: Schema Parsing Failed: Content is not allowed in prolog.
    at org.apache.solr.schema.IndexSchema.readSchema(IndexSchema.java:678)
    at org.apache.solr.schema.IndexSchema.<init>(IndexSchema.java:125)
    at org.apache.solr.core.SolandraCoreContainer.readSchema(SolandraCoreContainer.java:165)
    at org.apache.solr.core.SolandraCoreContainer.getCore(SolandraCoreContainer.java:100)
    at org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilter.java:194)
    at solandra.SolandraDispatchFilter.doFilter(SolandraDispatchFilter.java:137)
    at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1212)
    at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:399)
    at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:182)
    at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:766)
    at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
    at org.mortbay.jetty.Server.handle(Server.java:326)
    at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:542)
    at org.mortbay.jetty.HttpConnection$RequestHandler.content(HttpConnection.java:945)
    at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:756)
    at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:218)
    at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:404)
    at org.mortbay.jetty.bio.SocketConnector$Connection.run(SocketConnector.java:228)
    at org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:582)
Caused by: org.xml.sax.SAXParseException; lineNumber: 1; columnNumber: 1; Content is not allowed in prolog.
    at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerWrapper.java:198)
    at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.fatalError(ErrorHandlerWrapper.java:177)
    at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:391)
    at com.sun.org.apache.xerces.internal.impl.XMLScanner.reportFatalError(XMLScanner.java:1391)
    at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl$PrologDriver.next(XMLDocumentScannerImpl.java:1014)
    at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:625)
    at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:488)
    at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:819)
    at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:748)
    at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:123)
    at com.sun.org.apache.xerces.internal.parsers.DOMParser.parse(DOMParser.java:239)
    at com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl.parse(DocumentBuilderImpl.java:288)
    at org.apache.solr.core.Config.<init>(Config.java:159)
    at org.apache.solr.schema.IndexSchema.readSchema(IndexSchema.java:420)
    ... 18 more

我应该首先检查哪里来解决这个问题?

4

1 回答 1

0

您的 schema.xml 必须无效。您可以通过获取http://localhost:8983/solandra/schema/wikassandra来查看它

于 2012-01-04T14:27:51.583 回答