[JERSEY-1746] Jersey code (providers, runtime) does not throw proper WAE sublcasses as required by the spec. Created: 22/Feb/13  Updated: 26/Feb/13  Resolved: 22/Feb/13

Status: Resolved
Project: jersey
Component/s: None
Affects Version/s: None
Fix Version/s: 2.0-m13, 2.0

Type: Bug Priority: Blocker
Reporter: Marek Potociar Assignee: Marek Potociar
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: 0 minutes
Time Spent: 1 hour, 30 minutes
Original Estimate: 3 hours





[JERSEY-1742] Bean Validation doesn't work when Inflector<DATA, RESULT> is used for handling requests Created: 19/Feb/13  Updated: 26/Feb/13  Resolved: 21/Feb/13

Status: Resolved
Project: jersey
Component/s: extensions
Affects Version/s: 2.0-m12
Fix Version/s: 2.0-m13, 2.0

Type: Bug Priority: Critical
Reporter: Michal Gajdos Assignee: Michal Gajdos
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: 0 minutes
Time Spent: 6 hours
Original Estimate: 12 hours


 Description   

Reason is that Invocable#APPLY_INFLECTOR_METHOD does not honor generic type arguments of inflector set by ResourceMethod.Builder#handledBy(Inflector) (and probably others as well).

The following exception is thrown by Hibernate Validator:

java.lang.IllegalArgumentException: HV000116: A method is required to create a method return value path.
	at org.hibernate.validator.internal.util.Contracts.assertNotNull(Contracts.java:51)
	at org.hibernate.validator.internal.engine.path.PathImpl.createPathForExecutable(PathImpl.java:98)
	at org.hibernate.validator.internal.engine.ValidatorImpl.getExecutableValueContext(ValidatorImpl.java:1012)
	at org.hibernate.validator.internal.engine.ValidatorImpl.validateParametersForGroup(ValidatorImpl.java:968)
	at org.hibernate.validator.internal.engine.ValidatorImpl.validateParametersInContext(ValidatorImpl.java:895)
	at org.hibernate.validator.internal.engine.ValidatorImpl.validateParameters(ValidatorImpl.java:261)
	at org.hibernate.validator.internal.engine.ValidatorImpl.validateParameters(ValidatorImpl.java:215)
	at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher.validateInput(AbstractJavaResourceMethodDispatcher.java:173)
	at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher.invoke(AbstractJavaResourceMethodDispatcher.java:123)
	at org.glassfish.jersey.server.model.internal.JavaResourceMethodDispatcherProvider$ObjectOutInvoker.doDispatch(JavaResourceMethodDispatcherProvider.java:167)
	at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher.dispatch(AbstractJavaResourceMethodDispatcher.java:93)
	at org.glassfish.jersey.server.model.ResourceMethodInvoker.invoke(ResourceMethodInvoker.java:350)
	at org.glassfish.jersey.server.model.ResourceMethodInvoker.apply(ResourceMethodInvoker.java:345)
	at org.glassfish.jersey.server.model.ResourceMethodInvoker.apply(ResourceMethodInvoker.java:102)
	at org.glassfish.jersey.server.ServerRuntime$1.run(ServerRuntime.java:207)
	at org.glassfish.jersey.process.internal.RequestScope.runInScope(RequestScope.java:317)
	at org.glassfish.jersey.server.ServerRuntime.process(ServerRuntime.java:183)
	at org.glassfish.jersey.server.ApplicationHandler.handle(ApplicationHandler.java:850)
	at org.glassfish.jersey.grizzly2.httpserver.GrizzlyHttpContainer.service(GrizzlyHttpContainer.java:321)
	at org.glassfish.grizzly.http.server.HttpHandler.doHandle(HttpHandler.java:164)
	at org.glassfish.grizzly.http.server.HttpHandlerChain.service(HttpHandlerChain.java:196)
	at org.glassfish.grizzly.http.server.HttpHandler.doHandle(HttpHandler.java:164)
	at org.glassfish.grizzly.http.server.HttpServerFilter.handleRead(HttpServerFilter.java:175)
	at org.glassfish.grizzly.filterchain.ExecutorResolver$9.execute(ExecutorResolver.java:119)
	at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeFilter(DefaultFilterChain.java:273)
	at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeChainPart(DefaultFilterChain.java:200)
	at org.glassfish.grizzly.filterchain.DefaultFilterChain.execute(DefaultFilterChain.java:134)
	at org.glassfish.grizzly.filterchain.DefaultFilterChain.process(DefaultFilterChain.java:112)
	at org.glassfish.grizzly.ProcessorExecutor.execute(ProcessorExecutor.java:77)
	at org.glassfish.grizzly.nio.transport.TCPNIOTransport.fireIOEvent(TCPNIOTransport.java:820)
	at org.glassfish.grizzly.strategies.AbstractIOStrategy.fireIOEvent(AbstractIOStrategy.java:113)
	at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.run0(WorkerThreadIOStrategy.java:115)
	at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.access$100(WorkerThreadIOStrategy.java:55)
	at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy$WorkerThreadRunnable.run(WorkerThreadIOStrategy.java:135)
	at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:564)
	at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.run(AbstractThreadPool.java:544)
	at java.lang.Thread.run(Thread.java:722)

As a part of this task enhance logging of errors thrown from Bean Validation implementation.






[JERSEY-1736] Integrate 2.0-m12-1 into GF Created: 15/Feb/13  Updated: 29/May/13  Resolved: 15/Feb/13

Status: Resolved
Project: jersey
Component/s: None
Affects Version/s: None
Fix Version/s: 2.0-m13, 2.0

Type: Task Priority: Blocker
Reporter: Jakub Podlesak Assignee: Jakub Podlesak
Resolution: Duplicate Votes: 0
Labels: None
Remaining Estimate: 0 minutes
Time Spent: Not Specified
Original Estimate: 0 minutes


 Description   

javax.annotation-api packaging changes in GF are required to make this happen



 Comments   
Comment by Jakub Podlesak [ 15/Feb/13 ]

Closing as a duplicate, this was already submitted as JERSEY-1702





[JERSEY-1735] Release 2.0-m12-1 Created: 15/Feb/13  Updated: 29/May/13  Resolved: 15/Feb/13

Status: Resolved
Project: jersey
Component/s: release
Affects Version/s: None
Fix Version/s: 2.0-m13, 2.0

Type: Task Priority: Blocker
Reporter: Jakub Podlesak Assignee: Jakub Podlesak
Resolution: Duplicate Votes: 0
Labels: None
Remaining Estimate: 0 minutes
Time Spent: Not Specified
Original Estimate: 0 minutes


 Description   

2.0-m12-1 needs to be integrated into GF to unblock Marina EJB updates



 Comments   
Comment by Jakub Podlesak [ 15/Feb/13 ]

Closing as duplicate, this was already submitted as JERSEY-1701





[JERSEY-1734] Fix OSGi tests failing after JAX-RS 2.0-m16 update. Created: 15/Feb/13  Updated: 26/Feb/13  Resolved: 15/Feb/13

Status: Resolved
Project: jersey
Component/s: osgi
Affects Version/s: None
Fix Version/s: 2.0-m13, 2.0

Type: Task Priority: Blocker
Reporter: Jakub Podlesak Assignee: Jakub Podlesak
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: 0 minutes
Time Spent: 6 hours
Original Estimate: Not Specified


 Comments   
Comment by Jakub Podlesak [ 15/Feb/13 ]

fixed in the master branch





[JERSEY-1728] Migrate to the latest (1.1.0.Beta3) BV API Created: 12/Feb/13  Updated: 26/Feb/13  Resolved: 13/Feb/13

Status: Resolved
Project: jersey
Component/s: extensions
Affects Version/s: 2.0-m12
Fix Version/s: 2.0-m13, 2.0

Type: Task Priority: Major
Reporter: Michal Gajdos Assignee: Michal Gajdos
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: 0 minutes
Time Spent: 2 hours
Original Estimate: Not Specified


 Description   

un-ignore related e2e tests






[JERSEY-1724] Migrate to JAX-RS 2.0-m16 API Created: 10/Feb/13  Updated: 26/Feb/13  Resolved: 13/Feb/13

Status: Resolved
Project: jersey
Component/s: None
Affects Version/s: None
Fix Version/s: 2.0-m13, 2.0

Type: Task Priority: Blocker
Reporter: Marek Potociar Assignee: Marek Potociar
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: 0 minutes
Time Spent: 7 hours
Original Estimate: Not Specified





[JERSEY-1719] introduce proxiable request scoped Response proxy injectable on the server side Created: 08/Feb/13  Updated: 11/Mar/14  Resolved: 20/Feb/13

Status: Resolved
Project: jersey
Component/s: None
Affects Version/s: None
Fix Version/s: 2.0-m13, 2.0

Type: Bug Priority: Major
Reporter: Jakub Podlesak Assignee: Marek Potociar
Resolution: Invalid Votes: 0
Labels: None
Remaining Estimate: 0 minutes
Time Spent: 1 minute
Original Estimate: 3 hours


 Description   

JAX-RS Response is actually the only missing request scoped proxiable injectee on the server side. This should be fixed (including appropriate test case(s)).
Since Response is not created at the very beginning of Request processing, it should be also clarified, what effect should have e.g. modifying a Response injecting into an inbound entity body processing MessageBodyReader.



 Comments   
Comment by Marek Potociar [ 20/Feb/13 ]

Since when do we need to support injection of Response? Not to mention a proxiability requirement. There's nothing in the spec that requires Response injection IMO. (Only the HttpServletResponse in ServletContainer has to be injectable.)

Comment by Marek Potociar [ 20/Feb/13 ]

I have closed the issue as invalid. Feel free to reopen if you disagree.





[JERSEY-1712] A MessageBodyReader is not instantiated, no error provided Created: 07/Feb/13  Updated: 19/Feb/13  Resolved: 19/Feb/13

Status: Resolved
Project: jersey
Component/s: core
Affects Version/s: 2.0-m12, 2.0
Fix Version/s: 2.0-m13, 2.0

Type: Bug Priority: Blocker
Reporter: jan.supol Assignee: Marek Potociar
Resolution: Duplicate Votes: 0
Labels: None
Remaining Estimate: 0 minutes
Time Spent: 30 minutes
Original Estimate: 3 hours

Issue Links:
Duplicate
duplicates JERSEY-1529 Jersey is unable to create Resource w... Resolved
Related
is related to JERSEY-1529 Jersey is unable to create Resource w... Resolved

 Description   

Spec. Section 4.1.2 says:

If more than one public constructor can be used then an implementation MUST use the one with the most parameters

My provider :

@Provider
public class StringReader implements MessageBodyReader<String> {
	private HttpHeaders headers;
	private UriInfo info;
	private Application application;
	private Request request;
	private Providers provider;

