You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@jackrabbit.apache.org by Ian Boston <ia...@googlemail.com> on 2009/03/24 22:00:56 UTC

Concurrent writes causes repository exception.

     I have some code that writes about 4 nt:file nodes which are  
observed. (each group of 4 files represents a user and their profile)
I test this will a perl script over HTTP to rest that is capable of  
running multithreaded.
When I run single threaded, then there is no problem, I can create  
25k, although a bit slowly.

However when I run with 8 threads I get the below in within the first  
few create requests.

Any idea what the problem is ?

Ian





      [exec] Caused by: javax.jcr.RepositoryException:  
09a609cb-267f-4dfc-bc95-56eff64a08b7: 09a609cb-267f-4dfc- 
bc95-56eff64a08b7
      [exec] 	at  
org.apache.jackrabbit.core.version.NodeStateEx.store(NodeStateEx.java: 
505)
      [exec] 	at  
org 
.apache 
.jackrabbit 
.core 
.version 
.AbstractVersionManager 
.createVersionHistory(AbstractVersionManager.java:321)
      [exec] 	at  
org 
.apache 
.jackrabbit 
.core 
.version.XAVersionManager.createVersionHistory(XAVersionManager.java: 
138)
      [exec] 	at  
org.apache.jackrabbit.core.ItemImpl.initVersionHistories(ItemImpl.java: 
782)
      [exec] 	at  
org.apache.jackrabbit.core.ItemImpl.save(ItemImpl.java:1224)
      [exec] 	at  
org.apache.jackrabbit.core.SessionImpl.save(SessionImpl.java:897)
      [exec] 	at  
org 
.sakaiproject 
.kernel 
.jcr.jackrabbit.sakai.SakaiXASessionImpl.save(SakaiXASessionImpl.java: 
220)
      [exec] 	at  
org 
.sakaiproject 
.kernel.jcr.jackrabbit.JCRServiceImpl.save(JCRServiceImpl.java:114)
      [exec] 	at  
org 
.sakaiproject 
.kernel.rest.RestUserProvider.createUser(RestUserProvider.java:378)
      [exec] 	at  
org 
.sakaiproject 
.kernel.rest.RestUserProvider.dispatch(RestUserProvider.java:134)
      [exec] 	... 22 more
      [exec] Caused by:  
org.apache.jackrabbit.core.state.NoSuchItemStateException:  
09a609cb-267f-4dfc-bc95-56eff64a08b7
      [exec] 	at  
org 
.apache 
.jackrabbit 
.core 
.state.SharedItemStateManager.getItemState(SharedItemStateManager.java: 
260)
      [exec] 	at  
org 
.apache 
.jackrabbit 
.core 
.state.LocalItemStateManager.getNodeState(LocalItemStateManager.java:93)
      [exec] 	at  
org 
.apache 
.jackrabbit 
.core 
.state.LocalItemStateManager.getItemState(LocalItemStateManager.java: 
158)
      [exec] 	at  
org 
.apache 
.jackrabbit 
.core.state.XAItemStateManager.getItemState(XAItemStateManager.java:243)
      [exec] 	at  
org.apache.jackrabbit.core.version.NodeStateEx.store(NodeStateEx.java: 
533)
      [exec] 	at  
org.apache.jackrabbit.core.version.NodeStateEx.store(NodeStateEx.java: 
503)


AW: Problem getting full textual search to work with textextractors

Posted by Kurz Wolfgang <wo...@gwvs.de>.
Thx for the info!

I have it working now even without jempbox.

I will add that to my jars though.

Don't ask me why it didn't work:-) I haven't changed anything:-)

-----Ursprüngliche Nachricht-----
Von: mreutegg@day.com [mailto:mreutegg@day.com] Im Auftrag von Marcel Reutegger
Gesendet: Freitag, 27. März 2009 09:31
An: users@jackrabbit.apache.org
Betreff: Re: Problem getting full textual search to work with textextractors

Hi Wolfgang,

pdfbox has an additional dependency to jempbox:

[dependency:tree]
org.apache.jackrabbit:jackrabbit-text-extractors:jar:1.5.0
+- org.apache.poi:poi:jar:3.0.2-FINAL:compile
|  \- commons-logging:commons-logging:jar:1.1:compile
|     \- log4j:log4j:jar:1.2.14:compile
+- org.apache.poi:poi-scratchpad:jar:3.0.2-FINAL:compile
+- pdfbox:pdfbox:jar:0.7.3:compile
|  +- org.fontbox:fontbox:jar:0.1.0:compile
|  \- org.jempbox:jempbox:jar:0.2.0:compile   <=====
+- net.sourceforge.nekohtml:nekohtml:jar:1.9.7:compile
|  \- xerces:xercesImpl:jar:2.8.1:compile
|     \- xml-apis:xml-apis:jar:1.3.03:compile
+- org.slf4j:slf4j-api:jar:1.5.3:compile

