Hi Markus,
the okhttp protocol plugin should work out-of-the-box
and we use it in production (currently on Hadoop 3.2.2)
I remember that I had once an issue with the Hadoop library
having okhttp as a dependency which then caused a conflict.
It was solved by adding an exclusion rule to the Hadoop
dependency in ivy/ivy.xml:
<dependency org="org.apache.hadoop" name="hadoop-client" rev="3.0.0-cdh6.1.0"
conf="*->default">
...
<exclude org="com.squareup.okhttp" name="*" />
(the exclusion rule should be now)
<exclude org="com.squareup.okhttp3" name="*" />
The okhttp library is quite popular which makes conflicts
more probable.
Best,
Sebastian
On 7/23/21 5:25 PM, Markus Jelsma wrote:
Hello,
With a 1.18 checkout i am trying the okhttp plugin. I couldn't get it to
work on 1.15 due to another NoClassDefFoundError, and now with 1.18, it
still doesn't work and throws another NoClassDefFoundError.
java.lang.NoClassDefFoundError: okhttp3/Authenticator
at java.base/java.lang.Class.getDeclaredConstructors0(Native Method)
at
java.base/java.lang.Class.privateGetDeclaredConstructors(Class.java:3137)
at java.base/java.lang.Class.getConstructor0(Class.java:3342)
at java.base/java.lang.Class.getConstructor(Class.java:2151)
at
org.apache.nutch.plugin.Extension.getExtensionInstance(Extension.java:164)
at
org.apache.nutch.protocol.ProtocolFactory.getProtocolInstanceByExtension(ProtocolFactory.java:177)
at
org.apache.nutch.protocol.ProtocolFactory.getProtocol(ProtocolFactory.java:146)
at
org.apache.nutch.fetcher.FetcherThread.run(FetcherThread.java:308)
Caused by: java.lang.ClassNotFoundException: okhttp3.Authenticator
at
java.base/java.net.URLClassLoader.findClass(URLClassLoader.java:471)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:589)
at
org.apache.nutch.plugin.PluginClassLoader.loadClass(PluginClassLoader.java:104)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:522)
... 8 more
Any ideas what's going on?
Thanks,
Markus