In the Web project, write the main method and run OK.
Error after posting to Tomcat.
Javax.ws.rs.core.UriBuilder.uri (ljava/lang/string;) Ljavax/ws/rs/core/uribuilder
caused By:java.lang.AbstractMethodError:javax.ws.rs.core.UriBuilder.uri (ljava/lang/string;) ljavax/ws/rs/core/ UriBuilder;
At Javax.ws.rs.core.UriBuilder.fromUri (uribuilder.java:119)
At Org.glassfish.jersey.servlet.ServletContainer.service (servletcontainer.java:286)
At Org.glassfish.jersey.servlet.ServletContainer.service (servletcontainer.java:218)
After the toss, finally found that the original need to add a jaxrs dependency. Either the reference implementations provided in the GlassFish project, or Apache CXF should be available. Attach the MAVEN project dependency on the Jarxs reference implementation for the GlassFish project.
<dependency>
<groupId>org.glassfish.jersey.bundles</groupId>
<artifactId>jaxrs-ri</artifactId>
<version>2.4</version>
</dependency>
Note: Jaxrs = = Java API for RESTful Web Services
In the Tomcat Web container, call the jersey client side for error handling