OK, so I am using Xindice 1.0 in standalone mode with the XML:DB api.
I have a collection called say, "clientprofile" and I am executing an XPath
query against
a document that looks sort of like this:
<?xml version="1.0" encoding="UTF-8"?>
<ClientProfile>
<id>ACME</id>
<historyId>ACME</historyId>
<name>ACME</name>
<corporateEntityId>acme1234</corporateEntityId>
<status>pending</status>
<contacts>
<Contact>
<id>Mrs. Jones</id>
<name>Mrs. Jones</name>
<type>Financial</type>
<title>CFO</title>
<Address>
<addressOne>1 Main St.</addressOne>
<city>St. Louis</city>
<stateOrProvince>MO</stateOrProvince>
<country>USA</country>
<postalCode>68134</postalCode>
</Address>
<phone>533-255-6677</phone>
<fax>533-255-6678</fax>
<email>[EMAIL PROTECTED]</email>
</Contact>
</contacts>
<effectiveDate>2002/10/25</effectiveDate>
<endDate>2002/12/29</endDate>
<products>
<Product>
<id>Balance</id>
</Product>
</products>
<propertySheets>
<ClientPropertySheet>
<id>BIN</id>
<properties>
<property id="bins">111111</property>
<property id="bins">222222</property>
<property id="bins">5678</property>
</properties>
</ClientPropertySheet>
<ClientPropertySheet>
<id>FDRClientNumber</id>
<properties>
<property id="clients">1111</property>
<property id="clients">2222</property>
<property id="clients">3333</property>
<property id="clients">4444</property>
</properties>
</ClientPropertySheet>
<ClientPropertySheet>
<id>ICA</id>
<properties>
<property id="icas">1234</property>
<property id="icas">2345</property>
<property id="icas">5678</property>
</properties>
</ClientPropertySheet>
</propertySheets>
</ClientProfile>
Sorry for being redundant, but here is the query again:
(//ClientProfile/propertySheets/ClientPropertySheet/properties/property)
[EMAIL PROTECTED]'icas' and self::node()='1234']
The offending portion seems to be the self::node()='1234' location path.
I have a method called "getProfileByProperty(String propName, String
propValue)"
which sets up the query like this:
// builds the above query first.
XPathQueryService xpathService = getQueryService(collectionName);
ResourceSet resultSet = xpathService.query(xpath);
// code to handle the result.
I have also executed this query manually with the XMLDBGui app, same
results.
I hope this is information is useful.
Rob Marcotte
|---------+---------------------------->
| | "Mark J. Stang" |
| | <[EMAIL PROTECTED]|
| | ink.net> |
| | |
| | 01/27/2003 05:43 |
| | PM |
| | Please respond to|
| | xindice-users |
| | |
|---------+---------------------------->
>------------------------------------------------------------------------------------------------------------------------------|
|
|
| To: [email protected]
|
| cc:
|
| bcc:
|
| Subject: Re: NullPointerException in query "Beep"
|
>------------------------------------------------------------------------------------------------------------------------------|
Need more input. Who, what, where, when and how!
Mark
[EMAIL PROTECTED] wrote:
> Please help! when I execute the following XPath query against Xindice,
>
> (//ClientProfile/propertySheets/ClientPropertySheet/properties/property)
> [EMAIL PROTECTED]'icas' and self::node()='1234']
>
> Xindice causes a Beep and the following stack trace :
>
> java.lang.NullPointerException
> at
> org.apache.xindice.core.indexer.IndexPattern.<init>(IndexPattern.java:91)
> at
>
org.apache.xindice.core.query.XPathQueryResolver$XPathQuery.queryComparison(XPathQueryResolver.java:923)
> at
>
org.apache.xindice.core.query.XPathQueryResolver$XPathQuery.evalValComparison(XPathQueryResolver.java:468)
> at
>
org.apache.xindice.core.query.XPathQueryResolver$XPathQuery.evaluate(XPathQueryResolver.java:314)
> at
>
org.apache.xindice.core.query.XPathQueryResolver$XPathQuery.evalSetComparison(XPathQueryResolver.java:430)
> at
>
org.apache.xindice.core.query.XPathQueryResolver$XPathQuery.evaluate(XPathQueryResolver.java:306)
> at
>
org.apache.xindice.core.query.XPathQueryResolver$XPathQuery.evaluate(XPathQueryResolver.java:302)
> at
>
org.apache.xindice.core.query.XPathQueryResolver$XPathQuery.evalLocationPath(XPathQueryResolver.java:393)
> at
>
org.apache.xindice.core.query.XPathQueryResolver$XPathQuery.evaluate(XPathQueryResolver.java:297)
> at
>
org.apache.xindice.core.query.XPathQueryResolver$XPathQuery.evaluate(XPathQueryResolver.java:302)
> at
>
org.apache.xindice.core.query.XPathQueryResolver$XPathQuery.execute(XPathQueryResolver.java:229)
> at
>
org.apache.xindice.core.query.XPathQueryResolver.query(XPathQueryResolver.java:151)
> at
> org.apache.xindice.core.query.QueryEngine.query(QueryEngine.java:147)
> at
> org.apache.xindice.core.Collection.queryCollection(Collection.java:847)
> at
>
org.apache.xindice.client.corba.CollectionServant.queryCollection(CollectionServant.java:424)
> at org.apache.xindice.client.corba.db.CollectionPOA.
> _invoke(CollectionPOA.java:332)
> at org.openorb.adapter.poa.POA.dispatch(POA.java:975)
> at
>
org.openorb.net.AbstractServerRequest.dispatch(AbstractServerRequest.java:750)
> at
>
org.openorb.net.ServerManagerImpl.serve_request(ServerManagerImpl.java:1467)
> at
>
org.openorb.net.ServerManagerImpl.thread_pool_main(ServerManagerImpl.java:1410)
> at
> org.openorb.net.ServerManagerImpl.access$200(ServerManagerImpl.java:77)
> at
>
org.openorb.net.ServerManagerImpl$PoolThread.run(ServerManagerImpl.java:1557)
>
> What is going on here? What am I doing wrong?
>
> The result however, is the desired one!
> Go figure.
>
> Rob Marcotte
> team partner, FDNET
--
Mark J Stang
System Architect
Cybershop Systems