[jira] [Commented] (CXF-8119) Can't Inject "javax.ws.rs.core.Context" annotation with camel blueprint
[ https://issues.apache.org/jira/browse/CXF-8119?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16957213#comment-16957213 ] Marco Tenti commented on CXF-8119: -- After many test and sue case the interceptor management i popose seem not to work . I'm open to any suggestion for solve this issue . ty. > Can't Inject "javax.ws.rs.core.Context" annotation with camel blueprint > --- > > Key: CXF-8119 > URL: https://issues.apache.org/jira/browse/CXF-8119 > Project: CXF > Issue Type: Bug > Components: Bus, Core, JAX-RS, OSGi, Resources >Affects Versions: 3.2.7 >Reporter: Marco Tenti >Priority: Major > > I have a REST Service project build for a Red Hat Fuse. > it's a simple set up of a rest service with a "blueprint.xml" and the > "cxf:rsServer" and it's work just fine. > But i need to use the @Context annotation of javax.ws.rs and i ca't find a > way to inject dynamically the @Context on my java class. > A full project for test of the problem can be found here: > [bug-load-context-annotation-blueprint|https://github.com/p4535992/bug-load-context-annotation-blueprint] > My goal is to set the value of the field; > {code:java} > @javax.ws.rs.core.Context > public javax.ws.rs.core.HttpHeaders httpHeaders; > {code} > Another strange bug is if i call the method: > {code:java} > @GET > @Path("/ping") > @Produces(MediaType.APPLICATION_JSON) > @WebMethod(operationName = "ping") > @WebResult(name = "Response") > @ApiResponses(value = { > @ApiResponse(code = 200, message = "Success") , > @ApiResponse(code = 500, message = "Error") > } > ) > @ApiOperation( "Get operation with Response and @Default value") > public Response ping() { > logger.info("PING SIGNATURE SERVICE"); > return Response.ok().entity("PING SIGNATURE SERVICE").build(); > } > } > {code} > it's work just fine , but if i call this (i just add the @Context HttpHeaders > httpHeaders parameter on the method) : > {code:java} > @GET > @Path("/ping") > @Produces(MediaType.APPLICATION_JSON) > @WebMethod(operationName = "ping") > @WebResult(name = "Response") > @ApiResponses(value = > { @ApiResponse(code = 200, message = "Success") , @ApiResponse(code = 500, > message = "Error") } > ) > @ApiOperation( "Get operation with Response and @Default value") > public Response ping(@Context HttpHeaders httpHeaders) > { logger.info("PING SIGNATURE SERVICE"); return Response.ok().entity("PING > SIGNATURE SERVICE").build(); } > } > {code} > i get this error: > {code} > 415 Error: Unsupported Media Type > {code} > Teh documentation say something about the attribute "propagateContexts" to > true, but seem do nothing: > {code:} > uri="cxfrs:bean:myRestSereer?performInvocation=true&bindingStyle=SimpleConsumer&propagateContexts=true"/> > {code} > ANOTHER example i can't undestand, the first method is injected with succes, > the second give me the "415 Error: Unsupported Media Type": > {code:java} > /** >* THIS WORK >*/ > @GET > @Path("/getheader") > public Response getHeaderDetails( > @HeaderParam("User-Agent") String userAgent, > @HeaderParam("Content-Type") String contentType, > @HeaderParam("Accept") String accept > ) { > String header = "User-Agent: " + userAgent + > "\nContent-Type: " + contentType + > "\nAccept: " + accept; > return Response.status(200).entity(header).build(); > } > /** >* THIS NOT WORK error "415 Error: Unsupported Media Type" >*/ > @GET > @Path("/getallheader") > public Response getAllHeader(@Context HttpHeaders httpHeaders) { > // local variables > StringBuffer stringBuffer = new StringBuffer(); > String headerValue = ""; > for(String header : httpHeaders.getRequestHeaders().keySet()) { > headerValue = > httpHeaders.getRequestHeader(header).get(0); > stringBuffer.append(header + ": " + headerValue + "\n"); > } > logger.info(stringBuffer.toString()); > return > Response.status(200).entity(stringBuffer.toString()).build(); > } > {code} > Anyone know what i'm doing wrong with camel-blueprint? -- This message was sent by Atlassian Jira (v8.3.4#803005)
[jira] [Comment Edited] (CXF-8119) Can't Inject "javax.ws.rs.core.Context" annotation with camel blueprint
[ https://issues.apache.org/jira/browse/CXF-8119?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16957213#comment-16957213 ] Marco Tenti edited comment on CXF-8119 at 10/22/19 4:34 PM: After many test and use case the interceptor management i propose seem not to work . I'm open to any suggestion for solve this issue . ty. was (Author: 4535992): After many test and sue case the interceptor management i popose seem not to work . I'm open to any suggestion for solve this issue . ty. > Can't Inject "javax.ws.rs.core.Context" annotation with camel blueprint > --- > > Key: CXF-8119 > URL: https://issues.apache.org/jira/browse/CXF-8119 > Project: CXF > Issue Type: Bug > Components: Bus, Core, JAX-RS, OSGi, Resources >Affects Versions: 3.2.7 >Reporter: Marco Tenti >Priority: Major > > I have a REST Service project build for a Red Hat Fuse. > it's a simple set up of a rest service with a "blueprint.xml" and the > "cxf:rsServer" and it's work just fine. > But i need to use the @Context annotation of javax.ws.rs and i ca't find a > way to inject dynamically the @Context on my java class. > A full project for test of the problem can be found here: > [bug-load-context-annotation-blueprint|https://github.com/p4535992/bug-load-context-annotation-blueprint] > My goal is to set the value of the field; > {code:java} > @javax.ws.rs.core.Context > public javax.ws.rs.core.HttpHeaders httpHeaders; > {code} > Another strange bug is if i call the method: > {code:java} > @GET > @Path("/ping") > @Produces(MediaType.APPLICATION_JSON) > @WebMethod(operationName = "ping") > @WebResult(name = "Response") > @ApiResponses(value = { > @ApiResponse(code = 200, message = "Success") , > @ApiResponse(code = 500, message = "Error") > } > ) > @ApiOperation( "Get operation with Response and @Default value") > public Response ping() { > logger.info("PING SIGNATURE SERVICE"); > return Response.ok().entity("PING SIGNATURE SERVICE").build(); > } > } > {code} > it's work just fine , but if i call this (i just add the @Context HttpHeaders > httpHeaders parameter on the method) : > {code:java} > @GET > @Path("/ping") > @Produces(MediaType.APPLICATION_JSON) > @WebMethod(operationName = "ping") > @WebResult(name = "Response") > @ApiResponses(value = > { @ApiResponse(code = 200, message = "Success") , @ApiResponse(code = 500, > message = "Error") } > ) > @ApiOperation( "Get operation with Response and @Default value") > public Response ping(@Context HttpHeaders httpHeaders) > { logger.info("PING SIGNATURE SERVICE"); return Response.ok().entity("PING > SIGNATURE SERVICE").build(); } > } > {code} > i get this error: > {code} > 415 Error: Unsupported Media Type > {code} > Teh documentation say something about the attribute "propagateContexts" to > true, but seem do nothing: > {code:} > uri="cxfrs:bean:myRestSereer?performInvocation=true&bindingStyle=SimpleConsumer&propagateContexts=true"/> > {code} > ANOTHER example i can't undestand, the first method is injected with succes, > the second give me the "415 Error: Unsupported Media Type": > {code:java} > /** >* THIS WORK >*/ > @GET > @Path("/getheader") > public Response getHeaderDetails( > @HeaderParam("User-Agent") String userAgent, > @HeaderParam("Content-Type") String contentType, > @HeaderParam("Accept") String accept > ) { > String header = "User-Agent: " + userAgent + > "\nContent-Type: " + contentType + > "\nAccept: " + accept; > return Response.status(200).entity(header).build(); > } > /** >* THIS NOT WORK error "415 Error: Unsupported Media Type" >*/ > @GET > @Path("/getallheader") > public Response getAllHeader(@Context HttpHeaders httpHeaders) { > // local variables > StringBuffer stringBuffer = new StringBuffer(); > String headerValue = ""; > for(String header : httpHeaders.getRequestHeaders().keySet()) { > headerValue = > httpHeaders.getRequestHeader(header).get(0); > stringBuffer.append(header + ": " + headerValue + "\n"); > } > logger.info(stringBuffer.toString()); > return > Response.status(200).entity(stringBuffer.toString()).build(); > } > {code} > Anyone know what i'm doing wrong with camel-blueprint? -- This message was sent by Atlassian Jira (v8.3.4#803005)
[jira] [Commented] (CXF-8134) Upgrade to Spring Boot 2.2
[ https://issues.apache.org/jira/browse/CXF-8134?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16957385#comment-16957385 ] Freeman Yue Fang commented on CXF-8134: --- Thanks [~reta]! We also need to upgrade to use spring framework 5.2.0 with spring boot 2.2.0 Freeman > Upgrade to Spring Boot 2.2 > -- > > Key: CXF-8134 > URL: https://issues.apache.org/jira/browse/CXF-8134 > Project: CXF > Issue Type: Improvement >Affects Versions: 3.4.0 >Reporter: Andriy Redko >Assignee: Andriy Redko >Priority: Major > Fix For: 3.4.0 > > > Spring Boot 2.2 has just been released: > * [https://spring.io/blog/2019/10/16/spring-boot-2-2-0] > * > [https://github.com/spring-projects/spring-boot/wiki/Spring-Boot-2.2-Release-Notes] > One of the most important and impactful changes are related to *Jakarta EE > dependencies*: > > {quote}Where possible, we have moved from Java EE dependencies with a > {{javax.**}} group ID to the equivalent Jakarta EE dependencies with a > {{jakarta.}} group ID in Spring Boot’s starters. Dependency management for > the Jakarta EE API dependencies has been added alongside the existing > dependency management for the Java EE API dependencies. The dependency > management for the Java EE API dependencies will be removed in the future and > all users are encouraged to move to the Jakarta EE API dependencies. > As part of the Java EE to Jakarta EE migration, two dependencies have changed > artifact ID in their latest maintenance releases. {{com.sun.mail:javax.mail}} > is now {{com.sun.mail:jakarta.mail}} and {{org.glassfish:javax.el}} is now > {{org.glassfish:jakarta.el}}. In the unlikely event that you were using > either of these dependencies directly, please update your {{pom.xml}} or > {{build.gradle}} accordingly. > {quote} > > -- This message was sent by Atlassian Jira (v8.3.4#803005)
[jira] [Commented] (CXF-8134) Upgrade to Spring Boot 2.2
[ https://issues.apache.org/jira/browse/CXF-8134?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16957494#comment-16957494 ] Andriy Redko commented on CXF-8134: --- Very right, thanks [~ffang], btw do you have any input on https://issues.apache.org/jira/browse/CXF-7910, (SAAJ 1.5 vs SAAJ 1.4) it would help us to move forward I think. > Upgrade to Spring Boot 2.2 > -- > > Key: CXF-8134 > URL: https://issues.apache.org/jira/browse/CXF-8134 > Project: CXF > Issue Type: Improvement >Affects Versions: 3.4.0 >Reporter: Andriy Redko >Assignee: Andriy Redko >Priority: Major > Fix For: 3.4.0 > > > Spring Boot 2.2 has just been released: > * [https://spring.io/blog/2019/10/16/spring-boot-2-2-0] > * > [https://github.com/spring-projects/spring-boot/wiki/Spring-Boot-2.2-Release-Notes] > One of the most important and impactful changes are related to *Jakarta EE > dependencies*: > > {quote}Where possible, we have moved from Java EE dependencies with a > {{javax.**}} group ID to the equivalent Jakarta EE dependencies with a > {{jakarta.}} group ID in Spring Boot’s starters. Dependency management for > the Jakarta EE API dependencies has been added alongside the existing > dependency management for the Java EE API dependencies. The dependency > management for the Java EE API dependencies will be removed in the future and > all users are encouraged to move to the Jakarta EE API dependencies. > As part of the Java EE to Jakarta EE migration, two dependencies have changed > artifact ID in their latest maintenance releases. {{com.sun.mail:javax.mail}} > is now {{com.sun.mail:jakarta.mail}} and {{org.glassfish:javax.el}} is now > {{org.glassfish:jakarta.el}}. In the unlikely event that you were using > either of these dependencies directly, please update your {{pom.xml}} or > {{build.gradle}} accordingly. > {quote} > > -- This message was sent by Atlassian Jira (v8.3.4#803005)
[jira] [Commented] (CXF-8119) Can't Inject "javax.ws.rs.core.Context" annotation with camel blueprint
[ https://issues.apache.org/jira/browse/CXF-8119?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16957495#comment-16957495 ] Andriy Redko commented on CXF-8119: --- Hi [~4535992] , my apologies, I promised to look at it but have not found the time. I will use the rest of the week to understand proper CXF and Camel integration and come back to you shortly. Thank you. > Can't Inject "javax.ws.rs.core.Context" annotation with camel blueprint > --- > > Key: CXF-8119 > URL: https://issues.apache.org/jira/browse/CXF-8119 > Project: CXF > Issue Type: Bug > Components: Bus, Core, JAX-RS, OSGi, Resources >Affects Versions: 3.2.7 >Reporter: Marco Tenti >Priority: Major > > I have a REST Service project build for a Red Hat Fuse. > it's a simple set up of a rest service with a "blueprint.xml" and the > "cxf:rsServer" and it's work just fine. > But i need to use the @Context annotation of javax.ws.rs and i ca't find a > way to inject dynamically the @Context on my java class. > A full project for test of the problem can be found here: > [bug-load-context-annotation-blueprint|https://github.com/p4535992/bug-load-context-annotation-blueprint] > My goal is to set the value of the field; > {code:java} > @javax.ws.rs.core.Context > public javax.ws.rs.core.HttpHeaders httpHeaders; > {code} > Another strange bug is if i call the method: > {code:java} > @GET > @Path("/ping") > @Produces(MediaType.APPLICATION_JSON) > @WebMethod(operationName = "ping") > @WebResult(name = "Response") > @ApiResponses(value = { > @ApiResponse(code = 200, message = "Success") , > @ApiResponse(code = 500, message = "Error") > } > ) > @ApiOperation( "Get operation with Response and @Default value") > public Response ping() { > logger.info("PING SIGNATURE SERVICE"); > return Response.ok().entity("PING SIGNATURE SERVICE").build(); > } > } > {code} > it's work just fine , but if i call this (i just add the @Context HttpHeaders > httpHeaders parameter on the method) : > {code:java} > @GET > @Path("/ping") > @Produces(MediaType.APPLICATION_JSON) > @WebMethod(operationName = "ping") > @WebResult(name = "Response") > @ApiResponses(value = > { @ApiResponse(code = 200, message = "Success") , @ApiResponse(code = 500, > message = "Error") } > ) > @ApiOperation( "Get operation with Response and @Default value") > public Response ping(@Context HttpHeaders httpHeaders) > { logger.info("PING SIGNATURE SERVICE"); return Response.ok().entity("PING > SIGNATURE SERVICE").build(); } > } > {code} > i get this error: > {code} > 415 Error: Unsupported Media Type > {code} > Teh documentation say something about the attribute "propagateContexts" to > true, but seem do nothing: > {code:} > uri="cxfrs:bean:myRestSereer?performInvocation=true&bindingStyle=SimpleConsumer&propagateContexts=true"/> > {code} > ANOTHER example i can't undestand, the first method is injected with succes, > the second give me the "415 Error: Unsupported Media Type": > {code:java} > /** >* THIS WORK >*/ > @GET > @Path("/getheader") > public Response getHeaderDetails( > @HeaderParam("User-Agent") String userAgent, > @HeaderParam("Content-Type") String contentType, > @HeaderParam("Accept") String accept > ) { > String header = "User-Agent: " + userAgent + > "\nContent-Type: " + contentType + > "\nAccept: " + accept; > return Response.status(200).entity(header).build(); > } > /** >* THIS NOT WORK error "415 Error: Unsupported Media Type" >*/ > @GET > @Path("/getallheader") > public Response getAllHeader(@Context HttpHeaders httpHeaders) { > // local variables > StringBuffer stringBuffer = new StringBuffer(); > String headerValue = ""; > for(String header : httpHeaders.getRequestHeaders().keySet()) { > headerValue = > httpHeaders.getRequestHeader(header).get(0); > stringBuffer.append(header + ": " + headerValue + "\n"); > } > logger.info(stringBuffer.toString()); > return > Response.status(200).entity(stringBuffer.toString()).build(); > } > {code} > Anyone know what i'm doing wrong with camel-blueprint? -- This message was sent by Atlassian Jira (v8.3.4#803005)
[jira] [Commented] (CXF-8135) AbstractJAXRSFactoryBean does not set the service on EndpointInfo
[ https://issues.apache.org/jira/browse/CXF-8135?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16957500#comment-16957500 ] Andriy Redko commented on CXF-8135: --- Hi [~Noé Maillard] , this a good question, could you please provide more details why this is a problem for `LoggingInInterceptor`, a small sample application or test case would be very helpful, thank you. > AbstractJAXRSFactoryBean does not set the service on EndpointInfo > - > > Key: CXF-8135 > URL: https://issues.apache.org/jira/browse/CXF-8135 > Project: CXF > Issue Type: Bug > Components: JAX-RS >Reporter: Noé Maillard >Priority: Major > > Hello, > `AbstractJAXRSFactoryBean` does not set the service on EndpointInfo, which > among other things i'm sure doesn't allow the `LoggingInInterceptor` to > retreive the correct logger name. > is there a way to circumvent this or is it a bug ? > [https://github.com/apache/cxf/blob/17ef92116d99c4a6d7f5721a546d90dc3c599923/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/AbstractJAXRSFactoryBean.java#L125|https://github.com/apache/cxf/blob/17ef92116d99c4a6d7f5721a546d90dc3c599923/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/AbstractJAXRSFactoryBean.java#L147] > > thank you ! -- This message was sent by Atlassian Jira (v8.3.4#803005)