You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@jackrabbit.apache.org by Antonio Gioia <an...@gmail.com> on 2012/03/21 16:22:22 UTC

SQL2 doesn't work with own custom node type

Hi to all, 

I tried the follow query :

String sql = "select * from [my:type]";
Query query = qm.createQuery(sql, Query.JCR_SQL2);

and query.execute() throws the follow exception

Exception in thread "main" java.lang.IllegalArgumentException: null argument
	at org.apache.jackrabbit.util.Text.replace(Text.java:192)
	at
org.apache.jackrabbit.value.ValueHelper.deserialize(ValueHelper.java:745)
	at
org.apache.jackrabbit.webdav.jcr.search.SearchResultProperty.parseColumnElement(SearchResultProperty.java:125)
	at
org.apache.jackrabbit.webdav.jcr.search.SearchResultProperty.<init>(SearchResultProperty.java:94)
	at
org.apache.jackrabbit.spi2dav.QueryResultRowImpl.<init>(QueryResultRowImpl.java:74)
	at
org.apache.jackrabbit.spi2dav.QueryInfoImpl.<init>(QueryInfoImpl.java:72)
	at
org.apache.jackrabbit.spi2dav.RepositoryServiceImpl.executeQuery(RepositoryServiceImpl.java:1811)
	at
org.apache.jackrabbit.jcr2spi.WorkspaceManager.executeQuery(WorkspaceManager.java:341)
	at
org.apache.jackrabbit.jcr2spi.query.QueryImpl.execute(QueryImpl.java:149)

somebody can help me?

Thanks.

--
View this message in context: http://jackrabbit.510166.n4.nabble.com/SQL2-doesn-t-work-with-own-custom-node-type-tp4492642p4492642.html
Sent from the Jackrabbit - Users mailing list archive at Nabble.com.

Re: SQL2 doesn't work with own custom node type

Posted by Antonio Gioia <an...@gmail.com>.
Please, somebody can help me ? 

With XPATH the query //element(*, my:type) works fine, but the field
javax.jcr.query.Query.XPATH is deprecated. 

I'm developing with
 
<dependency>
  <groupId>org.apache.jackrabbit</groupId>
  <artifactId>jackrabbit-jcr2dav</artifactId>
  <version>2.1.0</version>
</dependency>

Regards

--
View this message in context: http://jackrabbit.510166.n4.nabble.com/SQL2-doesn-t-work-with-own-custom-node-type-tp4492642p4495032.html
Sent from the Jackrabbit - Users mailing list archive at Nabble.com.

Re: SQL2 doesn't work with own custom node type

Posted by Alexander Klimetschek <ak...@adobe.com>.
>From the stacktrace, it looks like the webdav remoting does not support all kinds of queries. Note that spi2dav and co. are not complete wrt JCR 2.0. Many if not most users don't use remoting but integrate Jackrabbit directly into the web application stack, for example Apache Sling.

Cheers,
Alex

On 27.03.2012, at 11:53, Antonio Gioia wrote:

> Hi to all,
> 
> can you confirm my previous discussion? Or can you explain me how I have to
> execute a query by "own" type node? 
> 
> thanks regards
> 
> --
> View this message in context: http://jackrabbit.510166.n4.nabble.com/SQL2-doesn-t-work-with-own-custom-node-type-tp4492642p4508412.html
> Sent from the Jackrabbit - Users mailing list archive at Nabble.com.

-- 
Alexander Klimetschek
Developer // Adobe (Day) // Berlin - Basel


Re: SQL2 doesn't work with own custom node type

Posted by Antonio Gioia <an...@gmail.com>.
Hi to all,

can you confirm my previous discussion? Or can you explain me how I have to
execute a query by "own" type node? 

thanks regards

--
View this message in context: http://jackrabbit.510166.n4.nabble.com/SQL2-doesn-t-work-with-own-custom-node-type-tp4492642p4508412.html
Sent from the Jackrabbit - Users mailing list archive at Nabble.com.

