小编cer*_*tru的帖子

Solr 4.2.1 SSLinitializationException

升级到Solr 4.2.1后,将Solr war文件部署到GlassFish版本3.1.1会导致以下错误:

    2013-04-09 10:45:06,144 [main] ERROR org.apache.solr.servlet.SolrDispatchFilter - Could not start Solr. Check solr/home property and the logs
    2013-04-09 10:45:06,224 [main] ERROR org.apache.solr.core.SolrCore - null:org.apache.http.conn.ssl.SSLInitializationException: Failure initializing default system SSL context
    at org.apache.http.conn.ssl.SSLSocketFactory.createSystemSSLContext(SSLSocketFactory.java:368)
    at org.apache.http.conn.ssl.SSLSocketFactory.getSystemSocketFactory(SSLSocketFactory.java:204)
    at org.apache.http.impl.conn.SchemeRegistryFactory.createSystemDefault(SchemeRegistryFactory.java:82)
    at org.apache.http.impl.client.SystemDefaultHttpClient.createClientConnectionManager(SystemDefaultHttpClient.java:118)
    at org.apache.http.impl.client.AbstractHttpClient.getConnectionManager(AbstractHttpClient.java:466)
    at org.apache.solr.client.solrj.impl.HttpClientUtil.setMaxConnections(HttpClientUtil.java:179)
Caused by: java.io.IOException: Keystore was tampered with, or password was incorrect
  at sun.security.provider.JavaKeyStore.engineLoad(JavaKeyStore.java:772)
    at sun.security.provider.JavaKeyStore$JKS.engineLoad(JavaKeyStore.java:55)
    at java.security.KeyStore.load(KeyStore.java:1214)
    at org.apache.http.conn.ssl.SSLSocketFactory.createSystemSSLContext(SSLSocketFactory.java:281)
    at org.apache.http.conn.ssl.SSLSocketFactory.createSystemSSLContext(SSLSocketFactory.java:366)     
    ... 50 more
Caused by: java.security.UnrecoverableKeyException: Password verification failed
    at sun.security.provider.JavaKeyStore.engineLoad(JavaKeyStore.java:770)
    ... 54 …
Run Code Online (Sandbox Code Playgroud)

solr

5
推荐指数
1
解决办法
3612
查看次数

从DocsAndPositionsEnum中检索所有术语位置

我正在升级到Solr 4.1,并且无法使用新API检索位置和偏移信息.我的索引包含一个文档,其中一个字段包含字符串' 一只快速的棕色狐狸跳过一只懒狗 '.我正在查询我的索引'one'并尝试检索对应于'one'的位置和偏移量.

这是代码片段

Terms terms=reader.getTermVector(docId, fieldName);
TermsEnum termsEnum= terms.iterator(TermsEnum.EMPTY);
    BytesRef term;
    while((term=termsEnum.next())!=null){
        String docTerm = term.utf8ToString();
        DocsAndPositionsEnum docPosEnum = termsEnum.docsAndPositions(null, null, DocsAndPositionsEnum.FLAG_OFFSETS);
        //Check if the current term is the same as the query term and if so
        //retrieve all positions (can be multiple occurrences of a term in a field) corresponding to the term
        if (queryTerms.contains(docTerm)) {
            int position;
            while((position=docPosEnum.nextPosition())!=-1){
                int start=docPosEnum.startOffset();
                int end=docPosEnum.endOffset();
                //Store start, end and position in an a …
Run Code Online (Sandbox Code Playgroud)

lucene solr

1
推荐指数
1
解决办法
1331
查看次数

标签 统计

solr ×2

lucene ×1