did you see any warnings or errors in the logs?

regards
 marcel

On Thu, Mar 26, 2009 at 16:20, Kurz Wolfgang <wo...@gwvs.de> wrote:
> Hello everyone,
>
> i am trying to get the full textual search to work with text extractors.
>
>
> I uploaded a pfd-file as resource into jackrabbit which works fine as I can download it just fine and I get the file back.
>
> But now I wanted to implement textual search inside document I uploaded and somehow it doesn't find the documents even though the document contains the strings that I am searching for.
>
> What I did I this:
>
> I added these jar files to my tomcat server lib folder since I am using JNDI to connect
>
> -jackrabbit-text-extractors-1.5.0.jar
> -fontbox-0.1.0.jar
> -junit-3.8.1.jar
> -nekohtml-1.9.7.jar
> -pdfbox-0.7.3.jar
> -poi-3.0.2-FINAL.jar
> -poi-scratchpad-3.0.2-FINAL.jar
> -tm-extractors-0.4.jar
>
> Then my x-path query looks like this:
>
> //*[((jcr:contains(.,'consetetur')) or (jcr:contains(.,'sadipscing')))]
>
> Both of those words are inside the pdf but the search result is empty.
>
> Here is the code how I do the search:
>
> javax.jcr.query.Query jcrQuery;
>                try {
>                        jcrQuery = session.getWorkspace().getQueryManager().createQuery(query, language);
>                        QueryResult queryResult = jcrQuery.execute();
>                        NodeIterator nodeIterator = queryResult.getNodes();
>                        return nodeIterator;
>                }
>                catch (InvalidQueryException iqe) {
>                        throw new org.apache.jackrabbit.ocm.exception.InvalidQueryException(iqe);
>                }
>                catch (RepositoryException re) {
>                        throw new ObjectContentManagerException(re.getMessage(), re);
>                }
>
>
> Would be really awesome if anyone had an idea for me why this doesn't work
>
> Thx a lot in advance
> Wolfgang
>

Re: Problem getting full textual search to work with textextractors

Posted by Marcel Reutegger <ma...@gmx.net>.
Hi Wolfgang,

pdfbox has an additional dependency to jempbox:

[dependency:tree]
org.apache.jackrabbit:jackrabbit-text-extractors:jar:1.5.0
+- org.apache.poi:poi:jar:3.0.2-FINAL:compile
|  \- commons-logging:commons-logging:jar:1.1:compile
|     \- log4j:log4j:jar:1.2.14:compile
+- org.apache.poi:poi-scratchpad:jar:3.0.2-FINAL:compile
+- pdfbox:pdfbox:jar:0.7.3:compile
|  +- org.fontbox:fontbox:jar:0.1.0:compile
|  \- org.jempbox:jempbox:jar:0.2.0:compile   <=====
+- net.sourceforge.nekohtml:nekohtml:jar:1.9.7:compile
|  \- xerces:xercesImpl:jar:2.8.1:compile
|     \- xml-apis:xml-apis:jar:1.3.03:compile
+- org.slf4j:slf4j-api:jar:1.5.3:compile

did you see any warnings or errors in the logs?

regards
 marcel

On Thu, Mar 26, 2009 at 16:20, Kurz Wolfgang <wo...@gwvs.de> wrote:
> Hello everyone,
>
> i am trying to get the full textual search to work with text extractors.
>
>
> I uploaded a pfd-file as resource into jackrabbit which works fine as I can download it just fine and I get the file back.
>
> But now I wanted to implement textual search inside document I uploaded and somehow it doesn't find the documents even though the document contains the strings that I am searching for.
>
> What I did I this:
>
> I added these jar files to my tomcat server lib folder since I am using JNDI to connect
>
> -jackrabbit-text-extractors-1.5.0.jar
> -fontbox-0.1.0.jar
> -junit-3.8.1.jar
> -nekohtml-1.9.7.jar
> -pdfbox-0.7.3.jar
> -poi-3.0.2-FINAL.jar
> -poi-scratchpad-3.0.2-FINAL.jar
> -tm-extractors-0.4.jar
>
> Then my x-path query looks like this:
>
> //*[((jcr:contains(.,'consetetur')) or (jcr:contains(.,'sadipscing')))]
>
> Both of those words are inside the pdf but the search result is empty.
>
> Here is the code how I do the search:
>
> javax.jcr.query.Query jcrQuery;
>                try {
>                        jcrQuery = session.getWorkspace().getQueryManager().createQuery(query, language);
>                        QueryResult queryResult = jcrQuery.execute();
>                        NodeIterator nodeIterator = queryResult.getNodes();
>                        return nodeIterator;
>                }
>                catch (InvalidQueryException iqe) {
>                        throw new org.apache.jackrabbit.ocm.exception.InvalidQueryException(iqe);
>                }
>                catch (RepositoryException re) {
>                        throw new ObjectContentManagerException(re.getMessage(), re);
>                }
>
>
> Would be really awesome if anyone had an idea for me why this doesn't work
>
> Thx a lot in advance
> Wolfgang
>

Problem getting full textual search to work with textextractors

Posted by Kurz Wolfgang <wo...@gwvs.de>.
Hello everyone,

i am trying to get the full textual search to work with text extractors.


I uploaded a pfd-file as resource into jackrabbit which works fine as I can download it just fine and I get the file back.

But now I wanted to implement textual search inside document I uploaded and somehow it doesn't find the documents even though the document contains the strings that I am searching for.

What I did I this:

I added these jar files to my tomcat server lib folder since I am using JNDI to connect

-jackrabbit-text-extractors-1.5.0.jar
-fontbox-0.1.0.jar
-junit-3.8.1.jar
-nekohtml-1.9.7.jar
-pdfbox-0.7.3.jar
-poi-3.0.2-FINAL.jar
-poi-scratchpad-3.0.2-FINAL.jar
-tm-extractors-0.4.jar

Then my x-path query looks like this:

//*[((jcr:contains(.,'consetetur')) or (jcr:contains(.,'sadipscing')))]

Both of those words are inside the pdf but the search result is empty.

Here is the code how I do the search:

javax.jcr.query.Query jcrQuery;
		try {
			jcrQuery = session.getWorkspace().getQueryManager().createQuery(query, language);
			QueryResult queryResult = jcrQuery.execute();
			NodeIterator nodeIterator = queryResult.getNodes();
			return nodeIterator;
		}
		catch (InvalidQueryException iqe) {
			throw new org.apache.jackrabbit.ocm.exception.InvalidQueryException(iqe);
		}
		catch (RepositoryException re) {
			throw new ObjectContentManagerException(re.getMessage(), re);
		}


Would be really awesome if anyone had an idea for me why this doesn't work

Thx a lot in advance
Wolfgang

AW: Problem getting full textual search to work with textextractors

Posted by Kurz Wolfgang <wo...@gwvs.de>.
Oh i forgot to mention that i included 

lucene-core-2.3.2.jar

and in my workspace:

<SearchIndex class="org.apache.jackrabbit.core.query.lucene.SearchIndex">
            <param name="path" value="${wsp.home}/index"/>
            <param name="textFilterClasses" value="org.apache.jackrabbit.extractor.PlainTextExtractor,org.apache.jackrabbit.extractor.MsWordTextExtractor,org.apache.jackrabbit.extractor.MsExcelTextExtractor,org.apache.jackrabbit.extractor.MsPowerPointTextExtractor,org.apache.jackrabbit.extractor.PdfTextExtractor,org.apache.jackrabbit.extractor.OpenOfficeTextExtractor,org.apache.jackrabbit.extractor.RTFTextExtractor,org.apache.jackrabbit.extractor.HTMLTextExtractor,org.apache.jackrabbit.extractor.XMLTextExtractor"/>
            <param name="extractorPoolSize" value="2"/>
            <param name="supportHighlighting" value="true"/>
        </SearchIndex>



-----Ursprüngliche Nachricht-----
Von: Kurz Wolfgang 
Gesendet: Donnerstag, 26. März 2009 16:20
An: 'users@jackrabbit.apache.org'
Betreff: Problem getting full textual search to work with textextractors

Hello everyone,

i am trying to get the full textual search to work with text extractors.


I uploaded a pfd-file as resource into jackrabbit which works fine as I can download it just fine and I get the file back.

But now I wanted to implement textual search inside document I uploaded and somehow it doesn't find the documents even though the document contains the strings that I am searching for.

What I did I this:

I added these jar files to my tomcat server lib folder since I am using JNDI to connect

-jackrabbit-text-extractors-1.5.0.jar
-fontbox-0.1.0.jar
-junit-3.8.1.jar
-nekohtml-1.9.7.jar
-pdfbox-0.7.3.jar
-poi-3.0.2-FINAL.jar
-poi-scratchpad-3.0.2-FINAL.jar
-tm-extractors-0.4.jar

Then my x-path query looks like this:

//*[((jcr:contains(.,'consetetur')) or (jcr:contains(.,'sadipscing')))]

Both of those words are inside the pdf but the search result is empty.

Here is the code how I do the search:

