maven项目引org.apache.solr报错java.lang.VerifyError: Bad type on operand stack

maven项目引入org.apache.solr

<dependency>
    <groupId>org.apache.solrgroupId>
    <artifactId>solr-solrjartifactId>
    <version>5.3.1version>
dependency>

报错:

严重: Servlet.service() for servlet [springMvc] in context with path [] threw exception [Handler 

processing failed; nested exception is java.lang.VerifyError: Bad type on operand stack
Exception Details:
  Location:
    org/apache/solr/common/util/JavaBinCodec.unmarshal(Ljava/io/InputStream;)Ljava/lang/Object; @71: 

invokevirtual
  Reason:
    Type 'org/apache/solr/common/util/FastInputStream' (current frame, stack[1]) is not assignable to 

'org/apache/solr/common/util/DataInputInputStream'
  Current Frame:
    bci: @71
    flags: { }
    locals: { 'org/apache/solr/common/util/JavaBinCodec', 'java/io/InputStream', 

'org/apache/solr/common/util/FastInputStream' }
    stack: { 'org/apache/solr/common/util/JavaBinCodec', 'org/apache/solr/common/util/FastInputStream' }
  Bytecode:
    0000000: 2bb8 0016 4d2a 2cb6 0017 b500 182a b400
    0000010: 18b2 0012 9f00 31bb 0019 59bb 001a 59b7
    0000020: 001b 121c b600 1db2 0012 b600 1e12 1fb6
    0000030: 001d 2ab4 0018 b600 1e12 20b6 001d b600
    0000040: 21b7 0022 bf2a 2cb6 0023 b0            
  Stackmap Table:
    append_frame(@69,Object[#357])
] with root cause
java.lang.VerifyError: Bad type on operand stack
Exception Details:
  Location:
    org/apache/solr/common/util/JavaBinCodec.unmarshal(Ljava/io/InputStream;)Ljava/lang/Object; @71: 

invokevirtual
  Reason:
    Type 'org/apache/solr/common/util/FastInputStream' (current frame, stack[1]) is not assignable to 

'org/apache/solr/common/util/DataInputInputStream'
  Current Frame:
    bci: @71
    flags: { }
    locals: { 'org/apache/solr/common/util/JavaBinCodec', 'java/io/InputStream', 

'org/apache/solr/common/util/FastInputStream' }
    stack: { 'org/apache/solr/common/util/JavaBinCodec', 'org/apache/solr/common/util/FastInputStream' }
  Bytecode:
    0000000: 2bb8 0016 4d2a 2cb6 0017 b500 182a b400
    0000010: 18b2 0012 9f00 31bb 0019 59bb 001a 59b7
    0000020: 001b 121c b600 1db2 0012 b600 1e12 1fb6
    0000030: 001d 2ab4 0018 b600 1e12 20b6 001d b600
    0000040: 21b7 0022 bf2a 2cb6 0023 b0            
  Stackmap Table:
    append_frame(@69,Object[#357])

    at org.apache.solr.client.solrj.impl.BinaryResponseParser.processResponse

(BinaryResponseParser.java:50)
    at org.apache.solr.client.solrj.impl.HttpSolrClient.executeMethod(HttpSolrClient.java:535)
    at org.apache.solr.client.solrj.impl.HttpSolrClient.request(HttpSolrClient.java:234)
    at org.apache.solr.client.solrj.impl.HttpSolrClient.request(HttpSolrClient.java:226)
    at org.apache.solr.client.solrj.SolrRequest.process(SolrRequest.java:135)
    at org.apache.solr.client.solrj.SolrClient.query(SolrClient.java:943)

错误原因:
org/apache/solr/common/util下找不到JavaBinCodec类和DataInputInputStream。
即版本问题

换为较高版本5.5.1即可

你可能感兴趣的:(maven)