jakartaee / jakartaee/rest

Specification does not fully address resource class visibility in section 2.3.2

Open
#283 5 comments 0 reactions 1 assignee View on GitHub

@glassfishrobot is already working on this.

Since Feb 10, 2018.

Component: spec
Dominant language
Java
Stars
400
Forks
143
PR merge metrics
No merged PRs in 30d

Description

Section 2.3.2 of the specification reads (in part):

> A JAX-RS application is packaged as a Web application in a .war file. The application classes are packaged in WEB-INF/classes or WEB-INF/lib and required libraries are packaged in WEB-INF/lib. See the Servlet specification for full details on packaging of web applications.

Then:

> In either of the latter two cases, if both Application.getClasses and Application.getSingletons return an empty list then all root resource classes and providers packaged in the web application MUST be included in the published JAX-RS application. If either getClasses or getSingletons return a non-empty list then only those classes or singletons returned MUST be included in the published JAX-RS application.

Both cases assume that the JAX-RS application will be (can _only_ be) assembled as a web application. But what about an enterprise application? Does the requirement that resource classes be packaged in .jar files in the lib directory of a .war file still hold? The second paragraph cited above, in particular, mixes strict packaging requirements ("all root resource classes and providers packaged in the web application") with visibility concerns (the second sentence makes no mention of where the "classes or singletons returned" may live, and therefore as long as they're visible everything should work).

Working from an old email from Paul Sandoz, I suspect that what was intended throughout the specification was a clarification of class _visibility_, not class _location_. I would appreciate it if the specification could be amended to state what is and isn't legal in an .ear packaging scenario as well as a .war scenario.

The forum discussion is here: [http://java.net/projects/javaee-spec/lists/users/archive/2012-10/message/27](http://java.net/projects/javaee-spec/lists/users/archive/2012-10/message/27)
#### Affected Versions
[2.0]

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.