Re: SQL2 doesn't work with own custom node type

Posted by Antonio Gioia <an...@gmail.com>.
I'm sorry, I was wrong but also Query.XPATH throws the same exception,  so I
can't perform a search by "own" type nodes. But so, does the query work fine
only with default node type definition (eg nt:file, nt:resource, etc...)?

Thanks for your consideration.


--
View this message in context: http://jackrabbit.510166.n4.nabble.com/SQL2-doesn-t-work-with-own-custom-node-type-tp4492642p4499703.html
Sent from the Jackrabbit - Users mailing list archive at Nabble.com.

Re: SQL2 doesn't work with own custom node type

Posted by Alex Parvulescu <al...@gmail.com>.
Hi Antonio,

If XPath works for you then go ahead and use it.

Even if it's marked as deprecated it will still be supported for a long
time.

best,
alex


On Fri, Mar 23, 2012 at 2:34 PM, Antonio Gioia <an...@gmail.com>wrote:

> Please, Could someone give me an answer ?
>
> Regards
>
> --
> View this message in context:
> http://jackrabbit.510166.n4.nabble.com/SQL2-doesn-t-work-with-own-custom-node-type-tp4492642p4498818.html
> Sent from the Jackrabbit - Users mailing list archive at Nabble.com.
>

Re: SQL2 doesn't work with own custom node type

Posted by Antonio Gioia <an...@gmail.com>.
Please, Could someone give me an answer ?

Regards 

--
View this message in context: http://jackrabbit.510166.n4.nabble.com/SQL2-doesn-t-work-with-own-custom-node-type-tp4492642p4498818.html
Sent from the Jackrabbit - Users mailing list archive at Nabble.com.

Re: SQL2 doesn't work with own custom node type

Posted by Antonio Gioia <an...@gmail.com>.
Thanks for your consideration ...

yes I contact my Jackrabbit repository with WebDav.... and also I tried
Query.SQL but it doesn't work throwing the same exception. 

--
View this message in context: http://jackrabbit.510166.n4.nabble.com/SQL2-doesn-t-work-with-own-custom-node-type-tp4492642p4495206.html
Sent from the Jackrabbit - Users mailing list archive at Nabble.com.

Re: SQL2 doesn't work with own custom node type

Posted by Julian Reschke <ju...@gmx.de>.
On 2012-03-21 16:22, Antonio Gioia wrote:
> Hi to all,
>
> I tried the follow query :
>
> String sql = "select * from [my:type]";
> Query query = qm.createQuery(sql, Query.JCR_SQL2);
>
> and query.execute() throws the follow exception
>
> Exception in thread "main" java.lang.IllegalArgumentException: null argument
> 	at org.apache.jackrabbit.util.Text.replace(Text.java:192)
> 	at
> org.apache.jackrabbit.value.ValueHelper.deserialize(ValueHelper.java:745)
> 	at
> org.apache.jackrabbit.webdav.jcr.search.SearchResultProperty.parseColumnElement(SearchResultProperty.java:125)
> 	at
> org.apache.jackrabbit.webdav.jcr.search.SearchResultProperty.<init>(SearchResultProperty.java:94)
> 	at
> org.apache.jackrabbit.spi2dav.QueryResultRowImpl.<init>(QueryResultRowImpl.java:74)
> 	at
> org.apache.jackrabbit.spi2dav.QueryInfoImpl.<init>(QueryInfoImpl.java:72)
> 	at
> org.apache.jackrabbit.spi2dav.RepositoryServiceImpl.executeQuery(RepositoryServiceImpl.java:1811)
> 	at
> org.apache.jackrabbit.jcr2spi.WorkspaceManager.executeQuery(WorkspaceManager.java:341)
> 	at
> org.apache.jackrabbit.jcr2spi.query.QueryImpl.execute(QueryImpl.java:149)
>
> somebody can help me?
> ...

So this is with WebDAV remoting...

Do other query languages work, such as Query.JCR_XPATH?