This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 246151 - Project's RESTful Web Services Node should support SEI
Summary: Project's RESTful Web Services Node should support SEI
Status: RESOLVED WONTFIX
Alias: None
Product: webservices
Classification: Unclassified
Component: REST (show other bugs)
Version: 8.0
Hardware: PC Linux
: P3 normal (vote)
Assignee: Milan Kuchtiak
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-07-30 22:53 UTC by kospiotr
Modified: 2016-07-07 09:54 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description kospiotr 2014-07-30 22:53:48 UTC
When using Jax-RS in a web project, Netbeans discovers services and methods that are annotated. This allows to browse HTTP MEthods and Subresource Locators in the RESTful Web Services section which is great as I can next open and test them.

In a project I usually create Service Interface in order to share interface between REST client and server. For Example:

@Path("customer")
public interface CustomerRestServiceInterface {

	@DELETE
	@Path("{id}")
	public void remove(@PathParam("id") Long id);

	@GET
	@Path("{id}")
	@Produces({"application/xml", "application/json"})
	public Customer find(@PathParam("id") Long id);

	@GET
	@Produces({"application/xml", "application/json"})
	public List<Customer> findAll();

}

And then I implement Service Bean on the server side:

@Stateless
public class CustomerRestServiceBean implements CustomerRestServiceInterface {

	@Inject
	private CustomerDao dao;

	@Override
	public void remove(Long id) {
		dao.remove(dao.find(id));
	}

	@Override
	public Customer find(Long id) {
		return dao.find(id);
	}

	@Override
	public List<Customer> findAll() {
		return dao.findAll();
	}

}


Then unfortunately in the RESTful Web Services browser I don't see any node for implemented `customer` web service.
Properly it should display a real resource hierarchy that is hosted:

+RESTful Web Services
    |
    +CustomerRestServiceBean [customer]
        |
        + HTTP Methods
        |  |
        |  + remove(): void
        |  + find(): Customer
        |  + findAll(): List<Customer>
        |
        + Subresource Locators
Comment 1 Milan Kuchtiak 2014-08-01 09:49:45 UTC
That's interresting. In fact, such a construction is possible.
Comment 2 Milan Kuchtiak 2014-08-04 12:18:50 UTC
The JAX-RS 2.0 specification says (3.6):
===============================================
JAX-RS annotations may be used on the methods and method parameters of a super-class or an implemented interface. Such annotations are inherited by a corresponding sub-class or implementation class method provided that the method and its parameters do not have any JAX-RS annotations of their own. Annotations on a super-class take precedence over those on an implemented interface. The precedence over conflicting annotations defined in multiple implemented interfaces is implementation specific. Note that inheritance of class or interface annotations is not supported.

If a subclass or implementation method has any JAX-RS annotations then all of the annotations on the superclass or interface method are ignored. 
==============================================

The JAX-RS implementation should guarantee the method annotation inheritence, but not the class annotation inheritence, so the @Path annotation, from the example, applied onto the interface, isn't guaranteed to work :

@Path("customer")
public interface CustomerRestServiceInterface

Anyway, Netbeans should support the specification (method annotations inheritence).
Comment 3 Martin Balin 2016-07-07 09:54:21 UTC
This old bug may not be relevant anymore. If you can still reproduce it in 8.2 development builds please reopen this issue.

Thanks for your cooperation,
NetBeans IDE 8.2 Release Boss