jersey
  1. jersey
  2. JERSEY-1412

Invoceation.submit(Class) frozes when used with ClientRequestFilter

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Critical Critical
    • Resolution: Fixed
    • Affects Version/s: 2.0-m07
    • Fix Version/s: 2.0-m08, 2.0
    • Component/s: core
    • Labels:
      None

      Description

      The following code frozes on future.get()

             void main() {
      		Invocation.Builder builder = createInvocationBuilder();
      		Entity<String> entity = createEntity("submitClassTest");
      		Invocation invocation = builder.buildPost(entity);
      		Future<String> future = invocation.submit(String.class);
      		String response;
      		try {
      			response = future.get();
      		} catch (Exception e) {
      			throw new Fault(e);
      		}
             }
      
      	protected ClientRequestFilter createRequestFilter() {
      		ClientRequestFilter filter = new ClientRequestFilter() {
      			@Override
      			public void filter(ClientRequestContext ctx) throws IOException {
      				Response r = Response.ok("something").build();
      				ctx.abortWith(r);
      			}
      		};
      		return filter;
      	}
      
      	protected Invocation.Builder createInvocationBuilder(
      			ClientRequestFilter filter) {
      		Client client = ClientFactory.newClient();
      		client.configuration().register(filter);
      		WebTarget target = client.target("http://any.web:888");
      		Invocation.Builder builder = target.request();
      		return builder;
      	}
      
      	protected Invocation.Builder createInvocationBuilder() {
      		return createInvocationBuilder(createRequestFilter());
      	}
      
      	protected <T> Entity<T> createEntity(T t) {
      		return Entity.entity(t, MediaType.WILDCARD_TYPE);
      	}
      
      

        Activity

        There are no comments yet on this issue.

          People

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

            Dates

            • Created:
              Updated:
              Resolved:

              Time Tracking

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