On Thursday, May 26, 2011, Zhemzhitsky Sergey <sergey_zhemzhit...@troika.ru> wrote: > Is it possible to instantiate a jdk proxy based on the interface of the > service? If so, the code would be cleaner because there will no dummy service > implementations? >
Yep that would be lovely. Also the cxf rs docu should be updated with a clear highlight of the fact if end user is still using a class its just a facade. > > Best Regards, > Sergey Zhemzhitsky > > > -----Original Message----- > From: Willem Jiang [mailto:willem.ji...@gmail.com] > Sent: Thursday, May 26, 2011 12:08 PM > To: users@camel.apache.org > Subject: Re: Camel CXF RS Consumer. Why serviceClass is required? > > As the CXF RS need to instantiate the resource class to navigate the > resource. That is why we need the serviceClass to be class instead of > interface. > > On 5/26/11 3:37 PM, Zhemzhitsky Sergey wrote: >> Hi Willem, Ben >> >> Thanks for the information. >> I tried to use the interface instead of class in the serviceClass attribute >> and I didn't succeed because of an exception that told that the class is >> required. >> Here is the exception: >> >> Caused by: java.lang.RuntimeException: Resource class interface >> org.test.MyService has no valid constructor >> at >> org.apache.cxf.jaxrs.lifecycle.PerRequestResourceProvider.<init>(PerRequestResourceProvider.java:45) >> at >> org.apache.cxf.jaxrs.JAXRSServerFactoryBean.updateClassResourceProviders(JAXRSServerFactoryBean.java:338) >> at >> org.apache.cxf.jaxrs.JAXRSServerFactoryBean.create(JAXRSServerFactoryBean.java:119) >> ... 26 more >> >> I think that using an interface would be better in that case so I have >> reported the issue: https://issues.apache.org/jira/browse/CAMEL-4014 >> >> >> Best Regards, >> Sergey Zhemzhitsky >> >> >> -----Original Message----- >> From: Willem Jiang [mailto:willem.ji...@gmail.com] >> Sent: Thursday, May 26, 2011 7:46 AM >> To: users@camel.apache.org >> Subject: Re: Camel CXF RS Consumer. Why serviceClass is required? >> >> Hi Ben, >> >> You are right, the serviceClass is just used to build up the JAXRS service >> module. And Camel CXF RS Consumer doesn't all serviceClass instance at the >> end, it just route the request to the camel route. >> >> On 5/25/11 11:31 PM, boday wrote: >>> Sergey, I've wondered this myself. The serviceClass appears to just >>> be used to configure the endpoint based on class/method level >>> annotations...nothing more. I'll look into it...or perhaps one of >>> the more CXF savvy users can comment of this... >>> >>> >>> Sergey_Zhemzhitsky wrote: >>>> >>>> I'm wondering why we have to specify the serviceClass attribute and >>>> why this attribute should point at the real class. I'm asking >>>> because the response of such a service will always be "Hello >>>> World!!!" and implementation of MyService.add method does not matter in >>>> that case. >>>> >>>> Best Regards, >>>> Sergey Zhemzhitsky >>>> >>> >>> >>> ----- >>> Ben O'Day >>> IT Consultant -http://benoday.blogspot.com >>> >>> -- >>> View this message in context: >>> http://camel.465427.n5.nabble.com/Camel-CXF-RS-Consumer-Why-serviceCl >>> a ss-is-required-tp4424498p4425664.html >>> Sent from the Camel - Users mailing list archive at Nabble.com. >> >> >> -- >> Willem >> ---------------------------------- >> FuseSource >> Web: http://www.fusesource.com >> Blog: http://willemjiang.blogspot.com (English) >> http://jnn.javaeye.com (Chinese) >> Twitter: willemjiang >> >> Connect at CamelOne May 24-26 >> The Open Source Integration Conference http://camelone.com >> >> _______________________________________________________ >> >> The information contained in this message may be privileged and conf >> idential and protected from disclosure. If you are not the original intended >> recipient, you are hereby notified that any review, retransmission, >> dissemination, or other use of, or taking of any action in reliance upon, >> this information is prohibited. If you have received this communication in >> error, please notify the sender immediately by replying to this message and >> delete it from your computer. Thank you for your cooperation. Troika Dialog, >> Russia. >> If you need assistance please contact our Contact Center (+7495) 258 >> 0500 or go to www.troika.ru/eng/Contacts/system.wbp >> >> >> > > > -- > Willem > ---------------------------------- > FuseSource > Web: http://www.fusesource.com > Blog: http://willemjiang.blogspot.com (English) > http://jnn.javaeye.com (Chinese) > Twitter: willemjiang > > Connect at CamelOne May 24-26 > The Open Source Integration Conference > http://camelone.com > > _______________________________________________________ > > The information contained in this message may be privileged and conf idential > and protected from disclosure. If you are not the original intended > recipient, you are hereby notified that any review, retransmission, > dissemination, or other use of, or taking of any action in reliance upon, > this information is prohibited. If you have received this communication in > error, please notify the sender immediately by replying to this message and > delete it from your computer. Thank you for your cooperation. Troika Dialog, > Russia. > If you need assistance please contact our Contact Center (+7495) 258 0500 or > go to www.troika.ru/eng/Contacts/system.wbp > > > -- Claus Ibsen ----------------- FuseSource Email: cib...@fusesource.com Web: http://fusesource.com CamelOne 2011: http://fusesource.com/camelone2011/ Twitter: davsclaus, fusenews Blog: http://davsclaus.blogspot.com/ Author of Camel in Action: http://www.manning.com/ibsen/