|
jianwen lou
2012-03-27, 07:21
Uwe Schindler
2012-03-27, 07:24
jianwen lou
2012-03-27, 07:48
jianwen lou
2012-03-27, 07:56
Uwe Schindler
2012-03-27, 09:31
Uwe Schindler
2012-03-27, 09:33
jianwen lou
2012-03-27, 10:09
Erick Erickson
2012-03-27, 12:40
Brandon Mintern
2012-03-27, 19:12
jianwen lou
2012-03-28, 02:28
|
-
NumericField exception java.lang.IllegalStateException: call set???Value() before usage in lucene 3.5jianwen lou 2012-03-27, 07:21
I want to store the long type value to my index files like follwing:
NumericField priceField = new NumericField("price"); priceField.setDoubleValue(temp.getCurrentprice()); document.add(priceField); NumericField salesField = new NumericField("salescount"); priceField.setLongValue(temp.getSalescount()); document.add(salesField); NumericField ontimefiled = new NumericField("ontime"); ontimefiled.setLongValue(temp.getOntime().getTime()); document.add(ontimefiled); when writer add document i get the exception info:there is wrong with my using NumbericField? thanks java.lang.IllegalStateException: call set???Value() before usage at org.apache.lucene.analysis.NumericTokenStream.reset(NumericTokenStream.java:196) at org.apache.lucene.index.DocInverterPerField.processFields(DocInverterPerField.java:130) at org.apache.lucene.index.DocFieldProcessorPerThread.processDocument(DocFieldProcessorPerThread.java:278) at org.apache.lucene.index.DocumentsWriter.updateDocument(DocumentsWriter.java:766) at org.apache.lucene.index.IndexWriter.addDocument(IndexWriter.java:2066) at com.beike.common.lucene.dao.IndexDaoImpl.saveGoodsIndex4Mobile(IndexDaoImpl.java:308) at com.beike.common.lucene.dao.IndexStrategyServiceImpl.indexGoods4Mobile(IndexStrategyServiceImpl.java:118) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:307) at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149) at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:106) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171) at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:106) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171) at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:106) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171) at com.beike.ds.DataSourceInterceptor.invoke(DataSourceInterceptor.java:42) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171) at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204) at $Proxy53.indexGoods4Mobile(Unknown Source) at com.beike.lucene.test.TestLuceneIndex.initGoodsIndex4Mobile(TestLuceneIndex.java:45) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.springframework.test.context.junit4.SpringTestMethod.invoke(SpringTestMethod.java:160) at org.springframework.test.context.junit4.SpringMethodRoadie.runTestMethod(SpringMethodRoadie.java:233) at org.springframework.test.context.junit4.SpringMethodRoadie$RunBeforesThenTestThenAfters.run(SpringMethodRoadie.java:333) at org.springframework.test.context.junit4.SpringMethodRoadie.runWithRepetitions(SpringMethodRoadie.java:217) at org.springframework.test.context.junit4.SpringMethodRoadie.runTest(SpringMethodRoadie.java:197) at org.springframework.test.context.junit4.SpringMethodRoadie.run(SpringMethodRoadie.java:143) at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.invokeTestMethod(SpringJUnit4ClassRunner.java:160) at org.junit.internal.runners.JUnit4ClassRunner.runMethods(JUnit4ClassRunner.java:51) at org.junit.internal.runners.JUnit4ClassRunner$1.run(JUnit4ClassRunner.java:44) at org.junit.internal.runners.ClassRoadie.runUnprotected(ClassRoadie.java:27) at org.junit.internal.runners.ClassRoadie.runProtected(ClassRoadie.java:37) at org.junit.internal.runners.JUnit4ClassRunner.run(JUnit4ClassRunner.java:42) at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.run(SpringJUnit4ClassRunner.java:97) at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:38) at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:460) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196) * *twitter.com/loujianwen
-
RE: NumericField exception java.lang.IllegalStateException: call set???Value() before usage in lucene 3.5Uwe Schindler 2012-03-27, 07:24
Hi,
Are you sure that you are not reusing the same NumericField instances across different threads? ----- Uwe Schindler H.-H.-Meier-Allee 63, D-28213 Bremen http://www.thetaphi.de eMail: [EMAIL PROTECTED] > -----Original Message----- > From: jianwen lou [mailto:[EMAIL PROTECTED]] > Sent: Tuesday, March 27, 2012 9:21 AM > To: [EMAIL PROTECTED] > Subject: NumericField exception java.lang.IllegalStateException: call > set???Value() before usage in lucene 3.5 > > I want to store the long type value to my index files like follwing: > > NumericField priceField = new NumericField("price"); > priceField.setDoubleValue(temp.getCurrentprice()); > document.add(priceField); > > NumericField salesField = new NumericField("salescount"); > priceField.setLongValue(temp.getSalescount()); > document.add(salesField); > > NumericField ontimefiled = new NumericField("ontime"); > ontimefiled.setLongValue(temp.getOntime().getTime()); > document.add(ontimefiled); > > when writer add document i get the exception info:there is wrong with my > using NumbericField? thanks > > > java.lang.IllegalStateException: call set???Value() before usage > at > org.apache.lucene.analysis.NumericTokenStream.reset(NumericTokenStream.j > ava:196) > at > org.apache.lucene.index.DocInverterPerField.processFields(DocInverterPerFiel d > .java:130) > at > org.apache.lucene.index.DocFieldProcessorPerThread.processDocument(DocFie > ldProcessorPerThread.java:278) > at > org.apache.lucene.index.DocumentsWriter.updateDocument(DocumentsWriter > .java:766) > at > org.apache.lucene.index.IndexWriter.addDocument(IndexWriter.java:2066) > at > com.beike.common.lucene.dao.IndexDaoImpl.saveGoodsIndex4Mobile(IndexDa > oImpl.java:308) > at > com.beike.common.lucene.dao.IndexStrategyServiceImpl.indexGoods4Mobile(I > ndexStrategyServiceImpl.java:118) > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > at > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java: > 39) > at > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorI > mpl.java:25) > at java.lang.reflect.Method.invoke(Method.java:597) > at > org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(Aop > Utils.java:307) > at > org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpo > int(ReflectiveMethodInvocation.java:182) > at > org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(Refl > ectiveMethodInvocation.java:149) > at > org.springframework.transaction.interceptor.TransactionInterceptor.invoke(Tr a > nsactionInterceptor.java:106) > at > org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(Refl > ectiveMethodInvocation.java:171) > at > org.springframework.transaction.interceptor.TransactionInterceptor.invoke(Tr a > nsactionInterceptor.java:106) > at > org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(Refl > ectiveMethodInvocation.java:171) > at > org.springframework.transaction.interceptor.TransactionInterceptor.invoke(Tr a > nsactionInterceptor.java:106) > at > org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(Refl > ectiveMethodInvocation.java:171) > at > com.beike.ds.DataSourceInterceptor.invoke(DataSourceInterceptor.java:42) > at > org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(Refl > ectiveMethodInvocation.java:171) > at > org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamic > AopProxy.java:204) > at $Proxy53.indexGoods4Mobile(Unknown Source) > at > com.beike.lucene.test.TestLuceneIndex.initGoodsIndex4Mobile(TestLuceneInde > x.java:45) > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > at > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java: org.springframework.test.context.junit4.SpringTestMethod.invoke(SpringTestM org.springframework.test.context.junit4.SpringMethodRoadie.runWithRepetitio org.springframework.test.context.junit4.SpringJUnit4ClassRunner.invokeTestMe org.junit.internal.runners.JUnit4ClassRunner.runMethods(JUnit4ClassRunner.ja v org.junit.internal.runners.JUnit4ClassRunner$1.run(JUnit4ClassRunner.java:44 ) org.junit.internal.runners.JUnit4ClassRunner.run(JUnit4ClassRunner.java:42) org.springframework.test.context.junit4.SpringJUnit4ClassRunner.run(SpringJU n org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestRef ere org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:3 8) org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRu org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRu org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner. org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunne
-
Re: NumericField exception java.lang.IllegalStateException: call set???Value() before usage in lucene 3.5jianwen lou 2012-03-27, 07:48
No,There is no multi-thread building index at same time,
I google and get the result, i use 64 bit jvm. It matters? http://lucene.472066.n3.nabble.com/Lucene-3-4-shift-bug-in-possibly-invalid-use-of-NumericTokenStream-td3592962.html F:\Java\open-source\lucene>java -version java version "1.6.0_25" Java(TM) SE Runtime Environment (build 1.6.0_25-b06) Java HotSpot(TM) 64-Bit Server VM (build 20.0-b11, mixed mode) On Tue, Mar 27, 2012 at 3:24 PM, Uwe Schindler <[EMAIL PROTECTED]> wrote: > Hi, > > Are you sure that you are not reusing the same NumericField instances > across > different threads? > > ----- > Uwe Schindler > H.-H.-Meier-Allee 63, D-28213 Bremen > http://www.thetaphi.de > eMail: [EMAIL PROTECTED] > > > > -----Original Message----- > > From: jianwen lou [mailto:[EMAIL PROTECTED]] > > Sent: Tuesday, March 27, 2012 9:21 AM > > To: [EMAIL PROTECTED] > > Subject: NumericField exception java.lang.IllegalStateException: call > > set???Value() before usage in lucene 3.5 > > > > I want to store the long type value to my index files like follwing: > > > > NumericField priceField = new NumericField("price"); > > priceField.setDoubleValue(temp.getCurrentprice()); > > document.add(priceField); > > > > NumericField salesField = new NumericField("salescount"); > > priceField.setLongValue(temp.getSalescount()); > > document.add(salesField); > > > > NumericField ontimefiled = new NumericField("ontime"); > > ontimefiled.setLongValue(temp.getOntime().getTime()); > > document.add(ontimefiled); > > > > when writer add document i get the exception info:there is wrong with my > > using NumbericField? thanks > > > > > > java.lang.IllegalStateException: call set???Value() before usage > > at > > org.apache.lucene.analysis.NumericTokenStream.reset(NumericTokenStream.j > > ava:196) > > at > > > > org.apache.lucene.index.DocInverterPerField.processFields(DocInverterPerFiel > d > > .java:130) > > at > > org.apache.lucene.index.DocFieldProcessorPerThread.processDocument(DocFie > > ldProcessorPerThread.java:278) > > at > > org.apache.lucene.index.DocumentsWriter.updateDocument(DocumentsWriter > > .java:766) > > at > > org.apache.lucene.index.IndexWriter.addDocument(IndexWriter.java:2066) > > at > > com.beike.common.lucene.dao.IndexDaoImpl.saveGoodsIndex4Mobile(IndexDa > > oImpl.java:308) > > at > > com.beike.common.lucene.dao.IndexStrategyServiceImpl.indexGoods4Mobile(I > > ndexStrategyServiceImpl.java:118) > > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > > at > > > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java: > > 39) > > at > > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorI > > mpl.java:25) > > at java.lang.reflect.Method.invoke(Method.java:597) > > at > > > org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(Aop > > Utils.java:307) > > at > > org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpo > > int(ReflectiveMethodInvocation.java:182) > > at > > org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(Refl > > ectiveMethodInvocation.java:149) > > at > > > > org.springframework.transaction.interceptor.TransactionInterceptor.invoke(Tr > a > > nsactionInterceptor.java:106) > > at > > org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(Refl > > ectiveMethodInvocation.java:171) > > at > > > > org.springframework.transaction.interceptor.TransactionInterceptor.invoke(Tr > a > > nsactionInterceptor.java:106) > > at > > org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(Refl > > ectiveMethodInvocation.java:171) > > at > > > > org.springframework.transaction.interceptor.TransactionInterceptor.invoke(Tr > a > > nsactionInterceptor.java:106) > > at > > org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(Refl * *twitter.com/loujianwen
-
Re: NumericField exception java.lang.IllegalStateException: call set???Value() before usage in lucene 3.5jianwen lou 2012-03-27, 07:56
I am not exactly understand the precisionStep arg,I need to add the arg?
On Tue, Mar 27, 2012 at 3:48 PM, jianwen lou <[EMAIL PROTECTED]> wrote: > No,There is no multi-thread building index at same time, > I google and get the result, i use 64 bit jvm. It matters? > > > http://lucene.472066.n3.nabble.com/Lucene-3-4-shift-bug-in-possibly-invalid-use-of-NumericTokenStream-td3592962.html > > F:\Java\open-source\lucene>java -version > java version "1.6.0_25" > Java(TM) SE Runtime Environment (build 1.6.0_25-b06) > Java HotSpot(TM) 64-Bit Server VM (build 20.0-b11, mixed mode) > > > > On Tue, Mar 27, 2012 at 3:24 PM, Uwe Schindler <[EMAIL PROTECTED]> wrote: > >> Hi, >> >> Are you sure that you are not reusing the same NumericField instances >> across >> different threads? >> >> ----- >> Uwe Schindler >> H.-H.-Meier-Allee 63, D-28213 Bremen >> http://www.thetaphi.de >> eMail: [EMAIL PROTECTED] >> >> >> > -----Original Message----- >> > From: jianwen lou [mailto:[EMAIL PROTECTED]] >> > Sent: Tuesday, March 27, 2012 9:21 AM >> > To: [EMAIL PROTECTED] >> > Subject: NumericField exception java.lang.IllegalStateException: call >> > set???Value() before usage in lucene 3.5 >> > >> > I want to store the long type value to my index files like follwing: >> > >> > NumericField priceField = new NumericField("price"); >> > priceField.setDoubleValue(temp.getCurrentprice()); >> > document.add(priceField); >> > >> > NumericField salesField = new >> NumericField("salescount"); >> > priceField.setLongValue(temp.getSalescount()); >> > document.add(salesField); >> > >> > NumericField ontimefiled = new NumericField("ontime"); >> > ontimefiled.setLongValue(temp.getOntime().getTime()); >> > document.add(ontimefiled); >> > >> > when writer add document i get the exception info:there is wrong with my >> > using NumbericField? thanks >> > >> > >> > java.lang.IllegalStateException: call set???Value() before usage >> > at >> > org.apache.lucene.analysis.NumericTokenStream.reset(NumericTokenStream.j >> > ava:196) >> > at >> > >> >> org.apache.lucene.index.DocInverterPerField.processFields(DocInverterPerFiel >> d >> > .java:130) >> > at >> > >> org.apache.lucene.index.DocFieldProcessorPerThread.processDocument(DocFie >> > ldProcessorPerThread.java:278) >> > at >> > org.apache.lucene.index.DocumentsWriter.updateDocument(DocumentsWriter >> > .java:766) >> > at >> > org.apache.lucene.index.IndexWriter.addDocument(IndexWriter.java:2066) >> > at >> > com.beike.common.lucene.dao.IndexDaoImpl.saveGoodsIndex4Mobile(IndexDa >> > oImpl.java:308) >> > at >> > com.beike.common.lucene.dao.IndexStrategyServiceImpl.indexGoods4Mobile(I >> > ndexStrategyServiceImpl.java:118) >> > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) >> > at >> > >> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java: >> > 39) >> > at >> > >> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorI >> > mpl.java:25) >> > at java.lang.reflect.Method.invoke(Method.java:597) >> > at >> > >> >> org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(Aop >> > Utils.java:307) >> > at >> > >> org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpo >> > int(ReflectiveMethodInvocation.java:182) >> > at >> > >> org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(Refl >> > ectiveMethodInvocation.java:149) >> > at >> > >> >> org.springframework.transaction.interceptor.TransactionInterceptor.invoke(Tr >> a >> > nsactionInterceptor.java:106) >> > at >> > >> org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(Refl >> > ectiveMethodInvocation.java:171) >> > at >> > >> >> org.springframework.transaction.interceptor.TransactionInterceptor.invoke(Tr >> a >> > nsactionInterceptor.java:106) * *twitter.com/loujianwen
-
RE: NumericField exception java.lang.IllegalStateException: call set???Value() before usage in lucene 3.5Uwe Schindler 2012-03-27, 09:31
The bug mentioned in this link was a multithread bug (what I asked you). If
you reuse Documents and Fields this can happen, otherwise not. This code is heavily tested and the code you sent cannot fail. Maybe its different to the one you actually use? ----- Uwe Schindler H.-H.-Meier-Allee 63, D-28213 Bremen http://www.thetaphi.de eMail: [EMAIL PROTECTED] > -----Original Message----- > From: jianwen lou [mailto:[EMAIL PROTECTED]] > Sent: Tuesday, March 27, 2012 9:49 AM > To: [EMAIL PROTECTED] > Subject: Re: NumericField exception java.lang.IllegalStateException: call > set???Value() before usage in lucene 3.5 > > No,There is no multi-thread building index at same time, I google and get the > result, i use 64 bit jvm. It matters? > > http://lucene.472066.n3.nabble.com/Lucene-3-4-shift-bug-in-possibly-invalid- > use-of-NumericTokenStream-td3592962.html > > F:\Java\open-source\lucene>java -version java version "1.6.0_25" > Java(TM) SE Runtime Environment (build 1.6.0_25-b06) Java HotSpot(TM) 64- > Bit Server VM (build 20.0-b11, mixed mode) > > > On Tue, Mar 27, 2012 at 3:24 PM, Uwe Schindler <[EMAIL PROTECTED]> wrote: > > > Hi, > > > > Are you sure that you are not reusing the same NumericField instances > > across different threads? > > > > ----- > > Uwe Schindler > > H.-H.-Meier-Allee 63, D-28213 Bremen > > http://www.thetaphi.de > > eMail: [EMAIL PROTECTED] > > > > > > > -----Original Message----- > > > From: jianwen lou [mailto:[EMAIL PROTECTED]] > > > Sent: Tuesday, March 27, 2012 9:21 AM > > > To: [EMAIL PROTECTED] > > > Subject: NumericField exception java.lang.IllegalStateException: > > > call > > > set???Value() before usage in lucene 3.5 > > > > > > I want to store the long type value to my index files like follwing: > > > > > > NumericField priceField = new NumericField("price"); > > > priceField.setDoubleValue(temp.getCurrentprice()); > > > document.add(priceField); > > > > > > NumericField salesField = new NumericField("salescount"); > > > priceField.setLongValue(temp.getSalescount()); > > > document.add(salesField); > > > > > > NumericField ontimefiled = new NumericField("ontime"); > > > ontimefiled.setLongValue(temp.getOntime().getTime()); > > > document.add(ontimefiled); > > > > > > when writer add document i get the exception info:there is wrong > > > with my using NumbericField? thanks > > > > > > > > > java.lang.IllegalStateException: call set???Value() before usage > > > at > > > org.apache.lucene.analysis.NumericTokenStream.reset(NumericTokenStre > > > am.j > > > ava:196) > > > at > > > > > > > org.apache.lucene.index.DocInverterPerField.processFields(DocInverterP > > erFiel > > d > > > .java:130) > > > at > > > org.apache.lucene.index.DocFieldProcessorPerThread.processDocument(D > > > ocFie > > > ldProcessorPerThread.java:278) > > > at > > > > org.apache.lucene.index.DocumentsWriter.updateDocument(DocumentsWrit > > > er > > > .java:766) > > > at > > > org.apache.lucene.index.IndexWriter.addDocument(IndexWriter.java:2066) > > > at > > > > com.beike.common.lucene.dao.IndexDaoImpl.saveGoodsIndex4Mobile(Index > > > Da > > > oImpl.java:308) > > > at > > > com.beike.common.lucene.dao.IndexStrategyServiceImpl.indexGoods4Mobi > > > le(I > > > ndexStrategyServiceImpl.java:118) > > > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > > > at > > > > > > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java: > > > 39) > > > at > > > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcce > > > ssorI > > > mpl.java:25) > > > at java.lang.reflect.Method.invoke(Method.java:597) > > > at > > > > > org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflectio > > n(Aop > > > Utils.java:307) > > > at > > > org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJ com.beike.ds.DataSourceInterceptor.invoke(DataSourceInterceptor.java:42) org.junit.internal.runners.ClassRoadie.runProtected(ClassRoadie.java:37) org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.
-
RE: NumericField exception java.lang.IllegalStateException: call set???Value() before usage in lucene 3.5Uwe Schindler 2012-03-27, 09:33
Hi,
> I am not exactly understand the precisionStep arg,I need to add the arg? RTFM: http://goo.gl/PlhhO > On Tue, Mar 27, 2012 at 3:48 PM, jianwen lou <[EMAIL PROTECTED]> wrote: > > > No,There is no multi-thread building index at same time, I google and > > get the result, i use 64 bit jvm. It matters? > > > > > > http://lucene.472066.n3.nabble.com/Lucene-3-4-shift-bug-in-possibly-in > > valid-use-of-NumericTokenStream-td3592962.html > > > > F:\Java\open-source\lucene>java -version java version "1.6.0_25" > > Java(TM) SE Runtime Environment (build 1.6.0_25-b06) Java HotSpot(TM) > > 64-Bit Server VM (build 20.0-b11, mixed mode) > > > > > > > > On Tue, Mar 27, 2012 at 3:24 PM, Uwe Schindler <[EMAIL PROTECTED]> wrote: > > > >> Hi, > >> > >> Are you sure that you are not reusing the same NumericField instances > >> across different threads? > >> > >> ----- > >> Uwe Schindler > >> H.-H.-Meier-Allee 63, D-28213 Bremen > >> http://www.thetaphi.de > >> eMail: [EMAIL PROTECTED] > >> > >> > >> > -----Original Message----- > >> > From: jianwen lou [mailto:[EMAIL PROTECTED]] > >> > Sent: Tuesday, March 27, 2012 9:21 AM > >> > To: [EMAIL PROTECTED] > >> > Subject: NumericField exception java.lang.IllegalStateException: > >> > call > >> > set???Value() before usage in lucene 3.5 > >> > > >> > I want to store the long type value to my index files like follwing: > >> > > >> > NumericField priceField = new NumericField("price"); > >> > priceField.setDoubleValue(temp.getCurrentprice()); > >> > document.add(priceField); > >> > > >> > NumericField salesField = new > >> NumericField("salescount"); > >> > priceField.setLongValue(temp.getSalescount()); > >> > document.add(salesField); > >> > > >> > NumericField ontimefiled = new NumericField("ontime"); > >> > ontimefiled.setLongValue(temp.getOntime().getTime()); > >> > document.add(ontimefiled); > >> > > >> > when writer add document i get the exception info:there is wrong > >> > with my using NumbericField? thanks > >> > > >> > > >> > java.lang.IllegalStateException: call set???Value() before usage > >> > at > >> > org.apache.lucene.analysis.NumericTokenStream.reset(NumericTokenStr > >> > eam.j > >> > ava:196) > >> > at > >> > > >> > >> org.apache.lucene.index.DocInverterPerField.processFields(DocInverter > >> PerFiel > >> d > >> > .java:130) > >> > at > >> > > >> org.apache.lucene.index.DocFieldProcessorPerThread.processDocument(Do > >> cFie > >> > ldProcessorPerThread.java:278) > >> > at > >> > > org.apache.lucene.index.DocumentsWriter.updateDocument(DocumentsWri > >> > ter > >> > .java:766) > >> > at > >> > > org.apache.lucene.index.IndexWriter.addDocument(IndexWriter.java:2066) > >> > at > >> > > com.beike.common.lucene.dao.IndexDaoImpl.saveGoodsIndex4Mobile(Inde > >> > xDa > >> > oImpl.java:308) > >> > at > >> > > com.beike.common.lucene.dao.IndexStrategyServiceImpl.indexGoods4Mob > >> > ile(I > >> > ndexStrategyServiceImpl.java:118) > >> > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > >> > at > >> > > >> > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java: > >> > 39) > >> > at > >> > > >> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces > >> sorI > >> > mpl.java:25) > >> > at java.lang.reflect.Method.invoke(Method.java:597) > >> > at > >> > > >> > >> org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflecti > >> on(Aop > >> > Utils.java:307) > >> > at > >> > > >> org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJo > >> inpo > >> > int(ReflectiveMethodInvocation.java:182) > >> > at > >> > > >> org.springframework.aop.framework.ReflectiveMethodInvocation.proceed( > >> Refl > >> > ectiveMethodInvocation.java:149) > >> > at > >> > > >> > >> org.springframework.transaction.interceptor.TransactionInterceptor.in org.junit.internal.runners.ClassRoadie.runProtected(ClassRoadie.java:37) org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.
-
Re: NumericField exception java.lang.IllegalStateException: call set???Value() before usage in lucene 3.5jianwen lou 2012-03-27, 10:09
It seems that the Analyzer i used in my project is the problem.I use
CJKAnalyzer,I am not exactly understand the lucene analysis and tokenizer process .Is there other way to do this: I want to store numbers and date time in the lucene filed and to use the filed to filter and range the search,thanks On Tue, Mar 27, 2012 at 5:31 PM, Uwe Schindler <[EMAIL PROTECTED]> wrote: > The bug mentioned in this link was a multithread bug (what I asked you). If > you reuse Documents and Fields this can happen, otherwise not. This code is > heavily tested and the code you sent cannot fail. Maybe its different to > the > one you actually use? > > ----- > Uwe Schindler > H.-H.-Meier-Allee 63, D-28213 Bremen > http://www.thetaphi.de > eMail: [EMAIL PROTECTED] > > > > -----Original Message----- > > From: jianwen lou [mailto:[EMAIL PROTECTED]] > > Sent: Tuesday, March 27, 2012 9:49 AM > > To: [EMAIL PROTECTED] > > Subject: Re: NumericField exception java.lang.IllegalStateException: call > > set???Value() before usage in lucene 3.5 > > > > No,There is no multi-thread building index at same time, I google and get > the > > result, i use 64 bit jvm. It matters? > > > > > > http://lucene.472066.n3.nabble.com/Lucene-3-4-shift-bug-in-possibly-invalid- > > use-of-NumericTokenStream-td3592962.html > > > > F:\Java\open-source\lucene>java -version java version "1.6.0_25" > > Java(TM) SE Runtime Environment (build 1.6.0_25-b06) Java HotSpot(TM) 64- > > Bit Server VM (build 20.0-b11, mixed mode) > > > > > > On Tue, Mar 27, 2012 at 3:24 PM, Uwe Schindler <[EMAIL PROTECTED]> wrote: > > > > > Hi, > > > > > > Are you sure that you are not reusing the same NumericField instances > > > across different threads? > > > > > > ----- > > > Uwe Schindler > > > H.-H.-Meier-Allee 63, D-28213 Bremen > > > http://www.thetaphi.de > > > eMail: [EMAIL PROTECTED] > > > > > > > > > > -----Original Message----- > > > > From: jianwen lou [mailto:[EMAIL PROTECTED]] > > > > Sent: Tuesday, March 27, 2012 9:21 AM > > > > To: [EMAIL PROTECTED] > > > > Subject: NumericField exception java.lang.IllegalStateException: > > > > call > > > > set???Value() before usage in lucene 3.5 > > > > > > > > I want to store the long type value to my index files like follwing: > > > > > > > > NumericField priceField = new NumericField("price"); > > > > priceField.setDoubleValue(temp.getCurrentprice()); > > > > document.add(priceField); > > > > > > > > NumericField salesField = new > NumericField("salescount"); > > > > priceField.setLongValue(temp.getSalescount()); > > > > document.add(salesField); > > > > > > > > NumericField ontimefiled = new > NumericField("ontime"); > > > > ontimefiled.setLongValue(temp.getOntime().getTime()); > > > > document.add(ontimefiled); > > > > > > > > when writer add document i get the exception info:there is wrong > > > > with my using NumbericField? thanks > > > > > > > > > > > > java.lang.IllegalStateException: call set???Value() before usage > > > > at > > > > org.apache.lucene.analysis.NumericTokenStream.reset(NumericTokenStre > > > > am.j > > > > ava:196) > > > > at > > > > > > > > > > org.apache.lucene.index.DocInverterPerField.processFields(DocInverterP > > > erFiel > > > d > > > > .java:130) > > > > at > > > > org.apache.lucene.index.DocFieldProcessorPerThread.processDocument(D > > > > ocFie > > > > ldProcessorPerThread.java:278) > > > > at > > > > > > org.apache.lucene.index.DocumentsWriter.updateDocument(DocumentsWrit > > > > er > > > > .java:766) > > > > at > > > > > org.apache.lucene.index.IndexWriter.addDocument(IndexWriter.java:2066) > > > > at > > > > > > com.beike.common.lucene.dao.IndexDaoImpl.saveGoodsIndex4Mobile(Index > > > > Da > > > > oImpl.java:308) > > > > at > > > > com.beike.common.lucene.dao.IndexStrategyServiceImpl.indexGoods4Mobi > > > > le(I > > > > ndexStrategyServiceImpl.java:118) * *twitter.com/loujianwen
-
Re: NumericField exception java.lang.IllegalStateException: call set???Value() before usage in lucene 3.5Erick Erickson 2012-03-27, 12:40
I'll, of course, defer to Uwe for technical Lucene issues, but you've
got a copy/paste error it looks like. I doubt it's the root of your problem, but this code reuses priceField, it seems like you intend the second to use salesField.... NumericField priceField = new NumericField("price"); priceField.setDoubleValue(temp.getCurrentprice()) document.add(priceField); NumericField salesField = new NumericField("salescount"); priceField.setLongValue(temp.getSalescount()); document.add(salesField); On Tue, Mar 27, 2012 at 6:09 AM, jianwen lou <[EMAIL PROTECTED]> wrote: > It seems that the Analyzer i used in my project is the problem.I use > CJKAnalyzer,I am not exactly understand the lucene analysis and tokenizer > process .Is there other way to do this: > I want to store numbers and date time in the lucene filed and to use the > filed to filter and range the search,thanks > > On Tue, Mar 27, 2012 at 5:31 PM, Uwe Schindler <[EMAIL PROTECTED]> wrote: > >> The bug mentioned in this link was a multithread bug (what I asked you). If >> you reuse Documents and Fields this can happen, otherwise not. This code is >> heavily tested and the code you sent cannot fail. Maybe its different to >> the >> one you actually use? >> >> ----- >> Uwe Schindler >> H.-H.-Meier-Allee 63, D-28213 Bremen >> http://www.thetaphi.de >> eMail: [EMAIL PROTECTED] >> >> >> > -----Original Message----- >> > From: jianwen lou [mailto:[EMAIL PROTECTED]] >> > Sent: Tuesday, March 27, 2012 9:49 AM >> > To: [EMAIL PROTECTED] >> > Subject: Re: NumericField exception java.lang.IllegalStateException: call >> > set???Value() before usage in lucene 3.5 >> > >> > No,There is no multi-thread building index at same time, I google and get >> the >> > result, i use 64 bit jvm. It matters? >> > >> > >> >> http://lucene.472066.n3.nabble.com/Lucene-3-4-shift-bug-in-possibly-invalid- >> > use-of-NumericTokenStream-td3592962.html >> > >> > F:\Java\open-source\lucene>java -version java version "1.6.0_25" >> > Java(TM) SE Runtime Environment (build 1.6.0_25-b06) Java HotSpot(TM) 64- >> > Bit Server VM (build 20.0-b11, mixed mode) >> > >> > >> > On Tue, Mar 27, 2012 at 3:24 PM, Uwe Schindler <[EMAIL PROTECTED]> wrote: >> > >> > > Hi, >> > > >> > > Are you sure that you are not reusing the same NumericField instances >> > > across different threads? >> > > >> > > ----- >> > > Uwe Schindler >> > > H.-H.-Meier-Allee 63, D-28213 Bremen >> > > http://www.thetaphi.de >> > > eMail: [EMAIL PROTECTED] >> > > >> > > >> > > > -----Original Message----- >> > > > From: jianwen lou [mailto:[EMAIL PROTECTED]] >> > > > Sent: Tuesday, March 27, 2012 9:21 AM >> > > > To: [EMAIL PROTECTED] >> > > > Subject: NumericField exception java.lang.IllegalStateException: >> > > > call >> > > > set???Value() before usage in lucene 3.5 >> > > > >> > > > I want to store the long type value to my index files like follwing: >> > > > >> > > > NumericField priceField = new NumericField("price"); >> > > > priceField.setDoubleValue(temp.getCurrentprice()); >> > > > document.add(priceField); >> > > > >> > > > NumericField salesField = new >> NumericField("salescount"); >> > > > priceField.setLongValue(temp.getSalescount()); >> > > > document.add(salesField); >> > > > >> > > > NumericField ontimefiled = new >> NumericField("ontime"); >> > > > ontimefiled.setLongValue(temp.getOntime().getTime()); >> > > > document.add(ontimefiled); >> > > > >> > > > when writer add document i get the exception info:there is wrong >> > > > with my using NumbericField? thanks >> > > > >> > > > >> > > > java.lang.IllegalStateException: call set???Value() before usage >> > > > at >> > > > org.apache.lucene.analysis.NumericTokenStream.reset(NumericTokenStre >> > > > am.j >> > > > ava:196) >> > > > at >> > > > >> > > >> > > org.apache.lucene.index.DocInverterPerField.processFields(DocInverterP
-
Re: NumericField exception java.lang.IllegalStateException: call set???Value() before usage in lucene 3.5Brandon Mintern 2012-03-27, 19:12
On Tue, Mar 27, 2012 at 12:21 AM, jianwen lou <[EMAIL PROTECTED]> wrote:
> I want to store the long type value to my index files like follwing: > > NumericField priceField = new NumericField("price"); > priceField.setDoubleValue(temp.getCurrentprice()); > document.add(priceField); > --> NumericField salesField = new NumericField("salescount"); --> priceField.setLongValue(temp.getSalescount()); > document.add(salesField); It looks like you're setting priceField's value again instead of salesField's. Looks like a copy-paste that wasn't fully edited. ---------------------------------------------------------------------
-
Re: NumericField exception java.lang.IllegalStateException: call set???Value() before usage in lucene 3.5jianwen lou 2012-03-28, 02:28
thanks so much,Brandon Mintern.My mistak,sorry for everyone.
On Wed, Mar 28, 2012 at 3:12 AM, Brandon Mintern <[EMAIL PROTECTED]>wrote: > On Tue, Mar 27, 2012 at 12:21 AM, jianwen lou <[EMAIL PROTECTED]> wrote: > > I want to store the long type value to my index files like follwing: > > > > NumericField priceField = new NumericField("price"); > > priceField.setDoubleValue(temp.getCurrentprice()); > > document.add(priceField); > > > --> NumericField salesField = new > NumericField("salescount"); > --> priceField.setLongValue(temp.getSalescount()); > > document.add(salesField); > > It looks like you're setting priceField's value again instead of > salesField's. Looks like a copy-paste that wasn't fully edited. > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > -- * *twitter.com/loujianwen |