You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomee.apache.org by dsmalley <sm...@gmail.com> on 2015/05/23 20:16:51 UTC

CXF endpoints mapped on 1.7.1, not on 1.7.2

Hi,

I have a simple test JAX-RS application which creates an application and a
service with one endpoint. My javax.ws.rs.core.Application derived class is
empty and has an @ApplicationPath("api") annotation defined, and my service
class has a public method with the @GET and @Path annotations.

I am using the tomee maven plugin, and when specifying the version as 1.7.1,
the application and service deploy and the endpoint gets mapped. When I try
and use the new 1.7.2 version, I get no errors and the usual tomee startup
messages are there, but not the CXF ones registering the application and
endpoint, and the server returns 404.

Did something change in the requirements for "auto-magical" deployment of
JAX-RS? My web.xml is empty except for a data-source element. I remember a
long time ago I used to explicitly register the app and service class(es)
with the non-spring CXF servlet, but stopped when I discovered the
simplicity of just using annotations.

To re-iterate, the exact same war deploys as expected on 1.7.1, but not
1.7.2.

Dave





--
View this message in context: http://tomee-openejb.979440.n4.nabble.com/CXF-endpoints-mapped-on-1-7-1-not-on-1-7-2-tp4675020.html
Sent from the TomEE Users mailing list archive at Nabble.com.

Re: CXF endpoints mapped on 1.7.1, not on 1.7.2

Posted by dsmalley <sm...@gmail.com>.
Ah well, it turns out the problem was I had @Path annotations on the methods
of my service class, but not the class itself. In 1.7.1, the scanner found
them and inferred the class was a service class. It would appear now it
requires a @Path annotation on the class itself to consider its methods
eligible for mapping. For all I know this is what the spec requires.

Anyway, if, as in my case, there is no "common" path segment meant to be
shared by all endpoints (say, "user" and "users" endpoints), the class
annotation can be @Path(""). All is working now, and the 1.7.2 maven plugin
no longer hangs when I run the tomee:stop goal. All is well with the world.

Dave




--
View this message in context: http://tomee-openejb.979440.n4.nabble.com/CXF-endpoints-mapped-on-1-7-1-not-on-1-7-2-tp4675020p4675022.html
Sent from the TomEE Users mailing list archive at Nabble.com.

Re: CXF endpoints mapped on 1.7.1, not on 1.7.2

Posted by Romain Manni-Bucau <rm...@gmail.com>.
Hi

add a @Path at class level (by spec). We deactivated by default to avoid
very impacting side effects + to be aligned on spec


Romain Manni-Bucau
@rmannibucau <https://twitter.com/rmannibucau> |  Blog
<http://rmannibucau.wordpress.com> | Github <https://github.com/rmannibucau> |
LinkedIn <https://www.linkedin.com/in/rmannibucau> | Tomitriber
<http://www.tomitribe.com>

2015-05-23 20:16 GMT+02:00 dsmalley <sm...@gmail.com>:

> Hi,
>
> I have a simple test JAX-RS application which creates an application and a
> service with one endpoint. My javax.ws.rs.core.Application derived class is
> empty and has an @ApplicationPath("api") annotation defined, and my service
> class has a public method with the @GET and @Path annotations.
>
> I am using the tomee maven plugin, and when specifying the version as
> 1.7.1,
> the application and service deploy and the endpoint gets mapped. When I try
> and use the new 1.7.2 version, I get no errors and the usual tomee startup
> messages are there, but not the CXF ones registering the application and
> endpoint, and the server returns 404.
>
> Did something change in the requirements for "auto-magical" deployment of
> JAX-RS? My web.xml is empty except for a data-source element. I remember a
> long time ago I used to explicitly register the app and service class(es)
> with the non-spring CXF servlet, but stopped when I discovered the
> simplicity of just using annotations.
>
> To re-iterate, the exact same war deploys as expected on 1.7.1, but not
> 1.7.2.
>
> Dave
>
>
>
>
>
> --
> View this message in context:
> http://tomee-openejb.979440.n4.nabble.com/CXF-endpoints-mapped-on-1-7-1-not-on-1-7-2-tp4675020.html
> Sent from the TomEE Users mailing list archive at Nabble.com.
>