Search code examples
jsonjax-rswildfly-9

How do I get started with a RESTful login in wildfly 9?


I tried to do a simple login application here on github but when I try to see the json from the following url http://localhost:8080/loginpoc/loginp/status I get a not found page.

What am I doing wrong?


Solution

  • I didn't review you're entire project, but there are a few things wrong. Firstly you're using Jersey which is not used by WildFly. You also have a dependency on RESTEasy which is the JAX-RS implementation used in WildFly, but you shouldn't need a dependency on it. It's provided by the container.

    All of your dependencies should also be marked as <scope>provided</scope>.

    Also you need a @Path("/") on your Login.java.

    You're directory structure is also not a standard maven directory structure which is probably why your deployment does not fail as your WAR probably doesn't include any compiled Java classes. The src/java directory should be in src/main/java.

    Finally if this is more than just an exercise in playing with JAX-RS I'd suggest looking at something like Keycloak for authentication.