Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EclipseLink » REST Path("/") conflicts with app(Root REST path conflicts with app requirements)
REST Path("/") conflicts with app [message #1785265] Wed, 11 April 2018 17:49 Go to next message
Erik Sliman is currently offline Erik SlimanFriend
Messages: 2
Registered: April 2018
Junior Member
I use eclipselink to enable JSON marshalling with JAXB (org.eclipse.persistence.jaxb). I don't use for JPA or REST.

Deploying apps to Kubernetes (GKE) requires the root path to return HTTP 200 for a health check. I have basic code for that:

@GET
@Path("/")
public String checkHealth() {
return "OK";
}

However, at runtime, this conflicts with

public javax.ws.rs.core.Response org.eclipse.persistence.jpa.rs.resources.unversioned.PersistenceResource.getContexts(javax.ws.rs.core.HttpHeaders,javax.ws.rs.core.UriInfo)

which also declares:

@Path(value="/")

WildFly chooses this instead of the application's checkHealth(), resulting in an Internal Server Error, causing health check to fail, and application to complete deployment in Kubernetes.

I noticed this is deprecated but still in 2.7. It is not clear if its replacement would correct this issue, which uses this path:

@Path(value="/{version : v\\d\\.\\d|latest}/")

What is the easiest way to remedy this? Was it critical for eclipselink to use the root path?

If there was a separate JAXB library I'd just use that. Unfortunately, I'm getting JPA REST even though I have no interest in it.






Re: REST Path("/") conflicts with app [message #1785271 is a reply to message #1785265] Wed, 11 April 2018 20:02 Go to previous messageGo to next message
Lukas JungmannFriend
Messages: 30
Registered: November 2013
Location: Prague, Czech Republic
Member
You want 'MOXy' jar instead of 'eclipselink.jar'... for that look for org.eclipse.persistence:org.eclipse.persistence.moxy jar in Maven central, ie http://search.maven.org/remotecontent?filepath=org/eclipse/persistence/org.eclipse.persistence.moxy/2.7.1/org.eclipse.persistence.moxy-2.7.1.jar

thanks,
--lukas
Re: REST Path("/") conflicts with app [message #1785273 is a reply to message #1785271] Wed, 11 April 2018 20:33 Go to previous message
Erik Sliman is currently offline Erik SlimanFriend
Messages: 2
Registered: April 2018
Junior Member
Awesome! Thanks!
Previous Topic:java 10 with jpa eclipselink and tomcat 9
Next Topic:How to use EclipseLink to implement multi-tenancy
Goto Forum:
  


Current Time: Wed Sep 26 05:09:30 GMT 2018

Powered by FUDForum. Page generated in 0.02193 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top