	protected StringReader(@Context HttpHeaders headers, @Context UriInfo info,
			@Context Application application, @Context Request request,
			@Context Providers provider) {
		super();
		this.headers = headers;
		this.info = info;
		this.application = application;
		this.request = request;
		this.provider = provider;
	}

	public StringReader(@Context HttpHeaders headers, @Context UriInfo info,
			@Context Application application, @Context Request request) {
		super();
		this.headers = headers;
		this.info = info;
		this.application = application;
		this.request = request;
	}

	public StringReader(@Context HttpHeaders headers, @Context UriInfo info,
			@Context Application application) {
		super();
		this.headers = headers;
		this.info = info;
		this.application = application;
	}

	public StringReader(@Context HttpHeaders headers, @Context UriInfo info) {
		super();
		this.headers = headers;
		this.info = info;
	}

	public StringReader(@Context HttpHeaders headers) {
		super();
		this.headers = headers;
	}

	@Override
	public boolean isReadable(Class<?> type, Type genericType,
			Annotation[] annotations, MediaType mediaType) {
		return type == String.class;
	}

	@Override
	public String readFrom(Class<String> type, Type genericType,
			Annotation[] annotations, MediaType mediaType,
			MultivaluedMap<String, String> httpHeaders, InputStream entityStream)
			throws IOException, WebApplicationException {
		return "111";
	}
}

@Path("resource")
public class Resource {

	@POST
	public String echo(String entity) {
		return entity;
	}

}

A posted entity is echoed, not 111, and MessageBodyFactory#_getMessageBodyReader does not seem to have the provider in the mbrLookupCache, no error in any log provided.



 Comments   
Comment by jan.supol [ 07/Feb/13 ]

It's likely JERSEY-1529 will fix this issue, although JERSEY-1529 reports Resources and this reports Providers





[JERSEY-1710] Configure and add new virtual machines to the hudson infrastructure Created: 07/Feb/13  Updated: 11/Mar/14  Resolved: 26/Feb/13

Status: Resolved
Project: jersey
Component/s: None
Affects Version/s: None
Fix Version/s: 2.0-m13, 2.0

Type: Task Priority: Major
Reporter: Jakub Podlesak Assignee: Jakub Podlesak
Resolution: Duplicate Votes: 0
Labels: None
Remaining Estimate: 0 minutes
Time Spent: 5 hours
Original Estimate: 6 hours

Issue Links:
Duplicate
duplicates JERSEY-1757 Migrate local Hudson,Gerrit, ReviewBo... Resolved

 Description   

this is to cover replacement for the soon to be decommissioned old hudson slaves






[JERSEY-1706] ApplicationHandler is initialized twice for jdk-http server and simple-http + adjust port for simple-http tests. Created: 06/Feb/13  Updated: 26/Feb/13  Resolved: 07/Feb/13

Status: Resolved
Project: jersey
Component/s: None
Affects Version/s: None
Fix Version/s: 2.0-m13, 2.0

Type: Bug Priority: Major
Reporter: Miroslav Fuksa Assignee: Miroslav Fuksa
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: 0 minutes
Time Spent: 4 hours
Original Estimate: 4 hours


 Description   

In order to create ReloadContainerLifecycleListener in the containers the ApplicationHadnler is initialized twice. This also means that ReloadContainerLifecycleListener is based on providers from different ApplicationHandler.

code:

    public static Closeable create(URI address, SSLContext context, ResourceConfig config)
            throws ProcessingException {
        final SimpleContainer container = ContainerFactory.createContainer(SimpleContainer.class, config);
        return create(address, context, container, ConfigHelper.getContainerLifecycleListener(new ApplicationHandler(config)));
    }

adjust port for simple-http tests (use correct env variable to setup port during tests).






[JERSEY-1705] Use Apache as a client transport Created: 05/Feb/13  Updated: 26/Feb/13  Resolved: 12/Feb/13

Status: Resolved
Project: jersey
Component/s: connectors
Affects Version/s: 2.0-m12
Fix Version/s: 2.0-m13, 2.0

Type: Improvement Priority: Major
Reporter: Arul Dhesiaseelan Assignee: Michal Gajdos
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: 0 minutes
Time Spent: 3 hours
Original Estimate: Not Specified


 Description   

I am working on supporting Apache Client 4 in Jersey 2 as a Jersey client connector. I have ported all the tests as well. I would like to contribute this as a patch. I just wanted to make sure I am not duplicating any effort.



 Comments   
Comment by Michal Gajdos [ 06/Feb/13 ]

Hi Arul, thanks for contributing. We're not currently working on porting Jersey Apache HTTP Client from Jersey 1 to Jersey 2 so any help in this area would be appreciated.

Comment by Arul Dhesiaseelan [ 06/Feb/13 ]

Thanks for confirming Michal. I will send a PR tomorrow.

Comment by Arul Dhesiaseelan [ 07/Feb/13 ]

Sent a Github pull request. Let me know if this looks good.





[JERSEY-1704] Providers.getMessageBodyWriter() throws NPE when annotations argument is null Created: 05/Feb/13  Updated: 26/Feb/13  Resolved: 06/Feb/13

Status: Resolved
Project: jersey
Component/s: core
Affects Version/s: 2.0-m12
Fix Version/s: 2.0-m13, 2.0

Type: Bug Priority: Blocker
Reporter: jan.supol Assignee: Unassigned
Resolution: Invalid Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

javadoc says:

annotations - an array of the annotations on the declaration of the artifact that will be written. E.g. if the message body is to be produced from a field, this will be the annotations on that field returned by Field.getDeclaredAnnotations.

Obviously, Field.getDeclaredAnnotations can be null.
But, as Jersey contains EntityMessageWriter provider, which tries to get path value, and AbstractMessageBodyRW does not check for null annotations, this throws NPE.

code:

@Path("resource")
public class Resource {
	@Context
	Providers providers;

	@GET
	@Path("isRegisteredWriterWildcard")
	public Response isRegisteredWriterWildCard() {
		MessageBodyWriter<ReadableWritableEntity> writer;
		writer = providers.getMessageBodyWriter(ReadableWritableEntity.class,
				null, null, MediaType.WILDCARD_TYPE);
		Status status = entity == null ? Status.NOT_ACCEPTABLE : Status.OK;
		return Response.status(status).build();
	}
}
public class ReadableWritableEntity {
}





[JERSEY-1703] adjust jersey-gf-ejb module to align with new EJB and Interceptor Java EE API modules in GF Created: 05/Feb/13  Updated: 11/Mar/14  Resolved: 15/Feb/13

Status: Resolved
Project: jersey
Component/s: osgi
Affects Version/s: None
Fix Version/s: 2.0-m13, 2.0

Type: Task Priority: Major
Reporter: Jakub Podlesak Assignee: Jakub Podlesak
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: 0 minutes
Time Spent: 1 hour
Original Estimate: Not Specified


 Description   

org.glassfish:javax.ejb module has been split into javax.ejb:javax.ejb-api and javax.interceptor:javax.interceptor-api modules, new versioning schema was introduced for the latter module packages
OSGi manifest Import-Package header in jersey-gf-ejb module needs to be adjusted to deal with the above change



 Comments   
Comment by Jakub Podlesak [ 15/Feb/13 ]

Fixed in the master branch. Should be integrated into GF as part of 2.0-m12-1





[JERSEY-1702] Integrate 2.0-m12-1 into GF Created: 05/Feb/13  Updated: 11/Mar/14  Resolved: 15/Feb/13

Status: Resolved
Project: jersey
Component/s: release
Affects Version/s: None
Fix Version/s: 2.0-m13, 2.0

Type: Task Priority: Minor
Reporter: Jakub Podlesak Assignee: Jakub Podlesak
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: 0 minutes
Time Spent: 6 hours
Original Estimate: 3 hours

Issue Links:
Dependency
depends on JERSEY-1701 Release 2.0-m12-1 version Resolved




[JERSEY-1701] Release 2.0-m12-1 version Created: 05/Feb/13  Updated: 11/Mar/14  Resolved: 25/Feb/13

Status: Resolved
Project: jersey
Component/s: release
Affects Version/s: None
Fix Version/s: 2.0-m13, 2.0

Type: Task Priority: Major
Reporter: Jakub Podlesak Assignee: Jakub Podlesak
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: 0 minutes
Time Spent: 2 hours
Original Estimate: 3 hours

Issue Links:
Dependency
blocks JERSEY-1702 Integrate 2.0-m12-1 into GF Resolved

 Description   

This is to align with Java EE EJB and Interceptor API bundle changes
and should also give us opportunity to early integrate proxiable request scope, CDI integration and client SSL config support






[JERSEY-1700] Bean validation does not work out of the box (when jersey-bean-validation module is on the classpath) Created: 04/Feb/13  Updated: 26/Feb/13  Resolved: 21/Feb/13

Status: Resolved
Project: jersey
Component/s: extensions
Affects Version/s: 2.0-m12
Fix Version/s: 2.0-m13, 2.0

Type: Bug Priority: Critical
Reporter: Michal Gajdos Assignee: Michal Gajdos
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: 0 minutes
Time Spent: 1 hour
Original Estimate: 3 hours

Issue Links:
Dependency
depends on JERSEY-1159 Activation of features based on the p... Resolved

 Description   

Ensure that:

  • ValidationFeature gets registered when jersey-bean-validation.jar is on the classpath (see JERSEY-1159)
  • implementation of bean validation is present on the classpath as well when using jersey-bean-validation.jar (in case of maven)





[JERSEY-1696] servlet-3-init-2 integration test is not invoked Created: 31/Jan/13  Updated: 26/Feb/13  Resolved: 04/Feb/13

Status: Resolved
Project: jersey
Component/s: containers
Affects Version/s: 2.0-m12
Fix Version/s: 2.0-m13, 2.0

Type: Bug Priority: Major
Reporter: Michal Gajdos Assignee: Michal Gajdos
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: 0 minutes
Time Spent: 1 hour, 30 minutes
Original Estimate: 3 hours


 Description   

add the mentioned test into parent pom.xml as submodule + fix compilation errors in this test






[JERSEY-1695] Annotating Application subclass with @NameBinding annotation has no effect Created: 30/Jan/13  Updated: 26/Feb/13  Resolved: 26/Feb/13

Status: Resolved
Project: jersey
Component/s: core
Affects Version/s: 2.0-m12
Fix Version/s: 2.0-m13, 2.0

Type: Bug Priority: Blocker
Reporter: jan.supol Assignee: Miroslav Fuksa
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: 0 minutes
Time Spent: 3 hours
Original Estimate: Not Specified


 Description   

Spec. Section 6.5.2 says:

the application subclass must be annotated
as shown above in order for those filters or interceptors to be globally bound.

@NameBinding
@Target({ ElementType.TYPE, ElementType.METHOD })
@Retention(value = RetentionPolicy.RUNTIME)
public @interface GlobalNameBinding {
}

