You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by nikosdim <ni...@gmail.com> on 2013/07/16 11:22:24 UTC

Where to put contextual property ignore.matrix.parameters=true ?

Hi

I want to use FIQL expressions in the URL with the form of matrix parameter
and I saw in the  FIQL tutorial
<http://cxf.apache.org/docs/jax-rs-search.html#JAX-RSSearch-SearchExpressionsinURIPathsegments>  
that I have to set the contextual property "ignore.matrix.parameter" in
order to have this feature. 

My question is where to put this property?
I am running my service in Tomcat 6 and I tried the catalina.properties file
in tomcat but it didn't worked. 

Any ideas?



--
View this message in context: http://cxf.547215.n5.nabble.com/Where-to-put-contextual-property-ignore-matrix-parameters-true-tp5730881.html
Sent from the cxf-user mailing list archive at Nabble.com.

Re: Where to put contextual property ignore.matrix.parameters=true ?

Posted by Sergey Beryozkin <sb...@gmail.com>.
Hmm. Supporting something like "a<b" would really go beyond supporting 
FIQL... May be we indeed can support plain "=" only.

We already have a property called "search.use.plain.queries", this 
applies to a case where we have
?a=b&cFrom=2&cTo=3

This is not a FIQL expression, but we can use these property to support 
those cases where the clients are written to support plain non-FIQL 
queries but we want them routed to SearchCondition API.

Now, if we have a case when an expression is embedded within a path 
segment, then we may want to support this minor optimization, to support 
a single '=' only, this may also let people simplify slightly in the 
case when a  "search.use.all.query.component" property is set:
?a==b;a=lt=b

I'll add a property "search.support.single.equals.operator": note I'm 
doing it to make "search.lax.property.match" more useful :-), but to 
support slightly simpler expressions, and, in your case, a possibility 
of passing non-FIQL parameters alongside the actual expression

Sergey




On 18/07/13 13:00, Sergey Beryozkin wrote:
> Hi
> On 18/07/13 09:17, nikosdim wrote:
>> Hi
>>
>> I did some debugging in my code and I found out that the
>> NullPointerException is caused because the records=20 does not have a
>> double
>> == .FIQL recognizes only == and not =.
> I believe NPE is caused by the fact your code does not check a returned
> SearchCondition for null
>
>> When I changed it to records==20 then
>> the "search.lax.property.match" worked just fine and ignored the
>> records==20
>> successfully.
>> So as you said single = must be supported in order for the
>> "search.lax.property.match" to be useful.
> It is not quite the same conclusion that I came to.
>
> The goal of "search.lax.property.match" is to support the case where a
> bean class has no property setters for a given property name+value pair
> found in the FIQL expression.
>
> I don't think we can say that we need to support, for example
> "records<>20", where '<>' is a hypothetical 'not equal to' operator
> which is not part of FIQL, for "search.lax.property.match" be useful.
>
> The problem is that your expression is not a valid FIQL hence the whole
> issue arises, which would also be the case if we used something else,
> like '<>' operator, etc.
>
> However I as said IMHO it can make sense to support a consistent set of
> simplified expressions to support a "plain query"-like case, for
> example, we can have "author=Peter;records=20", or
> "author=Peter;records<20", but not a mix of FIQL & non-FIQL expressions,
> as in your case
>
> Cheers, Sergey
>>
>> Thanks
>>
>>
>>
>>
>> --
>> View this message in context:
>> http://cxf.547215.n5.nabble.com/Where-to-put-contextual-property-ignore-matrix-parameters-true-tp5730881p5731078.html
>>
>> Sent from the cxf-user mailing list archive at Nabble.com.
>>
>


Re: Where to put contextual property ignore.matrix.parameters=true ?