javax.jcr.query.Query jcrQuery;
		try {
			jcrQuery = session.getWorkspace().getQueryManager().createQuery(query, language);
			QueryResult queryResult = jcrQuery.execute();
			NodeIterator nodeIterator = queryResult.getNodes();
			return nodeIterator;
		}
		catch (InvalidQueryException iqe) {
			throw new org.apache.jackrabbit.ocm.exception.InvalidQueryException(iqe);
		}
		catch (RepositoryException re) {
			throw new ObjectContentManagerException(re.getMessage(), re);
		}


Would be really awesome if anyone had an idea for me why this doesn't work

Thx a lot in advance
Wolfgang

Re: Concurrent writes causes repository exception.

Posted by Ian Boston <ie...@tfd.co.uk>.
I think I may have fixed this problem with more aggressive explicit  
locking and putting all the observation code in transactions.
Its also possible that updates are now serial so the problem just  
doesn't happen, rather than being fixed..... alternatively you could  
say its the right way to do it.
The only problem that I have now is that the locks timeout in the  
observation code before they have a chance to get granted, but thats  
my problem (I am using an external lock manager to avoid the journal  
records hitting the db on lock/unlock)


On 24 Mar 2009, at 21:00, Ian Boston wrote:

>    I have some code that writes about 4 nt:file nodes which are  
> observed. (each group of 4 files represents a user and their profile)
> I test this will a perl script over HTTP to rest that is capable of  
> running multithreaded.
> When I run single threaded, then there is no problem, I can create  
> 25k, although a bit slowly.
>
> However when I run with 8 threads I get the below in within the  
> first few create requests.
>
> Any idea what the problem is ?
>
> Ian
>
>
>
>
>
>     [exec] Caused by: javax.jcr.RepositoryException:  
> 09a609cb-267f-4dfc-bc95-56eff64a08b7: 09a609cb-267f-4dfc- 
> bc95-56eff64a08b7
>     [exec] 	at  
> org 
> .apache.jackrabbit.core.version.NodeStateEx.store(NodeStateEx.java: 
> 505)
>     [exec] 	at  
> org 
> .apache 
> .jackrabbit 
> .core 
> .version 
> .AbstractVersionManager 
> .createVersionHistory(AbstractVersionManager.java:321)
>     [exec] 	at  
> org 
> .apache 
> .jackrabbit 
> .core 
> .version.XAVersionManager.createVersionHistory(XAVersionManager.java: 
> 138)
>     [exec] 	at  
> org 
> .apache.jackrabbit.core.ItemImpl.initVersionHistories(ItemImpl.java: 
> 782)
>     [exec] 	at  
> org.apache.jackrabbit.core.ItemImpl.save(ItemImpl.java:1224)
>     [exec] 	at  
> org.apache.jackrabbit.core.SessionImpl.save(SessionImpl.java:897)
>     [exec] 	at  
> org 
> .sakaiproject 
> .kernel 
> .jcr 
> .jackrabbit.sakai.SakaiXASessionImpl.save(SakaiXASessionImpl.java:220)
>     [exec] 	at  
> org 
> .sakaiproject 
> .kernel.jcr.jackrabbit.JCRServiceImpl.save(JCRServiceImpl.java:114)
>     [exec] 	at  
> org 
> .sakaiproject 
> .kernel.rest.RestUserProvider.createUser(RestUserProvider.java:378)
>     [exec] 	at  
> org 
> .sakaiproject 
> .kernel.rest.RestUserProvider.dispatch(RestUserProvider.java:134)
>     [exec] 	... 22 more
>     [exec] Caused by:  
> org.apache.jackrabbit.core.state.NoSuchItemStateException:  
> 09a609cb-267f-4dfc-bc95-56eff64a08b7
>     [exec] 	at  
> org 
> .apache 
> .jackrabbit 
> .core 
> .state 
> .SharedItemStateManager.getItemState(SharedItemStateManager.java:260)
>     [exec] 	at  
> org 
> .apache 
> .jackrabbit 
> .core 
> .state.LocalItemStateManager.getNodeState(LocalItemStateManager.java: 
> 93)
>     [exec] 	at  
> org 
> .apache 
> .jackrabbit 
> .core 
> .state.LocalItemStateManager.getItemState(LocalItemStateManager.java: 
> 158)
>     [exec] 	at  
> org 
> .apache 
> .jackrabbit 
> .core.state.XAItemStateManager.getItemState(XAItemStateManager.java: 
> 243)
>     [exec] 	at  
> org 
> .apache.jackrabbit.core.version.NodeStateEx.store(NodeStateEx.java: 
> 533)
>     [exec] 	at  
> org 
> .apache.jackrabbit.core.version.NodeStateEx.store(NodeStateEx.java: 
> 503)
>