Closed berezovskyi closed 5 years ago
This all makes very little sense to me. @jamsden @jadelkhoury did you have anything like that before? I am really at loss here because this is supposed to be a very simple request, a very simple POJO just a single Link property. And it's the first time I encounter the org.apache.jena.atlas.RuntimeIOException
.
Here is a "new" stack trace, cleaned up by the patch from https://github.com/eclipse/lyo.core/pull/93
21:43:18.132 ERROR se.ericsson.cf.scott.sandbox.whc.xtra.managers.PlanningManager - Unexpected exception while creating a plan for Twin 'rb-1':
javax.ws.rs.ProcessingException: java.net.ConnectException: Connection refused (Connection refused)
at org.glassfish.jersey.client.ClientRuntime.invoke(ClientRuntime.java:261)
at org.glassfish.jersey.client.JerseyInvocation$1.call(JerseyInvocation.java:684)
at org.glassfish.jersey.client.JerseyInvocation$1.call(JerseyInvocation.java:681)
at org.glassfish.jersey.internal.Errors.process(Errors.java:315)
at org.glassfish.jersey.internal.Errors.process(Errors.java:297)
at org.glassfish.jersey.internal.Errors.process(Errors.java:228)
at org.glassfish.jersey.process.internal.RequestScope.runInScope(RequestScope.java:444)
at org.glassfish.jersey.client.JerseyInvocation.invoke(JerseyInvocation.java:681)
at org.glassfish.jersey.client.JerseyInvocation$Builder.method(JerseyInvocation.java:437)
at org.glassfish.jersey.client.JerseyInvocation$Builder.post(JerseyInvocation.java:343)
at org.eclipse.lyo.oslc4j.client.OslcClient.createResource(OslcClient.java:273)
at org.eclipse.lyo.oslc4j.client.OslcClient.createResource(OslcClient.java:257)
at se.ericsson.cf.scott.sandbox.whc.xtra.clients.TwinClient.requestPlanExecution(TwinClient.kt:32)
at se.ericsson.cf.scott.sandbox.whc.xtra.managers.PlanningManager.tryRegisterPlan(PlanningManager.kt:116)
at se.ericsson.cf.scott.sandbox.whc.xtra.managers.PlanningManager.planForTwin(PlanningManager.kt:53)
at se.ericsson.cf.scott.sandbox.whc.xtra.managers.PlanningManager.access$planForTwin(PlanningManager.kt:25)
at se.ericsson.cf.scott.sandbox.whc.xtra.managers.PlanningManager$planForEachTwin$1.accept(PlanningManager.kt:45)
at se.ericsson.cf.scott.sandbox.whc.xtra.managers.PlanningManager$planForEachTwin$1.accept(PlanningManager.kt:25)
at java.util.stream.ForEachOps$ForEachOp$OfRef.accept(ForEachOps.java:184)
at java.util.Spliterators$ArraySpliterator.forEachRemaining(Spliterators.java:948)
at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:481)
at java.util.stream.ForEachOps$ForEachTask.compute(ForEachOps.java:291)
at java.util.concurrent.CountedCompleter.exec(CountedCompleter.java:731)
at java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:289)
at java.util.concurrent.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1056)
at java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1692)
at java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:157)
Caused by: java.lang.IllegalStateException: java.net.ConnectException: Connection refused (Connection refused)
at org.eclipse.lyo.oslc4j.provider.jena.AbstractOslcRdfXmlProvider.writeObjectsTo(AbstractOslcRdfXmlProvider.java:166)
at org.eclipse.lyo.oslc4j.provider.jena.AbstractOslcRdfXmlProvider.writeTo(AbstractOslcRdfXmlProvider.java:127)
at org.eclipse.lyo.oslc4j.provider.jena.OslcRdfXmlProvider.writeTo(OslcRdfXmlProvider.java:237)
at org.glassfish.jersey.message.internal.WriterInterceptorExecutor$TerminalWriterInterceptor.invokeWriteTo(WriterInterceptorExecutor.java:265)
at org.glassfish.jersey.message.internal.WriterInterceptorExecutor$TerminalWriterInterceptor.aroundWriteTo(WriterInterceptorExecutor.java:250)
at org.glassfish.jersey.message.internal.WriterInterceptorExecutor.proceed(WriterInterceptorExecutor.java:162)
at org.glassfish.jersey.message.internal.MessageBodyFactory.writeTo(MessageBodyFactory.java:1130)
at org.glassfish.jersey.client.ClientRequest.doWriteEntity(ClientRequest.java:517)
at org.glassfish.jersey.client.ClientRequest.writeEntity(ClientRequest.java:499)
at org.glassfish.jersey.client.internal.HttpUrlConnector._apply(HttpUrlConnector.java:393)
at org.glassfish.jersey.client.internal.HttpUrlConnector.apply(HttpUrlConnector.java:285)
at org.glassfish.jersey.client.ClientRuntime.invoke(ClientRuntime.java:252)
... 26 more
Caused by: java.net.ConnectException: Connection refused (Connection refused)
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:350)
at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:206)
at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:188)
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
at java.net.Socket.connect(Socket.java:589)
at sun.net.NetworkClient.doConnect(NetworkClient.java:175)
at sun.net.www.http.HttpClient.openServer(HttpClient.java:463)
at sun.net.www.http.HttpClient.openServer(HttpClient.java:558)
at sun.net.www.http.HttpClient.<init>(HttpClient.java:242)
at sun.net.www.http.HttpClient.New(HttpClient.java:339)
at sun.net.www.http.HttpClient.New(HttpClient.java:357)
at sun.net.www.protocol.http.HttpURLConnection.getNewHttpClient(HttpURLConnection.java:1220)
at sun.net.www.protocol.http.HttpURLConnection.plainConnect0(HttpURLConnection.java:1156)
at sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:1050)
at sun.net.www.protocol.http.HttpURLConnection.connect(HttpURLConnection.java:984)
at sun.net.www.protocol.http.HttpURLConnection.getOutputStream0(HttpURLConnection.java:1334)
at sun.net.www.protocol.http.HttpURLConnection.getOutputStream(HttpURLConnection.java:1309)
at org.glassfish.jersey.client.internal.HttpUrlConnector$4.getOutputStream(HttpUrlConnector.java:390)
at org.glassfish.jersey.message.internal.CommittingOutputStream.commitStream(CommittingOutputStream.java:200)
at org.glassfish.jersey.message.internal.CommittingOutputStream.commitStream(CommittingOutputStream.java:194)
at org.glassfish.jersey.message.internal.CommittingOutputStream.write(CommittingOutputStream.java:213)
at org.glassfish.jersey.message.internal.WriterInterceptorExecutor$UnCloseableOutputStream.write(WriterInterceptorExecutor.java:294)
at org.eclipse.lyo.oslc4j.provider.jena.AbstractOslcRdfXmlProvider.writeObjectsTo(AbstractOslcRdfXmlProvider.java:157)
... 37 more
Apologies, problem solved. The second trace had less noise and I went to double-check the URI and it turned out to be wrong (Docker vs host network addressing issues).
But now I think it might be a very common problem and we shall catch java.net.ConnectException
separately and either throw it directly or wrap it in something like OslcClientConnectionException
@berezovskyi should get some sleep before debugging such simple exceptions. won't fix.
I am trying to POST a new resource via a CreationFactory but the new client fails before even making a request. Here is the resource (serialised to Turtle via JMH from the POJO, so the problem should not be in the POJO or its annotations):
Here is a 200 OK response when executing this request manually:
Here is the exception stack trace I am getting: