The path used to retrieve "logo.png" should be:

.../app/ext/ndaw-crdp/images/logo.png

Not:

.../app/ext/ndaw-crdp/resources/images/logo.png

See the description of the "resources" part of guac-manifest.json:

https://guacamole.apache.org/doc/gug/guacamole-ext.html#extension-manifest

- Mike

On 5/4/23 03:28, Willem van de Mheen wrote:
Some introduction: When I started this project Guacamole 1.4.0 was still the latest 
version so I'm still using that to develop my extension. Once I have it working properly 
I want to test it with Guacamole 1.5.1. Also, the company I work for is branding 
Guacamole as "Clientless RDP" or CRDP so you'll see that name at several places.

I have the following files in place:
- guacamole-1.4.0.war file saved as /var/lib/tomcat9/webapps/clientlessrdp.war
- auth-jdbc extension saved as 
/etc/guacamole/extensions/guacamole-auth-jdbc-mysql-ndaw-1.4.0.jar
- my branding extension saved as /etc/guacamole/extensions/ndaw-crdp-1.4.0.jar

When I start Tomcat the logs show:
May 04 09:17:53 guacamole140 tomcat9[14304]: Deploying web application archive 
[/var/lib/tomcat9/webapps/clientlessrdp.war]
May 04 09:17:56 guacamole140 tomcat9[14304]: At least one JAR was scanned for 
TLDs yet contained no TLDs. Enable debug logging for this logger for a complete 
list of JARs that were scanned but no TLDs were found in them. Skipping 
unneeded JARs during scanning can improve startup time and JSP compilation time.
May 04 09:17:56 guacamole140 tomcat9[14304]: 09:17:56.967 [main] INFO  
o.a.g.environment.LocalEnvironment - GUACAMOLE_HOME is "/etc/guacamole".
May 04 09:17:57 guacamole140 tomcat9[14304]: 09:17:57.173 [main] INFO  
o.a.g.GuacamoleServletContextListener - Read configuration parameters from 
"/etc/guacamole/guacamole.properties".
May 04 09:17:57 guacamole140 tomcat9[14304]: 09:17:57.175 [main] INFO  
o.a.g.rest.auth.HashTokenSessionMap - Sessions will expire after 60 minutes of 
inactivity.
May 04 09:17:57 guacamole140 tomcat9[14304]: 09:17:57.587 [main] INFO  
o.a.g.extension.ExtensionModule - Multiple extensions are installed and will be 
loaded in order of decreasing priority:
May 04 09:17:57 guacamole140 tomcat9[14304]: 09:17:57.588 [main] INFO  
o.a.g.extension.ExtensionModule -  - [mysql] "MySQL Authentication" 
(/etc/guacamole/extensions/guacamole-auth-jdbc-mysql-ndaw-1.4.0.jar)
May 04 09:17:57 guacamole140 tomcat9[14304]: 09:17:57.590 [main] INFO  
o.a.g.extension.ExtensionModule -  - [ndaw-crdp] "New Day At Work Clientless RDP 
Guacamole extension" (/etc/guacamole/extensions/ndaw-crdp-1.4.0.jar)
May 04 09:17:57 guacamole140 tomcat9[14304]: 09:17:57.591 [main] INFO  
o.a.g.extension.ExtensionModule - To change this order, set the 
"extension-priority" property or rename the extension files. The default 
priority of extensions is dictated by the sort order of their filenames.
May 04 09:17:57 guacamole140 tomcat9[14304]: 09:17:57.629 [main] INFO  
o.a.g.a.mysql.conf.MySQLEnvironment - Installed JDBC driver for MySQL/MariaDB detected as 
"MySQL Connector/J".
May 04 09:17:59 guacamole140 tomcat9[14304]: 09:17:59.455 [main] INFO  
o.a.g.extension.ExtensionModule - Extension "MySQL Authentication" (mysql) 
loaded.
May 04 09:17:59 guacamole140 tomcat9[14304]: 09:17:59.594 [main] INFO  
o.a.g.extension.ExtensionModule - Extension "New Day At Work Clientless RDP 
Guacamole extension" (ndaw-crdp) loaded.
May 04 09:17:59 guacamole140 tomcat9[14304]: 09:17:59.790 [main] INFO  
o.a.g.t.w.WebSocketTunnelModule - Loading JSR-356 WebSocket support...
May 04 09:18:00 guacamole140 tomcat9[14304]: 09:18:00.879 [main] WARN  
o.g.jersey.server.wadl.WadlFeature - JAXBContext implementation could not be 
found. WADL feature is disabled.
May 04 09:18:01 guacamole140 tomcat9[14304]: Deployment of web application 
archive [/var/lib/tomcat9/webapps/clientlessrdp.war] has finished in [8,116] ms
May 04 09:18:01 guacamole140 tomcat9[14304]: Deploying web application 
directory [/var/lib/tomcat9/webapps/ROOT]
May 04 09:18:02 guacamole140 tomcat9[14304]: At least one JAR was scanned for 
TLDs yet contained no TLDs. Enable debug logging for this logger for a complete 
list of JARs that were scanned but no TLDs were found in them. Skipping 
unneeded JARs during scanning can improve startup time and JSP compilation time.
May 04 09:18:02 guacamole140 tomcat9[14304]: Deployment of web application 
directory [/var/lib/tomcat9/webapps/ROOT] has finished in [973] ms

