You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by Steve Cohen <st...@comcast.net> on 2011/09/14 21:22:28 UTC

Are there any GOOD tutorials on creating REST services in CXF?

I've wasted half a day trying to implement the article

"Creating a REST service with CXF and Spring in 10 minutes" 
(http://www.insaneprogramming.be/?p=140)

Why is this article recommended on 
http://cxf.apache.org/resources-and-articles.html?

There are so many unexplained things in this article, dependencies on 
pre-existing system configurations that are not explained.  Dependencies 
on the tomcat-maven-plugin which seems to be in a state of flux.

Can anyone recommend anything better?  Hell, I'll even buy a book if 
there's one available.





Re: Are there any GOOD tutorials on creating REST services in CXF?

Posted by Steve Cohen <sc...@javactivity.org>.
On 09/14/2011 02:33 PM, Jeff Wang wrote:
> Perhaps, instead of using the maven tomcat plugin, you can ignore
> that.  Just set the package type in maven to WAR, and then do a "mvn
> package".  then copy the resulting war file from your<project
> root>/target directory to your<tomcat root>/webapp directory.  and
> then manually start tomcat.
>
> That plugin shouldn't be a big blocker to the examples I think he
> wrote it there to make the entire thing as compact as possible.  I've
> found the example to be relatively helpful.  Is there anything you
> specifically need help with?
>
> Jeff

Thanks, Jeff.
Well, I've solved the main blocker which was caused by a bug in the 
latest release of m2e.  Somehow, before, my classpath had gotten mangled 
because the archetype did not come up correctly.  Now I have an 
application that loads successfully.

However, still no joy.  I would assume that if I'm not using the tomcat 
plugin, I would access the web service at
http://localhost:8080/cxf/rest/time or
http://localhost:8080//cxf/rest/time as mentioned in the comments,
(instead of port 9999)
but neither works.




>
> On Wed, Sep 14, 2011 at 12:22 PM, Steve Cohen<st...@comcast.net>  wrote:
>>
>> I've wasted half a day trying to implement the article
>>
>> "Creating a REST service with CXF and Spring in 10 minutes"
>> (http://www.insaneprogramming.be/?p=140)
>>
>> Why is this article recommended on
>> http://cxf.apache.org/resources-and-articles.html?
>>
>> There are so many unexplained things in this article, dependencies on
>> pre-existing system configurations that are not explained.  Dependencies on
>> the tomcat-maven-plugin which seems to be in a state of flux.
>>
>> Can anyone recommend anything better?  Hell, I'll even buy a book if there's
>> one available.
>>
>>
>>
>>
>>
>
>

Re: Are there any GOOD tutorials on creating REST services in CXF?

Posted by Jeff Wang <je...@plutom.com>.
Perhaps, instead of using the maven tomcat plugin, you can ignore
that.  Just set the package type in maven to WAR, and then do a "mvn
package".  then copy the resulting war file from your <project
root>/target directory to your <tomcat root>/webapp directory.  and
then manually start tomcat.

That plugin shouldn't be a big blocker to the examples I think he
wrote it there to make the entire thing as compact as possible.  I've
found the example to be relatively helpful.  Is there anything you
specifically need help with?

Jeff

On Wed, Sep 14, 2011 at 12:22 PM, Steve Cohen <st...@comcast.net> wrote:
>
> I've wasted half a day trying to implement the article
>
> "Creating a REST service with CXF and Spring in 10 minutes"
> (http://www.insaneprogramming.be/?p=140)
>
> Why is this article recommended on
> http://cxf.apache.org/resources-and-articles.html?
>
> There are so many unexplained things in this article, dependencies on
> pre-existing system configurations that are not explained.  Dependencies on
> the tomcat-maven-plugin which seems to be in a state of flux.
>
> Can anyone recommend anything better?  Hell, I'll even buy a book if there's
> one available.
>
>
>
>
>

Re: Are there any GOOD tutorials on creating REST services in CXF?

Posted by Eric Johnson <em...@fusesource.com>.
You could try http://fusesource.com/docs/framework/2.4/rest/index.html

On Wed, Sep 14, 2011 at 3:22 PM, Steve Cohen <st...@comcast.net> wrote:
>
> I've wasted half a day trying to implement the article
>
> "Creating a REST service with CXF and Spring in 10 minutes"
> (http://www.insaneprogramming.be/?p=140)
>
> Why is this article recommended on
> http://cxf.apache.org/resources-and-articles.html?
>
> There are so many unexplained things in this article, dependencies on
> pre-existing system configurations that are not explained.  Dependencies on
> the tomcat-maven-plugin which seems to be in a state of flux.
>
> Can anyone recommend anything better?  Hell, I'll even buy a book if there's
> one available.
>
>
>
>
>



-- 
Principle Technical Writer
FuseSource
Phone: (781) 280-4174
E-Mail: emjohnson@fusesource.com
Blog: http://documentingit.blogspot.com/
Twitter: finnmccumial

Re: Are there any GOOD tutorials on creating REST services in CXF?

Posted by Daniel Kulp <dk...@apache.org>.
As Glen just mentioned, the examples package for Talend Service Factory:

http://www.talend.com/download.php#SF
open the "Documentation and Examples tab.

has 8 jaxrs examples that Sergey and Glen wrote that can walk you through 
starting from a very basic introduction to get you started to more advanced 
topics like combinations with JAX-WS,   JAX-RS with JMS, using the 
transformation feature to modify the payloads, authorization, attachments, 
etc....  Most are setup for both war or OSGi deployments.  Lots of very good 
things in there, just wish I had a nice web page instead of a zip to point you 
at.   :-(    

Dan


On Wednesday, September 14, 2011 2:22:28 PM Steve Cohen wrote:
> I've wasted half a day trying to implement the article
> 
> "Creating a REST service with CXF and Spring in 10 minutes"
> (http://www.insaneprogramming.be/?p=140)
> 
> Why is this article recommended on
> http://cxf.apache.org/resources-and-articles.html?
> 
> There are so many unexplained things in this article, dependencies on
> pre-existing system configurations that are not explained.  Dependencies
> on the tomcat-maven-plugin which seems to be in a state of flux.
> 
> Can anyone recommend anything better?  Hell, I'll even buy a book if
> there's one available.
-- 
Daniel Kulp
dkulp@apache.org
http://dankulp.com/blog
Talend - http://www.talend.com

Re: Are there any GOOD tutorials on creating REST services in CXF?

Posted by Sergey Beryozkin <sb...@gmail.com>.
Hi

On 14/09/11 20:22, Steve Cohen wrote:
>
> I've wasted half a day trying to implement the article
>
> "Creating a REST service with CXF and Spring in 10 minutes"
> (http://www.insaneprogramming.be/?p=140)
>
> Why is this article recommended on
> http://cxf.apache.org/resources-and-articles.html?
>
> There are so many unexplained things in this article, dependencies on
> pre-existing system configurations that are not explained. Dependencies
> on the tomcat-maven-plugin which seems to be in a state of flux.
>
I guess we added a link awhile back without validating the quality of 
the source. Have a look please at a Glen's presentation:
http://www.jroller.com/gmazza/entry/video_tsf_jaxrs_advanced_example

Consider downloading a TSF distro which has some good quality examples:
http://www.talend.com/download_form.php?cont=sfact&src=ResourcePage

> Can anyone recommend anything better? Hell, I'll even buy a book if
> there's one available.
>
Right, may be we should revisit the idea of getting the book out :-)

Cheers, Sergey

Re: Are there any GOOD tutorials on creating REST services in CXF?

Posted by Steve Cohen <sc...@javactivity.org>.
On 09/14/2011 04:56 PM, Glen Mazza wrote:
> I think one of your headaches may be in using Eclipse to do your builds
> -- I would recommend opening up a command-line prompt and doing your
> Maven commands (mvn clean install, mvn tomcat:deploy, etc.) from that
> and use Eclipse purely as a code editor.
>
Actually, the plugin works rather nicely within eclipse once I figured 
out how to use it.  (basically, Run-As->maven build-> tomcat:run) with 
the embedded tomcat, don't mess with the Eclipse Server stuff, although 
I suppose that might work too.

It could use a bit of documentation upgrade, but otherwise a cool thing.

Re: Are there any GOOD tutorials on creating REST services in CXF?

Posted by Steve Cohen <sc...@javactivity.org>.
On 09/14/2011 04:56 PM, Glen Mazza wrote:
> I think one of your headaches may be in using Eclipse to do your builds
> -- I would recommend opening up a command-line prompt and doing your
> Maven commands (mvn clean install, mvn tomcat:deploy, etc.) from that
> and use Eclipse purely as a code editor.
>
> I'm not aware of the Tomcat Maven Plugin downloading a copy of Apache
> Tomcat (it might, but news to me...). I don't know what the Eclipse IDE
> would do. Perhaps we're talking two different plugins -- I'm referring
> to this: http://tomcat.apache.org/maven-plugin.html, not any plugin
> offered by Eclipse.
>
> HTH,
> Glen
>
> On 09/14/2011 05:37 PM, Steve Cohen wrote:
>> Thanks. There's SO much bad information on the Web.
>> Including Tomcat's own site:
>> http://tomcat.apache.org/tomcat-6.0-doc/manager-howto.html#Configuring_Manager_Application_Access
>>
>> which gives the 7.0 role names on the 6.0 page.
>>
>> However, using the 6.0 names doesn't help either. Still won't let me
>> in. Does the tomcat maven plugin have to use the same version of
>> tomcat as my server? The plugin pulled down 6.0.29. My server is 6.0.20.
>>
>>
>> On 09/14/2011 03:02 PM, Glen Mazza wrote:
>>> There's several REST examples in the free and open source Talend Service
>>> Factory (thin wrapper over CXF) -- the advanced REST example I did a
>>> video over:
>>> http://www.jroller.com/gmazza/entry/video_tsf_jaxrs_advanced_example.
>>> Although I have the example deploy to an OSGi container, the READMEs for
>>> those examples show how to use Tomcat deployment instead.
>>>
>>> The Tomcat-Maven-Plugin works fine, for both Tomcat 6 and 7, here's some
>>> config info for it:
>>> http://www.jroller.com/gmazza/entry/web_service_tutorial#maventomcat
>>>
>>> As for a book, Bill Burke's RESTful Java book I learned a lot from:
>>> http://www.jroller.com/gmazza/entry/book_review_restful_java_with
>>>
>>> Glen
>>>
>>> On 09/14/2011 03:22 PM, Steve Cohen wrote:
>>>>
>>>> I've wasted half a day trying to implement the article
>>>>
>>>> "Creating a REST service with CXF and Spring in 10 minutes"
>>>> (http://www.insaneprogramming.be/?p=140)
>>>>
>>>> Why is this article recommended on
>>>> http://cxf.apache.org/resources-and-articles.html?
>>>>
>>>> There are so many unexplained things in this article, dependencies on
>>>> pre-existing system configurations that are not explained.
>>>> Dependencies on the tomcat-maven-plugin which seems to be in a state
>>>> of flux.
>>>>
>>>> Can anyone recommend anything better? Hell, I'll even buy a book if
>>>> there's one available.
>>>>
>>>>
>>>>
>>>>
>>>
>>>
>>
>
>
Yes. that's the plugin, but I was using an earlier version of it as 
recommended in the article.  However, delving into the links from the 
site, I find them talking about the "embedded tomcat" for some of the 
goals but not others.  Very confusing ... and the article did not say 
which goal to invoke.

But, after reading this, I find that mvn tomcat:run from the project 
directory and the damned thing works!

The tomcat plugin could use some better docs, I think.  I'm not sure 
when the plugin invokes an embedded tomcat and when it deploys to a 
"real" installation.

I've also begun looking at your Talend Service Factory stuff.

Thanks for your help.

Re: Are there any GOOD tutorials on creating REST services in CXF?

Posted by Glen Mazza <gl...@gmail.com>.
I think one of your headaches may be in using Eclipse to do your builds 
-- I would recommend opening up a command-line prompt and doing your 
Maven commands (mvn clean install, mvn tomcat:deploy, etc.) from that 
and use Eclipse purely as a code editor.

I'm not aware of the Tomcat Maven Plugin downloading a copy of Apache 
Tomcat (it might, but news to me...).  I don't know what the Eclipse IDE 
would do.  Perhaps we're talking two different plugins -- I'm referring 
to this:  http://tomcat.apache.org/maven-plugin.html, not any plugin 
offered by Eclipse.

HTH,
Glen

On 09/14/2011 05:37 PM, Steve Cohen wrote:
> Thanks.  There's SO much bad information on the Web.
> Including Tomcat's own site:
> http://tomcat.apache.org/tomcat-6.0-doc/manager-howto.html#Configuring_Manager_Application_Access 
>
> which gives the 7.0 role names on the 6.0 page.
>
> However, using the 6.0 names doesn't help either.  Still won't let me 
> in.  Does the tomcat maven plugin have to use the same version of 
> tomcat as my server?  The plugin pulled down 6.0.29.  My server is 
> 6.0.20.
>
>
> On 09/14/2011 03:02 PM, Glen Mazza wrote:
>> There's several REST examples in the free and open source Talend Service
>> Factory (thin wrapper over CXF) -- the advanced REST example I did a
>> video over:
>> http://www.jroller.com/gmazza/entry/video_tsf_jaxrs_advanced_example.
>> Although I have the example deploy to an OSGi container, the READMEs for
>> those examples show how to use Tomcat deployment instead.
>>
>> The Tomcat-Maven-Plugin works fine, for both Tomcat 6 and 7, here's some
>> config info for it:
>> http://www.jroller.com/gmazza/entry/web_service_tutorial#maventomcat
>>
>> As for a book, Bill Burke's RESTful Java book I learned a lot from:
>> http://www.jroller.com/gmazza/entry/book_review_restful_java_with
>>
>> Glen
>>
>> On 09/14/2011 03:22 PM, Steve Cohen wrote:
>>>
>>> I've wasted half a day trying to implement the article
>>>
>>> "Creating a REST service with CXF and Spring in 10 minutes"
>>> (http://www.insaneprogramming.be/?p=140)
>>>
>>> Why is this article recommended on
>>> http://cxf.apache.org/resources-and-articles.html?
>>>
>>> There are so many unexplained things in this article, dependencies on
>>> pre-existing system configurations that are not explained.
>>> Dependencies on the tomcat-maven-plugin which seems to be in a state
>>> of flux.
>>>
>>> Can anyone recommend anything better? Hell, I'll even buy a book if
>>> there's one available.
>>>
>>>
>>>
>>>
>>
>>
>


-- 
Glen Mazza
Talend - http://www.talend.com/ai
Blog - http://www.jroller.com/gmazza
Twitter - glenmazza


Re: Are there any GOOD tutorials on creating REST services in CXF?

Posted by Steve Cohen <sc...@javactivity.org>.
Thanks.  There's SO much bad information on the Web.
Including Tomcat's own site:
http://tomcat.apache.org/tomcat-6.0-doc/manager-howto.html#Configuring_Manager_Application_Access
which gives the 7.0 role names on the 6.0 page.

However, using the 6.0 names doesn't help either.  Still won't let me 
in.  Does the tomcat maven plugin have to use the same version of tomcat 
as my server?  The plugin pulled down 6.0.29.  My server is 6.0.20.


On 09/14/2011 03:02 PM, Glen Mazza wrote:
> There's several REST examples in the free and open source Talend Service
> Factory (thin wrapper over CXF) -- the advanced REST example I did a
> video over:
> http://www.jroller.com/gmazza/entry/video_tsf_jaxrs_advanced_example.
> Although I have the example deploy to an OSGi container, the READMEs for
> those examples show how to use Tomcat deployment instead.
>
> The Tomcat-Maven-Plugin works fine, for both Tomcat 6 and 7, here's some
> config info for it:
> http://www.jroller.com/gmazza/entry/web_service_tutorial#maventomcat
>
> As for a book, Bill Burke's RESTful Java book I learned a lot from:
> http://www.jroller.com/gmazza/entry/book_review_restful_java_with
>
> Glen
>
> On 09/14/2011 03:22 PM, Steve Cohen wrote:
>>
>> I've wasted half a day trying to implement the article
>>
>> "Creating a REST service with CXF and Spring in 10 minutes"
>> (http://www.insaneprogramming.be/?p=140)
>>
>> Why is this article recommended on
>> http://cxf.apache.org/resources-and-articles.html?
>>
>> There are so many unexplained things in this article, dependencies on
>> pre-existing system configurations that are not explained.
>> Dependencies on the tomcat-maven-plugin which seems to be in a state
>> of flux.
>>
>> Can anyone recommend anything better? Hell, I'll even buy a book if
>> there's one available.
>>
>>
>>
>>
>
>


Re: Are there any GOOD tutorials on creating REST services in CXF?

Posted by Glen Mazza <gl...@gmail.com>.
There's several REST examples in the free and open source Talend Service 
Factory (thin wrapper over CXF) -- the advanced REST example I did a 
video over: 
http://www.jroller.com/gmazza/entry/video_tsf_jaxrs_advanced_example.  
Although I have the example deploy to an OSGi container, the READMEs for 
those examples show how to use Tomcat deployment instead.

The Tomcat-Maven-Plugin works fine, for both Tomcat 6 and 7, here's some 
config info for it:
http://www.jroller.com/gmazza/entry/web_service_tutorial#maventomcat

As for a book, Bill Burke's RESTful Java book I learned a lot from:
http://www.jroller.com/gmazza/entry/book_review_restful_java_with

Glen

On 09/14/2011 03:22 PM, Steve Cohen wrote:
>
> I've wasted half a day trying to implement the article
>
> "Creating a REST service with CXF and Spring in 10 minutes" 
> (http://www.insaneprogramming.be/?p=140)
>
> Why is this article recommended on 
> http://cxf.apache.org/resources-and-articles.html?
>
> There are so many unexplained things in this article, dependencies on 
> pre-existing system configurations that are not explained.  
> Dependencies on the tomcat-maven-plugin which seems to be in a state 
> of flux.
>
> Can anyone recommend anything better?  Hell, I'll even buy a book if 
> there's one available.
>
>
>
>


-- 
Glen Mazza
Talend - http://www.talend.com/ai
Blog - http://www.jroller.com/gmazza
Twitter - glenmazza