Posted by Sergey Beryozkin <sb...@gmail.com>.
Hi
On 18/07/13 09:17, nikosdim wrote:
> Hi
>
> I did some debugging in my code and I found out that the
> NullPointerException is caused because the records=20 does not have a double
> == .FIQL recognizes only == and not =.
I believe NPE is caused by the fact your code does not check a returned 
SearchCondition for null

> When I changed it to records==20 then
> the "search.lax.property.match" worked just fine and ignored the records==20
> successfully.
> So as you said single = must be supported in order for the
> "search.lax.property.match" to be useful.
It is not quite the same conclusion that I came to.

The goal of "search.lax.property.match" is to support the case where a 
bean class has no property setters for a given property name+value pair 
found in the FIQL expression.

I don't think we can say that we need to support, for example 
"records<>20", where '<>' is a hypothetical 'not equal to' operator 
which is not part of FIQL, for "search.lax.property.match" be useful.

The problem is that your expression is not a valid FIQL hence the whole 
issue arises, which would also be the case if we used something else, 
like '<>' operator, etc.

However I as said IMHO it can make sense to support a consistent set of 
simplified expressions to support a "plain query"-like case, for 
example, we can have "author=Peter;records=20", or 
"author=Peter;records<20", but not a mix of FIQL & non-FIQL expressions, 
as in your case

Cheers, Sergey
>
> Thanks
>
>
>
>
> --
> View this message in context: http://cxf.547215.n5.nabble.com/Where-to-put-contextual-property-ignore-matrix-parameters-true-tp5730881p5731078.html
> Sent from the cxf-user mailing list archive at Nabble.com.
>


Re: Where to put contextual property ignore.matrix.parameters=true ?

Posted by nikosdim <ni...@gmail.com>.
Hi 

I did some debugging in my code and I found out that the
NullPointerException is caused because the records=20 does not have a double
== .FIQL recognizes only == and not =. When I changed it to records==20 then
the "search.lax.property.match" worked just fine and ignored the records==20
successfully. 
So as you said single = must be supported in order for the
"search.lax.property.match" to be useful.

Thanks 




--
View this message in context: http://cxf.547215.n5.nabble.com/Where-to-put-contextual-property-ignore-matrix-parameters-true-tp5730881p5731078.html
Sent from the cxf-user mailing list archive at Nabble.com.

Re: Where to put contextual property ignore.matrix.parameters=true ?

Posted by Sergey Beryozkin <sb...@gmail.com>.
On 16/07/13 15:52, nikosdim wrote:
> I see what you mean but according to your previous post shouldn't the
> "search.lax.property.match" property force the parser to ignore any
> properties that are not included in the beanPropertiesMap?
>
> SQLPrinterVisitor<Booki> visitor = new SQLPrinterVisitor<Book>(
>                       beanPropertiesMap, "books", cols);
>
This property works at a different level, what happens, assuming the 
actual FIQL expression is correct, is that FIQL parser will attempt to 
inject a property with name 'records' into Book class, and, by default, 
it will throw a PropertyException if Book has no 'records' property, 
unless "search.lax.property.match" is enabled.

In your case, you have an expression like "author==Peter;records=20", 
note ';' is also part of FIQL language, but while "author==Peter" is OK, 
"records=20" is not, so the exception is thrown but at the moment 'null' 
SearchCondition is returned. On one hand it is reasonable because most 
sites won't return back an HTTP error if a user has mistyped the query: 
better return some default response along the lines 'the query is 
mistyped, try again, etc' or offer some default view of authors.

One just needs to check if SearchCondition is null. That said, I will 
also optionally throw the exceptions (reporting on the wrong properties) 
so that implementations can offer more detailed info if preferred.

This also made me thinking that may be this part:
http://cxf.apache.org/docs/jax-rs-search.html#JAX-RSSearch-PlainqueriestoFIQLconversion

needs to be enhanced a bit so that encoded <, >, <=, >= are also 
supported, and then, when we have path segments, then we also support 
plain '=', I'll experiment a bit


Sergey

