lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Uwe Schindler" <...@thetaphi.de>
Subject RE: NumericField exception java.lang.IllegalStateException: call set???Value() before usage in lucene 3.5
Date Tue, 27 Mar 2012 09:33:09 GMT
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 <loujanwen@gmail.com> 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 <uwe@thetaphi.de> 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: uwe@thetaphi.de
> >>
> >>
> >> > -----Original Message-----
> >> > From: jianwen lou [mailto:loujanwen@gmail.com]
> >> > Sent: Tuesday, March 27, 2012 9:21 AM
> >> > To: java-user@lucene.apache.org
> >> > 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
> >> voke(Tr
> >> a
> >> > nsactionInterceptor.java:106)
> >> >     at
> >> >
> >> org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(
> >> Refl
> >> > ectiveMethodInvocation.java:171)
> >> >     at
> >> >
> >>
> >> org.springframework.transaction.interceptor.TransactionInterceptor.in
> >> voke(Tr
> >> a
> >> > nsactionInterceptor.java:106)
> >> >     at
> >> >
> >> org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(
> >> Refl
> >> > ectiveMethodInvocation.java:171)
> >> >     at
> >> >
> >>
> >> org.springframework.transaction.interceptor.TransactionInterceptor.in
> >> voke(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(JdkDyna
> >> > mic
> >> > AopProxy.java:204)
> >> >     at $Proxy53.indexGoods4Mobile(Unknown Source)
> >> >     at
> >> >
> >> com.beike.lucene.test.TestLuceneIndex.initGoodsIndex4Mobile(TestLucen
> >> eInde
> >> > x.java:45)
> >> >     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.test.context.junit4.SpringTestMethod.invoke(Sprin
> >> gTestM
> >> > ethod.java:160)
> >> >     at
> >> >
> >> org.springframework.test.context.junit4.SpringMethodRoadie.runTestMet
> >> hod(S
> >> > pringMethodRoadie.java:233)
> >> >     at
> >> >
> >> org.springframework.test.context.junit4.SpringMethodRoadie$RunBefores
> >> Then
> >> > TestThenAfters.run(SpringMethodRoadie.java:333)
> >> >     at
> >> >
> >>
> >> org.springframework.test.context.junit4.SpringMethodRoadie.runWithRep
> >> etitio
> >> > ns(SpringMethodRoadie.java:217)
> >> >     at
> >> >
> >> org.springframework.test.context.junit4.SpringMethodRoadie.runTest(Sp
> >> ringM
> >> > ethodRoadie.java:197)
> >> >     at
> >> >
> >> org.springframework.test.context.junit4.SpringMethodRoadie.run(Spring
> >> Metho
> >> > dRoadie.java:143)
> >> >     at
> >> >
> >>
> >> org.springframework.test.context.junit4.SpringJUnit4ClassRunner.invok
> >> eTestMe
> >> > thod(SpringJUnit4ClassRunner.java:160)
> >> >     at
> >> >
> >>
> >> org.junit.internal.runners.JUnit4ClassRunner.runMethods(JUnit4ClassRu
> >> nner.ja
> >> v
> >> > a:51)
> >> >     at
> >> >
> >>
> >> org.junit.internal.runners.JUnit4ClassRunner$1.run(JUnit4ClassRunner.
> >> java:44
> >> )
> >> >     at
> >> >
> >> org.junit.internal.runners.ClassRoadie.runUnprotected(ClassRoadie.jav
> >> a:27)
> >> >     at
> >> >
org.junit.internal.runners.ClassRoadie.runProtected(ClassRoadie.java:37)
> >> >     at
> >> >
> >>
> >> org.junit.internal.runners.JUnit4ClassRunner.run(JUnit4ClassRunner.ja
> >> va:42)
> >> >     at
> >> >
> >>
> >> org.springframework.test.context.junit4.SpringJUnit4ClassRunner.run(S
> >> pringJU
> >> n
> >> > it4ClassRunner.java:97)
> >> >     at
> >> >
> >>
> >> org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4
> >> TestRef
> >> ere
> >> > nce.java:38)
> >> >     at
> >> >
> >>
> >> org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution
> >> .java:3
> >> 8)
> >> >     at
> >> >
> >>
> >> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(Remot
> >> eTestRu
> >> > nner.java:460)
> >> >     at
> >> >
> >>
> >> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(Remot
> >> eTestRu
> >> > nner.java:673)
> >> >     at
> >> >
> >>
> >>
>
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.
> >> > java:386)
> >> >     at
> >> >
> >>
> >> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTes
> >> tRunne
> >> > r.java:196)
> >> >
> >> >
> >> >
> >> > --
> >> > *
> >> > *twitter.com/loujianwen
> >>
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
> >> For additional commands, e-mail: java-user-help@lucene.apache.org
> >>
> >>
> >
> >
> > --
> > *
> > *twitter.com/loujianwen
> >
> >
> 
> 
> --
> *
> *twitter.com/loujianwen


---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org


Mime
View raw message