@Provider
@GlobalNameBinding
public class AddOneInterceptor implements
		WriterInterceptor {
	public void aroundWriteTo(WriterInterceptorContext context)
			throws IOException, WebApplicationException {
		String entity = (String) context.getEntity();
		Integer i = Integer.parseInt(entity);
		entity = String.valueOf(i + 1);
		context.setEntity(entity);
		context.proceed();
	}
}

@Provider
@GlobalNameBinding
public class AddTenFilter implements ContainerResponseFilter {
	@Override
	public void filter(ContainerRequestContext requestContext,
			ContainerResponseContext responseContext) throws IOException {
		int status = responseContext.getStatus();
		String entity = (String) responseContext.getEntity();
		Integer i = Integer.valueOf(entity);
		entity = String.valueOf(i + 10);
		responseContext.setEntity(entity, (Annotation[]) null,
					MediaType.WILDCARD_TYPE);
	}
}

@GlobalNameBinding
public class MyApp extends Application {

	public java.util.Set<java.lang.Class<?>> getClasses() {
		Set<Class<?>> resources = new HashSet<Class<?>>();
		resources.add(Resource.class);
		resources.add(AddOneInterceptor.class);
		resources.add(AddTenFilter.class);
		return resources;
	}
}

@Path("resource")
public class Resource {
	
	@POST
	@Path("bind")
	@GlobalNameBinding
	public String echoWithBind(String echo){
		return echo;
	}
	
	@POST
	@Path("nobind")
	public String echoNoBind(String echo){
		return echo;
	}
}

Request:

POST http://localhost:6080/resource/bind
Accept:/, Content-Type:/,
0

gives 11, where as

POST http://localhost:6080/resource/nobind
Accept:/, Content-Type:/,
0

gives 0.






Evaluate all unevaluated issues - (or spend at least 1d evaluating if too many issues) (JERSEY-1678)

[JERSEY-1688] Marek Created: 29/Jan/13  Updated: 26/Feb/13  Resolved: 26/Feb/13

Status: Resolved
Project: jersey
Component/s: None
Affects Version/s: None
Fix Version/s: 2.0-m13, 2.0

Type: Sub-task Priority: Blocker
Reporter: Marek Potociar Assignee: Marek Potociar
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: 0 minutes
Time Spent: 2 hours
Original Estimate: 6 hours





Evaluate all unevaluated issues - (or spend at least 1d evaluating if too many issues) (JERSEY-1678)

[JERSEY-1687] Mira Created: 29/Jan/13  Updated: 26/Feb/13  Resolved: 26/Feb/13

Status: Resolved
Project: jersey
Component/s: None
Affects Version/s: None
Fix Version/s: 2.0-m13, 2.0

Type: Sub-task Priority: Blocker
Reporter: Marek Potociar Assignee: Miroslav Fuksa
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: 0 minutes
Time Spent: 1 hour
Original Estimate: 6 hours





Evaluate all unevaluated issues - (or spend at least 1d evaluating if too many issues) (JERSEY-1678)

[JERSEY-1686] Michal Created: 29/Jan/13  Updated: 26/Feb/13  Resolved: 26/Feb/13

Status: Resolved
Project: jersey
Component/s: None
Affects Version/s: None
Fix Version/s: 2.0-m13, 2.0

Type: Sub-task Priority: Blocker
Reporter: Marek Potociar Assignee: Michal Gajdos
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: 0 minutes
Time Spent: 1 hour, 15 minutes
Original Estimate: 6 hours





Evaluate all unevaluated issues - (or spend at least 1d evaluating if too many issues) (JERSEY-1678)

[JERSEY-1685] Jakub Created: 29/Jan/13  Updated: 26/Feb/13  Resolved: 26/Feb/13

Status: Resolved
Project: jersey
Component/s: None
Affects Version/s: None
Fix Version/s: 2.0-m13, 2.0

Type: Sub-task Priority: Blocker
Reporter: Marek Potociar Assignee: Jakub Podlesak
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: 0 minutes
Time Spent: 5 hours, 30 minutes
Original Estimate: 6 hours





Evaluate all unevaluated issues - (or spend at least 1d evaluating if too many issues) (JERSEY-1678)

[JERSEY-1684] Pavel Created: 29/Jan/13  Updated: 26/Feb/13  Resolved: 26/Feb/13

Status: Resolved
Project: jersey
Component/s: None
Affects Version/s: None
Fix Version/s: 2.0-m13, 2.0

Type: Sub-task Priority: Blocker
Reporter: Marek Potociar Assignee: Pavel Bucek
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: 0 minutes
Time Spent: 1 minute
Original Estimate: 6 hours





[JERSEY-1683] Clean up automated hudson jobs Created: 29/Jan/13  Updated: 29/May/13  Resolved: 26/Feb/13

Status: Resolved
Project: jersey
Component/s: None
Affects Version/s: None
Fix Version/s: 2.0-m13, 2.0

Type: Task Priority: Blocker
Reporter: Marek Potociar Assignee: Jakub Podlesak
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: 0 minutes
Time Spent: 3 hours, 30 minutes
Original Estimate: 1 hour





[JERSEY-1682] Integrate 2.0-m12 into GF Created: 29/Jan/13  Updated: 05/Feb/13  Resolved: 05/Feb/13

Status: Resolved
Project: jersey
Component/s: None
Affects Version/s: None
Fix Version/s: 2.0-m13, 2.0

Type: Task Priority: Blocker
Reporter: Marek Potociar Assignee: Jakub Podlesak
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: 0 minutes
Time Spent: 6 hours
Original Estimate: 6 hours


 Comments   
Comment by Jakub Podlesak [ 05/Feb/13 ]

2.0-m12 is integrated into GF main trunk, all GF hudson jobs are passing





[JERSEY-1680] Release 2.0-m12 Created: 28/Jan/13  Updated: 29/May/13  Resolved: 04/Feb/13

Status: Resolved
Project: jersey
Component/s: None
Affects Version/s: None
Fix Version/s: 2.0-m13, 2.0

Type: Task Priority: Blocker
Reporter: Marek Potociar Assignee: Jakub Podlesak
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: 0 minutes
Time Spent: 2 hours
Original Estimate: 3 hours





[JERSEY-1679] Support new Java EE 7 JSON-P API as a separate module (parto of RI). Created: 28/Jan/13  Updated: 26/Feb/13  Resolved: 26/Feb/13

Status: Resolved
Project: jersey
Component/s: None
Affects Version/s: None
Fix Version/s: 2.0-m13, 2.0

Type: New Feature Priority: Blocker
Reporter: Marek Potociar Assignee: Michal Gajdos
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: 0 minutes
Time Spent: 13 hours
Original Estimate: 6 hours


 Description   

DEMO: Example using the JsonStructure, JsonArray and JsonObject in both inbound and outbound scenarios.






[JERSEY-1678] Evaluate all unevaluated issues - (or spend at least 1d evaluating if too many issues) Created: 28/Jan/13  Updated: 26/Feb/13  Resolved: 26/Feb/13

Status: Resolved
Project: jersey
Component/s: None
Affects Version/s: None
Fix Version/s: 2.0-m13, 2.0

Type: Task Priority: Blocker
Reporter: Marek Potociar Assignee: Unassigned
Resolution: Fixed Votes: 0
Labels: None
Σ Remaining Estimate: 0 minutes Remaining Estimate: Not Specified
Σ Time Spent: 9 hours, 46 minutes Time Spent: Not Specified
Σ Original Estimate: 1 day, 6 hours Original Estimate: Not Specified

Sub-Tasks:
Key
Summary
Type
Status
Assignee
JERSEY-1684 Pavel Sub-task Resolved Pavel Bucek  
JERSEY-1685 Jakub Sub-task Resolved Jakub Podlesak  
JERSEY-1686 Michal Sub-task Resolved Michal Gajdos  
JERSEY-1687 Mira Sub-task Resolved Miroslav Fuksa  
JERSEY-1688 Marek Sub-task Resolved Marek Potociar  

 Description   

Everyone with unevaluated issues assigned should evaluate all issues or spend at least 1d evaluating issues. This is a group umbrella task for everyone in the team.






[JERSEY-1673] Support for Simple 5.x container in Jersey 2.0 Created: 28/Jan/13  Updated: 26/Feb/13  Resolved: 05/Feb/13

Status: Resolved
Project: jersey
Component/s: containers
Affects Version/s: None
Fix Version/s: 2.0-m13, 2.0

Type: Improvement Priority: Major
Reporter: Arul Dhesiaseelan Assignee: Miroslav Fuksa
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: 0 minutes
Time Spent: 2 hours
Original Estimate: 3 hours


 Description   

I have ported Simple 5.x container support from Jersey 1.x to Jersey 2.0. I have ported all the tests except CanonicalizationFeatureTest which I do not see a direct support in Jersey 2.0 yet. The other test EscapedURITest which is currenty ignored since it fails with the current implementation for all containers. All other tests are passing. Here is my pull request:
https://github.com/jersey/jersey/pull/9



 Comments   
Comment by Pavel Bucek [ 29/Jan/13 ]

review, merge

Comment by Miroslav Fuksa [ 05/Feb/13 ]

merged





[JERSEY-1668] Create JAX-RS 2.0 Java EE 7 Samples Created: 23/Jan/13  Updated: 14/Feb/13  Resolved: 14/Feb/13

Status: Resolved
Project: jersey
Component/s: None
Affects Version/s: None
Fix Version/s: 2.0-m13, 2.0

Type: Task Priority: Blocker
Reporter: Marek Potociar Assignee: Miroslav Fuksa
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: 0 minutes
Time Spent: 1 day, 14 hours
Original Estimate: 18 hours


 Description   

(see aseng-wiki .../display/GlassFish/Java+EE+7+Samples)

  • add client side to existing message board sample
  • filters/interceptors/async.





[JERSEY-1662] Check/update @NameBinding support to reflect recent changes in the spec. Created: 18/Jan/13  Updated: 07/Feb/13  Resolved: 07/Feb/13

Status: Resolved
Project: jersey
Component/s: None
Affects Version/s: 2.0-m11
Fix Version/s: 2.0-m13, 2.0

Type: Task Priority: Blocker
Reporter: Marek Potociar Assignee: Miroslav Fuksa
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: 0 minutes
Time Spent: 9 hours, 30 minutes
Original Estimate: 6 hours


 Description   

The correct implementation of @NameBinding support when multiple name-bound annotations are applied to a single provider should be a logical "AND". E.g. having @A and @B name-bound annotations, then:

@A @B public class MyFilter ... { ... }

@A public void resourceMethod_1(...) { ... } // MyFilter is NOT applied

@B public void resourceMethod_2(...) { ... } // MyFilter is NOT applied

@A @B public void resourceMethod_3(...) { ... } // MyFilter is applied





Add support for MVC pattern - port support for MVC to Jersey 2.0 (including all the tests). (JERSEY-1390)

[JERSEY-1646] Implement MVC in Jersey 2.0 Created: 14/Jan/13  Updated: 18/Feb/13  Resolved: 18/Feb/13

Status: Resolved
Project: jersey
Component/s: core
Affects Version/s: None
Fix Version/s: 2.0-m13, 2.0

Type: Sub-task Priority: Major
Reporter: Michal Gajdos Assignee: Michal Gajdos
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: 0 minutes
Time Spent: 2 days, 16 hours
Original Estimate: 1 day, 6 hours





[JERSEY-1645] Upgrade Jersey 2 MOXy dependency to align with current BG version (2.5.0-M5 at the moment) Created: 10/Jan/13  Updated: 11/Mar/14  Resolved: 31/Jan/13

Status: Resolved
Project: jersey
Component/s: media
Affects Version/s: None
Fix Version/s: 2.0-m13, 2.0

Type: Task Priority: Major
Reporter: Jakub Podlesak Assignee: Pavel Bucek
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: 0 minutes
Time Spent: Not Specified
Original Estimate: 0 minutes


 Description   

MOXy version should be aligned with BG to avoid integration issues.
Current version used in BG is 2.5.0-M5, as per https://svn.java.net/svn/glassfish~svn/trunk/main/appserver/pom.xml






[JERSEY-1629] Describe how to reliably run Jersey build with PaxExam behind proxy. Created: 20/Dec/12  Updated: 29/Jan/13  Resolved: 29/Jan/13

Status: Resolved
Project: jersey
Component/s: None
Affects Version/s: None
Fix Version/s: 2.0-m13, 2.0

Type: Task Priority: Critical
Reporter: Marek Potociar Assignee: Marek Potociar
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified





[JERSEY-1617] Support outbound entity buffering to compute Content-Length value. Created: 12/Dec/12  Updated: 26/Feb/13  Resolved: 26/Feb/13

Status: Resolved
Project: jersey
Component/s: None
Affects Version/s: None
Fix Version/s: 2.0-m13, 2.0

Type: New Feature Priority: Blocker
Reporter: Marek Potociar Assignee: Miroslav Fuksa
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: 0 minutes
Time Spent: 1 day, 21 hours
Original Estimate: 12 hours

Issue Links:
Duplicate
duplicates JERSEY-1760 Support outbound entity buffering to ... Resolved
Related
is related to JERSEY-1543 Ignore MBW.getSize(). Resolved
is related to JERSEY-1689 Outbound entity buffering to compute ... Open

 Description   

DEMO: Uncomment code that tests content-length values in tests (core-server:HeadTest, e2e:ContentLengthTest).

With MBW.getSize() ignored in JAX-RS 2.0, we may want to implement a way that would let us compute the Content-Length value for messages of up to certain size. We could do this by defining a configurable-size buffer for outbound entities that would try to buffer whole entity and compute the actual Content-Length value that would be then set in the headers before flushing the buffered entity. Should the buffer overrun, it would resume to serializing the entity without computing the C-L value.

add client side request tests






[JERSEY-1608] Broken link in Javadoc Created: 06/Dec/12  Updated: 19/Feb/13  Resolved: 19/Feb/13

Status: Resolved
Project: jersey
Component/s: docs
Affects Version/s: 2.0-m10
Fix Version/s: 2.0-m13, 2.0

Type: Bug Priority: Minor
Reporter: cowwoc Assignee: Marek Potociar
Resolution: Cannot Reproduce Votes: 0
Labels: None
Remaining Estimate: 0 minutes
Time Spent: 1 minute
Original Estimate: 3 hours


 Description   

http://jersey.java.net/nonav/apidocs/2.0-m05/jersey/org/glassfish/jersey/client/JerseyConfiguration.html and click on the "Configuration" interface that the class implements. You will get a broken link.



 Comments   
Comment by Marek Potociar [ 19/Feb/13 ]

Not reproducible in most recent builds.





[JERSEY-1578] WebTarget#resolve... does not return the same target when empty map argument Created: 14/Nov/12  Updated: 29/May/13  Resolved: 18/Feb/13

Status: Resolved
Project: jersey
Component/s: core
Affects Version/s: 2.0-m09
Fix Version/s: 2.0-m13, 2.0

Type: Bug Priority: Blocker
Reporter: jan.supol Assignee: Pavel Bucek
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: 0 minutes
Time Spent: 30 minutes
Original Estimate: 3 hours


 Description   

Javadoc of e.g. WebTarget#resolveTemplatesFromEncoded says:

A call to the method with an empty parameter map is ignored, i.e. same WebTarget instance is returned.

But

WebTarget target = ...
WebTarget other = target.resolveTemplatesFromEncoded(new TreeMap<String, Object>());

target != other

The same for

target.resolveTemplates(new TreeMap<String, Object>());

and

target.resolveTemplates(new TreeMap<String, Object>(), false);





[JERSEY-1577] WebTarget throws IAE instead of NPE Created: 14/Nov/12  Updated: 20/Feb/13  Resolved: 20/Feb/13

Status: Resolved
Project: jersey
Component/s: core
Affects Version/s: 2.0-m09
Fix Version/s: 2.0-m13, 2.0

Type: Bug Priority: Blocker
Reporter: jan.supol Assignee: Michal Gajdos
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: 0 minutes
Time Spent: 2 hours
Original Estimate: 3 hours

Issue Links:
Dependency
depends on JAX_RS_SPEC-354 UriBuilder/WebTarget - Unify thrown e... Resolved

 Description   

WebTarget#queryParam javadoc says:

Throws:
java.lang.NullPointerException - if the parameter name is null or if there are multiple values present and any of those values is null.

WebTarget#resolveTemplatesFromEncoded javadoc says:

Throws:
java.lang.NullPointerException - if the parameter name is null or if there are multiple values present and any of those values is null.

WebTarget#resolveTemplates javadoc says:

Throws:
java.lang.NullPointerException - if the name-value map or any of the names or values in the map is null.

But

target.queryParam(null, "abc");
HashMap<String, Object> map = new HashMap<String, Object>();
map.put(null, "xyz");
target.path("{path}").resolveTemplatesFromEncoded(map);
HashMap<String, Object> map = new HashMap<String, Object>();
map.put("path", null);
target.path("{path}").resolveTemplatesFromEncoded(map);
Map<String, Object> map = new HashMap<String, Object>();
map.put(null, "xyz");
target.path("{path}").resolveTemplates(map);
Map<String, Object> map = new HashMap<String, Object>();
map.put("path", null);
target.path("{path}").resolveTemplates(map);
Map<String, Object> map = new HashMap<String, Object>();
map.put(null, "xyz");
target.path("{path}").resolveTemplates(map, false);
Map<String, Object> map = new HashMap<String, Object>();
map.put("path", null);
target.path("{path}").resolveTemplates(map, true);

each throws IAE.






[JERSEY-1575] Canceling Resumed AsynResponse Throws IllegalStateException Created: 12/Nov/12  Updated: 06/Feb/13  Resolved: 06/Feb/13

Status: Closed
Project: jersey
Component/s: core
Affects Version/s: 2.0-m09
Fix Version/s: 2.0-m13

Type: Bug Priority: Blocker
Reporter: jan.supol Assignee: Unassigned
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: 3 hours
Time Spent: Not Specified
Original Estimate: 3 hours


 Description   

javadoc of AsyncResponse#cancel() says:

Invoking a cancel(...) method on an asynchronous response instance that has already been resumed has no effect and the method call is ignored.

But when it is resumed and cancel is called:

@Path("resource")
public class Resource {
	private static AsyncResponse lastResponse = null;

	@GET
	@Path("suspend")
	public void suspend(@Suspended AsyncResponse asyncResponse) {
		lastResponse = asyncResponse;
	}

	@GET
	@Path("cancelvoid")
	public void cancel(){
		AsyncResponse response = lastResponse;
		response.cancel();
	}

	@POST
	@Path("resume")
	public String resume(String response) {
		AsyncResponse async = lastResponse;
		async.resume(response);
		return "RESUMED";
	}
}

the following exception is thrown:

java.lang.IllegalStateException: Not suspended
at org.glassfish.jersey.server.ServerRuntime$AsyncResponder.cancel(ServerRuntime.java:684)
at org.glassfish.jersey.server.ServerRuntime$AsyncResponder.cancel(ServerRuntime.java:644)



 Comments   
Comment by jan.supol [ 06/Feb/13 ]

Currently, it works





[JERSEY-1549] Helloworld-webapp (and possibly all other) sample is broken Created: 31/Oct/12  Updated: 11/Feb/13  Resolved: 11/Feb/13

Status: Resolved
Project: jersey
Component/s: None
Affects Version/s: 2.0-m09
Fix Version/s: 2.0-m13, 2.0

Type: Bug Priority: Blocker
Reporter: Pavel Bucek Assignee: Michal Gajdos
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: 0 minutes
Time Spent: 15 hours
Original Estimate: 3 hours


 Description   

mvn clean compile exec:java results in

java.lang.reflect.InvocationTargetException
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:597)
	at org.codehaus.mojo.exec.ExecJavaMojo$1.run(ExecJavaMojo.java:297)
	at java.lang.Thread.run(Thread.java:680)
Caused by: java.lang.NoClassDefFoundError: javax/servlet/SessionTrackingMode
	at org.glassfish.jersey.grizzly2.servlet.GrizzlyWebContainerFactory.create(GrizzlyWebContainerFactory.java:243)
	at org.glassfish.jersey.examples.helloworld.webapp.App.main(App.java:71)
	... 6 more
Caused by: java.lang.ClassNotFoundException: javax.servlet.SessionTrackingMode
	at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:247)


 Comments   
Comment by Michal Gajdos [ 27/Nov/12 ]

@PersistenceUnit in bookmark/bookmark-em is not working as well. Migrate this functionality from Jersey 1.x.

Comment by CliffRedmond [ 04/Feb/13 ]