>
>
> --
> View this message in context: http://cxf.547215.n5.nabble.com/Where-to-put-contextual-property-ignore-matrix-parameters-true-tp5730881p5730953.html
> Sent from the cxf-user mailing list archive at Nabble.com.
>


-- 
Sergey Beryozkin

Talend Community Coders
http://coders.talend.com/

Blog: http://sberyozkin.blogspot.com

Re: Where to put contextual property ignore.matrix.parameters=true ?

Posted by nikosdim <ni...@gmail.com>.
I see what you mean but according to your previous post shouldn't the
"search.lax.property.match" property force the parser to ignore any
properties that are not included in the beanPropertiesMap?

SQLPrinterVisitor<Booki> visitor = new SQLPrinterVisitor<Book>( 
                     beanPropertiesMap, "books", cols); 



--
View this message in context: http://cxf.547215.n5.nabble.com/Where-to-put-contextual-property-ignore-matrix-parameters-true-tp5730881p5730953.html
Sent from the cxf-user mailing list archive at Nabble.com.

Re: Where to put contextual property ignore.matrix.parameters=true ?

Posted by Sergey Beryozkin <sb...@gmail.com>.
On 16/07/13 14:16, nikosdim wrote:
> Sergey Beryozkin wrote
>> I think the NPE is coming from your own code, see the exception fragment
>> below,
>>
>> Cheers, Sergey
>>
>>
>> On 16/07/13 13:56, nikosdim wrote:
>>> Caused by: java.lang.NullPointerException
>>> 	at
>>> com.ba.oasis.resources.ServersResource.doFindSelectedBooks(ServersResource.java:233)
>
> @GET
> @Path("matrix;{search}")
> @Produces("plain/text")
> public Response findSelectedBooks(
> 		@PathParam("search") String searchExpression,
> 		@MatrixParam("records") String records) {
>
>          SearchCondition<Book> sc = searchContext.getCondition(
> 			searchExpression, Book.class);
> 	List<String> cols = new ArrayList<String>();
> 	SQLPrinterVisitor<Book> visitor = new SQLPrinterVisitor<Book>(
> 			beanPropertiesMap,
> 			"books"), cols);
> 	sc.accept(visitor);
>
> ...
> }
>
> sc.accept(visitor);   is line 233. This is where I get NullPointerException
> when I try to access books;author==Peter;records=20
>
> If I remove ;records=20 then it works fine.
>
The problem is "records=20" is not a correct FIQL syntax but I wonder 
why the parser returns 'null'. I think it has to throw a proper 
exception, I'll look into it.

As I said, you can't have  a case where you'd like to use matrix 
parameters to capture the expression and have this expression mixed in 
with the other matrix parameters which are not meant to be part of the 
expression (such as 'records' - this is a paging parameter which can 
apply to the search results).

However, a wrong search expression must cause the exception, I'll look 
into it

Thanks, Sergey

>
>
>
>
>
> --
> View this message in context: http://cxf.547215.n5.nabble.com/Where-to-put-contextual-property-ignore-matrix-parameters-true-tp5730881p5730934.html
> Sent from the cxf-user mailing list archive at Nabble.com.
>


-- 
Sergey Beryozkin

Talend Community Coders
http://coders.talend.com/

Blog: http://sberyozkin.blogspot.com

Re: Where to put contextual property ignore.matrix.parameters=true ?

Posted by nikosdim <ni...@gmail.com>.
Sergey Beryozkin wrote
> I think the NPE is coming from your own code, see the exception fragment 
> below,
> 
> Cheers, Sergey
> 
> 
> On 16/07/13 13:56, nikosdim wrote:
>> Caused by: java.lang.NullPointerException
>> 	at
>> com.ba.oasis.resources.ServersResource.doFindSelectedBooks(ServersResource.java:233)

