[jira] [Commented] (ARIES-1867) ContainerResponseFilter not fired for SSE endpoint

2018-11-27 Thread JIRA


[ 
https://issues.apache.org/jira/browse/ARIES-1867?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16701022#comment-16701022
 ] 

Raymond Augé commented on ARIES-1867:
-

[~tomq42] I have to say that I'm worried by your description that at runtime 
you make a request which triggers a change in configuration with the intention 
of affecting some other closely related request.

That makes me nervous because we generally assume that changes in configuration 
are not part of the business logic of an application. Configuration is the 
deployers domain, not application domain.

[~timothyjward] thoughts on this?

> ContainerResponseFilter not fired for SSE endpoint
> --
>
> Key: ARIES-1867
> URL: https://issues.apache.org/jira/browse/ARIES-1867
> Project: Aries
>  Issue Type: Bug
>  Components: jax-rs-whiteboard
>Affects Versions: jax-rs-whiteboard-1.0.2
>Reporter: Tom Quarendon
>Assignee: Carlos Sierra
>Priority: Major
> Attachments: CORSFilter.java, Server.java, TestService3.java, 
> make.out, make2.out
>
>
> I have a resource class such as the following:
> {code:java}
> @Path("events")
> @JaxrsResource
> public class EventsResource {
>   private Sse sse;
>   private SseBroadcaster eventBroadcaster;
>   @Context
>   public void setSse(Sse sse) {
> this.sse = sse;
> this.eventBroadcaster = sse.newBroadcaster();
>   }
>   @GET
>   @Produces(MediaType.SERVER_SENT_EVENTS)
>   public void suscribeToEvents(@Context SseEventSink eventSink) {
> eventBroadcaster.register(eventSink);
>   }
> }
> {code}
>  
>  
> In addition, I have a CORS filter:
>  
> {code:java}
> @Component(immediate=true)
> @Provider
> @JaxrsExtension
> public class CORSFilter implements ContainerResponseFilter {
>   @Override
>   public void filter(ContainerRequestContext requestContext, 
> ContainerResponseContext responseContext) throws IOException {
> System.out.println("CORSFilter for 
> "+requestContext.getUriInfo().getPath());
> MultivaluedMap headers = responseContext.getHeaders();
> headers.add("Access-Control-Allow-Origin", 
> requestContext.getHeaderString("Origin"));
> ...
> {code}
>  
> The CORS filter gets fired on all requests as I expect, _except_ for ones to 
> the EventResource.subscribeToEvents method. Hence browsers complain when 
> receiving SSE events.
> This used to work fine with jersey as the JAXRS implementation. CORS filter 
> got called for the EventsResource.subscribeToEvents call.
> I've no idea whether this is a jaxrs-whiteboard level issue, or a CXF level 
> issue. I will try and come up with a plain CXF test of the same thing for 
> comparison.
>  



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (ARIES-1867) ContainerResponseFilter not fired for SSE endpoint

2018-11-27 Thread Carlos Sierra (JIRA)


[ 
https://issues.apache.org/jira/browse/ARIES-1867?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16701004#comment-16701004
 ] 

Carlos Sierra commented on ARIES-1867:
--

I forgot to mention that, during the time of rewiring, it is likely that the 
underlying servlet will return 404.

Carlos.

> ContainerResponseFilter not fired for SSE endpoint
> --
>
> Key: ARIES-1867
> URL: https://issues.apache.org/jira/browse/ARIES-1867
> Project: Aries
>  Issue Type: Bug
>  Components: jax-rs-whiteboard
>Affects Versions: jax-rs-whiteboard-1.0.2
>Reporter: Tom Quarendon
>Assignee: Carlos Sierra
>Priority: Major
> Attachments: CORSFilter.java, Server.java, TestService3.java, 
> make.out, make2.out
>
>
> I have a resource class such as the following:
> {code:java}
> @Path("events")
> @JaxrsResource
> public class EventsResource {
>   private Sse sse;
>   private SseBroadcaster eventBroadcaster;
>   @Context
>   public void setSse(Sse sse) {
> this.sse = sse;
> this.eventBroadcaster = sse.newBroadcaster();
>   }
>   @GET
>   @Produces(MediaType.SERVER_SENT_EVENTS)
>   public void suscribeToEvents(@Context SseEventSink eventSink) {
> eventBroadcaster.register(eventSink);
>   }
> }
> {code}
>  
>  
> In addition, I have a CORS filter:
>  
> {code:java}
> @Component(immediate=true)
> @Provider
> @JaxrsExtension
> public class CORSFilter implements ContainerResponseFilter {
>   @Override
>   public void filter(ContainerRequestContext requestContext, 
> ContainerResponseContext responseContext) throws IOException {
> System.out.println("CORSFilter for 
> "+requestContext.getUriInfo().getPath());
> MultivaluedMap headers = responseContext.getHeaders();
> headers.add("Access-Control-Allow-Origin", 
> requestContext.getHeaderString("Origin"));
> ...
> {code}
>  
> The CORS filter gets fired on all requests as I expect, _except_ for ones to 
> the EventResource.subscribeToEvents method. Hence browsers complain when 
> receiving SSE events.
> This used to work fine with jersey as the JAXRS implementation. CORS filter 
> got called for the EventsResource.subscribeToEvents call.
> I've no idea whether this is a jaxrs-whiteboard level issue, or a CXF level 
> issue. I will try and come up with a plain CXF test of the same thing for 
> comparison.
>  



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (ARIES-1867) ContainerResponseFilter not fired for SSE endpoint

2018-11-27 Thread Carlos Sierra (JIRA)


[ 
https://issues.apache.org/jira/browse/ARIES-1867?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16700998#comment-16700998
 ] 

Carlos Sierra commented on ARIES-1867:
--

[~tomq42]
{code:java}
Can you explain to me the circumstances under which the JAX-RS whiteboard 
reconfigures?{code}
it _rewires_ the application everytime a change is detected in a resource or an 
extension affecting an application. If the properties are modified and those 
properties affect the whiteboard it also _rewires_ the application. This is 
needed because JAX-RS has not dynamic update of applications.

In the case of extensions, the whiteboard will request a new instance to the 
registry everytime an application is boostrapped. If the extension is not 
_PROTOTYPE_ scoped, the same instance will be used.

Carlos.

> ContainerResponseFilter not fired for SSE endpoint
> --
>
> Key: ARIES-1867
> URL: https://issues.apache.org/jira/browse/ARIES-1867
> Project: Aries
>  Issue Type: Bug
>  Components: jax-rs-whiteboard
>Affects Versions: jax-rs-whiteboard-1.0.2
>Reporter: Tom Quarendon
>Assignee: Carlos Sierra
>Priority: Major
> Attachments: CORSFilter.java, Server.java, TestService3.java, 
> make.out, make2.out
>
>
> I have a resource class such as the following:
> {code:java}
> @Path("events")
> @JaxrsResource
> public class EventsResource {
>   private Sse sse;
>   private SseBroadcaster eventBroadcaster;
>   @Context
>   public void setSse(Sse sse) {
> this.sse = sse;
> this.eventBroadcaster = sse.newBroadcaster();
>   }
>   @GET
>   @Produces(MediaType.SERVER_SENT_EVENTS)
>   public void suscribeToEvents(@Context SseEventSink eventSink) {
> eventBroadcaster.register(eventSink);
>   }
> }
> {code}
>  
>  
> In addition, I have a CORS filter:
>  
> {code:java}
> @Component(immediate=true)
> @Provider
> @JaxrsExtension
> public class CORSFilter implements ContainerResponseFilter {
>   @Override
>   public void filter(ContainerRequestContext requestContext, 
> ContainerResponseContext responseContext) throws IOException {
> System.out.println("CORSFilter for 
> "+requestContext.getUriInfo().getPath());
> MultivaluedMap headers = responseContext.getHeaders();
> headers.add("Access-Control-Allow-Origin", 
> requestContext.getHeaderString("Origin"));
> ...
> {code}
>  
> The CORS filter gets fired on all requests as I expect, _except_ for ones to 
> the EventResource.subscribeToEvents method. Hence browsers complain when 
> receiving SSE events.
> This used to work fine with jersey as the JAXRS implementation. CORS filter 
> got called for the EventsResource.subscribeToEvents call.
> I've no idea whether this is a jaxrs-whiteboard level issue, or a CXF level 
> issue. I will try and come up with a plain CXF test of the same thing for 
> comparison.
>  



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Updated] (ARIES-1871) race condition during test execution

2018-11-27 Thread JIRA


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

Raymond Augé updated ARIES-1871:

Description: 
When I run the jax-rs-whiteboard tests about 30-40% of the time I get a failure 
as follows (Always the same test):
{code:java}
TEST testSSEApplication(test.JaxrsTest) <<< ERROR: expected:<[welcome, 
message]> but was:<[]>
java.lang.AssertionError: expected:<[welcome, message]> but was:<[]>
    at org.junit.Assert.fail(Assert.java:88)
    at org.junit.Assert.failNotEquals(Assert.java:834)
    at org.junit.Assert.assertEquals(Assert.java:118)
    at org.junit.Assert.assertEquals(Assert.java:144)
    at test.JaxrsTest.testSSEApplication(JaxrsTest.java:2327)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at 
org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
    at 
org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
    at 
org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
    at 
org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
    at 
org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26)
    at 
org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27)
    at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
    at 
org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)
    at 
org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57)
    at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
    at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
    at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
    at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
    at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
    at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
    at junit.framework.JUnit4TestAdapter.run(JUnit4TestAdapter.java:38)
    at junit.framework.TestSuite.runTest(TestSuite.java:252)
    at junit.framework.TestSuite.run(TestSuite.java:247)
    at aQute.junit.Activator.test(Activator.java:351)
    at aQute.junit.Activator.automatic(Activator.java:237)
    at aQute.junit.Activator.run(Activator.java:178)
    at aQute.launcher.Launcher.lambda$serviceChanged$0(Launcher.java:1345)
    at aQute.launcher.Launcher.run(Launcher.java:347)
    at aQute.launcher.Launcher.main(Launcher.java:147){code}
{code:java}
Tests run  : 64
Passed : 63
Errors : 1
Failures   : 0
[INFO] 1 Error(s){code}
there's often a variation in the actual result, such as zero or one of 
"{{welcome, message".}}

  was:
When I run the jax-rs-whiteboard tests about 30-40% of the time I get a failure 
as follows (Always the same test):
{code:java}
TEST testSSEApplication(test.JaxrsTest) <<< ERROR: expected:<[welcome, 
message]> but was:<[]>
java.lang.AssertionError: expected:<[welcome, message]> but was:<[]>
    at org.junit.Assert.fail(Assert.java:88)
    at org.junit.Assert.failNotEquals(Assert.java:834)
    at org.junit.Assert.assertEquals(Assert.java:118)
    at org.junit.Assert.assertEquals(Assert.java:144)
    at test.JaxrsTest.testSSEApplication(JaxrsTest.java:2327)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at 
org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
    at 
org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
    at 
org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
    at 
org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
    at 
org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26)
    at 
org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27)
    at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
    at 