A workaround (while we're waiting for an official fix); add this to pom.xml:

<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<version>3.0.1</version>
</dependency>





[JERSEY-1531] Unable to mix inbound and outbound response on server side Created: 24/Oct/12  Updated: 22/Feb/13  Resolved: 22/Feb/13

Status: Resolved
Project: jersey
Component/s: core
Affects Version/s: 2.0-m09
Fix Version/s: 2.0-m13, 2.0

Type: Bug Priority: Blocker
Reporter: jan.supol Assignee: Marek Potociar
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: 0 minutes
Time Spent: 30 minutes
Original Estimate: 3 hours

Issue Links:
Related
is related to JERSEY-1516 An application class cannot extend Re... Resolved

 Description   

On a resource:

@Path("resource")
public class Resource {

	public static final String MESSAGE = "any message which should be returned by other resource method";

	@Uri("resource/other")
	WebTarget target;
	
	@GET
	@Path("uri")
	public Response uri() {
		Response response;
		if (target == null)
			response = Response.ok("injected WebTarget is null").build();
		else
			response = target.request().buildGet().invoke();
		return response;
	}
	
	@GET
	@Path("other")
	public String other() {
		return MESSAGE;
	}

}

Calling uri() method, the following exception occurs:

java.lang.IllegalArgumentException: Unsupported response implementation type: org.glassfish.jersey.client.ScopedJaxrsResponse
at org.glassfish.jersey.message.internal.OutboundJaxrsResponse.unwrap(OutboundJaxrsResponse.java:87)
at org.glassfish.jersey.server.ContainerResponse.<init>(ContainerResponse.java:83)
at org.glassfish.jersey.server.model.ResourceMethodInvoker.apply(ResourceMethodInvoker.java:299)
at org.glassfish.jersey.server.model.ResourceMethodInvoker.apply(ResourceMethodInvoker.java:90)
at org.glassfish.jersey.server.ServerRuntime$1.run(ServerRuntime.java:198)
at org.glassfish.jersey.process.internal.RequestScope.runInScope(RequestScope.java:316)
at org.glassfish.jersey.server.ServerRuntime.process(ServerRuntime.java:174)
at org.glassfish.jersey.server.ApplicationHandler.handle(ApplicationHandler.java:761)
at org.glassfish.jersey.servlet.WebComponent.service(WebComponent.java:309)
at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:349)
at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:312)
at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:195)

May be fixed by generally solving JERSEY-1516, though OutboundJaxrsResponse.unwrap() can count with ScopedJaxrsResponse directly.



 Comments   
Comment by jan.supol [ 24/Oct/12 ]

Actually maybe not a bug, but feature. But it leads to a need of fetching all data from Client response and wrap them to a new response to be finally sent elsewhere from a resource method.





[JERSEY-1529] Jersey is unable to create Resource with more constructors Created: 24/Oct/12  Updated: 25/Feb/13  Resolved: 25/Feb/13

Status: Resolved
Project: jersey
Component/s: core
Affects Version/s: 2.0-m09
Fix Version/s: 2.0-m13, 2.0

Type: Bug Priority: Blocker
Reporter: jan.supol Assignee: Marek Potociar
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: 0 minutes
Time Spent: 7 hours
Original Estimate: 3 hours

Issue Links:
Duplicate
is duplicated by JERSEY-1515 Exception Mapper is not used for cust... Resolved
is duplicated by JERSEY-1712 A MessageBodyReader is not instantiat... Resolved
Related
is related to JERSEY-1712 A MessageBodyReader is not instantiat... Resolved

 Description   

Spec. Section 3.1.2, says:

If more than one public constructor is suitable then an implementation MUST use the one with the most
parameters.

However, the following code:

@Path("Resource")
public class Resource {
	private HttpHeaders headers;
	private UriInfo info;
	private Application application;
	private Request request;
	private Providers provider;
	
	public Resource(){		
	}		
	
	public Resource(@Context HttpHeaders headers){		
		this.headers = headers;
	}	

	
	public Resource(@Context HttpHeaders headers, @Context UriInfo info){		
		this.headers = headers;
		this.info = info;
	}	
	
	public Resource(@Context HttpHeaders headers, @Context UriInfo info, @Context Application application){
		this.application = application;
		this.headers = headers;
		this.info = info;
	}
		
	public Resource(@Context HttpHeaders headers, @Context UriInfo info, @Context Application application, @Context Request request){
		this.application = application;
		this.headers = headers;
		this.info = info;
		this.request = request;
	}
	
	protected Resource(@Context HttpHeaders headers, @Context UriInfo info, @Context Application application, @Context Request request, @Context Providers provider){
		this.application = application;
		this.headers = headers;
		this.info = info;
		this.request = request;
		this.provider = provider;
	}	
	
	@GET
	@Path("mostAttributes")
	public Response isUsedConstructorWithMostAttributes(){
		boolean ok = application != null;
		ok &= headers != null;
		ok &= info != null;
		ok &= request != null;
		ok &= provider == null;
		Status status = ok ? Status.OK : Status.NOT_ACCEPTABLE;
		return Response.status(status).build();
	}
}

Throws :

MultiException stack 1 of 1
java.lang.IllegalArgumentException: There is more than one constructor on class Resource
at org.jvnet.hk2.internal.Utilities.findProducerConstructor(Utilities.java:824)
at org.jvnet.hk2.internal.Utilities.justCreate(Utilities.java:632)
at org.jvnet.hk2.internal.ServiceLocatorImpl.create(ServiceLocatorImpl.java:601)
at org.jvnet.hk2.internal.ServiceLocatorImpl.createAndInitialize(ServiceLocatorImpl.java:657)
at org.glassfish.jersey.internal.inject.Injections.getOrCreate(Injections.java:186)
at org.glassfish.jersey.server.model.MethodHandler$ClassBasedMethodHandler.getInstance(MethodHandler.java:185)
at org.glassfish.jersey.server.internal.routing.PushMethodHandlerRouter.apply(PushMethodHandlerRouter.java:102)
at org.glassfish.jersey.server.internal.routing.RoutingStage._apply(RoutingStage.java:115)
at org.glassfish.jersey.server.internal.routing.RoutingStage._apply(RoutingStage.java:118)
at org.glassfish.jersey.server.internal.routing.RoutingStage._apply(RoutingStage.java:118)
at org.glassfish.jersey.server.internal.routing.RoutingStage._apply(RoutingStage.java:118)
at org.glassfish.jersey.server.internal.routing.RoutingStage._apply(RoutingStage.java:118)
at org.glassfish.jersey.server.internal.routing.RoutingStage.apply(RoutingStage.java:101)
at org.glassfish.jersey.server.internal.routing.RoutingStage.apply(RoutingStage.java:61)
at org.glassfish.jersey.process.internal.Stages.process(Stages.java:197)
at org.glassfish.jersey.server.ServerRuntime$1.run(ServerRuntime.java:189)
at org.glassfish.jersey.process.internal.RequestScope.runInScope(RequestScope.java:316)
at org.glassfish.jersey.server.ServerRuntime.process(ServerRuntime.java:174)
at org.glassfish.jersey.server.ApplicationHandler.handle(ApplicationHandler.java:761)
at org.glassfish.jersey.servlet.WebComponent.service(WebComponent.java:309)
at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:349)
at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:312)
at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:195)



 Comments   
Comment by Marek Potociar [ 06/Feb/13 ]

We should use the new HK2 constructor selection feature to resolve this issue.





[JERSEY-1528] Null Response results in status 500. Created: 24/Oct/12  Updated: 22/Feb/13  Resolved: 22/Feb/13

Status: Resolved
Project: jersey
Component/s: core
Affects Version/s: 2.0-m09
Fix Version/s: 2.0-m13, 2.0

Type: Bug Priority: Blocker
Reporter: jan.supol Assignee: Marek Potociar
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: 0 minutes
Time Spent: 30 minutes
Original Estimate: 3 hours


 Description   

Spec., Section 3.3.3. Says:

A null return value results in a 204 status code.

The following code, however, results in status 500:

@Path("resource")
public class Resource {
	@GET
	@Path("nullResponse")
	public Response nullResponse() {
		return null;
	}
}





[JERSEY-1527] When Response has no status, 204 is returned Created: 24/Oct/12  Updated: 22/Feb/13  Resolved: 22/Feb/13

Status: Resolved
Project: jersey
Component/s: core
Affects Version/s: 2.0-m09
Fix Version/s: 2.0-m13, 2.0

Type: Bug Priority: Blocker
Reporter: jan.supol Assignee: Marek Potociar
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: 0 minutes
Time Spent: 1 hour
Original Estimate: 3 hours


 Description   

Spec. Section 3.3.3 says:

If the status property of the Response is not set: a 200 status code is used for a non-null entity
property and a 204 status code is used if the entity property is null.

However, the following code generates response with status 204:

@Path("resource")
public class Resource{
	@GET
	@Path("test")
	public Response entityResponseTest() {
		RuntimeDelegate rd = RuntimeDelegate.getInstance();
		ResponseBuilder rb = rd.createResponseBuilder();		
		return rb.entity("1234567890").build();
	}	
}





[JERSEY-1516] An application class cannot extend Response class directly Created: 19/Oct/12  Updated: 21/Feb/13  Resolved: 21/Feb/13

Status: Resolved
Project: jersey
Component/s: core
Affects Version/s: 2.0-m09
Fix Version/s: 2.0-m13, 2.0

Type: Bug Priority: Blocker
Reporter: jan.supol Assignee: Marek Potociar
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: 0 minutes
Time Spent: 1 hour
Original Estimate: 3 hours

Issue Links:
Related
is related to JERSEY-1531 Unable to mix inbound and outbound re... Resolved

 Description   

javadoc of Response says:

An application class can extend this class directly or can use one of the static methods to create an instance using a ResponseBuilder.

But on a resource method:

@Path("resource")
public class Resource {
	@GET
	@Path("subresponse")
	public OkResponse subresponse() {
		return new OkResponse("subresponse");
	}
}
public class OkResponse extends Response {

	Response r;

	public OkResponse(String entity) {
		r = Response.ok(entity).build();
	}

	@Override
	public Object getEntity() {
		return r.getEntity();
	}

	@Override
	public int getStatus() {
		return r.getStatus();
	}

	@Override
	public MultivaluedMap<String, Object> getMetadata() {
		return r.getMetadata();
	}

	@Override
	public boolean hasEntity() {
		return r.hasEntity();
	}

	@Override
	public Set<String> getAllowedMethods() {
		return r.getAllowedMethods();
	}

	@Override
	public Map<String, NewCookie> getCookies() {
		return r.getCookies();
	}

	@Override
	public Date getDate() {
		return null;
	}

	@Override
	public EntityTag getEntityTag() {
		return r.getEntityTag();
	}

	@Override
	public String getHeaderString(String arg0) {
		return r.getHeaderString(arg0);
	}

	@Override
	public Locale getLanguage() {
		return r.getLanguage();
	}

	@Override
	public Date getLastModified() {
		return r.getDate();
	}

	@Override
	public int getLength() {
		return r.getLength();
	}

	@Override
	public Link getLink(String arg0) {
		return r.getLink(arg0);
	}

	@Override
	public Builder getLinkBuilder(String arg0) {
		return r.getLinkBuilder(arg0);
	}

	@Override
	public Set<Link> getLinks() {
		return r.getLinks();
	}

	@Override
	public URI getLocation() {
		return r.getLocation();
	}

	@Override
	public MediaType getMediaType() {
		return r.getMediaType();
	}

	@Override
	public StatusType getStatusInfo() {
		return r.getStatusInfo();
	}

	@Override
	public boolean hasLink(String arg0) {
		return r.hasLink(arg0);
	}

	@Override
	public boolean bufferEntity() throws MessageProcessingException {
		return r.bufferEntity();
	}

	@Override
	public void close() throws MessageProcessingException {
		r.close();
	}

	@Override
	public <T> T readEntity(Class<T> arg0) throws MessageProcessingException,
			IllegalStateException {
		return r.readEntity(arg0);
	}

	@Override
	public <T> T readEntity(GenericType<T> arg0)
			throws MessageProcessingException, IllegalStateException {
		return r.readEntity(arg0);
	}

	@Override
	public <T> T readEntity(Class<T> arg0, Annotation[] arg1)
			throws MessageProcessingException, IllegalStateException {
		return r.readEntity(arg0, arg1);
	}

	@Override
	public <T> T readEntity(GenericType<T> arg0, Annotation[] arg1)
			throws MessageProcessingException, IllegalStateException {
		return r.readEntity(arg0, arg1);
	}

	@Override
	public MultivaluedMap<String, String> getStringHeaders() {
		return r.getStringHeaders();
	}

}

an IllegalArgumentException is thrown on OutboundJaxrsResponse#unwrap.



 Comments   
Comment by jan.supol [ 07/Feb/13 ]

Currently, Response.ok(entity).build() creates OutboundJaxrsResponse and it fails on static fail method, calling context.setEntity(response.readEntity(InputStream.class));
However, this calls OutboundJaxrsResponse#readEntity and where there is

// TODO implement additional support if entity object is InputStream ?
throw new IllegalStateException("Not supported on an outbound message");

So this issue is about implementing TODOs.





[JERSEY-1515] Exception Mapper is not used for custom WebApplicationException Created: 19/Oct/12  Updated: 19/Feb/13  Resolved: 19/Feb/13

Status: Resolved
Project: jersey
Component/s: core
Affects Version/s: 2.0-m09
Fix Version/s: 2.0-m13, 2.0

Type: Bug Priority: Blocker
Reporter: jan.supol Assignee: Marek Potociar
Resolution: Duplicate Votes: 0
Labels: None
Remaining Estimate: 0 minutes
Time Spent: 4 hours
Original Estimate: 3 hours

Issue Links:
Duplicate
duplicates JERSEY-1529 Jersey is unable to create Resource w... Resolved

 Description   
public class VisibilityException extends WebApplicationException {

	private static final long serialVersionUID = -1159407312691372429L;	
	
}
@Provider
public class VisibilityExceptionMapper implements
		ExceptionMapper<VisibilityException> {
	private HttpHeaders headers;
	private UriInfo info;
	private Application application;
	private Request request;
	private Providers provider;

	protected VisibilityExceptionMapper(@Context HttpHeaders headers,
			@Context UriInfo info, @Context Application application,
			@Context Request request, @Context Providers provider) {
		super();
		this.headers = headers;
		this.info = info;
		this.application = application;
		this.request = request;
		this.provider = provider;
	}

	public VisibilityExceptionMapper(@Context HttpHeaders headers,
			@Context UriInfo info, @Context Application application,
			@Context Request request) {
		super();
		this.headers = headers;
		this.info = info;
		this.application = application;
		this.request = request;
	}

	public VisibilityExceptionMapper(@Context HttpHeaders headers,
			@Context UriInfo info, @Context Application application) {
		super();
		this.headers = headers;
		this.info = info;
		this.application = application;
	}

	public VisibilityExceptionMapper(@Context HttpHeaders headers,
			@Context UriInfo info) {
		super();
		this.headers = headers;
		this.info = info;
	}

	public VisibilityExceptionMapper(@Context HttpHeaders headers) {
		super();
		this.headers = headers;
	}
        
        @Override
	public Response toResponse(VisibilityException exception) {
           return Response.ok().build();
        }
}

@Path("resource")
public class Resource {
	@Path("exceptionmapper")
	@GET
	public String exceptionMapper() {
		throw new VisibilityException();
	}
}

VisibilityException is thrown, but the mapper is not used.

Maybe the mapper is not instantiated.






[JERSEY-1511] MessageBodyReader does not set default content-type Created: 18/Oct/12  Updated: 20/Feb/13  Resolved: 20/Feb/13

Status: Resolved
Project: jersey
Component/s: core
Affects Version/s: 2.0-m09
Fix Version/s: 2.0-m13, 2.0

Type: Bug Priority: Blocker
Reporter: jan.supol Assignee: Michal Gajdos
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: 0 minutes
Time Spent: 3 hours
Original Estimate: 3 hours


 Description   

suppose

@Path("resource")
public class Resource {
	@Context
	HttpHeaders headers;

	@Path("plain")
	@POST
	public String plain(EntityForReader efr) {
		return efr.toString() + ";"
				+ headers.getHeaderString(HttpHeaders.CONTENT_TYPE);
	}
}
@Provider
@Consumes(MediaType.APPLICATION_OCTET_STREAM)
public class AppOctetReader extends AbstractReader implements MessageBodyReader<EntityForReader> {

	@Override
	public boolean isReadable(Class<?> type, Type genericType,
			Annotation[] annotations, MediaType mediaType) {
		return MediaType.APPLICATION_OCTET_STREAM_TYPE.equals(mediaType);
	}

	@Override
	public EntityForReader readFrom(Class<EntityForReader> type,
			Type genericType, Annotation[] annotations, MediaType mediaType,
			MultivaluedMap<String, String> httpHeaders, InputStream entityStream)
			throws IOException, WebApplicationException {
		return null;
	}

}
public class EntityForReader {
	private String value;
	public EntityForReader(String value) {
		this.value = value;
	}
	
	@Override
	public String toString() {
		return value;
	}
}

AppOctetReader is used as appropriate, but mediaType is null, so isReadable returns false;
But the Spec. 4.2.1 Message Body Reader, paragraph 1, says:

Obtain the media type of the request. If the request does not contain a Content-Type header then
use application/octet-stream.

Hence, mediaType should be application/octet-stream.






[JERSEY-1510] Link.toString() returns incorrect value - URI is missing Created: 17/Oct/12  Updated: 18/Feb/13  Resolved: 18/Feb/13

Status: Resolved
Project: jersey
Component/s: core
Affects Version/s: 2.0-m08
Fix Version/s: 2.0-m13, 2.0

Type: Bug Priority: Major
Reporter: algermissen Assignee: Marek Potociar
Resolution: Cannot Reproduce Votes: 0
Labels: None
Remaining Estimate: 0 minutes
Time Spent: 1 hour
Original Estimate: 3 hours
Environment:

Glassfish 4 b58



 Description   

Link.toString() returns e.g. '; rel="edit"' instead of '<URI>; re="edit"'

Also, when using Link.fromResourceMethod() the created URI reference is relative to the JAX-RS context URI. I would have expected an absolute URI.



 Comments   
Comment by Marek Potociar [ 06/Feb/13 ]

Note that in the latest version of the API, the Link has changed significantly (e.g. it is an abstract class and not a final class). The change in implementation should take into account this issue that has been reported against original link impl.

Comment by Marek Potociar [ 18/Feb/13 ]

The issue is not reproducible anymore. I've added a unit test to verify this.





[JERSEY-1509] Clean up TODOs in OutboundJaxrsResponse Created: 17/Oct/12  Updated: 13/Feb/13  Resolved: 13/Feb/13

Status: Resolved
Project: jersey
Component/s: None
Affects Version/s: None
Fix Version/s: 2.0-m13, 2.0

Type: Bug Priority: Blocker
Reporter: Pavel Bucek Assignee: Marek Potociar
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: 0 minutes
Time Spent: 3 hours
Original Estimate: 3 hours


 Description   

consider special handling for cases where entity is InputStream or remove TODOs from code






[JERSEY-1502] Invocation.Builder#header("Content-Encoding",..) is omitted. Created: 15/Oct/12  Updated: 04/Feb/13  Resolved: 04/Feb/13

Status: Resolved
Project: jersey
Component/s: None
Affects Version/s: 2.0-m09
Fix Version/s: 2.0-m13, 2.0

Type: Bug Priority: Blocker
Reporter: jan.supol Assignee: Marek Potociar
Resolution: Works as designed Votes: 0
Labels: None
Remaining Estimate: 0 minutes
Time Spent: 2 hours
Original Estimate: 3 hours

Issue Links:
Related
is related to JAX_RS_SPEC-347 Clarify API docs around client-side e... Resolved

 Description   
		Client client = ClientFactory.newClient();
		WebTarget target = client
				.target("....");
		Invocation.Builder builder;
		builder = target.request("*/*");
		builder.header("Content-Encoding", "deflate");
		Invocation i;
		i = builder.build("POST", Entity.entity("aaa", MediaType.WILDCARD_TYPE));
		Response r = i.invoke();

results in:

>> POST ....
>> Accept:/, Transfer-Encoding:chunked, Content-Encoding:, Content-Type:/, Content-Language:

Content-Encoding is not set. Content-Language is not set, too, even if header is set.



 Comments   
Comment by Marek Potociar [ 04/Feb/13 ]

The expectations of the code above are invalid. The entity overrides Content-Encoding header that has been previously set, namely in this case it un-sets it (or sets it to null).

I have updated the JAX-RS API javadoc to clarify this explicitly in the API. See JAX_RS_SPEC-347. Closing the issue as works as designed.





[JERSEY-1488] @Context and @PostConstruct makes the App not to be deployed Created: 15/Oct/12  Updated: 22/Feb/13  Resolved: 22/Feb/13

Status: Resolved
Project: jersey
Component/s: core
Affects Version/s: 2.0-m09
Fix Version/s: 2.0-m13, 2.0

Type: Bug Priority: Blocker
Reporter: jan.supol Assignee: Michal Gajdos
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: 0 minutes
Time Spent: 2 hours
Original Estimate: 3 hours


 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.






[JERSEY-1487] ClientConfig: local variable hides member Created: 15/Oct/12  Updated: 19/Feb/13  Resolved: 19/Feb/13

Status: Resolved
Project: jersey
Component/s: core
Affects Version/s: 2.0-m08
Fix Version/s: 2.0-m13, 2.0

Type: Bug Priority: Trivial
Reporter: Lutz Horn Assignee: Marek Potociar
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: 0 minutes
Time Spent: 1 minute
Original Estimate: 3 hours

Attachments: Text File ClientConfig.patch    
Tags: client, warning

 Description   

The local variable runtime in org.glassfish.jersey.client.ClientConfig hides the member variable.

The patch fixes this by renaming the local variable.






[JERSEY-1486] null as vargars is not cast to Object or Object[] Created: 15/Oct/12  Updated: 19/Feb/13  Resolved: 19/Feb/13