@GET
@Path("matrix;{search}")
@Produces("plain/text")
public Response findSelectedBooks(
		@PathParam("search") String searchExpression,
		@MatrixParam("records") String records) {

        SearchCondition<Book> sc = searchContext.getCondition(
			searchExpression, Book.class);
	List<String> cols = new ArrayList<String>();
	SQLPrinterVisitor<Book> visitor = new SQLPrinterVisitor<Book>(
			beanPropertiesMap,
			"books"), cols);
	sc.accept(visitor);

...
}

sc.accept(visitor);   is line 233. This is where I get NullPointerException
when I try to access books;author==Peter;records=20

If I remove ;records=20 then it works fine. 






--
View this message in context: http://cxf.547215.n5.nabble.com/Where-to-put-contextual-property-ignore-matrix-parameters-true-tp5730881p5730934.html
Sent from the cxf-user mailing list archive at Nabble.com.

Re: Where to put contextual property ignore.matrix.parameters=true ?

Posted by Sergey Beryozkin <sb...@gmail.com>.
I think the NPE is coming from your own code, see the exception fragment 
below,

Cheers, Sergey


On 16/07/13 13:56, nikosdim wrote:
> Caused by: java.lang.NullPointerException
> 	at
> com.ba.oasis.resources.ServersResource.doFindSelectedBooks(ServersResource.java:233)



Re: Where to put contextual property ignore.matrix.parameters=true ?

Posted by nikosdim <ni...@gmail.com>.
I use Apache CXF 2.7.5 and I get the Exception below

Jul 16, 2013 1:51:53 PM org.apache.cxf.phase.PhaseInterceptorChain
doDefaultLogging
WARNING: Application {http://resources.oasis.host.com/}ServersResource has
thrown exception, unwinding now
org.apache.cxf.interceptor.Fault
	at
org.apache.cxf.service.invoker.AbstractInvoker.createFault(AbstractInvoker.java:162)
	at
org.apache.cxf.service.invoker.AbstractInvoker.invoke(AbstractInvoker.java:128)
	at org.apache.cxf.jaxrs.JAXRSInvoker.invoke(JAXRSInvoker.java:198)
	at org.apache.cxf.jaxrs.JAXRSInvoker.invoke(JAXRSInvoker.java:100)
	at
org.apache.cxf.interceptor.ServiceInvokerInterceptor$1.run(ServiceInvokerInterceptor.java:58)
	at
org.apache.cxf.interceptor.ServiceInvokerInterceptor.handleMessage(ServiceInvokerInterceptor.java:94)
	at
org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:271)
	at
org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:121)
	at
org.apache.cxf.transport.http.AbstractHTTPDestination.invoke(AbstractHTTPDestination.java:239)
	at
org.apache.cxf.transport.servlet.ServletController.invokeDestination(ServletController.java:223)
	at
org.apache.cxf.transport.servlet.ServletController.invoke(ServletController.java:203)
	at
org.apache.cxf.transport.servlet.ServletController.invoke(ServletController.java:137)
	at
org.apache.cxf.transport.servlet.CXFNonSpringServlet.invoke(CXFNonSpringServlet.java:158)
	at
org.apache.cxf.transport.servlet.AbstractHTTPServlet.handleRequest(AbstractHTTPServlet.java:243)
	at
org.apache.cxf.transport.servlet.AbstractHTTPServlet.doGet(AbstractHTTPServlet.java:168)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:617)
	at
org.apache.cxf.transport.servlet.AbstractHTTPServlet.service(AbstractHTTPServlet.java:219)
	at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
	at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
	at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
	at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
	at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
	at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
	at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
	at
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)
	at
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:859)
	at
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588)
	at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
	at java.lang.Thread.run(Thread.java:722)
Caused by: java.lang.NullPointerException
	at
com.ba.oasis.resources.ServersResource.doFindSelectedBooks(ServersResource.java:233)
	at
com.ba.oasis.resources.ServersResource.findSelectedBooks(ServersResource.java:220)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
	at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:601)
	at
