Plugin Maven TomEE and javax.ws.rs.ext.Link

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Plugin Maven TomEE and javax.ws.rs.ext.Link

CarlotaVina
Hello,

I have a resource JAX-RS and I work with plugin TomEE Maven. My application
starts right when I start server TomEE.

My problem is when I use the class  javax.ws.rs.core.Link


Link self = Link.fromUri(uriInfo.getBaseUriBuilder()
                                .path(getClass())
                                .path(getClass(), "getBookByIsbn")
                                .build(book.get().getId()))
                                .rel("self")
                                .type("GET")
                                .build();


When I check with POSTMAN
http://localhost:8080/rest-server/api/books/2526987585               

In the server I get the message

Caused by: java.lang.NoSuchMethodError:
javax.ws.rs.ext.RuntimeDelegate.createLinkBuilder()Ljavax/ws/rs/core/Link$Builder;
        at javax.ws.rs.core.Link.fromUri(Link.java:198)


How do I have to configure dependencies to use TomEE and JAX-RS?




--
Sent from: http://tomee-openejb.979440.n4.nabble.com/TomEE-Users-f979441.html
Reply | Threaded
Open this post in threaded view
|

Re: Plugin Maven TomEE and javax.ws.rs.ext.Link

Cesar Hernandez
Hi Carlota,

Please take a look at the REST section in the examples website:
http://tomee.apache.org/tomee-8.0/examples/
You can also check out and test directly the examples described above right
from the git repository:
https://github.com/apache/tomee/tree/master/examples

For adding dependencies for TomEE maven plugin, you can use <libs> section
property:
http://tomee.apache.org/tomee-maven-plugin.html


El dom., 16 jun. 2019 a las 1:40, CarlotaVina (<[hidden email]>)
escribió:

> Hello,
>
> I have a resource JAX-RS and I work with plugin TomEE Maven. My application
> starts right when I start server TomEE.
>
> My problem is when I use the class  javax.ws.rs.core.Link
>
>
> Link self = Link.fromUri(uriInfo.getBaseUriBuilder()
>                                 .path(getClass())
>                                 .path(getClass(), "getBookByIsbn")
>                                 .build(book.get().getId()))
>                                 .rel("self")
>                                 .type("GET")
>                                 .build();
>
>
> When I check with POSTMAN
> http://localhost:8080/rest-server/api/books/2526987585
>
> In the server I get the message
>
> Caused by: java.lang.NoSuchMethodError:
>
> javax.ws.rs.ext.RuntimeDelegate.createLinkBuilder()Ljavax/ws/rs/core/Link$Builder;
>         at javax.ws.rs.core.Link.fromUri(Link.java:198)
>
>
> How do I have to configure dependencies to use TomEE and JAX-RS?
>
>
>
>
> --
> Sent from:
> http://tomee-openejb.979440.n4.nabble.com/TomEE-Users-f979441.html
>


--
Atentamente:
César Hernández.