Hi

I've added this test to 2.7.18-SNAPSHOT:

http://git-wip-us.apache.org/repos/asf/cxf/commit/abc7838f

Can you please prototype Bar and Baz beans, and tell more about their access level, perhaps one of these classes is not public or is nested ?

Also try 2.7.18-SNAPHOT (in a day or two), but also CXF 3.1.3.
While the best effort was made to have as many JAX-RS 2.0 features be available to CXF 2.7.x users as possible, it it possible the relevant implementation in 2.7.x is less robust

Thanks, Sergey


On 16/10/15 11:42, Sergey Beryozkin wrote:
Hi Christian

Thanks for reporting it - I'll look into it shortly.
Multiple BeanParams in a single signature are allowed indeed
Cheers, Sergey
On 16/10/15 11:32, Christian Balzer wrote:
Hello all,

We are using Spring and Apache CXF.

For the following example code, I get an exception. Which makes me
wonder: can I use two BeanParam annotations/beans in the same method
signature?

import javax.ws.rs.BeanParam;
//...
@GET
@Produces({"application/json;charset=UTF-8"})
public Response doFoo(
         @BeanParam Bar bar,
         @BeanParam Bas bas,
         @Context UriInfo uriInfo)
         throws BazException {

Here is the stack trace:

javax.ws.rs.InternalServerErrorException: null
at
org.apache.cxf.jaxrs.utils.SpecExceptions.toInternalServerErrorException(SpecExceptions.java:77)

~[cxf-rt-frontend-jaxrs-2.7.15.jar:2.7.15]
at
org.apache.cxf.jaxrs.utils.ExceptionUtils.toInternalServerErrorException(ExceptionUtils.java:110)

~[cxf-rt-frontend-jaxrs-2.7.15.jar:2.7.15]
at
org.apache.cxf.jaxrs.utils.JAXRSUtils.createBeanParamValue(JAXRSUtils.java:975)

~[cxf-rt-frontend-jaxrs-2.7.15.jar:2.7.15]
at
org.apache.cxf.jaxrs.utils.JAXRSUtils.processParameter(JAXRSUtils.java:767)

~[cxf-rt-frontend-jaxrs-2.7.15.jar:2.7.15]
at
org.apache.cxf.jaxrs.utils.JAXRSUtils.processParameters(JAXRSUtils.java:716)

~[cxf-rt-frontend-jaxrs-2.7.15.jar:2.7.15]
at org.apache.cxf.jaxrs.JAXRSInvoker.invoke(JAXRSInvoker.java:265)
[cxf-rt-frontend-jaxrs-2.7.15.jar:2.7.15]
at org.apache.cxf.jaxrs.JAXRSInvoker.invoke(JAXRSInvoker.java:101)
[cxf-rt-frontend-jaxrs-2.7.15.jar:2.7.15]

In JAXRSUtils, I can see this:

BeanParamInfo bmi =
ProviderFactory.getInstance(m).getBeanParamInfo(clazz);
if (bmi == null) {
     // we could've started introspecting now but the fact no bean info
     // is available indicates that the one created at start up has been
     // lost and hence it is 500
     LOG.warning("Bean parameter info is not available");
     throw ExceptionUtils.toInternalServerErrorException(null, null);
}

Which is the exception that gets thrown.

Is there any hint in this on what I'm doing wrong? Things seem to work
when I comment out the "@BeanParam Bas bas," line... Am I maybe not
allowed to use two @BeanParam in the same method signature? (I
couldn't find any hint that I wouldn't be, though...)

Kind regards,

Christian
P.S.: This is a cross-post from StackOverflow:
http://stackoverflow.com/q/33168074/2018047




--
Sergey Beryozkin

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

Reply via email to