Folder and file structure looks good. Debug log says: "Caused by: 
java.lang.UnsupportedClassVersionError: 
org/apache/guacamole/event/LoginListener has been compiled by a more recent 
version of the Java Runtime (class file version 61.0), this version of the Java 
Runtime only recognizes class file versions up to 52.0"

This feels like a Maven issue. Full pom.xml:

> <?xml version="1.0" encoding="UTF-8"?>
> <project xmlns="http://maven.apache.org/POM/4.0.0"; 
> 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>guac-listener</artifactId>
> <packaging>jar</packaging>
> <version>0.2</version>
>
> <name>guac-listener</name>
> <!-- FIXME change it to the project's website -->
> <!-- <url>http://www.example.com</url> -->
>
> <properties>
> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
> <maven.compiler.release>17</maven.compiler.release>
> </properties>
>
> <dependencies>
> <dependency>
> <groupId>org.apache.guacamole</groupId>
> <artifactId>guacamole-ext</artifactId>
> <version>1.5.5</version>
> </dependency>
> </dependencies>
>
> <build>
> <pluginManagement><!-- lock down plugins versions to avoid using Maven 
> defaults (may be moved to parent pom) -->
> <plugins>
> <!-- clean lifecycle, see 
> https://maven.apache.org/ref/current/maven-core/lifecycles.html#clean_Lifecycle
>  -->
> <plugin>
> <artifactId>maven-clean-plugin</artifactId>
> <version>3.4.0</version>
> </plugin>
> <!-- default lifecycle, jar packaging: see 
> https://maven.apache.org/ref/current/maven-core/default-bindings.html#Plugin_bindings_for_jar_packaging
>  -->
> <plugin>
> <artifactId>maven-resources-plugin</artifactId>
> <version>3.3.1</version>
> </plugin>
> <plugin>
> <artifactId>maven-compiler-plugin</artifactId>
> <version>3.13.0</version>
> <configuration>
> <source>1.8</source>
> <target>1.8</target>
> </configuration>
> </plugin>
> <plugin>
> <artifactId>maven-surefire-plugin</artifactId>
> <version>3.3.0</version>
> </plugin>
> <plugin>
> <artifactId>maven-jar-plugin</artifactId>
> <version>3.4.2</version>
> </plugin>
> <plugin>
> <artifactId>maven-install-plugin</artifactId>
> <version>3.1.2</version>
> </plugin>
> <plugin>
> <artifactId>maven-deploy-plugin</artifactId>
> <version>3.1.2</version>
> </plugin>
> <!-- site lifecycle, see 
> https://maven.apache.org/ref/current/maven-core/lifecycles.html#site_Lifecycle
>  -->
> <plugin>
> <artifactId>maven-site-plugin</artifactId>
> <version>3.12.1</version>
> </plugin>
> <plugin>
> <artifactId>maven-project-info-reports-plugin</artifactId>
> <version>3.6.1</version>
> </plugin>
> </plugins>
> </pluginManagement>
> </build>
> </project>

Sent with [Proton Mail](https://proton.me/mail/home) secure email.

On Wednesday, June 4th, 2025 at 4:07 AM, Michael Jumper <[email protected]> 
wrote:

> On June 3, 2025 2:17:59 PM PDT, viktor_krumm <[email protected]> 
> wrote:
>
>> I am attempting to write an event listener using the documentation. I have 
>> successfully compiled a basic jar with Maven with no errors. When I load it 
>> into guacamole, I get "Extension guac-listener.jar could not be loaded: 
>> Listener class cannot be loaded (wrong version of API?)".
>>
>> My files are simple:
>>
>> guac-manifest.json:
>> {
>>
>> "guacamoleVersion" : "1.5.5",
>>
>> "name" : "Guacamole Login Listener",
>> "namespace" : "guac-listener",
>>
>> "listeners" : [
>> "org.apache.guacamole.event.LoginListener"
>> ]
>> }
>>
>> LoginListener.java:
>> package org.apache.guacamole.event;
>>
>> import org.apache.guacamole.GuacamoleException;
>> import org.apache.guacamole.net.event.listener.Listener;
>> import java.io.FileWriter;
>> import java.io.IOException;
>>
>> public class LoginListener implements Listener {
>>
>> @Override
>> public void handleEvent(Object event) throws GuacamoleException {
>> String path = "/tmp/dummy.txt";
>> String msg = "handler called!";
>>
>> try (FileWriter writer = new FileWriter(path, true)) {
>> writer.write(msg);
>> }
>>
>> catch (IOException e) {
>> System.out.println("Err");
>> }
>>
>> }
>>
>> }
>>
>> pom.xml dependencies:
>> <dependencies>
>> <dependency>
>> <groupId>org.apache.guacamole</groupId>
>> <artifactId>guacamole-ext</artifactId>
>> <version>1.5.5</version>
>> </dependency>
>> </dependencies>
>> My first guess is I am somehow linking the wrong library. The guacamole 
>> webserver is docker latest tag.
>>
>> Thanks
>>
>> Sent with [Proton Mail](https://proton.me/mail/home) secure email.
>
> If you extract the extension .jar as a zip file, do you see the expected 
> contents (guac-manifest.json at the root level plus your LoginListener class 
> nested beneath its package directories)?
>
> What do you see in the Guacamole logs with debug-level logging enabled?
>
> - Mike

Reply via email to