guacamole-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elvelux <os...@lantalde.net>
Subject Extension not working
Date Wed, 30 May 2018 14:09:31 GMT
Hello, i´m new to guacamole and i have managed to get it working with
proxmox.

But I have a problem. I am trying to add an extension to run a linux script
when an user logs into guacamole.

I have followed the guacamole manual in its 22th chapter and I have got the
extension loaded into guacamole (log file says Extension "lantalde" loaded).
The extension adds an event listener, but the code inside the listener is
never run.

I´m not sure if the problem is with the code or if i´m not creating the .jar
correctly. The only way to get the extension loaded that I have find is
creatin the .har with winrar including the guac-manifest.json and the
pom.xml into it. I have tried to generate the .jar with a mvn package
command, but then guacamole does not load the plugin because the manifest is
not in the root of the .jar file.

I´m not sure if I have to put the .java class file into the .jar or into the
guacamole client source code and then compile, I have tried both with no
success.

I suppose I am failing at something very basic because I´m new to guacamole
and Java. Can you see what is the problem? Thanks!

the files of the extension:

LantaldeListener.java
/package org.apache.guacamole.event;

import org.apache.guacamole.GuacamoleException;
import org.apache.guacamole.net.event.listener.Listener;
import org.apache.guacamole.net.event.AuthenticationSuccessEvent;
import java.io.IOException;

public class LantaldeListener implements Listener {
    @Override
    public void handleEvent(Object event) throws GuacamoleException {
        if (event instanceof AuthenticationSuccessEvent) {
			try { 
				Process p =
Runtime.getRuntime().exec("/var/lib/tomcat8/webapps/lanzar.sh");                        
				p.waitFor();
			} catch (Exception e) {
			}
        }
    }
}

/

guac-manifest.json
/{
    "guacamoleVersion" : "*",
    "name" : "lantalde",
    "namespace" : "lantalde",
    
    "listeners" : [
        "org.apache.guacamole.event.LantaldeListener"
    ]
}/

pom.xml
/	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/xsd/maven-4.0.0.xsd">
	<modelVersion>4.0.0</modelVersion>
	<groupId>org.apache.guacamole</groupId>
	<artifactId>lantalde</artifactId>
	<version>0.9.14</version>
	<name>lantalde</name>
	<properties>
		<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
	</properties>
	
	
    <build>
        <plugins>

            
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.3</version>
                <configuration>
                    <source>1.6</source>
                    <target>1.6</target>
                </configuration>
            </plugin>

        </plugins>
    </build>
	
	<dependencies>
        <dependency>
            <groupId>org.apache.guacamole</groupId>
            <artifactId>guacamole-ext</artifactId>
            <version>0.9.14</version>
            <scope>provided</scope>
        </dependency>
    </dependencies>
</project>/



--
Sent from: http://apache-guacamole-general-user-mailing-list.2363388.n4.nabble.com/

Mime
View raw message