[ 
https://issues.apache.org/jira/browse/CXF-8119?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Marco Tenti updated CXF-8119:
-----------------------------
    Description: 
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 f 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 annotation;
{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:
{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}

Anyone know what i'm doing wrong with camel-blueprint?

  was:
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 f 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 annotation;
{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:
{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:java}
415 Error: Unsupported Media Type
{code:java}
 {code}
Anyone know what i'm doing wrong with camel-blueprint?


> 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: Minor
>
> 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 f 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 annotation;
> {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:
> {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}
> Anyone know what i'm doing wrong with camel-blueprint?



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to