So that seems fine. There are no other errors being logged. The missing logo is 
only shown in the access logs:

[04/May/2023:09:20:23 +0000] "GET 
/clientlessrdp/app/ext/ndaw-crdp/resources/images/logo.png HTTP/1.1" 404 799

The layout of the branding jar is:

│   guac-manifest.json
│   license.txt
│   ndaw-crdp.css
│   ndaw-crdp.js
│   ndaw-crdp.min.css
│   ndaw-crdp.min.js
│
├───controllers
│       fonts.js
│       switchAppKey.js
│       templates-main-ndaw.js
│       ws365Draggable.js
│
├───generated
│   └───templates-main
│           templates.js
│
├───images
│       logo-144.png
│       logo-64.png
│       logo.png
│       Symbol.svg
│       WS365-AppSwitcher.png
│
├───META-INF
│   │   MANIFEST.MF
│   │
│   └───maven
│       └───org.apache.guacamole
│           └───ndaw-crdp
│                   pom.properties
│                   pom.xml
│
├───styles
│       ndaw.css
│
├───templates
│       guacTextInput.html
│       switchAppKey.html
│       ws365Draggable.html
│
└───translations
         ca.json
         cs.json
         de.json
         en.json
         es.json
         fr.json
         it.json
         ja.json
         ko.json
         nl.json
         no.json
         pt.json
         ru.json
         zh.json


The contents of the guac-manifest.json is:

{
     "guacamoleVersion" : "*",
     "name"             : "New Day At Work Clientless RDP Guacamole extension",
     "namespace"        : "ndaw-crdp",
     "smallIcon"        : "images/logo-64.png",
     "largeIcon"        : "images/logo-144.png",
"css" : [
         "ndaw-crdp.min.css"
     ],

     "js" : [
         "ndaw-crdp.min.js"
     ],

     "resources" : {
         "images/Symbol.svg" : "image/svg+xml",
         "images/logo.png" : "image/png",
         "images/WS365-AppSwitcher.png" : "image/png",
         "templates/switchAppKey.html" : "text/html",
         "templates/ws365Draggable.html" : "text/html"
     },
"translations" : [
         "translations/ca.json",
         "translations/cs.json",
         "translations/de.json",
         "translations/en.json",
         "translations/es.json",
         "translations/fr.json",
         "translations/it.json",
         "translations/ja.json",
         "translations/ko.json",
         "translations/nl.json",
         "translations/no.json",
         "translations/pt.json",
         "translations/ru.json",
         "translations/zh.json"
     ]
}

I based my pom.xml in the pom.xml of the TOTP extension. I only changed the artifactId, name and 
url and in the configurations for the angular-maven-plugin and minify-maven-plugin, I replaced 
"totp" with "ndaw-crdp".

Best regards,
Willem van de Mheen




-----Original Message-----
From: Michael Jumper <[email protected]>
Sent: Thursday, May 4, 2023 2:02 AM
To: [email protected]
Subject: Re: Resource 404 error after packaging with Maven

On 5/3/23 08:39, Nick Couchman wrote:
On Wed, May 3, 2023 at 11:29 AM Willem van de Mheen
<[email protected]> wrote:

I’m working on a Guacamole branding extension and when I create a jar file by 
zipping the directory, I can load the extension and images load just fine. The 
strange thing is that when I package the files with Maven, the extension still 
loads perfectly and while for instance the custom font is still working, the 
paths to images that worked before no longer work. Tomcat returns a 404 error 
when trying to open the image. When I open the jar file from Maven in 7-zip, 
everything seems the same. I can see the images are there. It almost seems like 
the path is blocked in Tomcat somewhere, but I can’t find where. Do you have 
any pointers on where to look? If you need more information, please let me know.


You'll need to provide some more detail - maybe some logs from Tomcat,
and a rough idea of the configuration - what folder you're putting the
WAR file in, where you're putting the JARs, etc., so that we can
better help identify the problem.


A listing of the contents of each .jar and the contents of their 
guac-manifest.json files would also be helpful.

- Mike

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to