org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)
    at 
org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57)
    at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
    at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
    at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
    at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
    at 

[jira] [Updated] (ARIES-1870) URLs are not correctly reported on Windows

2018-11-27 Thread JIRA


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

Raymond Augé updated ARIES-1870:

Affects Version/s: (was: jax-rs-whiteboard-1.0.2)

> URLs are not correctly reported on Windows
> --
>
> Key: ARIES-1870
> URL: https://issues.apache.org/jira/browse/ARIES-1870
> Project: Aries
>  Issue Type: Bug
>  Components: jax-rs-whiteboard
>Affects Versions: jax-rs-whiteboard-1.0.2
>Reporter: Carlos Sierra
>Assignee: Carlos Sierra
>Priority: Major
> Fix For: jax-rs-whiteboard-1.0.2
>
>
> The report was using FileSystem dependent classes that have different 
> implementations depending on the operating system.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Updated] (ARIES-1870) URLs are not correctly reported on Windows

2018-11-27 Thread JIRA


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

Raymond Augé updated ARIES-1870:

Affects Version/s: jax-rs-whiteboard-1.0.2

> URLs are not correctly reported on Windows
> --
>
> Key: ARIES-1870
> URL: https://issues.apache.org/jira/browse/ARIES-1870
> Project: Aries
>  Issue Type: Bug
>  Components: jax-rs-whiteboard
>Affects Versions: jax-rs-whiteboard-1.0.2
>Reporter: Carlos Sierra
>Assignee: Carlos Sierra
>Priority: Major
> Fix For: jax-rs-whiteboard-1.0.2
>
>
> The report was using FileSystem dependent classes that have different 
> implementations depending on the operating system.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Created] (ARIES-1871) race condition during test execution

