Hi,

That is a Spring proxy issue, a complete error message explains it.
How do you import ? Is it an application context which is being imported, or
packages (via Import-Package) ?
What CXF version do you use ? Can you prepare a simple test or bundle for me
to try it locally ?

Cheers, Sergey


On Mon, Apr 4, 2011 at 5:30 PM, jjurkiew <[email protected]> wrote:

>  The function it fails on with the rest of the stack is:
>
> org.apache.cxf.interceptor.Fault: object is not an instance of declaring
> class while invoking public javax.xml.bind.JAXBElement <Our Package>.<Our
> Class>.que
> ry(java.lang.String,java.lang.String)
>         at
> org.apache.cxf.service.invoker.AbstractInvoker.createFault(AbstractInvoker.java:159)
>
>        at
> org.apache.cxf.service.invoker.AbstractInvoker.invoke(AbstractInvoker.java:133)
>         at org.apache.cxf.jaxrs.JAXRSInvoker.invoke(JAXRSInvoker.java:130)
>         at org.apache.cxf.jaxrs.JAXRSInvoker.invoke(JAXRSInvoker.java:82)
>
>        at
> org.apache.cxf.interceptor.ServiceInvokerInterceptor$1.run(ServiceInvokerInterceptor.java:58)
>
> And I checked the function def denoted in the class:
> @Path("/registry")
> public class OurClass implements OurInterface {
>
>     @GET
>     @Produces({JSON_CONTENT_TYPE, XML_CONTENT_TYPE})
>     public JAXBElement query(
>             @QueryParam("id") @DefaultValue("") String id,
>             @QueryParam("xpath") @DefaultValue("/") String xpath)
>
> So it does have a get with the denoted return type.   This only throws when
> I import a set of CXF classes from another team.   If it’s just our code in
> the app, works fine.   As soon as I import their code, blows up.
>
> I’m trying to get trace turned on now to see if I can figure out what is
> going on.
>
> Sincerely,
> -- Jared
>
>
>
> On 4/4/11 12:07 PM, "Sergey Beryozkin" <[email protected]> wrote:
>
> Hi
>
> What most likely happens is that you have a JAX-RS resource method with a
> single @Path annotation (but no @GET/@POST) which returns JAXBElement - if
> it is the case then JAXBElement will be assumed to be a JAX-RS subresource.
>
> Can you double check it please ? If you can't find the cause then please
> post a sample resource & configuration which I can try to reproduce a
> problem
>
> Fine/trace-level logging will tell you all about the resolution process as
> well,
>
> Cheers, Sergey
>
> On Mon, Apr 4, 2011 at 4:37 PM, Jared_J <[email protected]> wrote:
>
> In an application I'm working on, I import two sets of CXF-based classes to
> implement some basic rest services.   I find that when both are imported, I
> get this error when I try to access one of the services:
>
> CXF object is not an instance of declaring class while invoking public
> javax.xml.bind.JAXBElement
>
> But it tells me little else, such as what the classname actually was that
> it
> got.   Is there any simple way to track down the source of this error?   Is
> there tracing that can be turned on in CXF?   Any advice would be vastly
> appreciated.
>
> Sincerely,
> -- Jared
>
> --
> View this message in context:
> http://cxf.547215.n5.nabble.com/Trying-to-track-down-cause-of-a-vague-CXF-error-tp4282081p4282081.html
> Sent from the cxf-user mailing list archive at Nabble.com.
>
>
>
>


-- 
Sergey Beryozkin

Application Integration Division of Talend <http://www.talend.com>
http://sberyozkin.blogspot.com

Reply via email to