You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@knox.apache.org by Ebrahim Khalil Abbasi <eb...@gmail.com> on 2020/12/29 04:43:17 UTC

java.lang.NoClassDefFoundError in KNOX

Dear all,

I am using KNOX and its plugin in Ranger for authorization.
I restarted KNOX and Ranger and then executed the following command:
-----------------------------
 curl -ik  -u admin:<PASS> https://
<SERVER>:8443/gateway/dsgdev/livy/v1/sessions
-----------------------------


I got the http error 500

--------------------------------
<body><h2>HTTP ERROR 500</h2>
<p>Problem accessing /gateway/dsgdev/livy/v1/sessions. Reason:
<pre>    Server Error</pre></p><hr><a href="http://eclipse.org/jetty">Powered
by Jetty:// 9.4.12.v20180830</a><hr/></body>
-------------------------------

The gateway.log file shows two errors
2020-12-29 08:03:42,348 ERROR config.RangerConfiguration
(RangerConfiguration.java:addResourceIfReadable(63)) -
addResourceIfReadable(ranger-knox-dsgdev_knox-policymgr-ssl.xml): couldn't
find resource file location
2020-12-29 08:03:43,131 ERROR knox.gateway
(AbstractGatewayFilter.java:doFilter(69)) - Failed to execute filter:
java.lang.NoClassDefFoundError: com/kstruct/gethostname4j/Hostname


Would you please help me what should I do for this problem?
Ebrahim

Re: java.lang.NoClassDefFoundError in KNOX

Posted by Ebrahim Khalil Abbasi <eb...@gmail.com>.
Hi Larry,
Thanks for your reply. You are right the problem was a classpath related
issue.

Best

On Sat, Jan 2, 2021 at 8:13 PM larry mccay <lm...@apache.org> wrote:

> Hi Ebrahim -
>
> This is obviously a classpath related issue that would not be caused
> simply by restarting the gateway.
> Either, you have changed jars or the command line in gateway.sh script.
>
> Given that this is a Ranger Plugin related class, I assume that you have
> changed that jar or introduced an extension that assumes a different
> version of that code.
> If you have backed up the jars that you have changed - which you obviously
> should have - then put them back and restart.
>
> HTH,
>
> --larry
>
> On Mon, Dec 28, 2020 at 11:43 PM Ebrahim Khalil Abbasi <
> ebrahim.khalil.abbasi@gmail.com> wrote:
>
>> Dear all,
>>
>> I am using KNOX and its plugin in Ranger for authorization.
>> I restarted KNOX and Ranger and then executed the following command:
>> -----------------------------
>>  curl -ik  -u admin:<PASS> https://
>> <SERVER>:8443/gateway/dsgdev/livy/v1/sessions
>> -----------------------------
>>
>>
>> I got the http error 500
>>
>> --------------------------------
>> <body><h2>HTTP ERROR 500</h2>
>> <p>Problem accessing /gateway/dsgdev/livy/v1/sessions. Reason:
>> <pre>    Server Error</pre></p><hr><a href="http://eclipse.org/jetty">Powered
>> by Jetty:// 9.4.12.v20180830</a><hr/></body>
>> -------------------------------
>>
>> The gateway.log file shows two errors
>> 2020-12-29 08:03:42,348 ERROR config.RangerConfiguration
>> (RangerConfiguration.java:addResourceIfReadable(63)) -
>> addResourceIfReadable(ranger-knox-dsgdev_knox-policymgr-ssl.xml): couldn't
>> find resource file location
>> 2020-12-29 08:03:43,131 ERROR knox.gateway
>> (AbstractGatewayFilter.java:doFilter(69)) - Failed to execute filter:
>> java.lang.NoClassDefFoundError: com/kstruct/gethostname4j/Hostname
>>
>>
>> Would you please help me what should I do for this problem?
>> Ebrahim
>>
>>
>>
>>
>>
>>
>>
>>

Re: java.lang.NoClassDefFoundError in KNOX

Posted by larry mccay <lm...@apache.org>.
Hi Ebrahim -

This is obviously a classpath related issue that would not be caused simply
by restarting the gateway.
Either, you have changed jars or the command line in gateway.sh script.

Given that this is a Ranger Plugin related class, I assume that you have
changed that jar or introduced an extension that assumes a different
version of that code.
If you have backed up the jars that you have changed - which you obviously
should have - then put them back and restart.

HTH,

--larry

On Mon, Dec 28, 2020 at 11:43 PM Ebrahim Khalil Abbasi <
ebrahim.khalil.abbasi@gmail.com> wrote:

> Dear all,
>
> I am using KNOX and its plugin in Ranger for authorization.
> I restarted KNOX and Ranger and then executed the following command:
> -----------------------------
>  curl -ik  -u admin:<PASS> https://
> <SERVER>:8443/gateway/dsgdev/livy/v1/sessions
> -----------------------------
>
>
> I got the http error 500
>
> --------------------------------
> <body><h2>HTTP ERROR 500</h2>
> <p>Problem accessing /gateway/dsgdev/livy/v1/sessions. Reason:
> <pre>    Server Error</pre></p><hr><a href="http://eclipse.org/jetty">Powered
> by Jetty:// 9.4.12.v20180830</a><hr/></body>
> -------------------------------
>
> The gateway.log file shows two errors
> 2020-12-29 08:03:42,348 ERROR config.RangerConfiguration
> (RangerConfiguration.java:addResourceIfReadable(63)) -
> addResourceIfReadable(ranger-knox-dsgdev_knox-policymgr-ssl.xml): couldn't
> find resource file location
> 2020-12-29 08:03:43,131 ERROR knox.gateway
> (AbstractGatewayFilter.java:doFilter(69)) - Failed to execute filter:
> java.lang.NoClassDefFoundError: com/kstruct/gethostname4j/Hostname
>
>
> Would you please help me what should I do for this problem?
> Ebrahim
>
>
>
>
>
>
>
>