jackrabbit-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Marcel Reutegger <marcel.reuteg...@gmx.net>
Subject Re: XPath query returns no results
Date Mon, 19 Nov 2007 14:33:47 GMT
Hi Daniel,

ah, now I'm starting to realize what happens. You are using spring modules, 
which probably wraps a transaction around your code. because queries are only 
run against *committed* content it may happen that you won't see results even 
though you saved (but not yet committed) changes. this is somewhat counter 
intuitive and has been debated on this list a while ago. JSR 283 will be more 
flexible in this respect.

can you please make sure you commit the transaction before you execute the 
query? that will probably solve your issue.

regards
  marcel

Daniel Mitterdorfer wrote:
> Hi Marcel,
> 
> Marcel Reutegger wrote:
>> Hi Daniel,
>>
>> that's quite strange. I tried to reproduce the issue, but was unable 
>> to do so. Is there anything unusual in the log files that might 
>> explain why the queries fail?
>>
>> you can also re-index the content and see if the query works afterwards:
>>
>> - stop jackrabbit
>> - delete the directory <repo-home>/workspaces/default/index
>> - start jackrabbit
>> - execute the query
> 
> I have embedded Jackrabbit into my application, therefore there is no 
> need to stop Jackrabbit.
> 
> Here is what I did:
> 
> 1. Deleted all directories below <repo-home>.
> 2. Started my test case (saving an item to the repository and executing 
> the query "/jcr:root/interedu/*"). I do not see anything unusal in the 
> logs below (full debug logging enabled, I have shortened the log a bit)
> 
> 2007-11-19 14:33:12,595 DEBUG 
> [org.apache.jackrabbit.core.TransientRepository] - <Initializing 
> transient repository>
> 2007-11-19 14:33:12,626 INFO [org.apache.jackrabbit.core.RepositoryImpl] 
> - <Starting repository...>
> 2007-11-19 14:33:12,658 INFO 
> [org.apache.jackrabbit.core.fs.local.LocalFileSystem] - <LocalFileSystem 
> initialized at path 
> D:\projects\interedu\workspace\AssetStore\target\test-classes\jcr-repository> 
> 
> 2007-11-19 14:33:12,798 INFO 
> [org.apache.jackrabbit.core.nodetype.NodeTypeRegistry] - <no custom node 
> type definitions found>
> 2007-11-19 14:33:12,814 INFO 
> [org.apache.jackrabbit.core.fs.local.LocalFileSystem] - <LocalFileSystem 
> initialized at path 
> D:\projects\interedu\workspace\AssetStore\target\test-classes\jcr-repository> 
> 
> 2007-11-19 14:33:12,845 INFO 
> [org.apache.jackrabbit.core.fs.local.LocalFileSystem] - <LocalFileSystem 
> initialized at path 
> D:\projects\interedu\workspace\AssetStore\target\test-classes\jcr-repository\versions\blobs>

> 
> 2007-11-19 14:33:12,923 DEBUG 
> [org.apache.jackrabbit.core.state.MLRUItemStateCache] - 
> <org.apache.jackrabbit.core.state.MLRUItemStateCache@1e903d5 size=1, 
> 664/4194304>
> 2007-11-19 14:33:12,923 DEBUG 
> [org.apache.jackrabbit.core.state.MLRUItemStateCache] - 
> <org.apache.jackrabbit.core.state.MLRUItemStateCache@1490eb5 size=1, 
> 664/4194304>
> 2007-11-19 14:33:12,923 INFO [org.apache.jackrabbit.core.RepositoryImpl] 
> - <initializing workspace 'default'...>
> 2007-11-19 14:33:12,923 INFO 
> [org.apache.jackrabbit.core.fs.local.LocalFileSystem] - <LocalFileSystem 
> initialized at path 
> D:\projects\interedu\workspace\AssetStore\target\test-classes\jcr-repository\workspaces\default>

> 
> 2007-11-19 14:33:12,923 INFO 
> [org.apache.jackrabbit.core.fs.local.LocalFileSystem] - <LocalFileSystem 
> initialized at path 
> D:\projects\interedu\workspace\AssetStore\target\test-classes\jcr-repository\workspaces\default\blobs>

> 
> 2007-11-19 14:33:12,939 DEBUG 
> [org.apache.jackrabbit.core.state.MLRUItemStateCache] - 
> <org.apache.jackrabbit.core.state.MLRUItemStateCache@eaf40c size=1, 
> 964/4194304>
> 2007-11-19 14:33:12,954 DEBUG 
> [org.apache.jackrabbit.core.virtual.AbstractVISProvider] - <item added 
> to cache. size=1>
> 2007-11-19 14:33:12,954 DEBUG 
> [org.apache.jackrabbit.core.virtual.AbstractVISProvider] - <item added 
> to cache. size=2>
> [...]
> 2007-11-19 14:33:13,017 DEBUG 
> [org.apache.jackrabbit.core.virtual.AbstractVISProvider] - <item added 
> to cache. size=92>
> 2007-11-19 14:33:13,017 DEBUG 
> [org.apache.jackrabbit.core.virtual.AbstractVISProvider] - <item added 
> to cache. size=93>
> 2007-11-19 14:33:13,033 INFO [org.apache.jackrabbit.core.RepositoryImpl] 
> - <workspace 'default' initialized>
> 2007-11-19 14:33:13,173 DEBUG 
> [org.apache.jackrabbit.core.query.lucene.JackrabbitTextExtractor] - 
> <JackrabbitTextExtractor(org.apache.jackrabbit.extractor.DefaultTextExtractor)>

> 
> 2007-11-19 14:33:13,204 INFO 
> [org.apache.jackrabbit.core.fs.local.LocalFileSystem] - <LocalFileSystem 
> initialized at path 
> D:\projects\interedu\workspace\AssetStore\target\test-classes\jcr-repository\repository\index>

> 
> 2007-11-19 14:33:13,220 DEBUG 
> [org.apache.jackrabbit.core.query.lucene.Recovery] - <RedoLog is empty, 
> no recovery needed.>
> 2007-11-19 14:33:13,220 DEBUG 
> [org.apache.jackrabbit.core.state.MLRUItemStateCache] - 
> <org.apache.jackrabbit.core.state.MLRUItemStateCache@1551b0 size=1, 
> 1264/4194304>
> 2007-11-19 14:33:13,642 INFO 
> [org.apache.jackrabbit.core.state.CacheManager] - <resizeAll size=4>
> 2007-11-19 14:33:13,642 DEBUG 
> [org.apache.jackrabbit.core.state.CacheManager] - 
> <org.apache.jackrabbit.core.state.MLRUItemStateCache@1551b0 now:4194304 
> used:476790 access:1397 new:476790>
> 2007-11-19 14:33:13,642 DEBUG 
> [org.apache.jackrabbit.core.state.CacheManager] - 
> <org.apache.jackrabbit.core.state.MLRUItemStateCache@1490eb5 now:4194304 
> used:664 access:2 new:131072>
> 2007-11-19 14:33:13,642 DEBUG 
> [org.apache.jackrabbit.core.state.CacheManager] - 
> <org.apache.jackrabbit.core.state.MLRUItemStateCache@1e903d5 now:4194304 
> used:1178 access:5 new:131072>
> 2007-11-19 14:33:13,642 DEBUG 
> [org.apache.jackrabbit.core.state.CacheManager] - 
> <org.apache.jackrabbit.core.state.MLRUItemStateCache@eaf40c now:4194304 
> used:3256 access:7 new:131072>
> 2007-11-19 14:33:13,829 INFO 
> [org.apache.jackrabbit.core.query.lucene.SearchIndex] - <Index 
> initialized: 
> D:\projects\interedu\workspace\AssetStore\target\test-classes\jcr-repository/repository/index>

> 
> 2007-11-19 14:33:13,829 DEBUG 
> [org.apache.jackrabbit.core.query.lucene.JackrabbitTextExtractor] - 
> <JackrabbitTextExtractor( 
> org.apache.jackrabbit.extractor.XMLTextExtractor,org.apache.jackrabbit.extractor.PlainTextExtractor,org.apache.jackrabbit.extractor.PdfTextExtractor,org.apache.jackrabbit.extractor.OpenOfficeTextExtractor,org.apache.jackrabbit.extractor.MsWordTextExtractor,org.apache.jackrabbit.extractor.MsPowerPointTextExtractor,org.apache.jackrabbit.extractor.MsExcelTextExtractor,org.apache.jackrabbit.extractor.HTMLTextExtractor)>

> 
> 2007-11-19 14:33:13,861 INFO 
> [org.apache.jackrabbit.core.fs.local.LocalFileSystem] - <LocalFileSystem 
> initialized at path 
> D:\projects\interedu\workspace\AssetStore\target\test-classes\jcr-repository\workspaces\default\index>

> 
> 2007-11-19 14:33:13,861 DEBUG 
> [org.apache.jackrabbit.core.query.lucene.Recovery] - <RedoLog is empty, 
> no recovery needed.>
> 2007-11-19 14:33:13,861 INFO 
> [org.apache.jackrabbit.core.query.lucene.SearchIndex] - <Index 
> initialized: 
> D:\projects\interedu\workspace\AssetStore\target\test-classes\jcr-repository\workspaces\default/index>

> 
> 2007-11-19 14:33:13,861 INFO [org.apache.jackrabbit.core.RepositoryImpl] 
> - <Repository started>
> 2007-11-19 14:33:13,861 INFO 
> [org.apache.jackrabbit.core.TransientRepository] - <Transient repository 
> initialized>
> 2007-11-19 14:33:13,861 DEBUG 
> [org.apache.jackrabbit.core.TransientRepository] - <Opening a new session>
> 2007-11-19 14:33:13,892 DEBUG 
> [org.apache.jackrabbit.core.state.MLRUItemStateCache] - 
> <org.apache.jackrabbit.core.state.MLRUItemStateCache@578073 size=1, 
> 664/4194304>
> 2007-11-19 14:33:13,892 INFO 
> [org.apache.jackrabbit.core.TransientRepository] - <Session opened>
> 2007-11-19 14:33:13,908 DEBUG 
> [org.springmodules.jcr.jackrabbit.LocalTransactionManager] - <Opened new 
> session [org.apache.jackrabbit.core.XASessionImpl@1415056] for JCR 
> transaction>
> 2007-11-19 14:33:13,923 DEBUG 
> [org.springmodules.jcr.jackrabbit.LocalTransactionManager] - <Found 
> thread-bound session [org.apache.jackrabbit.core.XASessionImpl@1415056] 
> for JCR transaction>
> 2007-11-19 14:33:13,923 DEBUG 
> [org.springmodules.jcr.jackrabbit.LocalTransactionManager] - <Using 
> transaction object 
> [org.springmodules.jcr.jackrabbit.LocalTransactionManager$JcrTransactionObject@4845aa]>

> 
> 2007-11-19 14:33:13,923 DEBUG 
> [org.springmodules.jcr.jackrabbit.LocalTransactionManager] - 
> <Participating in existing transaction>
> 2007-11-19 14:33:13,923 DEBUG [org.springmodules.jcr.JcrTemplate] - 
> <Found thread-bound Session for JcrTemplate>
> 2007-11-19 14:33:13,939 DEBUG 
> [org.apache.jackrabbit.core.state.MLRUItemStateCache] - 
> <org.apache.jackrabbit.core.state.MLRUItemStateCache@14a75bb size=1, 
> 964/4194304>
> 2007-11-19 14:33:13,970 DEBUG [org.apache.jackrabbit.core.ItemManager] - 
> <created item cafebabe-cafe-babe-cafe-babecafebabe>
> 2007-11-19 14:33:13,970 DEBUG [org.apache.jackrabbit.core.ItemManager] - 
> <caching item cafebabe-cafe-babe-cafe-babecafebabe>
> [...]
> 2007-11-19 14:33:14,001 DEBUG [org.apache.jackrabbit.core.ItemManager] - 
> <caching item 
> f39def9f-4dde-4b31-9de5-8f804f493bbd/{http://www.jcp.org/jcr/1.0}predecessors> 
> 
> 2007-11-19 14:33:14,017 DEBUG 
> [org.apache.jackrabbit.core.HierarchyManagerImpl] - <failed to build 
> path of f39def9f-4dde-4b31-9de5-8f804f493bbd>
> 2007-11-19 14:33:14,017 DEBUG [org.apache.jackrabbit.core.ItemManager] - 
> <created item ebdad629-ac0b-44fe-8438-f0479403c4fb>
> 2007-11-19 14:33:14,017 DEBUG [org.apache.jackrabbit.core.ItemManager] - 
> <caching item ebdad629-ac0b-44fe-8438-f0479403c4fb>
> 2007-11-19 14:33:14,017 DEBUG [org.springmodules.jcr.JcrTemplate] - <Not 
> closing pre-bound Jcr Session after JcrTemplate>
> 2007-11-19 14:33:14,017 DEBUG 
> [org.springmodules.jcr.jackrabbit.LocalTransactionManager] - <Found 
> thread-bound session [org.apache.jackrabbit.core.XASessionImpl@1415056] 
> for JCR transaction>
> 2007-11-19 14:33:14,017 DEBUG 
> [org.springmodules.jcr.jackrabbit.LocalTransactionManager] - <Using 
> transaction object 
> [org.springmodules.jcr.jackrabbit.LocalTransactionManager$JcrTransactionObject@650892]>

> 
> 2007-11-19 14:33:14,017 DEBUG 
> [org.springmodules.jcr.jackrabbit.LocalTransactionManager] - 
> <Participating in existing transaction>
> 2007-11-19 14:33:14,017 DEBUG [org.springmodules.jcr.JcrTemplate] - 
> <Found thread-bound Session for JcrTemplate>
> 2007-11-19 14:33:14,017 DEBUG [org.springmodules.jcr.JcrTemplate] - <Not 
> closing pre-bound Jcr Session after JcrTemplate>
> 2007-11-19 14:33:14,017 DEBUG 
> [org.springmodules.jcr.jackrabbit.LocalTransactionManager] - <Found 
> thread-bound session [org.apache.jackrabbit.core.XASessionImpl@1415056] 
> for JCR transaction>
> 2007-11-19 14:33:14,017 DEBUG 
> [org.springmodules.jcr.jackrabbit.LocalTransactionManager] - <Using 
> transaction object 
> [org.springmodules.jcr.jackrabbit.LocalTransactionManager$JcrTransactionObject@13e15f7]>

> 
> 2007-11-19 14:33:14,017 DEBUG 
> [org.springmodules.jcr.jackrabbit.LocalTransactionManager] - 
> <Participating in existing transaction>
> 2007-11-19 14:33:14,017 DEBUG [org.springmodules.jcr.JcrTemplate] - 
> <Found thread-bound Session for JcrTemplate>
> 2007-11-19 14:33:14,173 DEBUG 
> [org.apache.jackrabbit.core.query.lucene.QueryImpl] - <Executing query:
> + Root node
> + Select properties: *
>  + PathQueryNode
>    + LocationStepQueryNode:  NodeTest={} Descendants=false Index=NONE
>    + LocationStepQueryNode:  NodeTest={}interedu Descendants=false 
> Index=NONE
>    + LocationStepQueryNode:  NodeTest=* Descendants=false Index=NONE
>  >
> 2007-11-19 14:33:14,189 DEBUG 
> [org.apache.jackrabbit.core.query.lucene.QueryResultImpl] - 
> <getResults(2147483647)>
> 2007-11-19 14:33:14,267 DEBUG 
> [org.apache.jackrabbit.core.query.lucene.AbstractIndex] - <merging 
> segments _0 (1 docs) _1 (1 docs) _2 (1 docs) _3 (1 docs) _4 (1 docs) _5 
> (1 docs) _6 (1 docs) _7 (1 docs) _8 (1 docs) _9 (1 docs) _a (1 docs) _b 
> (1 docs) _c (1 docs) _d (1 docs) _e (1 docs) _f (1 docs) _g (1 docs) _h 
> (1 docs) _i (1 docs) _j (1 docs) _k (1 docs) _l (1 docs) _m (1 docs) _n 
> (1 docs) _o (1 docs) _p (1 docs) _q (1 docs) _r (1 docs) _s (1 docs) _t 
> (1 docs) _u (1 docs) _v (1 docs) _w (1 docs) _x (1 docs) _y (1 docs) _z 
> (1 docs) _10 (1 docs) _11 (1 docs) _12 (1 docs) _13 (1 docs) _14 (1 
> docs) _15 (1 docs) _16 (1 docs) _17 (1 docs) _18 (1 docs) _19 (1 docs) 
> _1a (1 docs) _1b (1 docs) _1c (1 docs) _1d (1 docs) _1e (1 docs) _1f (1 
> docs) _1g (1 docs) _1h (1 docs) _1i (1 docs) _1j (1 docs) _1k (1 docs) 
> _1l (1 docs) _1m (1 docs) _1n (1 docs) _1o (1 docs) _1p (1 docs) _1q (1 
> docs) _1r (1 docs) _1s (1 docs) _1t (1 docs) _1u (1 docs) _1v (1 docs) 
> _1w (1 docs) _1x (1 docs) _1y (1 docs) _1z (1 docs) _20 (1 docs) _21 (1 
> docs) _22 (1 docs) _23 (1 docs) _24 (1 docs) _25 (1 docs) _26 (1 docs) 
> _27 (1 docs) _28 (1 docs) _29 (1 docs) _2a (1 docs) _2b (1 docs) _2c (1 
> docs) _2d (1 docs) _2e (1 docs) _2f (1 docs) _2g (1 docs) _2h (1 docs) 
> _2i (1 docs) _2j (1 docs) _2k (1 docs) _2l (1 docs) _2m (1 docs) _2n (1 
> docs) into _2o (96 docs)>
> 2007-11-19 14:33:14,283 DEBUG 
> [org.apache.jackrabbit.core.query.lucene.AbstractIndex] - <closing 
> IndexWriter.>
> 2007-11-19 14:33:14,298 DEBUG 
> [org.apache.jackrabbit.core.query.lucene.AbstractIndex] - <merging 
> segments _0 (1 docs) into _1 (1 docs)>
> 2007-11-19 14:33:14,298 DEBUG 
> [org.apache.jackrabbit.core.query.lucene.AbstractIndex] - <closing 
> IndexWriter.>
> 2007-11-19 14:33:14,329 DEBUG 
> [org.apache.jackrabbit.core.query.QueryImpl] - <executed in 0,16 s. 
> (/jcr:root/interedu/*)>
> 2007-11-19 14:33:14,329 DEBUG 
> [org.apache.jackrabbit.core.query.lucene.DocOrderNodeIteratorImpl] - <0 
> node(s) ordered in 0 ms>
> 2007-11-19 14:33:14,329 DEBUG [org.springmodules.jcr.JcrTemplate] - <Not 
> closing pre-bound Jcr Session after JcrTemplate>
> 2007-11-19 14:33:14,329 DEBUG 
> [org.springmodules.jcr.jackrabbit.LocalTransactionManager] - <Triggering 
> beforeCompletion synchronization>
> 2007-11-19 14:33:14,345 DEBUG 
> [org.springmodules.jcr.jackrabbit.LocalTransactionManager] - <Initiating 
> transaction rollback>
> 2007-11-19 14:33:14,345 DEBUG 
> [org.springmodules.jcr.jackrabbit.LocalTransactionManager] - <Rolling 
> back JCR transaction on session 
> [org.apache.jackrabbit.core.XASessionImpl@1415056]>
> 2007-11-19 14:33:14,345 DEBUG 
> [org.springmodules.jcr.jackrabbit.LocalTransactionManager] - <Triggering 
> afterCompletion synchronization>
> 2007-11-19 14:33:14,345 DEBUG 
> [org.springmodules.jcr.jackrabbit.LocalTransactionManager] - <Closing 
> JCR session [org.apache.jackrabbit.core.XASessionImpl@1415056] after 
> transaction>
> 2007-11-19 14:33:14,345 DEBUG 
> [org.springmodules.jcr.SessionFactoryUtils] - <Closing JCR Session>
> 2007-11-19 14:33:14,345 INFO 
> [org.apache.jackrabbit.core.TransientRepository] - <Session closed>
> 2007-11-19 14:33:14,345 DEBUG 
> [org.apache.jackrabbit.core.TransientRepository] - <Shutting down 
> transient repository>
> [...]
> 2007-11-19 14:33:14,408 INFO 
> [org.apache.jackrabbit.core.TransientRepository] - <Transient repository 
> shut down>
> 
> Bye,
> 
> Daniel
> 
> 


Mime
View raw message