Thanks for the fast reply. I do not use a concrete class and when I create the proxyFactory I use the corresponding ws interface class as "clazz" value.
Andrea Date: Tue, 7 May 2013 09:01:10 -0700 From: [email protected] To: [email protected] Subject: Re: java.lang.NoClassDefFoundError exception loading a rest endPoint in particular condition Hi On 07/05/13 15:56, eanbiso wrote: > Hi at all, > I have the following problem loading a rest endPoint using cxf. > The operations I do to load the rest endPoint after its publication are the > following: > > JAXRSClientFactoryBean proxyFactory = new > JAXRSClientFactoryBean(); > proxyFactory.setServiceClass(clazz); > address += servName; > proxyFactory.setAddress(address); > proxy = proxyFactory.create(); > ..... > > The "proxyFactory.create()" operation recall the "createWithValues" method > of JAXRSClientFactoryBean: > > public Client createWithValues(Object... varValues) { > ... > actualClient = > (Client)ProxyHelper.getProxy(Thread.currentThread().getContextClassLoader(), > new Class[]{cri.getServiceClass(), > Client.class, InvocationHandlerAware.class}, > proxyImpl); > ... > } > > Now I have the following anomalous behavior: > the "getProxy(...)" operation fails when the ws interface contains a method > that wants a "complex" input parameter like this: > > @GET > @Consumes({MediaType.APPLICATION_XML}) > @Path("/getJsonGenericCommandDescriptor/{genericCommand}") > public String getJsonGenericCommandDescriptor( > @WebParam(name = "genericCommand") > @PathParam("genericCommand") > GenCmdDescr genericCommand) throws InstantiationException; > > If the ws interface contains this method, an exception > "java.lang.NoClassDefFoundError: ___.GenCmdDescr" occurs loading the > endPoint. > If I remove this method from the ws interface the loading operation is right > and no exceptions occurs. > I do not understand why it happens. > In fact in the same ws interface I have another method that returns a > GenCmdDescr and no NoClassDefFoundError exception occurs with this. > The exception seems to occur only if the GenCmdDescr is used like an input > parameters of one of the methods and no excpetions occurs for method that > return an object GenCmdDescr. > Someone can help me? Do you use a concrete class to create a proxy ? Example, do you use say MyServiceImpl.class where MyServiceImpl is a root resource implementation ? I can only think at the moment of CGLIB getting confused (which is used to create a proxy when a concrete class like MyServiceImpl is proxified) Cheers, Sergey > Thanks a lot, > > Andrea > > > NOTE: > 1. > The GenCmdDescr object is an object like this: > > @XmlRootElement(name="GenCmdDescr", namespace="http://****/") > @XmlAccessorType(XmlAccessType.FIELD) > public class GenCmdDescr { > > @XmlAttribute private String name; > @XmlAttribute private int a; > @XmlAttribute private int b; > @XmlAttribute private int c; > @XmlAttribute private short d; > ... > } > > 2. > I'm using cxf 2.5.0 version > > > > -- > View this message in context: > http://cxf.547215.n5.nabble.com/java-lang-NoClassDefFoundError-exception-loading-a-rest-endPoint-in-particular-condition-tp5727361.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 If you reply to this email, your message will be added to the discussion below: http://cxf.547215.n5.nabble.com/java-lang-NoClassDefFoundError-exception-loading-a-rest-endPoint-in-particular-condition-tp5727361p5727365.html To unsubscribe from java.lang.NoClassDefFoundError exception loading a rest endPoint in particular condition, click here. NAML -- View this message in context: http://cxf.547215.n5.nabble.com/java-lang-NoClassDefFoundError-exception-loading-a-rest-endPoint-in-particular-condition-tp5727361p5727369.html Sent from the cxf-user mailing list archive at Nabble.com.
