Hey Carlos, I've just updated my dependencies to use the newest version of the whiteboard and the error seems gone... Sorry for the fuzz. I was using the dependencies provided by the OSGi enRoute POMs and those could need an update, which I was not aware of before :/
Have a nice weekend, Thomas Am Fr., 10. Jan. 2020 um 15:14 Uhr schrieb Thomas Driessen < thomas.driessen...@gmail.com>: > Hi Carlos, > > thanks for your quick response. > > The traces get deserialized without an error and I can print them on the > console, but somewhere afterwards an NPE is internally thrown which leads > to the mentioned error. > > What is strange though is, that if I change the return type of my method > into String and return something, then the error in the response is gone. > The NPE still gets thrown internally though, but does not seem to reach > the caller. > > Regarding the request I send: > > curl -X PUT localhost:8080/v0.4/traces -H "Content-Type: application/json" > -d @input.json > > where input.json looks like: > > [[ > { > "type": "sample", > "error": 1, > "duration": 123, > "parent_id": 0, > "start": 111, > "resource": "Some resource", > "name": "My name", > "service": "My Service", > "trace_id": 345, > "span_id": 678 > } > ]] > > > You still can jump right into a working workspace for this if you use the > gitpod link that I posted. Maybe then it's easier for you to pinpoint the > error. > > Kind regards, > Thomas > > Am Fr., 10. Jan. 2020 um 14:26 Uhr schrieb Carlos Sierra Andrés < > csie...@apache.org>: > >> Hi Thomas, >> >> I would put my money in List<List<Trace>> is not being properly >> deserialized and thus you get a null traces object reference. >> >> Could you please also paste what request are you making to the endpoint? >> >> Carlos. >> El 10/1/20 a las 13:27, Thomas Driessen escribió: >> >> Hi, >> >> I stumbled upon a bug/NPE in the Aries JAX-RS Whiteboard. In order to see >> it in action you can just open the example repo with steps to reproduce >> this bug that I prepared in GitPod. >> >> https://gitpod.io/#https://github.com/Sandared/osgi-pg/tree/jaxrs >> >> Long version: >> >> I'm currently trying to set up a simple JAX-RS Resource in OSGi. >> All I did so far was adding a PUT endpoint that receives a "Traces" >> object, and adding `org.apache.aries.jax.rs.jackson` to the project in >> order to be able to serialize and deserialize JSON. >> Each time I send a PUT request to my endpoint, I get this error response >> back: >> >> <ns1:XMLFault >> xmlns:ns1="http://cxf.apache.org/bindings/xformat"><ns1:faultstring >> xmlns:ns1="http://cxf.apache.org/bindings/xformat">java.lang.NullPointerException</ns1:faultstring></ns1:XMLFault> >> >> >> The log of the JAX-RS Whiteboard shows a NPE: >> >> java.nio.channels.ClosedChannelException: null >> at org.eclipse.jetty.io.WriteFlusher.onClose(WriteFlusher.java:502) >> at >> org.eclipse.jetty.io.AbstractEndPoint.onClose(AbstractEndPoint.java:353) >> at >> org.eclipse.jetty.io.ChannelEndPoint.onClose(ChannelEndPoint.java:216) >> at >> org.eclipse.jetty.io.AbstractEndPoint.doOnClose(AbstractEndPoint.java:225) >> at >> org.eclipse.jetty.io.AbstractEndPoint.close(AbstractEndPoint.java:192) >> at >> org.eclipse.jetty.io.AbstractEndPoint.close(AbstractEndPoint.java:175) >> at >> org.eclipse.jetty.io.AbstractConnection.close(AbstractConnection.java:248) >> at >> org.eclipse.jetty.server.HttpChannelOverHttp.earlyEOF(HttpChannelOverHttp.java:234) >> at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:1551) >> at >> org.eclipse.jetty.server.HttpConnection.parseRequestBuffer(HttpConnection.java:360) >> at >> org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:250) >> at >> org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:305) >> at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:103) >> at >> org.eclipse.jetty.io.ChannelEndPoint$2.run(ChannelEndPoint.java:118) >> at >> org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.runTask(EatWhatYouKill.java:333) >> at >> org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.doProduce(EatWhatYouKill.java:310) >> at >> org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.tryProduce(EatWhatYouKill.java:168) >> at >> org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.produce(EatWhatYouKill.java:132) >> at >> org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:765) >> at >> org.eclipse.jetty.util.thread.QueuedThreadPool$2.run(QueuedThreadPool.java:683) >> at java.base/java.lang.Thread.run(Thread.java:834) >> >> >> The endpoint looks like this: >> >> @Component(service = ComponentImpl.class)@JaxrsResource@JSONRequiredpublic >> class ComponentImpl { >> >> @Path("/v0.4/traces") >> @PUT >> @Consumes(MediaType.APPLICATION_JSON) >> public void receiveTraces(List<List<Trace>> traces) { >> System.out.println("recieveTraces was called, traces were " + >> traces); >> } >> } >> >> My bundles look like this: >> >> lb >> START LEVEL 1 >> ID|State |Level|Name >> 0|Active | 0|OSGi System Bundle >> (3.13.100.v20180827-1536)|3.13.100.v20180827-1536 >> 1|Active | 1|Logback Classic Module (1.2.3)|1.2.3 >> 2|Active | 1|Logback Core Module (1.2.3)|1.2.3 >> 3|Active | 1|jaxb-api (2.2.11)|2.2.11 >> 4|Active | 1|Apache Aries JAX-RS Specification API (1.0.0)|1.0.0 >> 5|Active | 1|Apache Aries JAX-RS Whiteboard (1.0.1)|1.0.1 >> 6|Active | 1|Apache Commons FileUpload (1.3.3)|1.3.3 >> 7|Active | 1|Apache Commons IO (2.6.0)|2.6.0 >> 8|Active | 1|Apache Felix Configuration Admin Service >> (1.9.8)|1.9.8 >> 9|Active | 1|Apache Felix Gogo Command (1.0.2)|1.0.2 >> 10|Active | 1|Apache Felix Gogo Runtime (1.0.10)|1.0.10 >> 11|Active | 1|Apache Felix Gogo Shell (1.0.0)|1.0.0 >> 12|Active | 1|Apache Felix Http Jetty (4.0.6)|4.0.6 >> 13|Active | 1|Apache Felix Servlet API (1.1.2)|1.1.2 >> 14|Active | 1|Apache Felix Inventory (1.0.4)|1.0.4 >> 15|Active | 1|Apache Felix Declarative Services (2.1.10)|2.1.10 >> 16|Active | 1|Apache Felix Web Management Console (4.3.4)|4.3.4 >> 17|Active | 1|Apache Felix Web Console Service Component >> Runtime/Declarative Services Plugin (2.0.8)|2.0.8 >> 18|Active | 1|Apache ServiceMix :: Specs :: Activation API 1.4 >> (2.9.0)|2.9.0 >> 19|Active | 1|Apache ServiceMix :: Specs :: Annotation API 1.3 >> (1.3.0.1)|1.3.0.1 >> 20|Active | 1|Apache ServiceMix :: Specs :: JAXWS API 2.2 >> (2.9.0)|2.9.0 >> 21|Active | 1|Apache ServiceMix :: Specs :: SAAJ API 1.3 >> (2.9.0)|2.9.0 >> 22|Active | 1|org.osgi:org.osgi.service.jaxrs >> (1.0.0.201802012106)|1.0.0.201802012106 >> 23|Active | 1|org.osgi:org.osgi.util.function >> (1.1.0.201802012106)|1.1.0.201802012106 >> 24|Active | 1|org.osgi:org.osgi.util.promise >> (1.1.0.201802012106)|1.1.0.201802012106 >> 25|Active | 1|slf4j-api (1.7.25)|1.7.25 >> 26|Active | 1|processagent.app >> (1.0.0.202001101124)|1.0.0.202001101124 >> 27|Active | 1|processagent.impl >> (1.0.0.202001101124)|1.0.0.202001101124 >> 28|Active | 1|Byte Buddy agent (1.10.6)|1.10.6 >> 29|Active | 1|Apache Felix Configurator Service (1.0.6)|1.0.6 >> 30|Active | 1|Apache ServiceMix :: Specs :: JSon API 1.1 >> (2.9.0)|2.9.0 >> 31|Active | 1|org.osgi:org.osgi.util.converter >> (1.0.0.201802012108)|1.0.0.201802012108 >> 32|Active | 1|Jackson-annotations (2.9.0)|2.9.0 >> 33|Active | 1|Jackson-core (2.9.6)|2.9.6 >> 34|Active | 1|jackson-databind (2.9.6)|2.9.6 >> 35|Active | 1|Jackson-JAXRS-base (2.9.6)|2.9.6 >> 36|Active | 1|Jackson-JAXRS-JSON (2.9.6)|2.9.6 >> 37|Active | 1|Jackson module: JAXB Annotations (2.9.6)|2.9.6 >> 38|Active | 1|Apache Aries JAX-RS JAX-RS Jackson (1.0.2)|1.0.2 >> >> >> Any suggestions what I'm doing wrong? >> >> Kind regards, >> Thomas >> >>