org.apache.cxf.service.invoker.AbstractInvoker.performInvocation(AbstractInvoker.java:180)
	at
org.apache.cxf.service.invoker.AbstractInvoker.invoke(AbstractInvoker.java:96)
	... 27 more

Jul 16, 2013 1:51:53 PM org.apache.cxf.phase.PhaseInterceptorChain unwind
WARNING: Exception in handleFault on interceptor
org.apache.cxf.binding.xml.interceptor.XMLFaultOutInterceptor@1ec452c
org.apache.cxf.interceptor.Fault
	at
org.apache.cxf.service.invoker.AbstractInvoker.createFault(AbstractInvoker.java:162)
	at
org.apache.cxf.service.invoker.AbstractInvoker.invoke(AbstractInvoker.java:128)
	at org.apache.cxf.jaxrs.JAXRSInvoker.invoke(JAXRSInvoker.java:198)
	at org.apache.cxf.jaxrs.JAXRSInvoker.invoke(JAXRSInvoker.java:100)
	at
org.apache.cxf.interceptor.ServiceInvokerInterceptor$1.run(ServiceInvokerInterceptor.java:58)
	at
org.apache.cxf.interceptor.ServiceInvokerInterceptor.handleMessage(ServiceInvokerInterceptor.java:94)
	at
org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:271)
	at
org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:121)
	at
org.apache.cxf.transport.http.AbstractHTTPDestination.invoke(AbstractHTTPDestination.java:239)
	at
org.apache.cxf.transport.servlet.ServletController.invokeDestination(ServletController.java:223)
	at
org.apache.cxf.transport.servlet.ServletController.invoke(ServletController.java:203)
	at
org.apache.cxf.transport.servlet.ServletController.invoke(ServletController.java:137)
	at
org.apache.cxf.transport.servlet.CXFNonSpringServlet.invoke(CXFNonSpringServlet.java:158)
	at
org.apache.cxf.transport.servlet.AbstractHTTPServlet.handleRequest(AbstractHTTPServlet.java:243)
	at
org.apache.cxf.transport.servlet.AbstractHTTPServlet.doGet(AbstractHTTPServlet.java:168)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:617)
	at
org.apache.cxf.transport.servlet.AbstractHTTPServlet.service(AbstractHTTPServlet.java:219)
	at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
	at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
	at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
	at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
	at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
	at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
	at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
	at
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)
	at
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:859)
	at
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588)
	at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
	at java.lang.Thread.run(Thread.java:722)
Caused by: java.lang.NullPointerException
	at
com.host.oasis.resources.BooksResource.findSelectedBooks(BooksResource.java:220)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
	at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:601)
	at
org.apache.cxf.service.invoker.AbstractInvoker.performInvocation(AbstractInvoker.java:180)
	at
org.apache.cxf.service.invoker.AbstractInvoker.invoke(AbstractInvoker.java:96)
	... 27 more

Jul 16, 2013 1:51:53 PM
org.apache.cxf.interceptor.AbstractFaultChainInitiatorObserver onMessage
SEVERE: Error occurred during error handling, give up!
org.apache.cxf.interceptor.Fault
	at
org.apache.cxf.service.invoker.AbstractInvoker.createFault(AbstractInvoker.java:162)
	at
org.apache.cxf.service.invoker.AbstractInvoker.invoke(AbstractInvoker.java:128)
	at org.apache.cxf.jaxrs.JAXRSInvoker.invoke(JAXRSInvoker.java:198)
	at org.apache.cxf.jaxrs.JAXRSInvoker.invoke(JAXRSInvoker.java:100)
	at
org.apache.cxf.interceptor.ServiceInvokerInterceptor$1.run(ServiceInvokerInterceptor.java:58)
	at
org.apache.cxf.interceptor.ServiceInvokerInterceptor.handleMessage(ServiceInvokerInterceptor.java:94)
	at
org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:271)
	at
org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:121)
	at
