Custom route cannot be added error in OpenIG

This topic contains 1 voice and has 0 replies.

  • Author
    Posts
  • #22383
     srinath.m 
    Participant

    Hi All,

    Iam getting below error on OpenIG start in debug logs and I have added a custom route 01-api-authcontext.json (C:\windows\system32\config\systemprofile\AppData\Roaming\OpenIG\config\routes\01-api-authcontext.json)

    Error in debug.log ::
    ——————————————————————————————
    MON JUN 25 15:20:19 IST 2018 WARNING JwtSession — JWT session support has been enabled but no encryption keys have been configured. A temporary key pair will be used but this means that OpenIG will not be able to decrypt any JWT session cookies after a configuration change, a server restart, nor will it be able to decrypt JWT session cookies encrypted by another OpenIG server.
    MON JUN 25 15:20:20 IST 2018 WARNING {Router}/handler — Heaplet name (‘{Router}/handler’) has been converted to a slug (‘router-handler’) for URL exposition (REST endpoints).
    MON JUN 25 15:20:20 IST 2018 ERROR {Router}/handler — The route defined in file ‘C:\windows\system32\config\systemprofile\AppData\Roaming\OpenIG\config\routes\01-api-authcontext.json’ cannot be added
    MON JUN 25 15:20
    :20 IST 2018 ERROR {Router}/handler — io/jsonwebtoken/ExpiredJwtException
    # java.lang.NoClassDefFoundError: io/jsonwebtoken/ExpiredJwtException
    # at java.lang.Class.forName0(Native Method)
    # at java.lang.Class.forName(Unknown Source)
    # at org.forgerock.openig.util.JsonValues.classForName(JsonValues.java:88)
    # at org.forgerock.openig.util.JsonValues.asClass(JsonValues.java:117)
    # at org.forgerock.openig.heap.HeapImpl.addDeclaration(HeapImpl.java:260)
    # at org.forgerock.openig.heap.HeapImpl.resolve(HeapImpl.java:413)
    # at org.forgerock.openig.heap.HeapImpl.resolve(HeapImpl.java:382)
    # at org.forgerock.openig.util.JsonValues$4.apply(JsonValues.java:301)
    # at org.forgerock.openig.util.JsonValues$4.apply(JsonValues.java:298)
    # at org.forgerock.json.JsonValue.asList(JsonValue.java:727)
    # at org.forgerock.openig.filter.Chain$Heaplet.create(Chain.java:81)
    # at org.forgerock.openig.heap.GenericHeaplet.create(GenericHeaplet.java:92)
    # at org.forgerock.openig.heap.HeapImpl.extract(HeapImpl.java:363)
    # at org.forgerock.openig.heap.HeapImpl.get(HeapImpl.java:310)
    # at org.forgerock.openig.heap.HeapImpl.resolve(HeapImpl.java:415)
    # at org.forgerock.openig.heap.HeapImpl.resolve(HeapImpl.java:382)
    # at org.forgerock.openig.handler.DispatchHandler$Heaplet.create(DispatchHandler.java:145)
    # at org.forgerock.openig.heap.GenericHeaplet.create(GenericHeaplet.java:92)
    # at org.forgerock.openig.heap.HeapImpl.extract(HeapImpl.java:363)
    # at org.forgerock.openig.heap.HeapImpl.get(HeapImpl.java:310)
    # at org.forgerock.openig.heap.HeapImpl.resolve(HeapImpl.java:415)
    # at org.forgerock.openig.heap.HeapImpl.resolve(HeapImpl.java:382)
    # at org.forgerock.openig.heap.HeapImpl.getHandler(HeapImpl.java:588)
    # at org.forgerock.openig.handler.router.RouteBuilder.setupRouteHandler(RouteBuilder.java:205)
    # at org.forgerock.openig.handler.router.RouteBuilder.build(RouteBuilder.java:146)
    # at org.forgerock.openig.handler.router.RouteBuilder.build(RouteBuilder.java:100)
    # at org.forgerock.openig.handler.router.RouterHandler.onAddedFile(RouterHandler.java:209)
    # at org.forgerock.openig.handler.router.RouterHandler.onChanges(RouterHandler.java:194)
    # at org.forgerock.openig.handler.router.DirectoryMonitor.scan(DirectoryMonitor.java:138)
    # at org.forgerock.openig.handler.router.PeriodicDirectoryScanner.scan(PeriodicDirectoryScanner.java:89)
    # at org.forgerock.openig.handler.router.RouterHandler.start(RouterHandler.java:163)
    # at org.forgerock.openig.handler.router.RouterHandler$Heaplet.start(RouterHandler.java:360)
    # at org.forgerock.openig.heap.GenericHeaplet.create(GenericHeaplet.java:99)
    # at org.forgerock.openig.heap.HeapImpl.extract(HeapImpl.java:363)
    # at org.forgerock.openig.heap.HeapImpl.get(HeapImpl.java:310)
    # at org.forgerock.openig.heap.HeapImpl.resolve(HeapImpl.java:415)
    # at org.forgerock.openig.heap.HeapImpl.resolve(HeapImpl.java:382)
    # at org.forgerock.openig.heap.HeapImpl.getHandler(HeapImpl.java:588)
    # at org.forgerock.openig.http.GatewayHttpApplication.start(GatewayHttpApplication.java:214)
    # at org.forgerock.http.servlet.HttpFrameworkServlet.init(HttpFrameworkServlet.java:134)
    # at javax.servlet.GenericServlet.init(GenericServlet.java:158)
    # at org.apache.catalina.core.StandardWrapper.initServlet(StandardWrapper.java:1227)
    # at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1140)
    # at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:1027)
    # at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:5037)
    # at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5347)
    # at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:145)
    # at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:753)
    # at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:729)
    # at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:717)
    # at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:974)
    # at org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:1850)
    # at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
    # at java.util.concurrent.FutureTask.run(Unknown Source)
    # at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
    # at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
    # at java.lang.Thread.run(Unknown Source)
    # Caused by: java.lang.ClassNotFoundException: io.jsonwebtoken.ExpiredJwtException
    # at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1335)
    # at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1163)
    # … 57 more
    —————————————————————————————————-

    OpenIG version – 4.0.0

    Created a filter class and deployed the jar file under C:\path-to-openig\Tomcat 8.0_Tomcat-openig\webapps\ROOT\WEB-INF\lib

    1.config.json details below

    {  
       "handler":{  
          "type":"Router",
          "audit":"global",
    	   "capture":"all"
       },
       "heap":[  
          {  
             "name":"LogSink",
             "type":"FileLogSink",
             "config":{  
                "file":"C:\\windows\\system32\\config\\systemprofile\\AppData\\Roaming\\OpenIG\\debug.log",
                "level":"DEBUG"
             }
          },
          {  
             "name":"JwtSession",
             "type":"JwtSession"
          },
          {  
             "name":"capture",
             "type":"CaptureDecorator",
             "config":{  
                "captureEntity":false,
                "_captureContext":true
             }
          }
       ]
    }

    2.here is my route 01-api-authcontext.json

    {  
       "handler":{  
          "type":"DispatchHandler",
          "config":{  
             "bindings":[  
                {  
                   "condition":"${request.cookies['iPlanetDirectoryPro'] == null}",
                   "handler":{  
                      "type":"StaticResponseHandler",
                      "config":{  
                         "status":401,
                         "reason":"Unauthorized Access",
                         "entity":"Unauthorized Access"
                      }
                   }
                },
                {  
                   "comment":"This condition is optional, but included for clarity.",
                   "condition":"${request.cookies['iPlanetDirectoryPro'] != null}",
                   "handler":{  
                      "type":"Chain",
                      "config":{  
                         "filters":[  
                            {  
                               "name":"UserContext",
                               "type":"com.ap.test.openig.filter.UserContext",
                               "config":{  
                                  "name":"X-Greeting",
                                  "value":"Welcome to OpenIG"
                               }
                            }
                            
                         ]
                      }
                   }
                }
             ]
          }
       },
       "condition":"${matches(request.uri.path, '^/api/auth-context')}"
    }

    Any idea on this would be appreciated.

    Thanks,
    Srinath

    • This topic was modified 1 year, 1 month ago by  srinath.m. Reason: formatted for better readability
Viewing 1 post (of 1 total)

You must be logged in to reply to this topic.

©2019 ForgeRock - we provide an identity and access platform to secure every online relationship for the enterprise market, educational sector and even entire countries. Click to view our privacy policy and terms of use.

Log in with your credentials

Forgot your details?