You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@guacamole.apache.org by Oliver Jones <ol...@glance.net> on 2016/07/28 19:32:17 UTC

auth. extension class loading error

Hi, I'm trying to implement an authorization extension to Guacamole.

I'm trying to do this by creating a class that implements this interface in
guacamole-ext:  org/apache/guacamole/net/auth/AuthenticationProvider.

But when I put my .jar file in the extensions directory and bounce Tomcat,
guacamole doesn't load properly and I get this class loader error in
localhost.YYYY-MM-DD.log:

SEVERE: Exception sending context initialized event to listener instance of
class org.glyptodon.guacamole.net.basic.BasicServletContextListener
java.lang.NoClassDefFoundError:
org/apache/guacamole/net/auth/AuthenticationProvider

This happens even before I mention the extension in the properties file.

To get my jarfile right, is there something I have to do beyond setting up
the dependencies as explained in chapter 18 at
http://guacamole.incubator.apache.org/doc/gug/custom-auth.html#idm140538186580816
?

Thanks
Ollie Jones


------------------------------

Here's the full error msg with tracebacks.

Jul 28, 2016 2:50:27 PM org.apache.catalina.core.StandardContext
listenerStart
SEVERE: Exception sending context initialized event to listener instance of
class org.glyptodon.guacamole.net.basic.BasicServletContextListener
java.lang.NoClassDefFoundError:
org/apache/guacamole/net/auth/AuthenticationProvider
        at java.lang.ClassLoader.defineClass1(Native Method)
        at java.lang.ClassLoader.defineClass(ClassLoader.java:763)
        at
java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
        at java.net.URLClassLoader.defineClass(URLClassLoader.java:467)
        at java.net.URLClassLoader.access$100(URLClassLoader.java:73)
        at java.net.URLClassLoader$1.run(URLClassLoader.java:368)
        at java.net.URLClassLoader$1.run(URLClassLoader.java:362)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(URLClassLoader.java:361)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
        at
org.glyptodon.guacamole.net.basic.extension.Extension.getAuthenticationProviderClass(Extension.java:214)
        at
org.glyptodon.guacamole.net.basic.extension.Extension.getAuthenticationProviderClasses(Extension.java:257)
        at
org.glyptodon.guacamole.net.basic.extension.Extension.<init>(Extension.java:359)
        at
org.glyptodon.guacamole.net.basic.extension.ExtensionModule.loadExtensions(ExtensionModule.java:349)
        at
org.glyptodon.guacamole.net.basic.extension.ExtensionModule.configureServlets(ExtensionModule.java:417)
        at
com.google.inject.servlet.ServletModule.configure(ServletModule.java:53)
        at
com.google.inject.AbstractModule.configure(AbstractModule.java:59)
        at
com.google.inject.spi.Elements$RecordingBinder.install(Elements.java:223)
        at com.google.inject.spi.Elements.getElements(Elements.java:101)
        at
com.google.inject.internal.InjectorShell$Builder.build(InjectorShell.java:133)
        at
com.google.inject.internal.InternalInjectorCreator.build(InternalInjectorCreator.java:103)
        at com.google.inject.Guice.createInjector(Guice.java:95)
        at com.google.inject.Guice.createInjector(Guice.java:83)
        at
org.glyptodon.guacamole.net.basic.BasicServletContextListener.getInjector(BasicServletContextListener.java:83)
        at
com.google.inject.servlet.GuiceServletContextListener.contextInitialized(GuiceServletContextListener.java:45)
        at
org.glyptodon.guacamole.net.basic.BasicServletContextListener.contextInitialized(BasicServletContextListener.java:77)
        at
org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:5068)
        at
org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5584)
        at
org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:147)
        at
org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:899)
        at
org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:875)
        at
org.apache.catalina.core.StandardHost.addChild(StandardHost.java:652)
        at
org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:1091)
        at
org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:1980)
        at
java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
        at java.util.concurrent.FutureTask.run(FutureTask.java:266)
        at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
        at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
        at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.ClassNotFoundException:
org.apache.guacamole.net.auth.AuthenticationProvider
        at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
        ... 40 more

Re: auth. extension class loading error

Posted by Mike Jumper <mi...@guac-dev.org>.
On Fri, Jul 29, 2016 at 9:38 AM, Oliver Jones <ol...@glance.net> wrote:
> Following up on my message from yesterday, I'm still stumped.
>
> Ubuntu 16.04 LTS, tomcat7, Java 1.8
>
> I built the tutorial auth extension described in chapter 18 of the Guacamole
> manual, and I have the same problem; this time it's the
> SimpleAuthenticationProvider that the class loader can't find.
>

Can you post the full text of the new error?

Re: auth. extension class loading error

Posted by Oliver Jones <ol...@glance.net>.
Following up on my message from yesterday, I'm still stumped.

Ubuntu 16.04 LTS, tomcat7, Java 1.8

I built the tutorial auth extension described in chapter 18 of the
Guacamole manual, and I have the same problem; this time it's the
SimpleAuthenticationProvider that the class loader can't find.

Any suggestions?
Thanks.

On Thu, Jul 28, 2016 at 3:32 PM, Oliver Jones <ol...@glance.net> wrote:

> When I put my .jar file in the extensions directory and bounce Tomcat,
> guacamole doesn't load properly and I get this class loader error in
> localhost.YYYY-MM-DD.log:
>
> SEVERE: Exception sending context initialized event to listener instance
> of class org.glyptodon.guacamole.net.basic.BasicServletContextListener
> java.lang.NoClassDefFoundError:
> org/apache/guacamole/net/auth/AuthenticationProvider
>

Re: auth. extension class loading error

Posted by Oliver Jones <ol...@glance.net>.
Yesterday I grumbled:

>  I'm trying to implement an authorization extension to Guacamole.
> ...
> But when I put my .jar file in the extensions directory and bounce
Tomcat, guacamole doesn't load properly and I get this class loader error
in localhost.YYYY-MM-DD.log:


On Fri, Jul 29, 2016 at 1:24 PM, Mike Jumper <mi...@guac-dev.org>
wrote:

> The issue here is that the version of the web application is from
> prior to the move to the Apache Incubator, thus it doesn't know about
> the org.apache.guacamole classes.....
> You'll need to build a guacamole.war from the latest git to obtain a
> Guacamole which can load an extension that uses the
> org.apache.guacamole classes.
>

That is exactly right. (smacks forehead) Thanks Mike.

Ollie Jones

Re: auth. extension class loading error

Posted by Mike Jumper <mi...@guac-dev.org>.
On Thu, Jul 28, 2016 at 12:32 PM, Oliver Jones <ol...@glance.net> wrote:
> Hi, I'm trying to implement an authorization extension to Guacamole.
>
> I'm trying to do this by creating a class that implements this interface in
> guacamole-ext:  org/apache/guacamole/net/auth/AuthenticationProvider.
>
> But when I put my .jar file in the extensions directory and bounce Tomcat,
> guacamole doesn't load properly and I get this class loader error in
> localhost.YYYY-MM-DD.log:
>
> SEVERE: Exception sending context initialized event to listener instance of
> class org.glyptodon.guacamole.net.basic.BasicServletContextListener
> java.lang.NoClassDefFoundError:
> org/apache/guacamole/net/auth/AuthenticationProvider
>

The issue here is that the version of the web application is from
prior to the move to the Apache Incubator, thus it doesn't know about
the org.apache.guacamole classes. The AuthenticationProvider class is
provided by guacamole-ext, which extensions expect to be provided by
the web application (and thus do not bundle the .jar internally).

You'll need to build a guacamole.war from the latest git to obtain a
Guacamole which can load an extension that uses the
org.apache.guacamole classes.

> This happens even before I mention the extension in the properties file.
>

Mention it how?

If you're referring to your extensions own properties, then no worries.

Just in case you're referring to the deprecated "auth-provider"
property, however: please don't use that. That property will either do
nothing (it doesn't exist in recent git [1]) or will result in a loud
warning in the logs and some of the extension subsystem being disabled
for compatibility with older releases which did use that property
(0.9.7, 0.9.8, and 0.9.9 will honor the property but log warnings
about its use [2]).

Thanks,

- Mike

[1] https://github.com/apache/incubator-guacamole-client/commit/c7a5f0bcd611f6acac003f18a2022a185a34a5ee
[2] https://github.com/glyptodon/guacamole-client/blob/162f4db386c3a612e8a1189e92b7f789d51945d8/guacamole/src/main/java/org/glyptodon/guacamole/net/basic/extension/ExtensionModule.java#L145-L179