kweb-core
kweb-core copied to clipboard
Using the same fomantic plugin instance in multiple Kweb instances fails to decorate HTML pages
I used 0.7.17 version of core and the fomantic styles are not applied in my application. I am using JDK8 (cannot upgrade). Is there any change between 0.7.11 and 0.7.12 that would alter the way fomantic styles are applied? I want to use the latest version but lacking fomantic styles prevents me from doing that.
Hmm, that's not good.
Do you see the styling applied in this Demo app? http://demo.kweb.io:7659/lists/7c5b34 It's using a recent version of Kweb.
JDK8 shouldn't be an issue.
Thanks for coming back. The demo works fine. Not sure what is happening but the FomanticUIPlugin executes the decorate method but the final (i.e. rendered website) does not have header as "enriched" by the decorate method. It seems like the header was created ignoring the FomanticUIPlugin. I have the plugin in the list of plugins.
OK, I found the reason. I started multiple instances of the Kweb server in a single JVM. This causes the plugin (which is a singleton) to go crazy. Do you think it would be possible to address this in a future release? Thanks in advance for your reply.
Oh, hmm, I can definitely remove the singletons - although I'm not sure why using a singleton would cause a problem, that may be a bug in its own right. I'm guessing maybe the StaticFilesPlugin, or some weirdness in plugin dependency resolution. The plugins should be fairly stateless.
One quick non-breaking way to get rid of the singletons would be something like val fomantic get() = FomanticUIPlugin().
Not sure what is causing it if you try to run two instances of the Kweb. :-(
Thanks a lot for your help.
No problem, I'm going to leave this open to investigate why the singleton plugins were causing problems.
This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.