Thanks larry.  It worked. I was only restarting Knox and thought it should take 
care of changes but I guess we need to do ‘touch or save topology’ as well.

Regards,
Rajat

From: larry mccay <[email protected]<mailto:[email protected]>>
Reply-To: "[email protected]<mailto:[email protected]>" 
<[email protected]<mailto:[email protected]>>
Date: Tuesday, 22 May 2018 at 7:45 PM
To: "[email protected]<mailto:[email protected]>" 
<[email protected]<mailto:[email protected]>>
Subject: Re: Knox failing to match path

Hi Rajat -

The service def looks okay to me.

There is a little dance that is required for new service definitions to be 
picked up properly - perhaps this is what you are running into:

1. update or add new service definition
2. restart the gateway - so that it is aware of the new service def changes
3. touch or otherwise save any topology that is hosting the service in question 
- so that the topology based webapp is rebuilt to include the new service def

If you didn't do it in that order there may likely be an old webapp in place 
even though you updated the service def.
It is an unfortunate dance but makes sense when you understand that topologies 
result in static webapp generation that needs to be redone with service updates.

Let us know whether that was the issue.

thanks,

--larry

On Tue, May 22, 2018 at 10:04 AM, Rajat Goel 
<[email protected]<mailto:[email protected]>> wrote:
Hi,

I am new to Knox. I am trying add a simple application service to my default 
Knox topology. Here’s what my service definition looks like:

<service role=“TESTAPP"name=“testapp"version="0.0.1">

    <routes>

        <route path="/app/**">

        </route>

        <route path="/app/api2">

        </route>

    </routes>

    <dispatch 
classname="org.apache.hadoop.gateway.dispatch.PassAllHeadersDispatch"/>

</service>


Rewrite.xml has rules:

<rules>

    <rule 
dir="IN"name=“TESTAPP/testapp/inbound/path"pattern="*://*:*/**/app/{**}">

        <rewrite template="{$serviceUrl[TESTAPP]}/app/{**}"/>

    </rule>

</rules>


I have added my service definition in Knox default topology:
<service>
                <role>TESTAPP</role>
                <url>http://19.2.168.154.194:8080</url>
            </service>

Now when I try to access my service through Knox gateway on web browser, using 
url:
https://192.168.154.194:8443/gateway/default/app/api1#/visualize?_g=<https://192.168.154.194:8443/gateway/default/app/testapp#/visualize?_g=>()

Its not working. Knox gateway.log says: 2018-05-22 18:59:42,056 WARN  
hadoop.gateway (GatewayFilter.java:doFilter(162)) - Failed to match path 
/app/api1

Can someone tell me whats the issue here?

Thanks,
Rajat

Reply via email to