Status: Resolved
Project: jersey
Component/s: core
Affects Version/s: 2.0-m08
Fix Version/s: 2.0-m13, 2.0

Type: Bug Priority: Trivial
Reporter: Lutz Horn Assignee: Marek Potociar
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: 0 minutes
Time Spent: 1 minute
Original Estimate: 3 hours

Attachments: Text File JerseyWebTargetTest.patch    
Tags: client, test, warning

 Description   

null as varargs parameter values of JerseyWebTarget.queryParam(String name, Object... values) is neither cast to Object nor to Object[].

The patches fixes this by casting null to Object.



 Comments   
Comment by Marek Potociar [ 19/Feb/13 ]

Has been resolved already.





[JERSEY-1485] Tests don't use Generics Created: 15/Oct/12  Updated: 19/Feb/13  Resolved: 19/Feb/13

Status: Resolved
Project: jersey
Component/s: core
Affects Version/s: 2.0-m08
Fix Version/s: 2.0-m13, 2.0

Type: Bug Priority: Trivial
Reporter: Lutz Horn Assignee: Marek Potociar
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: 0 minutes
Time Spent: 30 minutes
Original Estimate: 3 hours

Attachments: Text File ClientConfigTest.patch    
Tags: client, test, warning

 Description   

Two tests of org.glassfish.jersey.client.ClientConfigTest don't use Generics.

The attached patch fixes this.






[JERSEY-1484] Tests override member client Created: 15/Oct/12  Updated: 19/Feb/13  Resolved: 19/Feb/13

Status: Resolved
Project: jersey
Component/s: core
Affects Version/s: 2.0-m08
Fix Version/s: 2.0-m13, 2.0

Type: Bug Priority: Trivial
Reporter: Lutz Horn Assignee: Marek Potociar
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: 0 minutes
Time Spent: 1 minute
Original Estimate: 3 hours

Attachments: Text File JerseyClientTest.patch    
Tags: client, test, warning

 Description   

Two tests in org.glassfish.jersey.client.JerseyClientTest override the member client.

The attached patch fixes this.






[JERSEY-1390] Add support for MVC pattern - port support for MVC to Jersey 2.0 (including all the tests). Created: 27/Aug/12  Updated: 26/Feb/13  Resolved: 26/Feb/13

Status: Resolved
Project: jersey
Component/s: core
Affects Version/s: None
Fix Version/s: 2.0-m13, 2.0

Type: New Feature Priority: Critical
Reporter: Michal Gajdos Assignee: Michal Gajdos
Resolution: Fixed Votes: 0
Labels: None
Σ Remaining Estimate: 0 minutes Remaining Estimate: Not Specified
Σ Time Spent: 2 days, 16 hours, 1 minute Time Spent: Not Specified
Σ Original Estimate: 1 day, 12 hours Original Estimate: Not Specified

Issue Links:
Duplicate
is duplicated by JERSEY-1310 Migrate MVC support from Jersey 1.x Resolved
Sub-Tasks:
Key
Summary
Type
Status
Assignee
JERSEY-1623 spike Sub-task Resolved Michal Gajdos  
JERSEY-1646 Implement MVC in Jersey 2.0 Sub-task Resolved Michal Gajdos  

 Description   

Migrate support for MVC from Jersey 1.x to Jersey 2.0 (including all the tests).

DEMO: add relevant sample (see jersey 1.x bookstore for inspiration)






[JERSEY-1342] Introduce proxyable request scope Created: 06/Aug/12  Updated: 27/Feb/13  Resolved: 27/Feb/13

Status: Closed
Project: jersey
Component/s: core
Affects Version/s: None
Fix Version/s: 2.0-m13, 2.0

Type: New Feature Priority: Critical
Reporter: Marek Potociar Assignee: Jakub Podlesak
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: 0 minutes
Time Spent: 2 days, 5 hours, 30 minutes
Original Estimate: 18 hours

Issue Links:
Dependency
depends on HK2-76 HK2 proxied injection does not seem t... Resolved
Duplicate
is duplicated by JERSEY-1245 Introduce Proxiable RequestScope Resolved
Related
is related to JERSEY-1764 Proxiable injection does not seem to ... Resolved
is related to JERSEY-1761 proxiable request scoped injectables ... Resolved

 Description   

Once working, unignore org.glassfish.jersey.tests.e2e.entity.InjectedProvider test to confirm it is really working (the test is trying to inject UriInfo into a message body worker).



 Comments   
Comment by t.broyer [ 26/Feb/13 ]

Migrating from 2.0-m12 to 2.0-m12-1, my async responses that make use of UriInfo all start to fail (see stacktrace below)

févr. 26, 2013 3:54:28 PM com.google.common.util.concurrent.ExecutionList$RunnableExecutorPair execute
SEVERE: RuntimeException while executing runnable com.google.common.util.concurrent.Futures$6@3bf67d5f with executor com.google.common.util.concurrent.MoreExecutors$SameThreadExecutorService@33a106ba
java.lang.IllegalStateException: Not inside a request scope.
	at com.google.common.base.Preconditions.checkState(Preconditions.java:149)
	at org.glassfish.jersey.process.internal.RequestScope.current(RequestScope.java:225)
	at org.glassfish.jersey.process.internal.RequestScope.findOrCreate(RequestScope.java:153)
	at org.jvnet.hk2.internal.MethodInterceptorImpl.intercept(MethodInterceptorImpl.java:77)
	at org.jvnet.hk2.internal.Utilities$MethodInterceptorInvocationHandler.invoke(Utilities.java:2230)
	at sun.proxy.$Proxy46.getBaseUriBuilder(Unknown Source)
…
	at com.google.common.collect.Iterators$9.transform(Iterators.java:893)
	at com.google.common.collect.TransformedIterator.next(TransformedIterator.java:48)
	at com.google.common.collect.ImmutableList.copyOf(ImmutableList.java:266)
	at com.google.common.collect.ImmutableList.copyOf(ImmutableList.java:223)
…
	at com.google.common.util.concurrent.Futures$6.run(Futures.java:799)
	at com.google.common.util.concurrent.MoreExecutors$SameThreadExecutorService.execute(MoreExecutors.java:262)
	at com.google.common.util.concurrent.ExecutionList$RunnableExecutorPair.execute(ExecutionList.java:149)
	at com.google.common.util.concurrent.ExecutionList.execute(ExecutionList.java:134)
	at com.google.common.util.concurrent.AbstractFuture.set(AbstractFuture.java:175)
	at com.google.common.util.concurrent.SettableFuture.set(SettableFuture.java:53)
…
	at org.glassfish.jersey.client.JerseyInvocation$7.completed(JerseyInvocation.java:902)
	at org.glassfish.jersey.client.ClientRuntime$1$1$1.run(ClientRuntime.java:137)
	at org.glassfish.jersey.process.internal.RequestScope.runInScope(RequestScope.java:294)
	at org.glassfish.jersey.client.ClientRuntime$3.run(ClientRuntime.java:179)
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
	at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
	at java.util.concurrent.FutureTask.run(FutureTask.java:166)
	at com.google.common.util.concurrent.MoreExecutors$SameThreadExecutorService.execute(MoreExecutors.java:262)
	at com.google.common.util.concurrent.AbstractListeningExecutorService.submit(AbstractListeningExecutorService.java:43)
	at com.google.common.util.concurrent.AbstractListeningExecutorService.submit(AbstractListeningExecutorService.java:40)
	at org.glassfish.jersey.client.ClientRuntime.submit(ClientRuntime.java:176)
	at org.glassfish.jersey.client.ClientRuntime.access$300(ClientRuntime.java:67)
	at org.glassfish.jersey.client.ClientRuntime$1$1.response(ClientRuntime.java:126)
	at org.glassfish.jersey.client.HttpUrlConnector$2.run(HttpUrlConnector.java:212)
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
	at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
	at java.util.concurrent.FutureTask.run(FutureTask.java:166)
	at com.google.common.util.concurrent.MoreExecutors$SameThreadExecutorService.execute(MoreExecutors.java:262)
	at com.google.common.util.concurrent.AbstractListeningExecutorService.submit(AbstractListeningExecutorService.java:43)
	at org.glassfish.jersey.client.HttpUrlConnector.apply(HttpUrlConnector.java:208)
	at org.glassfish.jersey.client.ClientRuntime$1.run(ClientRuntime.java:156)
	at org.glassfish.jersey.process.internal.RequestScope.runInScope(RequestScope.java:317)
	at org.glassfish.jersey.client.ClientRuntime$2.run(ClientRuntime.java:170)
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
	at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
	at java.util.concurrent.FutureTask.run(FutureTask.java:166)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
	at java.lang.Thread.run(Thread.java:722)

Note: my JAX-RS resources are making async calls using the JAX-RS async client API, and tries to construct links using the UriInfo from the InvocationCallback's completed. More precisely, but it shouldn't matter here, the InvocationCallback is setting the value of a SettableFuture that my resource is listening (Futures.addCallback), and the UriInfo is used from the FutureCallback's onSuccess.

Other resources where I do JAX-RS async client calls but do not use UriInfo complete without error.