2018-11-27 Thread JIRA
Raymond Augé created ARIES-1871:
---

 Summary: race condition during test execution
 Key: ARIES-1871
 URL: https://issues.apache.org/jira/browse/ARIES-1871
 Project: Aries
  Issue Type: Bug
  Components: jax-rs-whiteboard
Reporter: Raymond Augé


When I run the jax-rs-whiteboard tests about 30-40% of the time I get a failure 
as follows (Always the same test):
{code:java}
TEST testSSEApplication(test.JaxrsTest) <<< ERROR: expected:<[welcome, 
message]> but was:<[]>
java.lang.AssertionError: expected:<[welcome, message]> but was:<[]>
    at org.junit.Assert.fail(Assert.java:88)
    at org.junit.Assert.failNotEquals(Assert.java:834)
    at org.junit.Assert.assertEquals(Assert.java:118)
    at org.junit.Assert.assertEquals(Assert.java:144)
    at test.JaxrsTest.testSSEApplication(JaxrsTest.java:2327)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at 
org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
    at 
org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
    at 
org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
    at 
org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
    at 
org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26)
    at 
org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27)
    at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
    at 
org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)
    at 
org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57)
    at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
    at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
    at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
    at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
    at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
    at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
    at junit.framework.JUnit4TestAdapter.run(JUnit4TestAdapter.java:38)
    at junit.framework.TestSuite.runTest(TestSuite.java:252)
    at junit.framework.TestSuite.run(TestSuite.java:247)
    at aQute.junit.Activator.test(Activator.java:351)
    at aQute.junit.Activator.automatic(Activator.java:237)
    at aQute.junit.Activator.run(Activator.java:178)
    at aQute.launcher.Launcher.lambda$serviceChanged$0(Launcher.java:1345)
    at aQute.launcher.Launcher.run(Launcher.java:347)
    at aQute.launcher.Launcher.main(Launcher.java:147)
12:51:16.883 [main] ERROR o.a.a.j.r.w.internal.Whiteboard - Invalid 
'osgi.jaxrs.whiteboard.target' filter syntax in CachingServiceReference {
cachedProperties={osgi.jaxrs.whiteboard.target=//}
serviceReference={java.lang.Object}={osgi.jaxrs.resource=true, service.id=337, 
service.bundleid=12, service.scope=singleton, osgi.jaxrs.whiteboard.target=//}
}
Tests run  : 64
Passed : 63
Errors : 1
Failures   : 0
[INFO] 1 Error(s){code}

there's often a variation in the actual result, such as zero or one of 
"{{welcome, message".}}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (ARIES-1867) ContainerResponseFilter not fired for SSE endpoint

2018-11-27 Thread Tom Quarendon (JIRA)


[ 
https://issues.apache.org/jira/browse/ARIES-1867?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16700756#comment-16700756
 ] 

Tom Quarendon commented on ARIES-1867:
--

[~csierra] I'll have to re-check the symptoms re SSE. What I was seeing was 
that the browser (in the devtools window) was complaining that then the event 
was received it didn't have the relevant CORS headers. I'll have to create a 
plain CXF example and raise it with them I think. Manually putting the relevant 
CORS headers into the response from within the resource method (via @Context 
HttpServletResponse) solved the issue for me.

