Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fuseki webapp does not load FusekiAutoModules #2774

Closed
Ostrzyciel opened this issue Oct 15, 2024 · 3 comments
Closed

Fuseki webapp does not load FusekiAutoModules #2774

Ostrzyciel opened this issue Oct 15, 2024 · 3 comments
Labels

Comments

@Ostrzyciel
Copy link
Contributor

Ostrzyciel commented Oct 15, 2024

Version

5.2.0

What happened?

I wrote an implementation of FusekiAutoModule and registered it via the service loader. However, I can't get this to work when using the Fuseki web app (FusekiWebappCmd). It seems like the module is never discovered, called, anything.

I did some probing with a debugger and it seems that the FusekiAutoModules class is not called when starting via this main class. In FusekiMain there is this code that does it:

if ( withModules ) {
// Use the discovered ones.
FusekiAutoModules.enable(true);
// Allows for external setting of serverConfig.fusekiModules
if ( serverConfig.fusekiModules == null ) {
FusekiAutoModules.setup();
serverConfig.fusekiModules = FusekiAutoModules.load();
}

But I can't find it in FusekiWebappCmd. There is also no parameter for enabling/disabling modules, which makes me guess that this was omitted by mistake when the module system was introduced.

I think this can be fixed by basically copy-pasting the module initialization part from FusekiMain to FusekiWebappCmd, along with the command-line argument. Assuming I'm correct in the assessment that this is really the issue 😆

Relevant output and stacktrace

No response

Are you interested in making a pull request?

Yes, but I'm not sure how to build Fuseki so that I can test the fix.

@Ostrzyciel Ostrzyciel added the bug label Oct 15, 2024
@Ostrzyciel
Copy link
Contributor Author

In the meantime I've finally figured out where to find the FusekiMain JAR and how to run it. Fuseki module loading works there just fine, but it's disabled by default. I'm not sure if this is the intended behavior, I thought this says it should be enabled:

/**
* Enable/disable discovery of modules using the service loader.
* The default is 'enabled'.
*/
public static void enable(boolean setting) {

@afs
Copy link
Member

afs commented Oct 15, 2024

Correct - the whole Fuseki module system is part of Fuseki main, not Fuseki webapp.

To add custom functionality to Fusekiwebap, you'll need to add the jar and repackage the server (see the current jena-fuseki-fulljar).

Webapps start up differently and can be run in environments that preclude additional jar files by design. They are supposed to be portable to different web application containers (Tomcat, Jetty, Resin, ...), A webapp is targetted at business logic,
middle tier functionality, originally running in a shared environment; not databases.

See #2775 for discussion about moving all development to the Fuskei main as base, and leaving the WAR file as fixed functionality.

@afs afs added Fuseki and removed bug labels Oct 15, 2024
@Ostrzyciel
Copy link
Contributor Author

Ahhh, now I get it! Thank you for the detailed explanation and the context in #2775.

In that case, I will close this. For my module, I will switch to the Jena initialization system instead, because what I want to do is simple enough to work in this way as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants