You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@jackrabbit.apache.org by pkrishna <pr...@ge.com> on 2009/10/07 23:53:14 UTC

XPATH search not finding the item

We have run into a strange problem while doing an XPATH search. Here is the
scenario:

1. Save an item
2. Retrieve the item using some metadata properties of the item
3. Search succeeds
4. Save another item
5. Retrieve the item using some metadata properties of the second item
6. Search fails

We print out the contents of the repository and we can see the 2nd item
saved.


Here are the items in the repo:

First Item

15:38:18,854 ERROR ContentMgmtSupport:106 - -------	Name=
1cef2b91-f88c-4413-9243-1247b93edda8 type= ecr:ecisContent
15:38:18,885 ERROR ContentMgmtSupport:113 - -------		ecr:documentState  
active
15:38:18,885 ERROR ContentMgmtSupport:113 - -------		jcr:created  
2009-10-07T15:30:38.321-06:00
15:38:18,885 ERROR ContentMgmtSupport:113 - -------		jcr:primaryType  
ecr:ecisContent
15:38:18,885 ERROR ContentMgmtSupport:106 - -------		Name= ecr:variant type=
ecr:ecisVariant
15:38:18,885 ERROR ContentMgmtSupport:113 - -------		
ecr:contextualVariantId   525f629a-36b9-4171-bf52-2105da5cbf1a
15:38:18,885 ERROR ContentMgmtSupport:113 - -------			ecr:documentState  
active
15:38:18,901 ERROR ContentMgmtSupport:113 - -------			jcr:uuid  
ea61f17d-c7a0-4569-847c-e560362f9882
15:38:18,901 ERROR ContentMgmtSupport:113 - -------			ecr:contentType  
GENERIC
15:38:18,901 ERROR ContentMgmtSupport:113 - -------			jcr:created  
2009-10-07T15:30:38.321-06:00
15:38:18,901 ERROR ContentMgmtSupport:113 - -------			jcr:baseVersion  
41af73c6-5c05-4ea8-a0ec-31602a12e458
15:38:18,901 ERROR ContentMgmtSupport:113 - -------			jcr:isCheckedOut  
false
15:38:18,901 ERROR ContentMgmtSupport:113 - -------			jcr:primaryType  
ecr:ecisVariant
15:38:18,901 ERROR ContentMgmtSupport:113 - -------			ecr:language  
00000000-0000-0000-0000-000000000001
15:38:18,916 ERROR ContentMgmtSupport:113 - -------			ecr:variantId  
6485eac3-f13a-45ff-84b6-1f00a9f5527b
15:38:18,932 ERROR ContentMgmtSupport:116 - -------			ecr:keywords
15:38:18,932 ERROR ContentMgmtSupport:118 - tcat
15:38:18,932 ERROR ContentMgmtSupport:118 - tdog
15:38:18,932 ERROR ContentMgmtSupport:113 - -------			ecr:title  
e2fa3b01-43c4-4dc6-8b7f-90987482093b
15:38:18,932 ERROR ContentMgmtSupport:116 - -------			jcr:predecessors
15:38:18,932 ERROR ContentMgmtSupport:113 - -------			jcr:versionHistory  
4d2a594d-e716-4f9c-94cd-a895b67ba8b4
15:38:18,932 ERROR ContentMgmtSupport:113 - -------		
ecr:variantVersionState   1
15:38:18,932 ERROR ContentMgmtSupport:113 - -------			ecr:version   1
15:38:18,932 ERROR ContentMgmtSupport:113 - -------			ecr:author   Jack
15:38:18,932 ERROR ContentMgmtSupport:113 - -------			jcr:mimeType  
text/plain
15:38:18,948 ERROR ContentMgmtSupport:113 - -------			ecr:contentLocation  
Internal
15:38:18,948 ERROR ContentMgmtSupport:113 - -------			jcr:lastModified  
2009-10-07T15:30:38.227-06:00

-----------------------------------------------------------------------------------------------------
Second Item