Looking at the diff between 2.0-m12 and 2.0-m12-1 (https://github.com/jersey/jersey/compare/2.0-m12...2.0-m12-1) it seems to be due to this specific change (https://github.com/jersey/jersey/commit/31282668a10fc115686fd6d4c181380b9bac5ee8) which references this issue.

The "Fix version" field is set to 2.0-m13 but I don't see any commit in the 2.0-m12-1...master diff that references this issue or would fix the issue I'm encountering.

Comment by Jakub Podlesak [ 27/Feb/13 ]

To workaround untile this gets fixed, you should be able to extract the correct value from the proxy before the request processing gets suspended.
Here is a simple example, as i do not know your exact use case:


@GET
public void asyncGet(@Context UriInfo ui, @Suspended final AsyncResponse response) {

          final UriBuilder baseUriBuilder = ui.getBaseUriBuilder();

          // now suspend and resume later on with
          Executors.newSingleThreadExecutor().submit(new Runnable() {

                  @Override
                  public void run() {
                        String hereWeGo = longRunningOp();
                        ar.resume(baseUriBuilder.path(hereWeGo).build());
                  }
           });
}
Comment by Marek Potociar [ 27/Feb/13 ]

Reopening as it seems the issue has not been fixed from the comments.

Comment by Marek Potociar [ 27/Feb/13 ]

Actually I see there is a separate issue filed. Closing again.

Comment by t.broyer [ 27/Feb/13 ]

Thanks Jakub, that does the trick. For completeness, it should be noted the UriBuilder has to be clone()}}d if used several times (i.e. replace {{uriInfo.getBaseUriBuilder() with uriBuilder.clone())





[JERSEY-1159] Activation of features based on the presence of certain properties in the ResourceConfig property bag. Created: 16/May/12  Updated: 26/Feb/13  Resolved: 21/Feb/13

Status: Resolved
Project: jersey
Component/s: None
Affects Version/s: 2.0-m12
Fix Version/s: 2.0-m13, 2.0

Type: New Feature Priority: Blocker
Reporter: Martin Matula Assignee: Michal Gajdos
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: 0 minutes
Time Spent: 8 hours
Original Estimate: 18 hours

Issue Links:
Dependency
blocks JERSEY-1700 Bean validation does not work out of ... Resolved

 Description   

There could for example be FeatureActivationProvider (or something similar). Implementations of that could be registered through META-INF services to "sniff" the resource config property bag during the application initialization and based on the presence of certain properties add feature-specific providers/modules, etc. - i.e. activate certain features.

Other option would be to add a custom annotation like @ActivateOn(

{list of property names}

) that could be attached to providers to indicate, they should only be used if a given property is present - such providers could be registered through meta-inf services to be always found by the runtime, but would only be used if a given property is set.

DEMO: Rewrite UriConfigFitler to utilize the property activator - if language or media type mapping property is present in the resource config, the activator would automatically add the UriConnegFilter to the set of providers. Add an integration test that uses web.xml to set media type mappings and show it works without explicitly adding the UriConnegFilter to the list of providers.






[JERSEY-1117] hk2 throws an exception when cannot inject entity Created: 18/Apr/12  Updated: 26/Feb/13  Resolved: 13/Feb/13

Status: Resolved
Project: jersey
Component/s: core
Affects Version/s: 2.0-m04, 2.0-m12
Fix Version/s: 2.0-m05, 2.0-m13, 2.0

Type: Bug Priority: Blocker
Reporter: jan.supol Assignee: Pavel Bucek
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: 0 minutes
Time Spent: 2 hours, 30 minutes
Original Estimate: 3 hours


 Description   

Suppose:

public class ParamEntityThrowingWebApplicationException {

    public static ParamEntityThrowingWebApplicationException fromString(
            String arg) {
        throw new WebApplicationException(Status.valueOf(parseArg(arg)));
    }

    protected static String parseArg(String arg) {
        return arg.contains("=") ? arg.replaceAll(".*=", "") : arg;
    }
} 

@Path(value = "/QueryParamTest")
public class QueryParamTest extends ParamTest {
	@QueryParam("FieldParamEntityThrowingWebApplicationException")
	ParamEntityThrowingWebApplicationException fieldEntityThrowingWebApplicationException;

        @GET
    @Produces("text/plain")
    public String stringParamHandling(...)
}

When

GET /jaxrs_ee_rs_queryparam_web/QueryParamTest?

then

org.jvnet.hk2.component.UnsatisfiedDependencyException: injection failed on com.sun.ts.tests.jaxrs.ee.rs.queryparam.QueryParamTest.fieldEntityThrowingWebApplicationException with class com.sun.ts.tests.jaxrs.ee.rs.ParamEntityThrowingWebApplicationException
at org.jvnet.hk2.component.InjectionManager.syncDoInject(InjectionManager.java:211)
at org.jvnet.hk2.component.InjectionManager.inject(InjectionManager.java:107)
at com.sun.hk2.component.AbstractCreatorImpl.inject(AbstractCreatorImpl.java:127)
at com.sun.hk2.component.ConstructorCreator.initialize(ConstructorCreator.java:117)
at com.sun.hk2.component.AbstractCreatorImpl.get(AbstractCreatorImpl.java:84)
at com.sun.hk2.component.AbstractInhabitantImpl.get(AbstractInhabitantImpl.java:135)
at org.jvnet.hk2.component.Habitat.getByType(Habitat.java:1387)
at org.jvnet.hk2.component.Habitat.inject(Habitat.java:1196)
at org.glassfish.jersey.server.internal.routing.PushResourceUriAndDelegateTreeAcceptor.pushMatchedToRoutingContext(PushResourceUriAndDelegateTreeAcceptor.java:74)
at org.glassfish.jersey.server.internal.routing.AbstractPushRoutingInfoAndDelegateTreeAcceptor.apply(AbstractPushRoutingInfoAndDelegateTreeAcceptor.java:79)
at org.glassfish.jersey.process.internal.HierarchicalRequestProcessor._apply(HierarchicalRequestProcessor.java:107)
at org.glassfish.jersey.process.internal.HierarchicalRequestProcessor._apply(HierarchicalRequestProcessor.java:114)
at org.glassfish.jersey.process.internal.HierarchicalRequestProcessor._apply(HierarchicalRequestProcessor.java:114)
at org.glassfish.jersey.process.internal.HierarchicalRequestProcessor.apply(HierarchicalRequestProcessor.java:101)
at org.glassfish.jersey.process.internal.RequestInvoker$AcceptingInvoker.apply(RequestInvoker.java:252)
at org.glassfish.jersey.process.internal.RequestInvoker$AcceptingInvoker.apply(RequestInvoker.java:236)
at org.glassfish.jersey.process.internal.AsyncInflectorAdapter.apply(AsyncInflectorAdapter.java:121)
at org.glassfish.jersey.process.internal.RequestInvoker$2.runInScope(RequestInvoker.java:212)
at org.glassfish.jersey.process.internal.RequestInvoker$2.run(RequestInvoker.java:187)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
at java.util.concurrent.FutureTask.run(FutureTask.java:138)
at com.google.common.util.concurrent.MoreExecutors$SameThreadExecutorService.execute(MoreExecutors.java:253)
at com.google.common.util.concurrent.AbstractListeningExecutorService.submit(AbstractListeningExecutorService.java:44)
at com.google.common.util.concurrent.AbstractListeningExecutorService.submit(AbstractListeningExecutorService.java:41)
at org.glassfish.jersey.process.internal.RequestInvoker.apply(RequestInvoker.java:220)
at org.glassfish.jersey.server.ApplicationHandler.apply(ApplicationHandler.java:477)
at org.glassfish.jersey.server.ApplicationHandler.apply(ApplicationHandler.java:445)
at org.glassfish.jersey.servlet.WebComponent.service(WebComponent.java:226)
at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:323)
at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:290)
at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:176)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:224)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:169)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:168)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:98)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:928)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407)
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:987)
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:539)
at org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.run(AprEndpoint.java:1815)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:662)



 Comments   
Comment by Pavel Bucek [ 14/May/12 ]
--- a/core-server/src/main/java/org/glassfish/jersey/server/internal/inject/ParamInjectionResolver.java
+++ b/core-server/src/main/java/org/glassfish/jersey/server/internal/inject/ParamInjectionResolver.java
@@ -94,7 +94,7 @@ public abstract class ParamInjectionResolver<A extends Annotation> extends Injec
 
     @Override
     public boolean isOptional(AnnotatedElement annotated, A annotation) {
-        return false; // TODO - is this ok?
+        return true;
     }
 
Comment by jan.supol [ 05/Feb/13 ]

The problem persists. Specifically, the Spec. Section 3.2 says:

A WebApplicationException thrown during construction of field or property values using 2 or 3 above
is processed directly as described in Section 3.3.4. Other exceptions thrown during construction of field
or property values using 2 or 3 above are treated as client errors: if the field or property is annotated with
@MatrixParam, @QueryParam or @PathParam then an implementation MUST generate an instance of
NotFoundException (404 status) that wraps the thrown exception and no entity; if the field or property is
annotated with @HeaderParam or @CookieParam then an implementation MUST generate an instance of
BadRequestException (400 status) that wraps the thrown exception and no entity. Exceptions MUST be
processed as described in Section 3.3.4.

The exception thrown is in wrapped hk2 runtime exception and exception mapper catching webapplicationexception is of no use here.





ApplicationPath annotation does not allow percent encoded values (JERSEY-975)

[JERSEY-998] ApplicationPath is not taken in an account on Tomcat Created: 29/Feb/12  Updated: 26/Feb/13  Resolved: 29/Feb/12

Status: Resolved
Project: jersey
Component/s: None
Affects Version/s: None
Fix Version/s: 2.0-m13, 2.0

Type: Sub-task Priority: Minor
Reporter: jan.supol Assignee: Unassigned
Resolution: Invalid Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

Suppose having

@ApplicationPath("ApplicationPath%21")
public class TSAppConfig extends Application {

public java.util.Set<java.lang.Class<?>> getClasses()

{ Set<Class<?>> resources = new HashSet<Class<?>>(); resources.add(Resource.class); return resources; }


}

and Resource

@Path("/Resource")
public class Resource {
@GET
public Response returnOk(@Context UriInfo uriInfo)

{ return Response.ok(uriInfo.getAbsolutePath().toString()).build(); }

}

On tomcat, for get /jaxrs_ee_applicationpath_web/ApplicationPath!/Resource/ HTTP/1.1, one receive 404, but get jaxrs_ee_applicationpath_web/Resource/ works, and http://localhost:8080/jaxrs_ee_applicationpath_web/Resource/ is the response.



 Comments   
Comment by Pavel Bucek [ 29/Feb/12 ]

you are evidently NOT using servlet 3.x features for deploying your application.

see @ApplicationPath javadoc:

  • <p>When published in a Servlet container, the value of the application path
  • may be overridden using a servlet-mapping element in the web.xml.</p>

closing as invalid.





[JERSEY-680] Proxy based client generation Created: 16/Mar/11  Updated: 26/Feb/13  Resolved: 22/Feb/13

Status: Resolved
Project: jersey
Component/s: core
Affects Version/s: None
Fix Version/s: 2.0-m13, 2.0

Type: Improvement Priority: Major
Reporter: gdavison Assignee: Marek Potociar
Resolution: Fixed Votes: 2
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

It is desirable to take a WADL or other IDL and be able to generate a skeleton client based on
java interfaces in the same way that JAX-WS works.

When we investigated this a while back we in JDeveloper team put together a proxing client
that could provide some input to this work.

http://kingsfleet.blogspot.com/2009/09/javalangreflectproxy-client-based-on.html
and
http://kingsfleet.blogspot.com/2009/10/proxy-client-based-on-jersey-with-bit.html

It should be possible to integration this with later work on link generation that Mark Hadley
had worked on.



 Comments   
Comment by alwillha [ 21/Mar/12 ]

See JAXRSClientFactory in CXF http://cxf.apache.org/docs/jax-rs-client-api.html

Comment by Pavel Bucek [ 21/Mar/12 ]

thanks for pointer.

very unfortunate naming though, this has nothing to do with JAX-RS Client API, see http://jcp.org/en/jsr/detail?id=339

Comment by Marek Potociar [ 22/Feb/13 ]

See the ext/proxy-client module in Jersey 2.x





Generated at Tue May 05 22:50:52 UTC 2015 using JIRA 6.2.3#6260-sha1:63ef1d6dac3f4f4d7db4c1effd405ba38ccdc558.