I'm using jackrabbit 1.4.2. The error doesn't appear all the time but when it
does the solution is to delete the repository. The test is:

        @Test
        public void addDocument() 
        {
                documentService.importFile("Ana", "doc", new byte[200]);
        }

documentService:
    public void importFile(final String name, final String contentType,
final byte[] content) {
                jcrTemplate.execute(new JcrCallback() {

                        public Object doInJcr(Session session) throws 
IOException,
                                        RepositoryException {
                                Node rootNode = session.getRootNode();
                                Node fileNode = rootNode.addNode(name, 
"nt:file");
                                fileNode.addMixin("mix:referenceable");
                                Node resNode = fileNode.addNode("jcr:content", 
"nt:resource");

                                resNode.setProperty("jcr:data", new 
BinaryValue(content));
                                resNode.setProperty("jcr:mimeType", 
contentType);
                                resNode.setProperty("jcr:lastModified", 
Calendar.getInstance());
                                session.save();
                                return resNode;
                        }
                });
        }


Michael McCandless-2 wrote:
> 
> 
> Which version of Jackrabbit are you using?
> 
> Can you post the code of the simple test?  Is it only adding a single  
> document?
> 
> Mike
> 
> fanfy wrote:
>>
>> I'm also having a similar problem. Can you help me solve it? I'm only
>> beginning to use lucene. This is the stack trace from a simple test  
>> that
>> adds a document in the repository. I just created the jackrabbit  
>> repository
>> so mine is not an upgrade from 2.2 to 2.3 problem. Anyway can you  
>> help me
>> with some hints?
>> The tests are running under a nightly building server using jdk6  
>> and maven2.
>> Thank you.
>>
>> Caused by: java.lang.AssertionError: Terms are out of order:
>> field=_:PROPERTIES (number 4) lastField=_:PROPERTIES (number 4)
>> text=3:autoCreated lastText=3:autoCreated
>>      at org.apache.lucene.index.TermInfosWriter.add 
>> (TermInfosWriter.java:154)
>>      at
>> org.apache.lucene.index.DocumentsWriter.appendPostings 
>> (DocumentsWriter.java:2316)
>>      at
>> org.apache.lucene.index.DocumentsWriter.writeSegment 
>> (DocumentsWriter.java:2011)
>>      at org.apache.lucene.index.DocumentsWriter.flush 
>> (DocumentsWriter.java:548)
>>      at org.apache.lucene.index.IndexWriter.doFlush(IndexWriter.java:2497)
>>      at org.apache.lucene.index.IndexWriter.flush(IndexWriter.java:2397)
>>      at org.apache.lucene.index.IndexWriter.closeInternal 
>> (IndexWriter.java:1204)
>>      at org.apache.lucene.index.IndexWriter.close(IndexWriter.java:1178)
>>      at org.apache.lucene.index.IndexWriter.close(IndexWriter.java:1153)
>>      at
>> org.apache.jackrabbit.core.query.lucene.AbstractIndex.commit 
>> (AbstractIndex.java:326)
>>      at
>> org.apache.jackrabbit.core.query.lucene.VolatileIndex.commit 
>> (VolatileIndex.java:139)
>>      at
>> org.apache.jackrabbit.core.query.lucene.PersistentIndex.copyIndex 
>> (PersistentIndex.java:121)
>>      at
>> org.apache.jackrabbit.core.query.lucene.MultiIndex 
>> $VolatileCommit.execute(MultiIndex.java:1911)
>>      at
>> org.apache.jackrabbit.core.query.lucene.MultiIndex.executeAndLog 
>> (MultiIndex.java:936)
>>      at
>> org.apache.jackrabbit.core.query.lucene.MultiIndex.commitVolatileIndex 
>> (MultiIndex.java:986)
>>      at
>> org.apache.jackrabbit.core.query.lucene.MultiIndex.flush 
>> (MultiIndex.java:868)
>>      at
>> org.apache.jackrabbit.core.query.lucene.MultiIndex.close 
>> (MultiIndex.java:760)
>>      at
>> org.apache.jackrabbit.core.query.lucene.SearchIndex.close 
>> (SearchIndex.java:630)
>>      at
>> org.apache.jackrabbit.core.SearchManager.shutdownQueryHandler 
>> (SearchManager.java:588)
>>      at org.apache.jackrabbit.core.SearchManager.close 
>> (SearchManager.java:264)
>>      at
>> org.apache.jackrabbit.core.RepositoryImpl.doShutdown 
>> (RepositoryImpl.java:987)
>>      at
>> org.apache.jackrabbit.core.RepositoryImpl.shutdown 
>> (RepositoryImpl.java:948)
>>      at
>> org.apache.jackrabbit.core.RepositoryImpl.<init> 
>> (RepositoryImpl.java:348)
>>      at
>> org.apache.jackrabbit.core.RepositoryImpl.create 
>> (RepositoryImpl.java:557)
>>      at
>> org.springmodules.jcr.jackrabbit.RepositoryFactoryBean.createRepositor 
>> y(RepositoryFactoryBean.java:57)
>>      at
>> org.springmodules.jcr.RepositoryFactoryBean.afterPropertiesSet 
>> (RepositoryFactoryBean.java:57)
>>      at
>> org.springframework.beans.factory.support.AbstractAutowireCapableBeanF 
>> actory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1333)
>>      at
>> org.springframework.beans.factory.support.AbstractAutowireCapableBeanF 
>> actory.initializeBean(AbstractAutowireCapableBeanFactory.java:1299)
>>      ... 75 more
>>
>>
>>
>> Sergey Kabashnyuk-3 wrote:
>>>
>>> Hi
>>> I want to update  from lucene 2.2.0 to 2.3.0
>>> but I have assert it TermInfosWriter line 143.
>>>
>>> What is it mean
>>> assert compareToLastTerm(fieldNumber, termText, termTextStart,
>>> termTextLength) < 0 || (isIndex && termTextLength == 0 &&
>>> lastTermTextLength == 0);
>>>
>>> Can you help me?
>>>
>>> Sergey Kabashnyuk
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>>> For additional commands, e-mail: [EMAIL PROTECTED]
>>>
>>>
>>>
>>
>> -- 
>> View this message in context: http://www.nabble.com/from--2.2.0- 
>> to-2.3.0-tp15501449p16323371.html
>> Sent from the Lucene - Java Users mailing list archive at Nabble.com.
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>> For additional commands, e-mail: [EMAIL PROTECTED]
>>
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/from--2.2.0-to-2.3.0-tp15501449p16354912.html
Sent from the Lucene - Java Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to