You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by Sonam Samdupkhangsar <So...@imail.org> on 2014/03/05 18:36:12 UTC
jaxrs:client configuration throws error
Hi,
I am not able to get my jaxrs:client configuration to work using CXF version 3 milestone 2 . The following is my configuration:
<?xml version="1.0" encoding="UTF-8"?>
<beans default-autowire="byName"
xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:jaxrs="http://cxf.apache.org/jaxrs" xmlns:context="http://www.springframework.org/schema/context"
xmlns:util="http://www.springframework.org/schema/util"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-3.0.xsd
http://www.springframework.org/schema/util
http://www.springframework.org/schema/util/spring-util-3.0.xsd
http://cxf.apache.org/jaxrs
http://cxf.apache.org/schemas/jaxrs.xsd">
<jaxrs:client id="myClient" address="local://books"
serviceClass="org.company.MyInterface"
inheritHeaders="true">
<jaxrs:headers>
<entry key="userId" value="${dev.userId}"/>
<entry key="password" value="${dev.password}"/>
</jaxrs:headers>
</jaxrs:client>
</beans>
I am seeing the following error when running a integ test:
Caused by: org.xml.sax.SAXParseException; lineNumber: 54; columnNumber: 25; cvc-complex-type.2.4.c: The matching wildcard is strict, but no declaration can be found for element 'jaxrs:client'.
at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(Unknown Source)
Is the Jaxrs client configuration in a separate namespace?
thanks
-Sonam
Re: jaxrs:client configuration throws error
Posted by wi...@yahoo.com.
oh so sorry i clicked reply on the wrong thread.. i'm so sorry for hi-jacking the other thread.. please ignore my previous message.. i'm sorry ... i clicked the wrong thread when replying.
________________________________
From: "wizpar@yahoo.com" <wi...@yahoo.com>
To: "users@cxf.apache.org" <us...@cxf.apache.org>
Sent: Thursday, March 6, 2014 1:34 PM
Subject: Re: jaxrs:client configuration throws error
Sergey,
The only situtation where it's not working for is if we have a @BeanParam
it does not pass the annotations of the method related to that param
down to ParamConvertProvider
public class MyBean {
private String field1;
private String field2;
public String getField1() {
return field1;
}
@PathParam("field1")
@Encoded
public void setField1(String field1) {
this.field1 = field1;
}
public String getField2() {
return field2;
}
@PathParam("field1")
public void setField2(String field2) {
this.field2 = field2;
}
}
@Path("/server")
public interface Server {
@GET
@Path("/{field1}/{field2}")
public BookBean book(@BeanParam MyBean myBean);
}
i think on clientside we can just send PathParam.class as anotations for these guys since we know in this method we are dealing with pathparam be it from service bean or be it from @BeanParam
ClientProxyImpl.getPathParamValues()
for (String varName : methodVars) {
Parameter p = paramsMap.remove(varName);
if (p != null) {
list.add(convertParamValue(params[p.getIndex()], getParamAnnotations(m, p)));
} else if (beanParamValues.containsKey(varName)) {
list.add(convertParamValue(beanParamValues.get(varName), null));
}
}
if it's from beanParamValues
we can just do convertParamValue(beanParamValues.get(varName), new Annotation[] {PathParam.class});
or get m.getDeclaredAnnotations() since these are declared and not part of
parameter formal definition itself in method signature.
Now on server side we are only sending m.getParameterAnnotations()[0]
and again since for BeanParam the annotations are delcaredAnnotations
then we have to do some sort of check and choose between m.getParameterAnnotations() or m.getDeclaredAnnotations() for BeanParams
inside JAXRSUtils.injectParameters()
o = createHttpParameterValue(p,
m.getParameterTypes()[0],
m.getGenericParameterTypes()[0],
m.getParameterAnnotations()[0],
message,
values,
ori);
please take a look as i believe this will fix the only param type so far that's not consistent with other params.
i tested with @PathParam, @QueryParam, @MatrixParam, @FormParam
in service layer and they all work fine with param converters
but @BeanParam is the only one that leaves out sending annotations of it's related method to converter.
thanks,
parwiz
________________________________
From: Sergey Beryozkin <sb...@gmail.com>
To: users@cxf.apache.org
Sent: Wednesday, March 5, 2014 12:44 PM
Subject: Re: jaxrs:client configuration throws error
You need to add a cxf-rt-rs-client module as described in the docs
Sergey
On 05/03/14 19:25, Sonam Samdupkhangsar wrote:
> After reading the link I tried several combinations of the namespace in the beans element such as following but can't find the right way :
>
> <beans default-autowire="byName"
> xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> xmlns:jaxrs="http://cxf.apache.org/jaxrs"
> xmlns:jaxrs-client="http://cxf.apache.org/jaxrs-client"
> xmlns:context="http://www.springframework.org/schema/context"
> xmlns:util="http://www.springframework.org/schema/util"
> xsi:schemaLocation="http://www.springframework.org/schema/beans
> http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
> http://www.springframework.org/schema/context
> http://www.springframework.org/schema/context/spring-context-3.0.xsd
> http://www.springframework.org/schema/util
> http://www.springframework.org/schema/util/spring-util-3.0.xsd
> http://cxf.apache.org/jaxrs
> http://cxf.apache.org/jaxrs-client
> http://cxf.apache.org/schemas/jaxrs.xsd
> http://cxf.apache.org/jaxrs-client/schemas/jaxrs-client.xsd">
>
>
> -Sonam
>
> -----Original Message-----
> From: Sergey Beryozkin [mailto:sberyozkin@gmail.com]
> Sent: Wednesday, March 05, 2014 10:44 AM
> To: users@cxf.apache.org
> Subject: Re: jaxrs:client configuration throws error
>
> This is a migration issue:
>
> http://cxf.apache.org/docs/jax-rs.html#JAX-RS-FromCXF2.7.xtoCXF3.0.0
> (with the link to all of CXF changes from there)
>
> Sergey
>
> On 05/03/14 17:36, Sonam Samdupkhangsar wrote:
>> Hi,
>>
>> I am not able to get my jaxrs:client configuration to work using CXF version 3 milestone 2 . The following is my configuration:
>>
>> <?xml version="1.0" encoding="UTF-8"?> <beans
>> default-autowire="byName"
>> xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>>
xmlns:jaxrs="http://cxf.apache.org/jaxrs" xmlns:context="http://www.springframework.org/schema/context"
>> xmlns:util="http://www.springframework.org/schema/util"
>> xsi:schemaLocation="http://www.springframework.org/schema/beans
>> http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
>>
http://www.springframework.org/schema/context
>> http://www.springframework.org/schema/context/spring-context-3.0.xsd
>> http://www.springframework.org/schema/util
>> http://www.springframework.org/schema/util/spring-util-3.0.xsd
>> http://cxf.apache.org/jaxrs
>> http://cxf.apache.org/schemas/jaxrs.xsd">
>>
>> <jaxrs:client id="myClient" address="local://books"
>> serviceClass="org.company.MyInterface"
>> inheritHeaders="true">
>> <jaxrs:headers>
>> <entry key="userId" value="${dev.userId}"/>
>> <entry key="password" value="${dev.password}"/>
>> </jaxrs:headers>
>> </jaxrs:client>
>>
>> </beans>
>>
>>
>> I am seeing the following error when running a
integ test:
>>
>> Caused by: org.xml.sax.SAXParseException; lineNumber: 54; columnNumber: 25; cvc-complex-type.2.4.c: The matching wildcard is strict, but no declaration can be found for element 'jaxrs:client'.
>> at
>> com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXP
>> arseException(Unknown Source)
>>
>>
>> Is the Jaxrs client configuration in a separate namespace?
>>
>> thanks
>> -Sonam
>>
>
>
> --
> Sergey Beryozkin
>
> Talend Community Coders
> http://coders.talend.com/
>
> Blog: http://sberyozkin.blogspot.com
>
Re: jaxrs:client configuration throws error
Posted by wi...@yahoo.com.
Sergey,
The only situtation where it's not working for is if we have a @BeanParam
it does not pass the annotations of the method related to that param
down to ParamConvertProvider
public class MyBean {
private String field1;
private String field2;
public String getField1() {
return field1;
}
@PathParam("field1")
@Encoded
public void setField1(String field1) {
this.field1 = field1;
}
public String getField2() {
return field2;
}
@PathParam("field1")
public void setField2(String field2) {
this.field2 = field2;
}
}
@Path("/server")
public interface Server {
@GET
@Path("/{field1}/{field2}")
public BookBean book(@BeanParam MyBean myBean);
}
i think on clientside we can just send PathParam.class as anotations for these guys since we know in this method we are dealing with pathparam be it from service bean or be it from @BeanParam
ClientProxyImpl.getPathParamValues()
for (String varName : methodVars) {
Parameter p = paramsMap.remove(varName);
if (p != null) {
list.add(convertParamValue(params[p.getIndex()], getParamAnnotations(m, p)));
} else if (beanParamValues.containsKey(varName)) {
list.add(convertParamValue(beanParamValues.get(varName), null));
}
}
if it's from beanParamValues
we can just do convertParamValue(beanParamValues.get(varName), new Annotation[] {PathParam.class});
or get m.getDeclaredAnnotations() since these are declared and not part of
parameter formal definition itself in method signature.
Now on server side we are only sending m.getParameterAnnotations()[0]
and again since for BeanParam the annotations are delcaredAnnotations
then we have to do some sort of check and choose between m.getParameterAnnotations() or m.getDeclaredAnnotations() for BeanParams
inside JAXRSUtils.injectParameters()
o = createHttpParameterValue(p,
m.getParameterTypes()[0],
m.getGenericParameterTypes()[0],
m.getParameterAnnotations()[0],
message,
values,
ori);
please take a look as i believe this will fix the only param type so far that's not consistent with other params.
i tested with @PathParam, @QueryParam, @MatrixParam, @FormParam
in service layer and they all work fine with param converters
but @BeanParam is the only one that leaves out sending annotations of it's related method to converter.
thanks,
parwiz
________________________________
From: Sergey Beryozkin <sb...@gmail.com>
To: users@cxf.apache.org
Sent: Wednesday, March 5, 2014 12:44 PM
Subject: Re: jaxrs:client configuration throws error
You need to add a cxf-rt-rs-client module as described in the docs
Sergey
On 05/03/14 19:25, Sonam Samdupkhangsar wrote:
> After reading the link I tried several combinations of the namespace in the beans element such as following but can't find the right way :
>
> <beans default-autowire="byName"
> xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> xmlns:jaxrs="http://cxf.apache.org/jaxrs"
> xmlns:jaxrs-client="http://cxf.apache.org/jaxrs-client"
> xmlns:context="http://www.springframework.org/schema/context"
> xmlns:util="http://www.springframework.org/schema/util"
> xsi:schemaLocation="http://www.springframework.org/schema/beans
> http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
> http://www.springframework.org/schema/context
> http://www.springframework.org/schema/context/spring-context-3.0.xsd
> http://www.springframework.org/schema/util
> http://www.springframework.org/schema/util/spring-util-3.0.xsd
> http://cxf.apache.org/jaxrs
> http://cxf.apache.org/jaxrs-client
> http://cxf.apache.org/schemas/jaxrs.xsd
> http://cxf.apache.org/jaxrs-client/schemas/jaxrs-client.xsd">
>
>
> -Sonam
>
> -----Original Message-----
> From: Sergey Beryozkin [mailto:sberyozkin@gmail.com]
> Sent: Wednesday, March 05, 2014 10:44 AM
> To: users@cxf.apache.org
> Subject: Re: jaxrs:client configuration throws error
>
> This is a migration issue:
>
> http://cxf.apache.org/docs/jax-rs.html#JAX-RS-FromCXF2.7.xtoCXF3.0.0
> (with the link to all of CXF changes from there)
>
> Sergey
>
> On 05/03/14 17:36, Sonam Samdupkhangsar wrote:
>> Hi,
>>
>> I am not able to get my jaxrs:client configuration to work using CXF version 3 milestone 2 . The following is my configuration:
>>
>> <?xml version="1.0" encoding="UTF-8"?> <beans
>> default-autowire="byName"
>> xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>> xmlns:jaxrs="http://cxf.apache.org/jaxrs" xmlns:context="http://www.springframework.org/schema/context"
>> xmlns:util="http://www.springframework.org/schema/util"
>> xsi:schemaLocation="http://www.springframework.org/schema/beans
>> http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
>> http://www.springframework.org/schema/context
>> http://www.springframework.org/schema/context/spring-context-3.0.xsd
>> http://www.springframework.org/schema/util
>> http://www.springframework.org/schema/util/spring-util-3.0.xsd
>> http://cxf.apache.org/jaxrs
>> http://cxf.apache.org/schemas/jaxrs.xsd">
>>
>> <jaxrs:client id="myClient" address="local://books"
>> serviceClass="org.company.MyInterface"
>> inheritHeaders="true">
>> <jaxrs:headers>
>> <entry key="userId" value="${dev.userId}"/>
>> <entry key="password" value="${dev.password}"/>
>> </jaxrs:headers>
>> </jaxrs:client>
>>
>> </beans>
>>
>>
>> I am seeing the following error when running a integ test:
>>
>> Caused by: org.xml.sax.SAXParseException; lineNumber: 54; columnNumber: 25; cvc-complex-type.2.4.c: The matching wildcard is strict, but no declaration can be found for element 'jaxrs:client'.
>> at
>> com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXP
>> arseException(Unknown Source)
>>
>>
>> Is the Jaxrs client configuration in a separate namespace?
>>
>> thanks
>> -Sonam
>>
>
>
> --
> Sergey Beryozkin
>
> Talend Community Coders
> http://coders.talend.com/
>
> Blog: http://sberyozkin.blogspot.com
>
Re: jaxrs:client configuration throws error
Posted by Sergey Beryozkin <sb...@gmail.com>.
Sure, check this one for example:
https://github.com/apache/cxf/blob/master/systests/jaxrs/src/test/resources/jaxrs_soap_rest/WEB-INF/beans.xml
Sergey
On 05/03/14 22:19, Sonam Samdupkhangsar wrote:
> Yes, I do have that as a dependency in my pom:
>
> <dependency>
> <groupId>org.apache.cxf</groupId>
> <artifactId>cxf-rt-rs-client</artifactId>
> <version>${cxf.version}</version>
> </dependency>
>
> Is there a sample configuration for the way the namespace is declared in the beans element for jaxws:client? I wonder if I have that wrong.
>
> Thanks
> -Sonam
>
>
> -----Original Message-----
> From: Sergey Beryozkin [mailto:sberyozkin@gmail.com]
> Sent: Wednesday, March 05, 2014 1:44 PM
> To: users@cxf.apache.org
> Subject: Re: jaxrs:client configuration throws error
>
> You need to add a cxf-rt-rs-client module as described in the docs
>
> Sergey
>
> On 05/03/14 19:25, Sonam Samdupkhangsar wrote:
>> After reading the link I tried several combinations of the namespace in the beans element such as following but can't find the right way :
>>
>> <beans default-autowire="byName"
>> xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>> xmlns:jaxrs="http://cxf.apache.org/jaxrs"
>> xmlns:jaxrs-client="http://cxf.apache.org/jaxrs-client"
>> xmlns:context="http://www.springframework.org/schema/context"
>> xmlns:util="http://www.springframework.org/schema/util"
>> xsi:schemaLocation="http://www.springframework.org/schema/beans
>> http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
>> http://www.springframework.org/schema/context
>> http://www.springframework.org/schema/context/spring-context-3.0.xsd
>> http://www.springframework.org/schema/util
>> http://www.springframework.org/schema/util/spring-util-3.0.xsd
>> http://cxf.apache.org/jaxrs
>> http://cxf.apache.org/jaxrs-client
>> http://cxf.apache.org/schemas/jaxrs.xsd
>> http://cxf.apache.org/jaxrs-client/schemas/jaxrs-client.xsd">
>>
>>
>> -Sonam
>>
>> -----Original Message-----
>> From: Sergey Beryozkin [mailto:sberyozkin@gmail.com]
>> Sent: Wednesday, March 05, 2014 10:44 AM
>> To: users@cxf.apache.org
>> Subject: Re: jaxrs:client configuration throws error
>>
>> This is a migration issue:
>>
>> http://cxf.apache.org/docs/jax-rs.html#JAX-RS-FromCXF2.7.xtoCXF3.0.0
>> (with the link to all of CXF changes from there)
>>
>> Sergey
>>
>> On 05/03/14 17:36, Sonam Samdupkhangsar wrote:
>>> Hi,
>>>
>>> I am not able to get my jaxrs:client configuration to work using CXF version 3 milestone 2 . The following is my configuration:
>>>
>>> <?xml version="1.0" encoding="UTF-8"?> <beans
>>> default-autowire="byName"
>>> xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>>> xmlns:jaxrs="http://cxf.apache.org/jaxrs" xmlns:context="http://www.springframework.org/schema/context"
>>> xmlns:util="http://www.springframework.org/schema/util"
>>> xsi:schemaLocation="http://www.springframework.org/schema/beans
>>> http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
>>> http://www.springframework.org/schema/context
>>> http://www.springframework.org/schema/context/spring-context-3.0.xsd
>>> http://www.springframework.org/schema/util
>>> http://www.springframework.org/schema/util/spring-util-3.0.xsd
>>> http://cxf.apache.org/jaxrs
>>> http://cxf.apache.org/schemas/jaxrs.xsd">
>>>
>>> <jaxrs:client id="myClient" address="local://books"
>>> serviceClass="org.company.MyInterface"
>>> inheritHeaders="true">
>>> <jaxrs:headers>
>>> <entry key="userId" value="${dev.userId}"/>
>>> <entry key="password" value="${dev.password}"/>
>>> </jaxrs:headers>
>>> </jaxrs:client>
>>>
>>> </beans>
>>>
>>>
>>> I am seeing the following error when running a integ test:
>>>
>>> Caused by: org.xml.sax.SAXParseException; lineNumber: 54; columnNumber: 25; cvc-complex-type.2.4.c: The matching wildcard is strict, but no declaration can be found for element 'jaxrs:client'.
>>> at
>>> com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAX
>>> P
>>> arseException(Unknown Source)
>>>
>>>
>>> Is the Jaxrs client configuration in a separate namespace?
>>>
>>> thanks
>>> -Sonam
>>>
>>
>>
>> --
>> Sergey Beryozkin
>>
>> Talend Community Coders
>> http://coders.talend.com/
>>
>> Blog: http://sberyozkin.blogspot.com
>>
>
>
--
Sergey Beryozkin
Talend Community Coders
http://coders.talend.com/
Blog: http://sberyozkin.blogspot.com
RE: jaxrs:client configuration throws error
Posted by Sonam Samdupkhangsar <So...@imail.org>.
Yes, I do have that as a dependency in my pom:
<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-rt-rs-client</artifactId>
<version>${cxf.version}</version>
</dependency>
Is there a sample configuration for the way the namespace is declared in the beans element for jaxws:client? I wonder if I have that wrong.
Thanks
-Sonam
-----Original Message-----
From: Sergey Beryozkin [mailto:sberyozkin@gmail.com]
Sent: Wednesday, March 05, 2014 1:44 PM
To: users@cxf.apache.org
Subject: Re: jaxrs:client configuration throws error
You need to add a cxf-rt-rs-client module as described in the docs
Sergey
On 05/03/14 19:25, Sonam Samdupkhangsar wrote:
> After reading the link I tried several combinations of the namespace in the beans element such as following but can't find the right way :
>
> <beans default-autowire="byName"
> xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> xmlns:jaxrs="http://cxf.apache.org/jaxrs"
> xmlns:jaxrs-client="http://cxf.apache.org/jaxrs-client"
> xmlns:context="http://www.springframework.org/schema/context"
> xmlns:util="http://www.springframework.org/schema/util"
> xsi:schemaLocation="http://www.springframework.org/schema/beans
> http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
> http://www.springframework.org/schema/context
> http://www.springframework.org/schema/context/spring-context-3.0.xsd
> http://www.springframework.org/schema/util
> http://www.springframework.org/schema/util/spring-util-3.0.xsd
> http://cxf.apache.org/jaxrs
> http://cxf.apache.org/jaxrs-client
> http://cxf.apache.org/schemas/jaxrs.xsd
> http://cxf.apache.org/jaxrs-client/schemas/jaxrs-client.xsd">
>
>
> -Sonam
>
> -----Original Message-----
> From: Sergey Beryozkin [mailto:sberyozkin@gmail.com]
> Sent: Wednesday, March 05, 2014 10:44 AM
> To: users@cxf.apache.org
> Subject: Re: jaxrs:client configuration throws error
>
> This is a migration issue:
>
> http://cxf.apache.org/docs/jax-rs.html#JAX-RS-FromCXF2.7.xtoCXF3.0.0
> (with the link to all of CXF changes from there)
>
> Sergey
>
> On 05/03/14 17:36, Sonam Samdupkhangsar wrote:
>> Hi,
>>
>> I am not able to get my jaxrs:client configuration to work using CXF version 3 milestone 2 . The following is my configuration:
>>
>> <?xml version="1.0" encoding="UTF-8"?> <beans
>> default-autowire="byName"
>> xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>> xmlns:jaxrs="http://cxf.apache.org/jaxrs" xmlns:context="http://www.springframework.org/schema/context"
>> xmlns:util="http://www.springframework.org/schema/util"
>> xsi:schemaLocation="http://www.springframework.org/schema/beans
>> http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
>> http://www.springframework.org/schema/context
>> http://www.springframework.org/schema/context/spring-context-3.0.xsd
>> http://www.springframework.org/schema/util
>> http://www.springframework.org/schema/util/spring-util-3.0.xsd
>> http://cxf.apache.org/jaxrs
>> http://cxf.apache.org/schemas/jaxrs.xsd">
>>
>> <jaxrs:client id="myClient" address="local://books"
>> serviceClass="org.company.MyInterface"
>> inheritHeaders="true">
>> <jaxrs:headers>
>> <entry key="userId" value="${dev.userId}"/>
>> <entry key="password" value="${dev.password}"/>
>> </jaxrs:headers>
>> </jaxrs:client>
>>
>> </beans>
>>
>>
>> I am seeing the following error when running a integ test:
>>
>> Caused by: org.xml.sax.SAXParseException; lineNumber: 54; columnNumber: 25; cvc-complex-type.2.4.c: The matching wildcard is strict, but no declaration can be found for element 'jaxrs:client'.
>> at
>> com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAX
>> P
>> arseException(Unknown Source)
>>
>>
>> Is the Jaxrs client configuration in a separate namespace?
>>
>> thanks
>> -Sonam
>>
>
>
> --
> Sergey Beryozkin
>
> Talend Community Coders
> http://coders.talend.com/
>
> Blog: http://sberyozkin.blogspot.com
>
Re: jaxrs:client configuration throws error
Posted by Sergey Beryozkin <sb...@gmail.com>.
You need to add a cxf-rt-rs-client module as described in the docs
Sergey
On 05/03/14 19:25, Sonam Samdupkhangsar wrote:
> After reading the link I tried several combinations of the namespace in the beans element such as following but can't find the right way :
>
> <beans default-autowire="byName"
> xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> xmlns:jaxrs="http://cxf.apache.org/jaxrs"
> xmlns:jaxrs-client="http://cxf.apache.org/jaxrs-client"
> xmlns:context="http://www.springframework.org/schema/context"
> xmlns:util="http://www.springframework.org/schema/util"
> xsi:schemaLocation="http://www.springframework.org/schema/beans
> http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
> http://www.springframework.org/schema/context
> http://www.springframework.org/schema/context/spring-context-3.0.xsd
> http://www.springframework.org/schema/util
> http://www.springframework.org/schema/util/spring-util-3.0.xsd
> http://cxf.apache.org/jaxrs
> http://cxf.apache.org/jaxrs-client
> http://cxf.apache.org/schemas/jaxrs.xsd
> http://cxf.apache.org/jaxrs-client/schemas/jaxrs-client.xsd">
>
>
> -Sonam
>
> -----Original Message-----
> From: Sergey Beryozkin [mailto:sberyozkin@gmail.com]
> Sent: Wednesday, March 05, 2014 10:44 AM
> To: users@cxf.apache.org
> Subject: Re: jaxrs:client configuration throws error
>
> This is a migration issue:
>
> http://cxf.apache.org/docs/jax-rs.html#JAX-RS-FromCXF2.7.xtoCXF3.0.0
> (with the link to all of CXF changes from there)
>
> Sergey
>
> On 05/03/14 17:36, Sonam Samdupkhangsar wrote:
>> Hi,
>>
>> I am not able to get my jaxrs:client configuration to work using CXF version 3 milestone 2 . The following is my configuration:
>>
>> <?xml version="1.0" encoding="UTF-8"?> <beans
>> default-autowire="byName"
>> xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>> xmlns:jaxrs="http://cxf.apache.org/jaxrs" xmlns:context="http://www.springframework.org/schema/context"
>> xmlns:util="http://www.springframework.org/schema/util"
>> xsi:schemaLocation="http://www.springframework.org/schema/beans
>> http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
>> http://www.springframework.org/schema/context
>> http://www.springframework.org/schema/context/spring-context-3.0.xsd
>> http://www.springframework.org/schema/util
>> http://www.springframework.org/schema/util/spring-util-3.0.xsd
>> http://cxf.apache.org/jaxrs
>> http://cxf.apache.org/schemas/jaxrs.xsd">
>>
>> <jaxrs:client id="myClient" address="local://books"
>> serviceClass="org.company.MyInterface"
>> inheritHeaders="true">
>> <jaxrs:headers>
>> <entry key="userId" value="${dev.userId}"/>
>> <entry key="password" value="${dev.password}"/>
>> </jaxrs:headers>
>> </jaxrs:client>
>>
>> </beans>
>>
>>
>> I am seeing the following error when running a integ test:
>>
>> Caused by: org.xml.sax.SAXParseException; lineNumber: 54; columnNumber: 25; cvc-complex-type.2.4.c: The matching wildcard is strict, but no declaration can be found for element 'jaxrs:client'.
>> at
>> com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXP
>> arseException(Unknown Source)
>>
>>
>> Is the Jaxrs client configuration in a separate namespace?
>>
>> thanks
>> -Sonam
>>
>
>
> --
> Sergey Beryozkin
>
> Talend Community Coders
> http://coders.talend.com/
>
> Blog: http://sberyozkin.blogspot.com
>
RE: jaxrs:client configuration throws error
Posted by Sonam Samdupkhangsar <So...@imail.org>.
After reading the link I tried several combinations of the namespace in the beans element such as following but can't find the right way :
<beans default-autowire="byName"
xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:jaxrs="http://cxf.apache.org/jaxrs"
xmlns:jaxrs-client="http://cxf.apache.org/jaxrs-client"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:util="http://www.springframework.org/schema/util"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-3.0.xsd
http://www.springframework.org/schema/util
http://www.springframework.org/schema/util/spring-util-3.0.xsd
http://cxf.apache.org/jaxrs
http://cxf.apache.org/jaxrs-client
http://cxf.apache.org/schemas/jaxrs.xsd
http://cxf.apache.org/jaxrs-client/schemas/jaxrs-client.xsd">
-Sonam
-----Original Message-----
From: Sergey Beryozkin [mailto:sberyozkin@gmail.com]
Sent: Wednesday, March 05, 2014 10:44 AM
To: users@cxf.apache.org
Subject: Re: jaxrs:client configuration throws error
This is a migration issue:
http://cxf.apache.org/docs/jax-rs.html#JAX-RS-FromCXF2.7.xtoCXF3.0.0
(with the link to all of CXF changes from there)
Sergey
On 05/03/14 17:36, Sonam Samdupkhangsar wrote:
> Hi,
>
> I am not able to get my jaxrs:client configuration to work using CXF version 3 milestone 2 . The following is my configuration:
>
> <?xml version="1.0" encoding="UTF-8"?> <beans
> default-autowire="byName"
> xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> xmlns:jaxrs="http://cxf.apache.org/jaxrs" xmlns:context="http://www.springframework.org/schema/context"
> xmlns:util="http://www.springframework.org/schema/util"
> xsi:schemaLocation="http://www.springframework.org/schema/beans
> http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
> http://www.springframework.org/schema/context
> http://www.springframework.org/schema/context/spring-context-3.0.xsd
> http://www.springframework.org/schema/util
> http://www.springframework.org/schema/util/spring-util-3.0.xsd
> http://cxf.apache.org/jaxrs
> http://cxf.apache.org/schemas/jaxrs.xsd">
>
> <jaxrs:client id="myClient" address="local://books"
> serviceClass="org.company.MyInterface"
> inheritHeaders="true">
> <jaxrs:headers>
> <entry key="userId" value="${dev.userId}"/>
> <entry key="password" value="${dev.password}"/>
> </jaxrs:headers>
> </jaxrs:client>
>
> </beans>
>
>
> I am seeing the following error when running a integ test:
>
> Caused by: org.xml.sax.SAXParseException; lineNumber: 54; columnNumber: 25; cvc-complex-type.2.4.c: The matching wildcard is strict, but no declaration can be found for element 'jaxrs:client'.
> at
> com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXP
> arseException(Unknown Source)
>
>
> Is the Jaxrs client configuration in a separate namespace?
>
> thanks
> -Sonam
>
--
Sergey Beryozkin
Talend Community Coders
http://coders.talend.com/
Blog: http://sberyozkin.blogspot.com
Re: jaxrs:client configuration throws error
Posted by Sergey Beryozkin <sb...@gmail.com>.
This is a migration issue:
http://cxf.apache.org/docs/jax-rs.html#JAX-RS-FromCXF2.7.xtoCXF3.0.0
(with the link to all of CXF changes from there)
Sergey
On 05/03/14 17:36, Sonam Samdupkhangsar wrote:
> Hi,
>
> I am not able to get my jaxrs:client configuration to work using CXF version 3 milestone 2 . The following is my configuration:
>
> <?xml version="1.0" encoding="UTF-8"?>
> <beans default-autowire="byName"
> xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> xmlns:jaxrs="http://cxf.apache.org/jaxrs" xmlns:context="http://www.springframework.org/schema/context"
> xmlns:util="http://www.springframework.org/schema/util"
> xsi:schemaLocation="http://www.springframework.org/schema/beans
> http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
> http://www.springframework.org/schema/context
> http://www.springframework.org/schema/context/spring-context-3.0.xsd
> http://www.springframework.org/schema/util
> http://www.springframework.org/schema/util/spring-util-3.0.xsd
> http://cxf.apache.org/jaxrs
> http://cxf.apache.org/schemas/jaxrs.xsd">
>
> <jaxrs:client id="myClient" address="local://books"
> serviceClass="org.company.MyInterface"
> inheritHeaders="true">
> <jaxrs:headers>
> <entry key="userId" value="${dev.userId}"/>
> <entry key="password" value="${dev.password}"/>
> </jaxrs:headers>
> </jaxrs:client>
>
> </beans>
>
>
> I am seeing the following error when running a integ test:
>
> Caused by: org.xml.sax.SAXParseException; lineNumber: 54; columnNumber: 25; cvc-complex-type.2.4.c: The matching wildcard is strict, but no declaration can be found for element 'jaxrs:client'.
> at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(Unknown Source)
>
>
> Is the Jaxrs client configuration in a separate namespace?
>
> thanks
> -Sonam
>
--
Sergey Beryozkin
Talend Community Coders
http://coders.talend.com/
Blog: http://sberyozkin.blogspot.com