BandwidthOnDemand / nsi-pce

Java NSI PCE
Other
2 stars 2 forks source link

Refresh of remote subscription fails due to relative URL. #8

Closed jmacauley closed 10 years ago

jmacauley commented 10 years ago

The documents returned from a remote DDS instance use relative URL instead of a fully qualified URL so a refresh of a remote subscription is failing.

2014-08-13 12:26:04,216 DEBUG NSI-DISCOVERY-akka.actor.default-dispatcher-15 - RegistrationActor: event=Update 2014-08-13 12:26:04,219 ERROR NSI-DISCOVERY-akka.actor.default-dispatcher-15 - RegistrationActor.update: failed to update subscription /subscriptions/57c90463-4783-4f44-b844-34731bb45f08 javax.ws.rs.ProcessingException: URI is not absolute at org.glassfish.jersey.client.ClientRuntime.invoke(ClientRuntime.java:255) at org.glassfish.jersey.client.JerseyInvocation$1.call(JerseyInvocation.java:667) at org.glassfish.jersey.client.JerseyInvocation$1.call(JerseyInvocation.java:664) 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:424) at org.glassfish.jersey.client.JerseyInvocation.invoke(JerseyInvocation.java:664) at org.glassfish.jersey.client.JerseyInvocation$Builder.method(JerseyInvocation.java:399) at org.glassfish.jersey.client.JerseyInvocation$Builder.get(JerseyInvocation.java:303) at net.es.nsi.pce.discovery.actors.RegistrationActor.update(RegistrationActor.java:148) at net.es.nsi.pce.discovery.actors.RegistrationActor.onReceive(RegistrationActor.java:66) at akka.actor.UntypedActor$$anonfun$receive$1.applyOrElse(UntypedActor.scala:167) at akka.actor.Actor$class.aroundReceive(Actor.scala:465) at akka.actor.UntypedActor.aroundReceive(UntypedActor.scala:97) at akka.actor.ActorCell.receiveMessage(ActorCell.scala:516) at akka.actor.ActorCell.invoke(ActorCell.scala:487) at akka.dispatch.Mailbox.processMailbox(Mailbox.scala:238) at akka.dispatch.Mailbox.run(Mailbox.scala:220) at akka.dispatch.ForkJoinExecutorConfigurator$AkkaForkJoinTask.exec(AbstractDispatcher.scala:393) at scala.concurrent.forkjoin.ForkJoinTask.doExec(ForkJoinTask.java:260) at scala.concurrent.forkjoin.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1339) at scala.concurrent.forkjoin.ForkJoinPool.runWorker(ForkJoinPool.java:1979) at scala.concurrent.forkjoin.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:107) Caused by: java.lang.IllegalArgumentException: URI is not absolute at java.net.URI.toURL(URI.java:1095) at org.glassfish.jersey.client.HttpUrlConnector._apply(HttpUrlConnector.java:257) at org.glassfish.jersey.client.HttpUrlConnector.apply(HttpUrlConnector.java:227) at org.glassfish.jersey.client.ClientRuntime.invoke(ClientRuntime.java:246) ... 23 more

jmacauley commented 10 years ago

Added code to convert all advertised URLs to absolute based on the provisioned baseURL in the dds.xml configuration file. This will support both direct HTTP/HTTPS support, as well as via a reverse proxy. Also added checks on remote resources references to create an absolute URL before attempting access. Fixes verified.