org.apache.cxf.transport.http.AbstractHTTPDestination.invoke(AbstractHTTPDestination.java:239)
	at
org.apache.cxf.transport.servlet.ServletController.invokeDestination(ServletController.java:223)
	at
org.apache.cxf.transport.servlet.ServletController.invoke(ServletController.java:203)
	at
org.apache.cxf.transport.servlet.ServletController.invoke(ServletController.java:137)
	at
org.apache.cxf.transport.servlet.CXFNonSpringServlet.invoke(CXFNonSpringServlet.java:158)
	at
org.apache.cxf.transport.servlet.AbstractHTTPServlet.handleRequest(AbstractHTTPServlet.java:243)
	at
org.apache.cxf.transport.servlet.AbstractHTTPServlet.doGet(AbstractHTTPServlet.java:168)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:617)
	at
org.apache.cxf.transport.servlet.AbstractHTTPServlet.service(AbstractHTTPServlet.java:219)
	at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
	at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
	at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
	at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
	at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
	at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
	at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
	at
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)
	at
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:859)
	at
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588)
	at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
	at java.lang.Thread.run(Thread.java:722)
Caused by: java.lang.NullPointerException

com.host.oasis.resources.BooksResource.findSelectedBooks(BooksResource.java:220)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
	at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:601)
	at
org.apache.cxf.service.invoker.AbstractInvoker.performInvocation(AbstractInvoker.java:180)
	at
org.apache.cxf.service.invoker.AbstractInvoker.invoke(AbstractInvoker.java:96)
	... 27 more

Jul 16, 2013 1:51:53 PM org.apache.catalina.core.StandardWrapperValve invoke
SEVERE: Servlet.service() for servlet CXFServlet threw exception
java.lang.RuntimeException: org.apache.cxf.interceptor.Fault
	at
org.apache.cxf.interceptor.AbstractFaultChainInitiatorObserver.onMessage(AbstractFaultChainInitiatorObserver.java:116)
	at
org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:331)
	at
org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:121)
	at
org.apache.cxf.transport.http.AbstractHTTPDestination.invoke(AbstractHTTPDestination.java:239)
	at
org.apache.cxf.transport.servlet.ServletController.invokeDestination(ServletController.java:223)
	at
org.apache.cxf.transport.servlet.ServletController.invoke(ServletController.java:203)
	at
org.apache.cxf.transport.servlet.ServletController.invoke(ServletController.java:137)
	at
org.apache.cxf.transport.servlet.CXFNonSpringServlet.invoke(CXFNonSpringServlet.java:158)
	at
org.apache.cxf.transport.servlet.AbstractHTTPServlet.handleRequest(AbstractHTTPServlet.java:243)
	at
org.apache.cxf.transport.servlet.AbstractHTTPServlet.doGet(AbstractHTTPServlet.java:168)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:617)
	at
org.apache.cxf.transport.servlet.AbstractHTTPServlet.service(AbstractHTTPServlet.java:219)
	at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
	at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
	at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
	at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
	at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
	at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
	at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
	at
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)
	at
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:859)
	at
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588)
	at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
	at java.lang.Thread.run(Thread.java:722)
Caused by: org.apache.cxf.interceptor.Fault
	at
org.apache.cxf.service.invoker.AbstractInvoker.createFault(AbstractInvoker.java:162)
	at
org.apache.cxf.service.invoker.AbstractInvoker.invoke(AbstractInvoker.java:128)
	at org.apache.cxf.jaxrs.JAXRSInvoker.invoke(JAXRSInvoker.java:198)
	at org.apache.cxf.jaxrs.JAXRSInvoker.invoke(JAXRSInvoker.java:100)
	at
org.apache.cxf.interceptor.ServiceInvokerInterceptor$1.run(ServiceInvokerInterceptor.java:58)
	at
org.apache.cxf.interceptor.ServiceInvokerInterceptor.handleMessage(ServiceInvokerInterceptor.java:94)
	at
org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:271)
	... 22 more
Caused by: java.lang.NullPointerException
	
com.host.oasis.resources.BooksResource.findSelectedBooks(BooksResource.java:220)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
	at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:601)
	at
org.apache.cxf.service.invoker.AbstractInvoker.performInvocation(AbstractInvoker.java:180)
	at
org.apache.cxf.service.invoker.AbstractInvoker.invoke(AbstractInvoker.java:96)
	... 27 more



--
View this message in context: http://cxf.547215.n5.nabble.com/Where-to-put-contextual-property-ignore-matrix-parameters-true-tp5730881p5730928.html
Sent from the cxf-user mailing list archive at Nabble.com.

Re: Where to put contextual property ignore.matrix.parameters=true ?

Posted by Sergey Beryozkin <sb...@gmail.com>.
On 16/07/13 13:42, nikosdim wrote:
> I have set the property search.lax.property.match in my xml file (assuming
> that it is a boolean property)
>
> <jaxrs:server id="services" address="/">
>          <jaxrs:properties>
> 			<entry key="ignore.matrix.parameters" value="true" />
> 			<entry key="search.lax.property.match" value="true" />
>          </jaxrs:properties>
> </jaxrs:server>
>
> but it does not work. I still get the same exceptions. I tried both true and
> false but nothing.
> Am I doing anything wrong?
What exception is being thrown ? Which CXF version ?

Cheers, Sergey

>
>
>
> --
> View this message in context: http://cxf.547215.n5.nabble.com/Where-to-put-contextual-property-ignore-matrix-parameters-true-tp5730881p5730918.html
> Sent from the cxf-user mailing list archive at Nabble.com.
>


Re: Where to put contextual property ignore.matrix.parameters=true ?

Posted by nikosdim <ni...@gmail.com>.
I have set the property search.lax.property.match in my xml file (assuming
that it is a boolean property)

<jaxrs:server id="services" address="/">
        <jaxrs:properties>
			<entry key="ignore.matrix.parameters" value="true" />
			<entry key="search.lax.property.match" value="true" />
        </jaxrs:properties>
</jaxrs:server>

but it does not work. I still get the same exceptions. I tried both true and
false but nothing. 
Am I doing anything wrong?



--
View this message in context: http://cxf.547215.n5.nabble.com/Where-to-put-contextual-property-ignore-matrix-parameters-true-tp5730881p5730918.html
Sent from the cxf-user mailing list archive at Nabble.com.

Re: Where to put contextual property ignore.matrix.parameters=true ?

Posted by Sergey Beryozkin <sb...@gmail.com>.
On 16/07/13 12:47, nikosdim wrote:
> And just a quick question on this FIQL approach.
>
> Lets say that I have the service
> localhost:808/service/books;author==Peter;records=20
>
>
> SQLPrinterVisitor<Server> visitor = new SQLPrinterVisitor<Server>(
> 				beanPropertiesMap, "books", cols);
>
> where the "author" is included in the beanPropertiesMap but the "records" is
> a parameter that we want to take with the @MatrixParam. Despite the fact
> that @MatrixParam("records") getsthe value 20 of the "records" the FIQL
> visitor throws an exception because the "records" matrix parameter is not
> included in the beanPropertiesMap.
>
> Is there any way to configure visitor to ignore the properties that are not
> included in the beanPropertiesMap?

You can set a "search.lax.property.match" contextual property to get 
those search properties which can not be mapped to bean properties ignored.

>
> Or if I decide to follow this FIQL functionality and get my search
> expressions through the ; symbol using the "ignore.matri.parameters"
> property I am losing the functionality of the matrix parameters?
>
When you use this particular style the idea is that an expression like
"books;author==Peter" needs to be made available to a FIQL parser as a 
single path segment value, and to do it we need to disable the runtime 
stripping "author==Peter" which it will do by default

Perhaps, when working with this style, you can separate the actual 
search expression from a paging parameter like this:

localhost:808/service/books;author==Peter?records=20

and capture the 'records' parameter with QueryParam.

Cheers, Sergey

> Thanks
>
>
>
> --
> View this message in context: http://cxf.547215.n5.nabble.com/Where-to-put-contextual-property-ignore-matrix-parameters-true-tp5730881p5730908.html
> Sent from the cxf-user mailing list archive at Nabble.com.
>


-- 
Sergey Beryozkin

Talend Community Coders
http://coders.talend.com/

Blog: http://sberyozkin.blogspot.com

Re: Where to put contextual property ignore.matrix.parameters=true ?

Posted by nikosdim <ni...@gmail.com>.
And just a quick question on this FIQL approach. 

Lets say that I have the service
localhost:808/service/books;author==Peter;records=20


SQLPrinterVisitor<Server> visitor = new SQLPrinterVisitor<Server>(
				beanPropertiesMap, "books", cols);

where the "author" is included in the beanPropertiesMap but the "records" is
a parameter that we want to take with the @MatrixParam. Despite the fact
that @MatrixParam("records") getsthe value 20 of the "records" the FIQL
visitor throws an exception because the "records" matrix parameter is not
included in the beanPropertiesMap. 

Is there any way to configure visitor to ignore the properties that are not
included in the beanPropertiesMap? 

Or if I decide to follow this FIQL functionality and get my search
expressions through the ; symbol using the "ignore.matri.parameters"
property I am losing the functionality of the matrix parameters? 

Thanks



--
View this message in context: http://cxf.547215.n5.nabble.com/Where-to-put-contextual-property-ignore-matrix-parameters-true-tp5730881p5730908.html
Sent from the cxf-user mailing list archive at Nabble.com.

Re: Where to put contextual property ignore.matrix.parameters=true ?

Posted by nikosdim <ni...@gmail.com>.
Worked like a charm!

Just a typo in your response. The attribute word key= is missing from the
entry tag.

<entry key="ignore.matrix.parameter" value="true"/>


Once again thanks Sergey



--
View this message in context: http://cxf.547215.n5.nabble.com/Where-to-put-contextual-property-ignore-matrix-parameters-true-tp5730881p5730893.html
Sent from the cxf-user mailing list archive at Nabble.com.

Re: Where to put contextual property ignore.matrix.parameters=true ?

Posted by Sergey Beryozkin <sb...@gmail.com>.
Hi
On 16/07/13 10:22, nikosdim wrote:
> Hi
>
> I want to use FIQL expressions in the URL with the form of matrix parameter
> and I saw in the  FIQL tutorial
> <http://cxf.apache.org/docs/jax-rs-search.html#JAX-RSSearch-SearchExpressionsinURIPathsegments>
> that I have to set the contextual property "ignore.matrix.parameter" in
> order to have this feature.
>
> My question is where to put this property?
> I am running my service in Tomcat 6 and I tried the catalina.properties file
> in tomcat but it didn't worked.
>
These are CXF endpoint contextual properties, for WS & RS endpoints, 
example, in this case, you can do:
<jaxrs:server address="/">
  <jaxrs:properties>
      <entry "ignore.matrix.parameter" value="true"/>
  </jaxrs:properties>
</jaxrs:server>

If you use CXFNonSpringServlet, do something like this:

<init-param>
   <param-name>jaxrs.properties</param-name>
   <param-value>
     ignore.matrix.parameter=true
   </param-value>
</init-param>

HTH, Sergey
> Any ideas?
>
>
>
> --
> View this message in context: http://cxf.547215.n5.nabble.com/Where-to-put-contextual-property-ignore-matrix-parameters-true-tp5730881.html
> Sent from the cxf-user mailing list archive at Nabble.com.
>


-- 
Sergey Beryozkin

Talend Community Coders
http://coders.talend.com/

Blog: http://sberyozkin.blogspot.com