Support Questions

Find answers, ask questions, and share your expertise

Issue with knox gateway when passing url with jsessionid

avatar

Hi All,

Facing an issue with knox gateway.

When we pass a url like:

https://app1.company.com:9443/company/opt/opentext/common/jslib/themes/default/athena.css;jsessionid...

The rule urlencodes it before sending to tomcat server. Tomcat then throws not found error:

I have two questions on this:

1. Is there a way to tell the rewrite rule to not encode the url or is there another way to not encode the incoming URL before forwarding to tomcat server?

I noticed ‘;’ and ‘=’ are getting converted in their ASCII formats.

;jsessionid= à %3Bjsessionid%3D

And the url passed becomes:

http://ip-172-1-1-1:9090/opentext/common/jslib/themes/default/athena.css%3Bjsessionid%3D6F4614AEAE08...

2. We were trying to specify another dispatch (PassAllHeadersDispatch) in the service.xml

But it never gets picked up as shown in the debug logs. How can we change the default dispatch apart from putting in the service.xml?

We did checked that the PassAllHeadersDispatch are supported in the knox version (0.9) we are using.

Given below are the topology, service.xml, rewrite.xml and the relevant portion of the log.

knox

topology

cat opt.xml

<topology>

<gateway>

<provider>

<role>webappsec</role>

<name>AppWebAppSec</name>

<enabled>false</enabled>

<param>

<name>ve.bodylength.enabled</name>

<value>true</value>

</param>

<param>

<name>ve.gzip.enabled</name>

<value>true</value>

</param>

<param>

<name>ve.header.enabled</name>

<value>true</value>

</param>

</provider>

<provider>

<role>identity-assertion</role>

<name>Default</name>

<enabled>false</enabled>

</provider>

</gateway>

<service>

<role>OPENTEXT</role>

<url>http://ip-172-1-1-1:9090</url>

</service>

</topology>

cat rewrite.xml

<rules>

<rule dir="IN" name="OPENTEXT/opentext/inbound" pattern="*://*:*/**/opentext/{**}">

<rewrite template="{$serviceUrl[OPENTEXT]}/opentext/{**}"/>

</rule>

<rule dir="OUT" name="OPENTEXT/opentext/outbound" pattern="/opentext/{**}">

<rewrite template="{$frontend[url]}/opentext/{**}"/>

</rule>

</rules>

cat service.xml

<service role="OPENTEXT" name="opentext" version="0.0.1">

<routes>

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

<route path="/opentext/"/>

</routes>

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

Logs

2017-05-11 15:34:25,692 DEBUG hadoop.gateway (GatewayFilter.java:doFilter(116)) - Received request: GET /opentext/common/jslib/themes/default/athena.css

2017-05-11 15:34:25,697 DEBUG hadoop.gateway (UrlRewriteProcessor.java:rewrite(164)) - Rewrote URL: https://app1.company.com:9443/company/opt/opentext/common/jslib/themes/default/athena.css;jsessionid..., direction: IN via implicit rule: OPENTEXT/opentext/inbound1 to URL: http://ip-172-1-1-1:9090/opentext/common/jslib/themes/default/athena.css;jsessionid=6F4614AEAE088D5D...

2017-05-11 15:34:25,698 DEBUG hadoop.gateway (DefaultDispatch.java:executeOutboundRequest(120)) - Dispatch request: GET http://ip-172-1-1-1:9090/opentext/common/jslib/themes/default/athena.css%3Bjsessionid%3D6F4614AEAE08...

2017-05-11 15:34:25,708 DEBUG hadoop.gateway (DefaultDispatch.java:executeOutboundRequest(133)) - Dispatch response status: 404

2017-05-11 15:34:25,708 DEBUG hadoop.gateway (DefaultDispatch.java:getInboundResponseContentType(202)) - Using explicit character set UTF-8 for entity of type text/html

2017-05-11 15:34:25,708 DEBUG hadoop.gateway (DefaultDispatch.java:getInboundResponseContentType(210)) - Inbound response entity content type: text/html; charset=utf-8

2017-05-11 15:34:25,709 DEBUG hadoop.gateway (UrlRewriteProcessor.java:rewrite(164)) - Rewrote URL: /opentext/common/jslib/themes/default/athena.css;jsessionid=6F4614AEAE088D5DD74915C45DDAC39D, direction: OUT via implicit rule: OPENTEXT/opentext/outbound2 to URL: https://app1.company.com:9443/company/opt/opentext/common/jslib/themes/default/athena.css;jsessionid...

Appreciate your help and time.

Thanks & regards,

Raj

1 ACCEPTED SOLUTION

avatar

Hi,

I managed to fix the issue.

The fix was to put the Hbase dispatch in the service.xml

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

Thanks

View solution in original post

1 REPLY 1

avatar

Hi,

I managed to fix the issue.

The fix was to put the Hbase dispatch in the service.xml

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

Thanks