1

I created a simple entity and then used NetBeans "create rest services from entity" wizard to generate the rest resource. All good so far. It gives a @Path of the entity package to the resource as follows:

@Stateless
@Path("org.hellorest.entity.project")
public class ProjectFacadeREST extends AbstractFacade<Project> {
    @PersistenceContext(unitName = "HelloRestPersistanceUnit")
    private EntityManager em;
...
...
}

I am able to hit the end point at localhost:8081/HelloRest/resources/org.hellorest.entity.project/133

I changed the @Path to @Path("project"). I am not able to hit the end points at this path. The old longer path still works. What am I missing?

palacsint
  • 28,416
  • 10
  • 82
  • 109
U-L
  • 2,671
  • 8
  • 35
  • 50

1 Answers1

0

Looks like the old class is still loaded by the server.

If this happens you should Clean & Build your NetBeans project. This should undeploy the application. Run the project to redeploy the application.

If it still doesn't work a restart of the server before redeploying may help.

There is an option in the NetBeans project properties in the Run tab named Deploy on Save. If this is enabled (it is by default), changed classes should be recompiled and redeployed automatically, but sometimes this doesn't work because GlassFish hasn't properly unloaded the class.

See also:

Community
  • 1
  • 1
unwichtich
  • 13,712
  • 4
  • 53
  • 66