15:38:19,026 ERROR ContentMgmtSupport:106 - -------	Name=
c249e45f-0f3d-41d6-ae12-65ef0a05d3bf type= ecr:ecisContent
15:38:19,026 ERROR ContentMgmtSupport:113 - -------		ecr:documentState  
active
15:38:19,026 ERROR ContentMgmtSupport:113 - -------		jcr:created  
2009-10-07T15:38:16.980-06:00
15:38:19,026 ERROR ContentMgmtSupport:113 - -------		jcr:primaryType  
ecr:ecisContent
15:38:19,026 ERROR ContentMgmtSupport:106 - -------		Name= ecr:variant type=
ecr:ecisVariant
15:38:19,026 ERROR ContentMgmtSupport:113 - -------		
ecr:contextualVariantId   9f6033dc-efc9-4622-b735-86c003626a90
15:38:19,026 ERROR ContentMgmtSupport:113 - -------			ecr:documentState  
active
15:38:19,026 ERROR ContentMgmtSupport:113 - -------			jcr:uuid  
a066d3f4-2beb-4dc1-8a73-1e77147db268
15:38:19,026 ERROR ContentMgmtSupport:113 - -------			ecr:contentType  
GENERIC
15:38:19,026 ERROR ContentMgmtSupport:113 - -------			jcr:created  
2009-10-07T15:38:16.980-06:00
15:38:19,026 ERROR ContentMgmtSupport:113 - -------			jcr:baseVersion  
475aab50-e055-43cf-997c-b10d85a00405
15:38:19,026 ERROR ContentMgmtSupport:113 - -------			jcr:isCheckedOut  
false
15:38:19,026 ERROR ContentMgmtSupport:113 - -------			jcr:primaryType  
ecr:ecisVariant
15:38:19,041 ERROR ContentMgmtSupport:113 - -------			ecr:language  
00000000-0000-0000-0000-000000000001
15:38:19,041 ERROR ContentMgmtSupport:113 - -------			ecr:variantId  
96395271-46b6-41a6-bd4e-bb1bd8f6cb66
15:38:19,041 ERROR ContentMgmtSupport:116 - -------			ecr:keywords
15:38:19,057 ERROR ContentMgmtSupport:118 - tcat
15:38:19,057 ERROR ContentMgmtSupport:118 - tdog
15:38:19,057 ERROR ContentMgmtSupport:113 - -------			ecr:title  
59fdbb5d-5a7c-4b4e-9abc-4511b2c0180e
15:38:19,057 ERROR ContentMgmtSupport:116 - -------			jcr:predecessors
15:38:19,073 ERROR ContentMgmtSupport:113 - -------		
ecr:variantVersionState   1
15:38:19,073 ERROR ContentMgmtSupport:113 - -------			jcr:versionHistory  
a284242e-bdf5-4cb1-ac40-9925ac769a8f
15:38:19,073 ERROR ContentMgmtSupport:113 - -------			ecr:version   1
15:38:19,073 ERROR ContentMgmtSupport:113 - -------			jcr:mimeType  
text/plain
15:38:19,073 ERROR ContentMgmtSupport:113 - -------			ecr:author   Jack
15:38:19,073 ERROR ContentMgmtSupport:113 - -------			ecr:contentLocation  
Internal
15:38:19,073 ERROR ContentMgmtSupport:113 - -------			jcr:lastModified  
2009-10-07T15:38:16.902-06:00

---------------------------------------------------------------------------------------------------

Here is the query while retrieving the 2nd item:

//ecr:variant[@ecr:documentState!='deleted' and
@ecr:language='00000000-0000-0000-0000-000000000001' and @ecr:author='Jack'
and @ecr:title='59fdbb5d-5a7c-4b4e-9abc-4511b2c0180e' and
@ecr:contentType='GENERIC' and @ecr:contentLocation='Internal' and
@jcr:mimeType='text/plain' and @ecr:keywords='cat' and @ecr:keywords='dog'
and @jcr:lastModified='2009-10-07T15:38:16.902-06:00']

We expect this query to retrieve the second item but fails.

Any help will be appreciated




-- 
View this message in context: http://www.nabble.com/XPATH-search-not-finding-the-item-tp25795093p25795093.html
Sent from the Jackrabbit - Users mailing list archive at Nabble.com.


Re: Location of repository.xml and workspace.xml

Posted by Guo Du <mr...@gmail.com>.
On Mon, Oct 12, 2009 at 11:50 PM, Phukan, Anit <An...@intuit.com> wrote:
> Did anyone encounter this type of issue on JBOSS or any other
> application server?
>
> Any suggestions would be highly appreciated.

First time seen it. Google may help you out:

http://www.google.ie/search?q=IllegalAnnotationExceptions+java.util.List+is+an+interface%2C+and+JAXB+can%27t+handle+interfaces&ie=utf-8&oe=utf-8&aq=t&rls={moz:distributionID}:{moz:locale}:{moz:official}

-Guo

RE: Location of repository.xml and workspace.xml

Posted by "Phukan, Anit" <An...@intuit.com>.
Thanks Guo,

I have one more query regarding deploying a war on jboss which has
jackrabbit dependencies.

I get the following JAXB exception while trying to deploy my war file to
jboss:

2009-10-12 14:45:38,217 SEVERE
[javax.enterprise.resource.webservices.jaxws.server.http]
(ResourceContainer.invoker.nonDaemon-1) WSSERVLET11: failed to parse
runtime descriptor: javax.xml.ws.WebServiceException: Unable to create
JAXBContext
javax.xml.ws.WebServiceException: Unable to create JAXBContext
        at
com.sun.xml.ws.model.AbstractSEIModelImpl.createJAXBContext(AbstractSEIM
odelImpl.java:158)
        at
com.sun.xml.ws.model.AbstractSEIModelImpl.postProcess(AbstractSEIModelIm
pl.java:87)
        at
com.sun.xml.ws.model.RuntimeModeler.buildRuntimeModel(RuntimeModeler.jav
a:262)
        at
com.sun.xml.ws.server.EndpointFactory.createSEIModel(EndpointFactory.jav
a:322)
        at
com.sun.xml.ws.server.EndpointFactory.createEndpoint(EndpointFactory.jav
a:188)
        at
com.sun.xml.ws.api.server.WSEndpoint.create(WSEndpoint.java:467)

Caused by: java.security.PrivilegedActionException:
com.sun.xml.bind.v2.runtime.IllegalAnnotationsException: 2 counts of
IllegalAnnotationExceptions
java.util.List is an interface, and JAXB can't handle interfaces.
        this problem is related to the following location:
                at java.util.List
java.util.List does not have a no-arg default constructor.
        this problem is related to the following location:
                at java.util.List


Did anyone encounter this type of issue on JBOSS or any other
application server?

Any suggestions would be highly appreciated.

Thanks
Anit


-----Original Message-----
From: Guo Du [mailto:mrduguo@gmail.com] 
Sent: Saturday, October 10, 2009 2:24 AM
To: users@jackrabbit.apache.org
Subject: Re: Location of repository.xml and workspace.xml

On Sat, Oct 10, 2009 at 12:55 AM, Phukan, Anit <An...@intuit.com>
wrote:
> Hi,
>
> Could anyone please let me know the correct directory location for the
2
> config files that I mentioned in the subject.
>
> It seems to work fine when the repository.xml file resides directly
> under the project (outside src). However, if I create a server and
> client project separately in my IDE(IntelliJ IDEA) and try to run the
> test cases, it's not able to read from the xml files. Is there a fixed
> location that these files have to reside under?
>
> Any piece of advice would be appreciated.
>
There are different place to load the repository, they will finally
invoke following constructor:
public TransientRepository(final File xml, final File dir)

Default constructor will detect the locations based on your current
java working directory with following code.
    private static final String CONF_PROPERTY
="org.apache.jackrabbit.repository.conf";
    private static final String CONF_DEFAULT = "repository.xml";
    private static final String HOME_PROPERTY =
"org.apache.jackrabbit.repository.home";
    private static final String HOME_DEFAULT = "repository";
public TransientRepository() {
        this(System.getProperty(CONF_PROPERTY, CONF_DEFAULT),
             System.getProperty(HOME_PROPERTY, HOME_DEFAULT));
    }

You may see more details from the TransientRepository class.

-Guo

Re: Location of repository.xml and workspace.xml

Posted by Guo Du <mr...@gmail.com>.
On Sat, Oct 10, 2009 at 12:55 AM, Phukan, Anit <An...@intuit.com> wrote:
> Hi,
>
> Could anyone please let me know the correct directory location for the 2
> config files that I mentioned in the subject.
>
> It seems to work fine when the repository.xml file resides directly
> under the project (outside src). However, if I create a server and
> client project separately in my IDE(IntelliJ IDEA) and try to run the
> test cases, it's not able to read from the xml files. Is there a fixed
> location that these files have to reside under?
>
> Any piece of advice would be appreciated.
>
There are different place to load the repository, they will finally
invoke following constructor:
public TransientRepository(final File xml, final File dir)

Default constructor will detect the locations based on your current
java working directory with following code.
    private static final String CONF_PROPERTY
="org.apache.jackrabbit.repository.conf";
    private static final String CONF_DEFAULT = "repository.xml";
    private static final String HOME_PROPERTY =
"org.apache.jackrabbit.repository.home";
    private static final String HOME_DEFAULT = "repository";
public TransientRepository() {
        this(System.getProperty(CONF_PROPERTY, CONF_DEFAULT),
             System.getProperty(HOME_PROPERTY, HOME_DEFAULT));
    }

You may see more details from the TransientRepository class.

-Guo

Location of repository.xml and workspace.xml

Posted by "Phukan, Anit" <An...@intuit.com>.
Hi,

Could anyone please let me know the correct directory location for the 2
config files that I mentioned in the subject. 

It seems to work fine when the repository.xml file resides directly
under the project (outside src). However, if I create a server and
client project separately in my IDE(IntelliJ IDEA) and try to run the
test cases, it's not able to read from the xml files. Is there a fixed
location that these files have to reside under?

Any piece of advice would be appreciated.

Thanks
Anit


Re: XPATH search not finding the item

Posted by Alexander Klimetschek <ak...@day.com>.
On Wed, Oct 7, 2009 at 23:53, pkrishna <pr...@ge.com> wrote:
> //ecr:variant[@ecr:documentState!='deleted' and
> @ecr:language='00000000-0000-0000-0000-000000000001' and @ecr:author='Jack'
> and @ecr:title='59fdbb5d-5a7c-4b4e-9abc-4511b2c0180e' and
> @ecr:contentType='GENERIC' and @ecr:contentLocation='Internal' and
> @jcr:mimeType='text/plain' and @ecr:keywords='cat' and @ecr:keywords='dog'
> and @jcr:lastModified='2009-10-07T15:38:16.902-06:00']

Date properties such as jcr:lastModified must be searched using a
special function:

jcr:lastModified=xs:dateTime('2009-10-07T15:38:16.902-06:00')

The string passed to that function must be the exact and full ISO-8601
representation (what property.getString() gives you and which is
already correct in your query).

Regards,
Alex

-- 
Alexander Klimetschek
alexander.klimetschek@day.com