jersey
  1. jersey
  2. JERSEY-1488

@Context and @PostConstruct makes the App not to be deployed

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Blocker Blocker
    • Resolution: Fixed
    • Affects Version/s: 2.0-m09
    • Fix Version/s: 2.0-m13, 2.0
    • Component/s: core
    • Labels:
      None

      Description

      Suppose an application

      public class AppConfig extends Application {
      
      	int value = 99;
      	
      	@Context
      	private UriInfo info;
      	private boolean isUriInfoInjectedBeforePostConstruct;
      	public boolean isUriInfoInjectedBeforePostConstruct() {
      		return isUriInfoInjectedBeforePostConstruct;
      	}
      
      	@PostConstruct
      	public void postConstruct() {
      		isUriInfoInjectedBeforePostConstruct = info != null; 
      	}	
      }
      

      Note that the Spec., sec. 9.2.5 Additional Requirements, says :

      Field and property injection of JAX-RS resources MUST be performed prior to the container invoking any @PostConstruct annotated method.

        Activity

        There are no comments yet on this issue.

          People

          • Assignee:
            Michal Gajdos
            Reporter:
            jan.supol
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Time Tracking

              Estimated:
              Original Estimate - 3 hours
              3h
              Remaining:
              Remaining Estimate - 0 minutes
              0m
              Logged:
              Time Spent - 2 hours Time Not Required
              2h