You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@lucene.apache.org by "Krishnamurthy, Kannan" <Ka...@cengage.com> on 2016/02/23 21:36:16 UTC
Weird ClassCastException running lucene 5.2.1 on Java 1.8.
Greetings,
Recently we port our load test environment to Java 1.8 and since then we are seeing a ClassCastException under heavy load after about 2 hours into our load test. Exception StackTrace below.
ava.lang.ClassCastException: [J cannot be cast to [B
at org.apache.lucene.util.fst.BytesStore.getReverseReader(BytesStore.java:424)
at org.apache.lucene.util.fst.BytesStore.getReverseReader(BytesStore.java:419)
at org.apache.lucene.util.fst.FST.getBytesReader(FST.java:1369)
at org.apache.lucene.codecs.blocktree.SegmentTermsEnum.<init>(SegmentTermsEnum.java:83)
at org.apache.lucene.codecs.blocktree.FieldReader.iterator(FieldReader.java:156)
at org.apache.lucene.index.TermContext.build(TermContext.java:94)
at org.apache.lucene.search.TermQuery.createWeight(TermQuery.java:191)
at org.apache.lucene.search.IndexSearcher.createWeight(IndexSearcher.java:851)
at org.apache.lucene.search.BooleanWeight.<init>(BooleanWeight.java:57)
at org.apache.lucene.search.BooleanQuery.createWeight(BooleanQuery.java:184)
at org.apache.lucene.search.FilteredQuery.createWeight(FilteredQuery.java:81)
at org.apache.lucene.search.IndexSearcher.createWeight(IndexSearcher.java:851)
at org.apache.lucene.search.IndexSearcher.createNormalizedWeight(IndexSearcher.java:834)
at org.apache.lucene.search.IndexSearcher.search(IndexSearcher.java:485)
at org.apache.lucene.search.IndexSearcher.search(IndexSearcher.java:473)
After the first occurrence of this exception, any search request with a boolean query fails with the same exception. As mentioned above this does happen not until about two hours. The single segment index is created using "Java 1.7.0_04" and the Search server where the ClassCastException happens uses "Java 1.8.0_65"
Our target environment,
Index information : Single segment index created using
java version "1.7.0_04"
Java(TM) SE Runtime Environment (build 1.7.0_04-b20)
Java HotSpot(TM) 64-Bit Server VM (build 23.0-b21, mixed mode
Lucene 5.2.1 version Information :
Manifest-Version: 1.0
Ant-Version: Apache Ant 1.8.4
Created-By: 1.7.0_75-b13 (Oracle Corporation)
Extension-Name: org.apache.lucene
Specification-Title: Lucene Search Engine: core
Specification-Version: 5.2.1
Specification-Vendor: The Apache Software Foundation
Implementation-Title: org.apache.lucene
Implementation-Version: 5.2.1 1684708 - shalin - 2015-06-10 23:11:06
Implementation-Vendor: The Apache Software Foundation
X-Compile-Source-JDK: 1.7
X-Compile-Target-JDK: 1.7
Search Searcher Java version :
java version "1.8.0_65"
Java(TM) SE Runtime Environment (build 1.8.0_65-b17)
Java HotSpot(TM) 64-Bit Server VM (build 25.65-b01, mixed mode)
OS Information:
Linux in2s1in056 3.0.58-0.6.6-default #1 SMP Tue Feb 19 11:07:00 UTC 2013 (1576ecd) x86_64 x86_64 x86_64 GNU/Linux
Please let me know if you need additional information on this issue. The error we are seeing is similar to the one posted here, https://discuss.elastic.co/t/strange-marvel-exception/36112
Are there any known issues running lucene 5.2.1 on JDK 1.8. In the meantime I will try compiling Lucene 5.2.1 using JDK 1.8 and see if this issues goes away.
Thanks
Kannan
<https://discuss.elastic.co/t/strange-marvel-exception/36112>
Re: Weird ClassCastException running lucene 5.2.1 on Java 1.8.
Posted by Torsten Krah <kr...@gmail.com>.
Hi,
you've already asked something similar in January about index corruption
and Uwe Schindler already told you to switch to a modern JVM and not
that antique one.
See:
http://www.gossamer-threads.com/lists/lucene/java-user/296418?page=last
Quote from him:
...
This Java version is "antique". Those old version had serious bugs that
most likely caused the index corrumption (while writing and merging
data). The checksum data is correct because Lucene "thinks" that data
was written correctly. In reality, the VLong is not correct (a sign
flipped because of one of the well-known sign-flipping bugs in those
antique Java versions).
Java 7 is only safe to use after 7u55, 7u4 is now more than 4 years
old.
...
So imho please first try to switch to that recommended version, maybe
already solved.
kind regards
Torsten
> Index information : Single segment index created using
>
> java version "1.7.0_04"
> Java(TM) SE Runtime Environment (build 1.7.0_04-b20)
> Java HotSpot(TM) 64-Bit Server VM (build 23.0-b21, mixed mode
>
---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org
Re: Weird ClassCastException running lucene 5.2.1 on Java 1.8.
Posted by "Krishnamurthy, Kannan" <Ka...@cengage.com>.
Hi Uwe,
Thanks for the pointers. We didn't see this error after upgrading to 8u74.
Thanks,
Kannan.
________________________________________
From: Uwe Schindler <uw...@thetaphi.de>
Sent: Wednesday, February 24, 2016 4:16 AM
To: java-user@lucene.apache.org
Subject: RE: Weird ClassCastException running lucene 5.2.1 on Java 1.8.
Hi Kannan,
the errors you see look like JVM bugs. We have no reports about this, but as the 2nd occurrence of this bug also refers to Java 8u65, I would say: Broken JVM.
This has nothing to do with Lucene and recompiling the sources with Java 8 will make no difference, as this is caused by broken optimizations in the Java VM not the Java bytecode or Lucene's source code.
Before opening bug reports anywhere be sure to:
- Update your JDK to latest: 8u74 and test again. 8u65 is coming from the 8u60+ series which contains new optimizations that were not available before. So it is more likely to break than e.g., earlier versions before 8u60. 8u74 may have those bugs already fixed.
- Don't run Lucene/Solr with any special JVM flags enabling aggressive optimizations: -XX:AggressiveOpts!!!
- Don't use G1GC Garbage collector.
After doing this you can further test, e.g. by reenabling G1GC and check if it breaks. You may also contact Oracle them if you have a support contract for help. - or just open bug report if you found out where the issue comes from.
> Are there any known issues running lucene 5.2.1 on JDK 1.8. In the meantime
> I will try compiling Lucene 5.2.1 using JDK 1.8 and see if this issues goes away.
That won't help.
Uwe
-----
Uwe Schindler
H.-H.-Meier-Allee 63, D-28213 Bremen
http://www.thetaphi.de
eMail: uwe@thetaphi.de
> -----Original Message-----
> From: Krishnamurthy, Kannan
> [mailto:Kannan.Krishnamurthy@cengage.com]
> Sent: Tuesday, February 23, 2016 9:36 PM
> To: java-user@lucene.apache.org
> Subject: Weird ClassCastException running lucene 5.2.1 on Java 1.8.
>
> Greetings,
>
>
> Recently we port our load test environment to Java 1.8 and since then we are
> seeing a ClassCastException under heavy load after about 2 hours into our
> load test. Exception StackTrace below.
>
>
>
> ava.lang.ClassCastException: [J cannot be cast to [B
> at
> org.apache.lucene.util.fst.BytesStore.getReverseReader(BytesStore.java:42
> 4)
> at
> org.apache.lucene.util.fst.BytesStore.getReverseReader(BytesStore.java:41
> 9)
> at org.apache.lucene.util.fst.FST.getBytesReader(FST.java:1369)
> at
> org.apache.lucene.codecs.blocktree.SegmentTermsEnum.<init>(SegmentTe
> rmsEnum.java:83)
> at
> org.apache.lucene.codecs.blocktree.FieldReader.iterator(FieldReader.java:1
> 56)
> at org.apache.lucene.index.TermContext.build(TermContext.java:94)
> at
> org.apache.lucene.search.TermQuery.createWeight(TermQuery.java:191)
> at
> org.apache.lucene.search.IndexSearcher.createWeight(IndexSearcher.java:
> 851)
> at
> org.apache.lucene.search.BooleanWeight.<init>(BooleanWeight.java:57)
> at
> org.apache.lucene.search.BooleanQuery.createWeight(BooleanQuery.java:1
> 84)
> at
> org.apache.lucene.search.FilteredQuery.createWeight(FilteredQuery.java:81
> )
> at
> org.apache.lucene.search.IndexSearcher.createWeight(IndexSearcher.java:
> 851)
> at
> org.apache.lucene.search.IndexSearcher.createNormalizedWeight(IndexSea
> rcher.java:834)
> at
> org.apache.lucene.search.IndexSearcher.search(IndexSearcher.java:485)
> at
> org.apache.lucene.search.IndexSearcher.search(IndexSearcher.java:473)
>
>
>
>
>
> After the first occurrence of this exception, any search request with a
> boolean query fails with the same exception. As mentioned above this does
> happen not until about two hours. The single segment index is created using
> "Java 1.7.0_04" and the Search server where the ClassCastException
> happens uses "Java 1.8.0_65"
>
>
> Our target environment,
>
>
> Index information : Single segment index created using
>
> java version "1.7.0_04"
> Java(TM) SE Runtime Environment (build 1.7.0_04-b20)
> Java HotSpot(TM) 64-Bit Server VM (build 23.0-b21, mixed mode
>
>
> Lucene 5.2.1 version Information :
>
> Manifest-Version: 1.0
>
> Ant-Version: Apache Ant 1.8.4
> Created-By: 1.7.0_75-b13 (Oracle Corporation)
> Extension-Name: org.apache.lucene
> Specification-Title: Lucene Search Engine: core
> Specification-Version: 5.2.1
> Specification-Vendor: The Apache Software Foundation
> Implementation-Title: org.apache.lucene
> Implementation-Version: 5.2.1 1684708 - shalin - 2015-06-10 23:11:06
> Implementation-Vendor: The Apache Software Foundation
> X-Compile-Source-JDK: 1.7
> X-Compile-Target-JDK: 1.7
>
>
>
> Search Searcher Java version :
>
> java version "1.8.0_65"
> Java(TM) SE Runtime Environment (build 1.8.0_65-b17)
> Java HotSpot(TM) 64-Bit Server VM (build 25.65-b01, mixed mode)
>
> OS Information:
> Linux in2s1in056 3.0.58-0.6.6-default #1 SMP Tue Feb 19 11:07:00 UTC 2013
> (1576ecd) x86_64 x86_64 x86_64 GNU/Linux
>
> Please let me know if you need additional information on this issue. The
> error we are seeing is similar to the one posted here,
> https://discuss.elastic.co/t/strange-marvel-exception/36112
> Are there any known issues running lucene 5.2.1 on JDK 1.8. In the meantime
> I will try compiling Lucene 5.2.1 using JDK 1.8 and see if this issues goes away.
>
> Thanks
> Kannan
> <https://discuss.elastic.co/t/strange-marvel-exception/36112>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org
RE: Weird ClassCastException running lucene 5.2.1 on Java 1.8.
Posted by Uwe Schindler <uw...@thetaphi.de>.
Hi Kannan,
the errors you see look like JVM bugs. We have no reports about this, but as the 2nd occurrence of this bug also refers to Java 8u65, I would say: Broken JVM.
This has nothing to do with Lucene and recompiling the sources with Java 8 will make no difference, as this is caused by broken optimizations in the Java VM not the Java bytecode or Lucene's source code.
Before opening bug reports anywhere be sure to:
- Update your JDK to latest: 8u74 and test again. 8u65 is coming from the 8u60+ series which contains new optimizations that were not available before. So it is more likely to break than e.g., earlier versions before 8u60. 8u74 may have those bugs already fixed.
- Don't run Lucene/Solr with any special JVM flags enabling aggressive optimizations: -XX:AggressiveOpts!!!
- Don't use G1GC Garbage collector.
After doing this you can further test, e.g. by reenabling G1GC and check if it breaks. You may also contact Oracle them if you have a support contract for help. - or just open bug report if you found out where the issue comes from.
> Are there any known issues running lucene 5.2.1 on JDK 1.8. In the meantime
> I will try compiling Lucene 5.2.1 using JDK 1.8 and see if this issues goes away.
That won't help.
Uwe
-----
Uwe Schindler
H.-H.-Meier-Allee 63, D-28213 Bremen
http://www.thetaphi.de
eMail: uwe@thetaphi.de
> -----Original Message-----
> From: Krishnamurthy, Kannan
> [mailto:Kannan.Krishnamurthy@cengage.com]
> Sent: Tuesday, February 23, 2016 9:36 PM
> To: java-user@lucene.apache.org
> Subject: Weird ClassCastException running lucene 5.2.1 on Java 1.8.
>
> Greetings,
>
>
> Recently we port our load test environment to Java 1.8 and since then we are
> seeing a ClassCastException under heavy load after about 2 hours into our
> load test. Exception StackTrace below.
>
>
>
> ava.lang.ClassCastException: [J cannot be cast to [B
> at
> org.apache.lucene.util.fst.BytesStore.getReverseReader(BytesStore.java:42
> 4)
> at
> org.apache.lucene.util.fst.BytesStore.getReverseReader(BytesStore.java:41
> 9)
> at org.apache.lucene.util.fst.FST.getBytesReader(FST.java:1369)
> at
> org.apache.lucene.codecs.blocktree.SegmentTermsEnum.<init>(SegmentTe
> rmsEnum.java:83)
> at
> org.apache.lucene.codecs.blocktree.FieldReader.iterator(FieldReader.java:1
> 56)
> at org.apache.lucene.index.TermContext.build(TermContext.java:94)
> at
> org.apache.lucene.search.TermQuery.createWeight(TermQuery.java:191)
> at
> org.apache.lucene.search.IndexSearcher.createWeight(IndexSearcher.java:
> 851)
> at
> org.apache.lucene.search.BooleanWeight.<init>(BooleanWeight.java:57)
> at
> org.apache.lucene.search.BooleanQuery.createWeight(BooleanQuery.java:1
> 84)
> at
> org.apache.lucene.search.FilteredQuery.createWeight(FilteredQuery.java:81
> )
> at
> org.apache.lucene.search.IndexSearcher.createWeight(IndexSearcher.java:
> 851)
> at
> org.apache.lucene.search.IndexSearcher.createNormalizedWeight(IndexSea
> rcher.java:834)
> at
> org.apache.lucene.search.IndexSearcher.search(IndexSearcher.java:485)
> at
> org.apache.lucene.search.IndexSearcher.search(IndexSearcher.java:473)
>
>
>
>
>
> After the first occurrence of this exception, any search request with a
> boolean query fails with the same exception. As mentioned above this does
> happen not until about two hours. The single segment index is created using
> "Java 1.7.0_04" and the Search server where the ClassCastException
> happens uses "Java 1.8.0_65"
>
>
> Our target environment,
>
>
> Index information : Single segment index created using
>
> java version "1.7.0_04"
> Java(TM) SE Runtime Environment (build 1.7.0_04-b20)
> Java HotSpot(TM) 64-Bit Server VM (build 23.0-b21, mixed mode
>
>
> Lucene 5.2.1 version Information :
>
> Manifest-Version: 1.0
>
> Ant-Version: Apache Ant 1.8.4
> Created-By: 1.7.0_75-b13 (Oracle Corporation)
> Extension-Name: org.apache.lucene
> Specification-Title: Lucene Search Engine: core
> Specification-Version: 5.2.1
> Specification-Vendor: The Apache Software Foundation
> Implementation-Title: org.apache.lucene
> Implementation-Version: 5.2.1 1684708 - shalin - 2015-06-10 23:11:06
> Implementation-Vendor: The Apache Software Foundation
> X-Compile-Source-JDK: 1.7
> X-Compile-Target-JDK: 1.7
>
>
>
> Search Searcher Java version :
>
> java version "1.8.0_65"
> Java(TM) SE Runtime Environment (build 1.8.0_65-b17)
> Java HotSpot(TM) 64-Bit Server VM (build 25.65-b01, mixed mode)
>
> OS Information:
> Linux in2s1in056 3.0.58-0.6.6-default #1 SMP Tue Feb 19 11:07:00 UTC 2013
> (1576ecd) x86_64 x86_64 x86_64 GNU/Linux
>
> Please let me know if you need additional information on this issue. The
> error we are seeing is similar to the one posted here,
> https://discuss.elastic.co/t/strange-marvel-exception/36112
> Are there any known issues running lucene 5.2.1 on JDK 1.8. In the meantime
> I will try compiling Lucene 5.2.1 using JDK 1.8 and see if this issues goes away.
>
> Thanks
> Kannan
> <https://discuss.elastic.co/t/strange-marvel-exception/36112>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org