> ContainerResponseFilter not fired for SSE endpoint
> --
>
> Key: ARIES-1867
> URL: https://issues.apache.org/jira/browse/ARIES-1867
> Project: Aries
>  Issue Type: Bug
>  Components: jax-rs-whiteboard
>Affects Versions: jax-rs-whiteboard-1.0.2
>Reporter: Tom Quarendon
>Assignee: Carlos Sierra
>Priority: Major
> Attachments: CORSFilter.java, Server.java, TestService3.java, 
> make.out, make2.out
>
>
> I have a resource class such as the following:
> {code:java}
> @Path("events")
> @JaxrsResource
> public class EventsResource {
>   private Sse sse;
>   private SseBroadcaster eventBroadcaster;
>   @Context
>   public void setSse(Sse sse) {
> this.sse = sse;
> this.eventBroadcaster = sse.newBroadcaster();
>   }
>   @GET
>   @Produces(MediaType.SERVER_SENT_EVENTS)
>   public void suscribeToEvents(@Context SseEventSink eventSink) {
> eventBroadcaster.register(eventSink);
>   }
> }
> {code}
>  
>  
> In addition, I have a CORS filter:
>  
> {code:java}
> @Component(immediate=true)
> @Provider
> @JaxrsExtension
> public class CORSFilter implements ContainerResponseFilter {
>   @Override
>   public void filter(ContainerRequestContext requestContext, 
> ContainerResponseContext responseContext) throws IOException {
> System.out.println("CORSFilter for 
> "+requestContext.getUriInfo().getPath());
> MultivaluedMap headers = responseContext.getHeaders();
> headers.add("Access-Control-Allow-Origin", 
> requestContext.getHeaderString("Origin"));
> ...
> {code}
>  
> The CORS filter gets fired on all requests as I expect, _except_ for ones to 
> the EventResource.subscribeToEvents method. Hence browsers complain when 
> receiving SSE events.
> This used to work fine with jersey as the JAXRS implementation. CORS filter 
> got called for the EventsResource.subscribeToEvents call.
> I've no idea whether this is a jaxrs-whiteboard level issue, or a CXF level 
> issue. I will try and come up with a plain CXF test of the same thing for 
> comparison.
>  



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (ARIES-1867) ContainerResponseFilter not fired for SSE endpoint

2018-11-27 Thread Tom Quarendon (JIRA)


[ 
https://issues.apache.org/jira/browse/ARIES-1867?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16700754#comment-16700754
 ] 

Tom Quarendon commented on ARIES-1867:
--

[~csierra] Can you explain to me the circumstances under which the JAX-RS 
whiteboard reconfigures? I'm afraid I can't follow the code, it relies on a 
bunch of other Aries things that at the moment I can't delve into.

Does it republish whenever it detects ANY service being deactivated or 
activated, regardless of whether the service is a resource of extension? (I've 
been printing out the list of classes in CxfJaxrsServiceRegistrator.rewire, and 
apparently seeing no changes sometimes). 

What happens to any requests that are received during the same time window as 
that republish operation occurs? Is there a window where the "old" endpoint is 
shutdown before the new one is created and wired in when requests that are 
received would return a 404?

I'm trying to find an explanation for a 404 response I'm seeing when one of my 
endpoints briefly seems to go missing. When I print out the list of resources 
in that "rewire" method the resource class always seems to be there, so I'm 
trying to understand where it's going.

Separately I'm trying to understand why some of my services are being 
deactivated and reactivated when their config changes, _despite_ having an 
@Modified method, which I think is contributing to the bouncing of the 
endpoints.

 

Thanks.

> ContainerResponseFilter not fired for SSE endpoint
> --
>
> Key: ARIES-1867
> URL: https://issues.apache.org/jira/browse/ARIES-1867
> Project: Aries
>  Issue Type: Bug
>  Components: jax-rs-whiteboard
>Affects Versions: jax-rs-whiteboard-1.0.2
>Reporter: Tom Quarendon
>Assignee: Carlos Sierra
>Priority: Major
> Attachments: CORSFilter.java, Server.java, TestService3.java, 
> make.out, make2.out
>
>
> I have a resource class such as the following:
> {code:java}
> @Path("events")
> @JaxrsResource
> public class EventsResource {
>   private Sse sse;
>   private SseBroadcaster eventBroadcaster;
>   @Context
>   public void setSse(Sse sse) {
> this.sse = sse;
> this.eventBroadcaster = sse.newBroadcaster();
>   }
>   @GET
>   @Produces(MediaType.SERVER_SENT_EVENTS)
>   public void suscribeToEvents(@Context SseEventSink eventSink) {
> eventBroadcaster.register(eventSink);
>   }
> }
> {code}
>  
>  
> In addition, I have a CORS filter:
>  
> {code:java}
> @Component(immediate=true)
> @Provider
> @JaxrsExtension
> public class CORSFilter implements ContainerResponseFilter {
>   @Override
>   public void filter(ContainerRequestContext requestContext, 
> ContainerResponseContext responseContext) throws IOException {
> System.out.println("CORSFilter for 
> "+requestContext.getUriInfo().getPath());
> MultivaluedMap headers = responseContext.getHeaders();
> headers.add("Access-Control-Allow-Origin", 
> requestContext.getHeaderString("Origin"));
> ...
> {code}
>  
> The CORS filter gets fired on all requests as I expect, _except_ for ones to 
> the EventResource.subscribeToEvents method. Hence browsers complain when 
> receiving SSE events.
> This used to work fine with jersey as the JAXRS implementation. CORS filter 
> got called for the EventsResource.subscribeToEvents call.
> I've no idea whether this is a jaxrs-whiteboard level issue, or a CXF level 
> issue. I will try and come up with a plain CXF test of the same thing for 
> comparison.
>  



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (ARIES-1870) URLs are not correctly reported on Windows

2018-11-27 Thread Carlos Sierra (JIRA)


[ 
https://issues.apache.org/jira/browse/ARIES-1870?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16700740#comment-16700740
 ] 

Carlos Sierra commented on ARIES-1870:
--

Hi [~tomq42],

this should fix the issues you were having with the tests.

Could you verify this works for you now?

Bests.

Carlos.

> URLs are not correctly reported on Windows
> --
>
> Key: ARIES-1870
> URL: https://issues.apache.org/jira/browse/ARIES-1870
> Project: Aries
>  Issue Type: Bug
>  Components: jax-rs-whiteboard
>Affects Versions: jax-rs-whiteboard-1.0.2
>Reporter: Carlos Sierra
>Assignee: Carlos Sierra
>Priority: Major
> Fix For: jax-rs-whiteboard-1.0.2
>
>
> The report was using FileSystem dependent classes that have different 
> implementations depending on the operating system.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (ARIES-1867) ContainerResponseFilter not fired for SSE endpoint

2018-11-27 Thread Carlos Sierra (JIRA)


[ 
https://issues.apache.org/jira/browse/ARIES-1867?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16700736#comment-16700736
 ] 

Carlos Sierra commented on ARIES-1867:
--

Hi [~tomq42],
{noformat}
So the SSE example seems to be the special case, and I can (and have) worked 
round that as our use of that is limited and I've just manually added the CORS 
headers where necessary.{noformat}
I have checked and it looks like CXF _suspends_ the response processing in the 
/_subscribe_ method and defers the headers until the first event is sent. I did 
not find anywhere saying this is not a proper behavior or that this does not 
work with CORS. In any case this would be a bug for CXF.

If we find further evidence that this is a bug in either the whiteboard or CXF 
we can reopen this.

Thx.

Carlos.

 

> ContainerResponseFilter not fired for SSE endpoint
> --
>
> Key: ARIES-1867
> URL: https://issues.apache.org/jira/browse/ARIES-1867
> Project: Aries
>  Issue Type: Bug
>  Components: jax-rs-whiteboard
>Affects Versions: jax-rs-whiteboard-1.0.2
>Reporter: Tom Quarendon
>Assignee: Carlos Sierra
>Priority: Major
> Attachments: CORSFilter.java, Server.java, TestService3.java, 
> make.out, make2.out
>
>
> I have a resource class such as the following:
> {code:java}
> @Path("events")
> @JaxrsResource
> public class EventsResource {
>   private Sse sse;
>   private SseBroadcaster eventBroadcaster;
>   @Context
>   public void setSse(Sse sse) {
> this.sse = sse;
> this.eventBroadcaster = sse.newBroadcaster();
>   }
>   @GET
>   @Produces(MediaType.SERVER_SENT_EVENTS)
>   public void suscribeToEvents(@Context SseEventSink eventSink) {
> eventBroadcaster.register(eventSink);
>   }
> }
> {code}
>  
>  
> In addition, I have a CORS filter:
>  
> {code:java}
> @Component(immediate=true)
> @Provider
> @JaxrsExtension
> public class CORSFilter implements ContainerResponseFilter {
>   @Override
>   public void filter(ContainerRequestContext requestContext, 
> ContainerResponseContext responseContext) throws IOException {
> System.out.println("CORSFilter for 
> "+requestContext.getUriInfo().getPath());
> MultivaluedMap headers = responseContext.getHeaders();
> headers.add("Access-Control-Allow-Origin", 
> requestContext.getHeaderString("Origin"));
> ...
> {code}
>  
> The CORS filter gets fired on all requests as I expect, _except_ for ones to 
> the EventResource.subscribeToEvents method. Hence browsers complain when 
> receiving SSE events.
> This used to work fine with jersey as the JAXRS implementation. CORS filter 
> got called for the EventsResource.subscribeToEvents call.
> I've no idea whether this is a jaxrs-whiteboard level issue, or a CXF level 
> issue. I will try and come up with a plain CXF test of the same thing for 
> comparison.
>  



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Closed] (ARIES-1867) ContainerResponseFilter not fired for SSE endpoint

2018-11-27 Thread Carlos Sierra (JIRA)


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

Carlos Sierra closed ARIES-1867.

Resolution: Not A Bug

> ContainerResponseFilter not fired for SSE endpoint
> --
>
> Key: ARIES-1867
> URL: https://issues.apache.org/jira/browse/ARIES-1867
> Project: Aries
>  Issue Type: Bug
>  Components: jax-rs-whiteboard
>Affects Versions: jax-rs-whiteboard-1.0.2
>Reporter: Tom Quarendon
>Assignee: Carlos Sierra
>Priority: Major
> Attachments: CORSFilter.java, Server.java, TestService3.java, 
> make.out, make2.out
>
>
> I have a resource class such as the following:
> {code:java}
> @Path("events")
> @JaxrsResource
> public class EventsResource {
>   private Sse sse;
>   private SseBroadcaster eventBroadcaster;
>   @Context
>   public void setSse(Sse sse) {
> this.sse = sse;
> this.eventBroadcaster = sse.newBroadcaster();
>   }
>   @GET
>   @Produces(MediaType.SERVER_SENT_EVENTS)
>   public void suscribeToEvents(@Context SseEventSink eventSink) {
> eventBroadcaster.register(eventSink);
>   }
> }
> {code}
>  
>  
> In addition, I have a CORS filter:
>  
> {code:java}
> @Component(immediate=true)
> @Provider
> @JaxrsExtension
> public class CORSFilter implements ContainerResponseFilter {
>   @Override
>   public void filter(ContainerRequestContext requestContext, 
> ContainerResponseContext responseContext) throws IOException {
> System.out.println("CORSFilter for 
> "+requestContext.getUriInfo().getPath());
> MultivaluedMap headers = responseContext.getHeaders();
> headers.add("Access-Control-Allow-Origin", 
> requestContext.getHeaderString("Origin"));
> ...
> {code}
>  
> The CORS filter gets fired on all requests as I expect, _except_ for ones to 
> the EventResource.subscribeToEvents method. Hence browsers complain when 
> receiving SSE events.
> This used to work fine with jersey as the JAXRS implementation. CORS filter 
> got called for the EventsResource.subscribeToEvents call.
> I've no idea whether this is a jaxrs-whiteboard level issue, or a CXF level 
> issue. I will try and come up with a plain CXF test of the same thing for 
> comparison.
>  



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (ARIES-1870) URLs are not correctly reported on Windows

2018-11-27 Thread ASF subversion and git services (JIRA)


[ 
https://issues.apache.org/jira/browse/ARIES-1870?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16700483#comment-16700483
 ] 

ASF subversion and git services commented on ARIES-1870:


Commit 30042ac6afe4c425fe019928bc559223892260e2 in aries-jax-rs-whiteboard's 
branch refs/heads/master from [~csierra]
[ https://gitbox.apache.org/repos/asf?p=aries-jax-rs-whiteboard.git;h=30042ac ]

[ARIES-1870] Do not use file system dependent classes


> URLs are not correctly reported on Windows
> --
>
> Key: ARIES-1870
> URL: https://issues.apache.org/jira/browse/ARIES-1870
> Project: Aries
>  Issue Type: Bug
>  Components: jax-rs-whiteboard
>Affects Versions: jax-rs-whiteboard-1.0.2
>Reporter: Carlos Sierra
>Assignee: Carlos Sierra
>Priority: Major
> Fix For: jax-rs-whiteboard-1.0.2
>
>
> The report was using FileSystem dependent classes that have different 
> implementations depending on the operating system.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Created] (ARIES-1870) URLs are not correctly reported on Windows

2018-11-27 Thread Carlos Sierra (JIRA)
Carlos Sierra created ARIES-1870:


 Summary: URLs are not correctly reported on Windows
 Key: ARIES-1870
 URL: https://issues.apache.org/jira/browse/ARIES-1870
 Project: Aries
  Issue Type: Bug
  Components: jax-rs-whiteboard
Affects Versions: jax-rs-whiteboard-1.0.2
Reporter: Carlos Sierra
Assignee: Carlos Sierra
 Fix For: jax-rs-whiteboard-1.0.2


The report was using FileSystem dependent classes that have different 
implementations depending on the operating system.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (ARIES-1867) ContainerResponseFilter not fired for SSE endpoint

2018-11-27 Thread Carlos Sierra (JIRA)


[ 
https://issues.apache.org/jira/browse/ARIES-1867?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16700473#comment-16700473
 ] 

Carlos Sierra commented on ARIES-1867:
--

indeed... this was not working on Windows. My bad

Opening a new ticket and fixing.

Thanks for reporting.

Carlos.

> ContainerResponseFilter not fired for SSE endpoint
> --
>
> Key: ARIES-1867
> URL: https://issues.apache.org/jira/browse/ARIES-1867
> Project: Aries
>  Issue Type: Bug
>  Components: jax-rs-whiteboard
>Affects Versions: jax-rs-whiteboard-1.0.2
>Reporter: Tom Quarendon
>Assignee: Carlos Sierra
>Priority: Major
> Attachments: CORSFilter.java, Server.java, TestService3.java, 
> make.out, make2.out
>
>
> I have a resource class such as the following:
> {code:java}
> @Path("events")
> @JaxrsResource
> public class EventsResource {
>   private Sse sse;
>   private SseBroadcaster eventBroadcaster;
>   @Context
>   public void setSse(Sse sse) {
> this.sse = sse;
> this.eventBroadcaster = sse.newBroadcaster();
>   }
>   @GET
>   @Produces(MediaType.SERVER_SENT_EVENTS)
>   public void suscribeToEvents(@Context SseEventSink eventSink) {
> eventBroadcaster.register(eventSink);
>   }
> }
> {code}
>  
>  
> In addition, I have a CORS filter:
>  
> {code:java}
> @Component(immediate=true)
> @Provider
> @JaxrsExtension
> public class CORSFilter implements ContainerResponseFilter {
>   @Override
>   public void filter(ContainerRequestContext requestContext, 
> ContainerResponseContext responseContext) throws IOException {
> System.out.println("CORSFilter for 
> "+requestContext.getUriInfo().getPath());
> MultivaluedMap headers = responseContext.getHeaders();
> headers.add("Access-Control-Allow-Origin", 
> requestContext.getHeaderString("Origin"));
> ...
> {code}
>  
> The CORS filter gets fired on all requests as I expect, _except_ for ones to 
> the EventResource.subscribeToEvents method. Hence browsers complain when 
> receiving SSE events.
> This used to work fine with jersey as the JAXRS implementation. CORS filter 
> got called for the EventsResource.subscribeToEvents call.
> I've no idea whether this is a jaxrs-whiteboard level issue, or a CXF level 
> issue. I will try and come up with a plain CXF test of the same thing for 
> comparison.
>  



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (ARIES-1869) Example does not work with current karaf 4.2.1

2018-11-27 Thread Christian Schneider (JIRA)


[ 
https://issues.apache.org/jira/browse/ARIES-1869?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16700245#comment-16700245
 ] 

Christian Schneider commented on ARIES-1869:


After the commit the closure based example works. The blueprint based example 
gives returns an exception:

java.lang.IllegalStateException: Need active coordination
 at org.apache.aries.jpa.support.impl.EMSupplierImpl.get(EMSupplierImpl.java:81)
 at org.apache.aries.jpa.support.osgi.impl.EmProxy.invoke(EmProxy.java:38)

 

> Example does not work with current karaf 4.2.1
> --
>
> Key: ARIES-1869
> URL: https://issues.apache.org/jira/browse/ARIES-1869
> Project: Aries
>  Issue Type: Bug
>  Components: JPA
>Affects Versions: jpa-2.7.0
>Reporter: Christian Schneider
>Assignee: Christian Schneider
>Priority: Major
> Fix For: jpa-2.8.0
>
>
> See 
> [https://stackoverflow.com/questions/53433775/org-apache-aries-jpaorg-apache-aries-jpa-blueprint2-3-0-cant-make-run]
>  



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[GitHub] aries pull request #92: Fix documentation in transaction20 schema

2018-11-27 Thread Smasherr
GitHub user Smasherr opened a pull request:

https://github.com/apache/aries/pull/92

Fix documentation in transaction20 schema



You can merge this pull request into a Git repository by running:

$ git pull https://github.com/Smasherr/aries trunk

Alternatively you can review and apply these changes as the patch at:

https://github.com/apache/aries/pull/92.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

This closes #92


commit 301b12f43062deffa2875d663585bdcb83f59dc4
Author: Daniel Estermann 
Date:   2018-11-27T10:51:37Z

Fix documentation in transaction20 schema




---


[jira] [Updated] (ARIES-1867) ContainerResponseFilter not fired for SSE endpoint

2018-11-27 Thread Tom Quarendon (JIRA)


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

Tom Quarendon updated ARIES-1867:
-
Attachment: make2.out

> ContainerResponseFilter not fired for SSE endpoint
> --
>
> Key: ARIES-1867
> URL: https://issues.apache.org/jira/browse/ARIES-1867
> Project: Aries
>  Issue Type: Bug
>  Components: jax-rs-whiteboard
>Affects Versions: jax-rs-whiteboard-1.0.2
>Reporter: Tom Quarendon
>Assignee: Carlos Sierra
>Priority: Major
> Attachments: CORSFilter.java, Server.java, TestService3.java, 
> make.out, make2.out
>
>
> I have a resource class such as the following:
> {code:java}
> @Path("events")
> @JaxrsResource
> public class EventsResource {
>   private Sse sse;
>   private SseBroadcaster eventBroadcaster;
>   @Context
>   public void setSse(Sse sse) {
> this.sse = sse;
> this.eventBroadcaster = sse.newBroadcaster();
>   }
>   @GET
>   @Produces(MediaType.SERVER_SENT_EVENTS)
>   public void suscribeToEvents(@Context SseEventSink eventSink) {
> eventBroadcaster.register(eventSink);
>   }
> }
> {code}
>  
>  
> In addition, I have a CORS filter:
>  
> {code:java}
> @Component(immediate=true)
> @Provider
> @JaxrsExtension
> public class CORSFilter implements ContainerResponseFilter {
>   @Override
>   public void filter(ContainerRequestContext requestContext, 
> ContainerResponseContext responseContext) throws IOException {
> System.out.println("CORSFilter for 
> "+requestContext.getUriInfo().getPath());
> MultivaluedMap headers = responseContext.getHeaders();
> headers.add("Access-Control-Allow-Origin", 
> requestContext.getHeaderString("Origin"));
> ...
> {code}
>  
> The CORS filter gets fired on all requests as I expect, _except_ for ones to 
> the EventResource.subscribeToEvents method. Hence browsers complain when 
> receiving SSE events.
> This used to work fine with jersey as the JAXRS implementation. CORS filter 
> got called for the EventsResource.subscribeToEvents call.
> I've no idea whether this is a jaxrs-whiteboard level issue, or a CXF level 
> issue. I will try and come up with a plain CXF test of the same thing for 
> comparison.
>  



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (ARIES-1867) ContainerResponseFilter not fired for SSE endpoint

2018-11-27 Thread Tom Quarendon (JIRA)


[ 
https://issues.apache.org/jira/browse/ARIES-1867?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16700186#comment-16700186
 ] 

Tom Quarendon commented on ARIES-1867:
--

If I manually run the jax-rs.itests directory, I get [^make2.out]

> ContainerResponseFilter not fired for SSE endpoint
> --
>
> Key: ARIES-1867
> URL: https://issues.apache.org/jira/browse/ARIES-1867
> Project: Aries
>  Issue Type: Bug
>  Components: jax-rs-whiteboard
>Affects Versions: jax-rs-whiteboard-1.0.2
>Reporter: Tom Quarendon
>Assignee: Carlos Sierra
>Priority: Major
> Attachments: CORSFilter.java, Server.java, TestService3.java, 
> make.out, make2.out
>
>
> I have a resource class such as the following:
> {code:java}
> @Path("events")
> @JaxrsResource
> public class EventsResource {
>   private Sse sse;
>   private SseBroadcaster eventBroadcaster;
>   @Context
>   public void setSse(Sse sse) {
> this.sse = sse;
> this.eventBroadcaster = sse.newBroadcaster();
>   }
>   @GET
>   @Produces(MediaType.SERVER_SENT_EVENTS)
>   public void suscribeToEvents(@Context SseEventSink eventSink) {
> eventBroadcaster.register(eventSink);
>   }
> }
> {code}
>  
>  
> In addition, I have a CORS filter:
>  
> {code:java}
> @Component(immediate=true)
> @Provider
> @JaxrsExtension
> public class CORSFilter implements ContainerResponseFilter {
>   @Override
>   public void filter(ContainerRequestContext requestContext, 
> ContainerResponseContext responseContext) throws IOException {
> System.out.println("CORSFilter for 
> "+requestContext.getUriInfo().getPath());
> MultivaluedMap headers = responseContext.getHeaders();
> headers.add("Access-Control-Allow-Origin", 
> requestContext.getHeaderString("Origin"));
> ...
> {code}
>  
> The CORS filter gets fired on all requests as I expect, _except_ for ones to 
> the EventResource.subscribeToEvents method. Hence browsers complain when 
> receiving SSE events.
> This used to work fine with jersey as the JAXRS implementation. CORS filter 
> got called for the EventsResource.subscribeToEvents call.
> I've no idea whether this is a jaxrs-whiteboard level issue, or a CXF level 
> issue. I will try and come up with a plain CXF test of the same thing for 
> comparison.
>  



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (ARIES-1867) ContainerResponseFilter not fired for SSE endpoint

2018-11-27 Thread Tom Quarendon (JIRA)


[ 
https://issues.apache.org/jira/browse/ARIES-1867?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16700185#comment-16700185
 ] 

Tom Quarendon commented on ARIES-1867:
--

I'm running Windows 10.

If I just run "mvn clean install" from the root of the repository I get 
[^make.out]

Those errors I can reproduce within eclipse, the test just seems a plain junit 
test. 

The "testResourceWithSubresource" failure, if I print out the "wrappers" list 
before the assert, I get:
[\{"method":"GET", "consumingMimeType":null, 
"producingMimeType":["application/xml"], "nameBindings":null, "path":"/"}, 
\{"method":"POST", "consumingMimeType":["application/xml"], 
"producingMimeType":["text/plain","application/json"], "nameBindings":null, 
"path":"resourc...ce\\{path}"}, \{"method":"GET", 
"consumingMimeType":["application/json"], 
"producingMimeType":["application/json"], "nameBindings":null, 
"path":"resourc...ce\\{path}"}, \{"method":"POST", 
"consumingMimeType":["application/xml"], 
"producingMimeType":["text/plain","application/json"], "nameBindings":null, 
"path":"resourc...resource\\"}, \{"method":"GET", 
"consumingMimeType":["application/json"], 
"producingMimeType":["application/json"], "nameBindings":null, 
"path":"resourc...resource\\"}]

The path values seem wrong, presumably because I'm on Windows? Printing just 
those values I get:
\\resource\subresource\\{path}
\\resource\subresource\\{path}
\\resource\subresource\
\\resource\subresource\

In testPlainResourceSeveralOperationsWithDifferentPath, it seems the same, I 
get:
[\{"method":"GET", "consumingMimeType":null, "producingMimeType":null, 
"nameBindings":null, "path":"/"}, \{"method":"POST", "consumingMimeType":null, 
"producingMimeType":null, "nameBindings":null, 
"path":"common\\different\\"}]
/
\\common\different\

for testPlainResourceSeveralOperationsWIthCommonPath I get:
[\{"method":"GET", "consumingMimeType":null, "producingMimeType":null, 
"nameBindings":null, "path":"/"}, \{"method":"POST", "consumingMimeType":null, 
"producingMimeType":null, "nameBindings":null, "path":"/"}] 

 

 

> ContainerResponseFilter not fired for SSE endpoint
> --
>
> Key: ARIES-1867
> URL: https://issues.apache.org/jira/browse/ARIES-1867
> Project: Aries
>  Issue Type: Bug
>  Components: jax-rs-whiteboard
>Affects Versions: jax-rs-whiteboard-1.0.2
>Reporter: Tom Quarendon
>Assignee: Carlos Sierra
>Priority: Major
> Attachments: CORSFilter.java, Server.java, TestService3.java, make.out
>
>
> I have a resource class such as the following:
> {code:java}
> @Path("events")
> @JaxrsResource
> public class EventsResource {
>   private Sse sse;
>   private SseBroadcaster eventBroadcaster;
>   @Context
>   public void setSse(Sse sse) {
> this.sse = sse;
> this.eventBroadcaster = sse.newBroadcaster();
>   }
>   @GET
>   @Produces(MediaType.SERVER_SENT_EVENTS)
>   public void suscribeToEvents(@Context SseEventSink eventSink) {
> eventBroadcaster.register(eventSink);
>   }
> }
> {code}
>  
>  
> In addition, I have a CORS filter:
>  
> {code:java}
> @Component(immediate=true)
> @Provider
> @JaxrsExtension
> public class CORSFilter implements ContainerResponseFilter {
>   @Override
>   public void filter(ContainerRequestContext requestContext, 
> ContainerResponseContext responseContext) throws IOException {
> System.out.println("CORSFilter for 
> "+requestContext.getUriInfo().getPath());
> MultivaluedMap headers = responseContext.getHeaders();
> headers.add("Access-Control-Allow-Origin", 
> requestContext.getHeaderString("Origin"));
> ...
> {code}
>  
> The CORS filter gets fired on all requests as I expect, _except_ for ones to 
> the EventResource.subscribeToEvents method. Hence browsers complain when 
> receiving SSE events.
> This used to work fine with jersey as the JAXRS implementation. CORS filter 
> got called for the EventsResource.subscribeToEvents call.
> I've no idea whether this is a jaxrs-whiteboard level issue, or a CXF level 
> issue. I will try and come up with a plain CXF test of the same thing for 
> comparison.
>  



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Updated] (ARIES-1867) ContainerResponseFilter not fired for SSE endpoint

2018-11-27 Thread Tom Quarendon (JIRA)


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

Tom Quarendon updated ARIES-1867:
-
Attachment: make.out

> ContainerResponseFilter not fired for SSE endpoint
> --
>
> Key: ARIES-1867
> URL: https://issues.apache.org/jira/browse/ARIES-1867
> Project: Aries
>  Issue Type: Bug
>  Components: jax-rs-whiteboard
>Affects Versions: jax-rs-whiteboard-1.0.2
>Reporter: Tom Quarendon
>Assignee: Carlos Sierra
>Priority: Major
> Attachments: CORSFilter.java, Server.java, TestService3.java, make.out
>
>
> I have a resource class such as the following:
> {code:java}
> @Path("events")
> @JaxrsResource
> public class EventsResource {
>   private Sse sse;
>   private SseBroadcaster eventBroadcaster;
>   @Context
>   public void setSse(Sse sse) {
> this.sse = sse;
> this.eventBroadcaster = sse.newBroadcaster();
>   }
>   @GET
>   @Produces(MediaType.SERVER_SENT_EVENTS)
>   public void suscribeToEvents(@Context SseEventSink eventSink) {
> eventBroadcaster.register(eventSink);
>   }
> }
> {code}
>  
>  
> In addition, I have a CORS filter:
>  
> {code:java}
> @Component(immediate=true)
> @Provider
> @JaxrsExtension
> public class CORSFilter implements ContainerResponseFilter {
>   @Override
>   public void filter(ContainerRequestContext requestContext, 
> ContainerResponseContext responseContext) throws IOException {
> System.out.println("CORSFilter for 
> "+requestContext.getUriInfo().getPath());
> MultivaluedMap headers = responseContext.getHeaders();
> headers.add("Access-Control-Allow-Origin", 
> requestContext.getHeaderString("Origin"));
> ...
> {code}
>  
> The CORS filter gets fired on all requests as I expect, _except_ for ones to 
> the EventResource.subscribeToEvents method. Hence browsers complain when 
> receiving SSE events.
> This used to work fine with jersey as the JAXRS implementation. CORS filter 
> got called for the EventsResource.subscribeToEvents call.
> I've no idea whether this is a jaxrs-whiteboard level issue, or a CXF level 
> issue. I will try and come up with a plain CXF test of the same thing for 
> comparison.
>  



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (ARIES-1867) ContainerResponseFilter not fired for SSE endpoint

2018-11-27 Thread Carlos Sierra (JIRA)


[ 
https://issues.apache.org/jira/browse/ARIES-1867?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16700165#comment-16700165
 ] 

Carlos Sierra commented on ARIES-1867:
--

hey [~tomq42],

no need to apologise :), software is difficult. Your feedback has been very 
useful.

Regarding the test failures, they always pass for me. Could you share what 
errors are you getting and your environment so I can try to reproduce?

Bests.

Carlos.

 

> ContainerResponseFilter not fired for SSE endpoint
> --
>
> Key: ARIES-1867
> URL: https://issues.apache.org/jira/browse/ARIES-1867
> Project: Aries
>  Issue Type: Bug
>  Components: jax-rs-whiteboard
>Affects Versions: jax-rs-whiteboard-1.0.2
>Reporter: Tom Quarendon
>Assignee: Carlos Sierra
>Priority: Major
> Attachments: CORSFilter.java, Server.java, TestService3.java
>
>
> I have a resource class such as the following:
> {code:java}
> @Path("events")
> @JaxrsResource
> public class EventsResource {
>   private Sse sse;
>   private SseBroadcaster eventBroadcaster;
>   @Context
>   public void setSse(Sse sse) {
> this.sse = sse;
> this.eventBroadcaster = sse.newBroadcaster();
>   }
>   @GET
>   @Produces(MediaType.SERVER_SENT_EVENTS)
>   public void suscribeToEvents(@Context SseEventSink eventSink) {
> eventBroadcaster.register(eventSink);
>   }
> }
> {code}
>  
>  
> In addition, I have a CORS filter:
>  
> {code:java}
> @Component(immediate=true)
> @Provider
> @JaxrsExtension
> public class CORSFilter implements ContainerResponseFilter {
>   @Override
>   public void filter(ContainerRequestContext requestContext, 
> ContainerResponseContext responseContext) throws IOException {
> System.out.println("CORSFilter for 
> "+requestContext.getUriInfo().getPath());
> MultivaluedMap headers = responseContext.getHeaders();
> headers.add("Access-Control-Allow-Origin", 
> requestContext.getHeaderString("Origin"));
> ...
> {code}
>  
> The CORS filter gets fired on all requests as I expect, _except_ for ones to 
> the EventResource.subscribeToEvents method. Hence browsers complain when 
> receiving SSE events.
> This used to work fine with jersey as the JAXRS implementation. CORS filter 
> got called for the EventsResource.subscribeToEvents call.
> I've no idea whether this is a jaxrs-whiteboard level issue, or a CXF level 
> issue. I will try and come up with a plain CXF test of the same thing for 
> comparison.
>  



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (ARIES-1869) Example does not work with current karaf 4.2.1

2018-11-27 Thread ASF subversion and git services (JIRA)


[ 
https://issues.apache.org/jira/browse/ARIES-1869?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16700156#comment-16700156
 ] 

ASF subversion and git services commented on ARIES-1869:


Commit 634e5e34f3c13e357616081ed5f31d23b9a8f11c in aries-jpa's branch 
refs/heads/master from [~ch...@die-schneider.net]
[ https://gitbox.apache.org/repos/asf?p=aries-jpa.git;h=634e5e3 ]

ARIES-1869 - Update examples to current versions


> Example does not work with current karaf 4.2.1
> --
>
> Key: ARIES-1869
> URL: https://issues.apache.org/jira/browse/ARIES-1869
> Project: Aries
>  Issue Type: Bug
>  Components: JPA
>Affects Versions: jpa-2.7.0
>Reporter: Christian Schneider
>Assignee: Christian Schneider
>Priority: Major
> Fix For: jpa-2.8.0
>
>
> See 
> [https://stackoverflow.com/questions/53433775/org-apache-aries-jpaorg-apache-aries-jpa-blueprint2-3-0-cant-make-run]
>  



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Created] (ARIES-1869) Example does not work with current karaf 4.2.1

2018-11-27 Thread Christian Schneider (JIRA)
Christian Schneider created ARIES-1869:
--

 Summary: Example does not work with current karaf 4.2.1
 Key: ARIES-1869
 URL: https://issues.apache.org/jira/browse/ARIES-1869
 Project: Aries
  Issue Type: Bug
  Components: JPA
Affects Versions: jpa-2.7.0
Reporter: Christian Schneider
Assignee: Christian Schneider
 Fix For: jpa-2.8.0


See 
[https://stackoverflow.com/questions/53433775/org-apache-aries-jpaorg-apache-aries-jpa-blueprint2-3-0-cant-make-run]

 



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)