BandwidthOnDemand / nsi-pce

Java NSI PCE
Other
2 stars 2 forks source link

NullPointerException when invalid ERO element specified. #15

Closed jmacauley closed 8 years ago

jmacauley commented 8 years ago

A NullPointerException is generated when an invalid ERO element is specified that attempts for force an impossible path. In this case the source and destination are on the same network so all other networks are pruned, however, the ERO contains an inter domain STP that makes that path impossible to complete.

Request:

2016-08-22 15:24:07,017 DEBUG [grizzly-http-server-0] (net.es.nsi.pce.path.api.FindPathService:98) - *** findPath:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<ns4:local xmlns:ns2="http://schemas.es.net/nsi/2013/08/pce/messages" xmlns:ns4="uri" xmlns:ns3="http://schemas.ogf.org/nsi/2013/12/services/point2point">
    <correlationId>urn:uuid:dd19adc9-7ae4-4ca8-8a8b-77134de02c33</correlationId>
    <replyTo>
        <url>https://agg.netherlight.net/pce/reply</url>
        <mediaType>application/json</mediaType>
    </replyTo>
    <algorithm>TREE</algorithm>
    <startTime>2016-08-22T16:00:00.000+02:00</startTime>
    <endTime>2016-08-22T18:00:00.000+02:00</endTime>
    <serviceType>http://services.ogf.org/nsi/2013/12/descriptions/EVTS.A-GOLE</serviceType>
    <trace index="0">urn:ogf:network:surfnet.nl:1990:nsa:nsi-requester:noId</trace>
    <ns3:p2ps>
        <capacity>101</capacity>
        <directionality>Bidirectional</directionality>
        <symmetricPath>true</symmetricPath>
        <sourceSTP>urn:ogf:network:netherlight.net:2013:production7:microsoft-2?vlan=2-4095</sourceSTP>
        <destSTP>urn:ogf:network:netherlight.net:2013:production7:nordunet-1?vlan=2-4095</destSTP>
        <ero>
            <orderedSTP order="0">
                <stp>urn:ogf:network:netherlight.net:2013:production7:geant-3?vlan=3750-4095</stp>
            </orderedSTP>
        </ero>
        <parameter type="protection">PROTECTED</parameter>
    </ns3:p2ps>
</ns4:local>

Exception:

2016-08-22 15:24:07,250 ERROR [grizzly-http-server-0] (net.es.nsi.pce.path.api.FindPathService:210) - findPath: findPath P2PS failed
java.lang.NullPointerException
        at net.es.nsi.pce.pf.RouteObject.<init>(RouteObject.java:74)
        at net.es.nsi.pce.pf.DijkstraPCE.apply(DijkstraPCE.java:109)
        at net.es.nsi.pce.pf.SequentialPCE.apply(SequentialPCE.java:31)
        at net.es.nsi.pce.pf.PathfinderCore.findPath(PathfinderCore.java:75)
        at net.es.nsi.pce.path.api.FindPathService.findPath(FindPathService.java:195)
        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:483)
        at org.glassfish.jersey.server.model.internal.ResourceMethodInvocationHandlerFactory$1.invoke(ResourceMethodInvocationHandlerFactory.java:81)
        at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher$1.run(AbstractJavaResourceMethodDispatcher.java:144)
        at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher.invoke(AbstractJavaResourceMethodDispatcher.java:161)
        at org.glassfish.jersey.server.model.internal.JavaResourceMethodDispatcherProvider$ResponseOutInvoker.doDispatch(JavaResourceMethodDispatcherProvider.java:160)
        at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher.dispatch(AbstractJavaResourceMethodDispatcher.java:99)
        at org.glassfish.jersey.server.model.ResourceMethodInvoker.invoke(ResourceMethodInvoker.java:389)
        at org.glassfish.jersey.server.model.ResourceMethodInvoker.apply(ResourceMethodInvoker.java:347)
        at org.glassfish.jersey.server.model.ResourceMethodInvoker.apply(ResourceMethodInvoker.java:102)
        at org.glassfish.jersey.server.ServerRuntime$2.run(ServerRuntime.java:317)
        at org.glassfish.jersey.internal.Errors$1.call(Errors.java:271)
        at org.glassfish.jersey.internal.Errors$1.call(Errors.java:267)
        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:267)
        at org.glassfish.jersey.process.internal.RequestScope.runInScope(RequestScope.java:317)
        at org.glassfish.jersey.server.ServerRuntime.process(ServerRuntime.java:298)
        at org.glassfish.jersey.server.ApplicationHandler.handle(ApplicationHandler.java:1154)
        at org.glassfish.jersey.grizzly2.httpserver.GrizzlyHttpContainer.service(GrizzlyHttpContainer.java:384)
        at org.glassfish.grizzly.http.server.HttpHandler$1.run(HttpHandler.java:224)
        at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:591)
        at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.run(AbstractThreadPool.java:571)
        at java.lang.Thread.run(Thread.java:745)

Result to clienty:

2016-08-22 15:24:07,276 DEBUG [grizzly-http-server-0] (net.es.nsi.pce.path.api.FindPathService:238) - FindPathService: sent response FAILED to client https://agg.netherlight.net/pce/reply, result = OK
2016-08-22 15:24:07,277 DEBUG [grizzly-http-server-0] (net.es.nsi.pce.path.api.FindPathService:240) - <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<ns2:findPathResponse xmlns:ns2="http://schemas.es.net/nsi/2013/08/pce/messages" xmlns:ns3="http://schemas.ogf.org/nsi/2013/12/services/point2point">
    <correlationId>urn:uuid:dd19adc9-7ae4-4ca8-8a8b-77134de02c33</correlationId>
    <status>FAILED</status>
    <ns2:findPathError>
        <code>00500</code>
        <label>INTERNAL_ERROR</label>
        <description>An internal error has caused a message processing failure (Issue parsing FindPathErrorType error message).</description>
    </ns2:findPathError>
</ns2:findPathResponse>
jmacauley commented 8 years ago

Added check to verify STP specified in ERO is associated with a valid SDP after pruning of graph. Fixed with update 1757ac4.