Problem with theme in springboot jar

asked 2022-05-14 18:24:04 +0800

dperez gravatar image dperez

Hi, i have this config.







When the project starts, this problem is launched

2022-05-14 12:03:51,042 ERROR [restartedMain] org.zkoss.zk.ui.sys.ConfigParser: Unable to load a listener, [null:jar:file:/C:/Users/user/.m2/repository/org/zkoss/theme/breeze/!/metainfo/zk/config.xml:11:12] org.zkoss.zk.ui.UiException: Unknown listener: class org.zkoss.theme.breeze.BreezeThemeWebAppInit at org.zkoss.zk.ui.util.Configuration.addListener(Configuration.java:413) at org.zkoss.zk.ui.sys.ConfigParser.parseListener(ConfigParser.java:288) at org.zkoss.zk.ui.sys.ConfigParser.parseListeners(ConfigParser.java:282) at org.zkoss.zk.ui.sys.ConfigParser.parseConfigXml(ConfigParser.java:220) at org.zkoss.zk.ui.http.WebManager.<init>(WebManager.java:149) at org.zkoss.zk.ui.http.WebManager.<init>(WebManager.java:111) at org.zkoss.zkspringboot.ZkAutoConfiguration$1.contextInitialized(ZkAutoConfiguration.java:93)

Afther this error the deployment continues and the app starts, but the breeze theme is not loaded and it take iceblue.

INFO [0;39m [[34mrestartedMain[0;39m] [33morg.zkoss.zk.ui.sys.ConfigParser[0;39m: Parsing file:/C:/pgp-zkspring/target/classes/metainfo/zk/zk.xml WARN [0;39m [[34mrestartedMain[0;39m] [33morg.zkoss.zk.ui.util.Configuration[0;39m: Enable event thread has deprecated! INFO [0;39m [[34mrestartedMain[0;39m] [33morg.zkoss.zk.ui.sys.ConfigParser[0;39m: Parsing jar:file:/C:/Users/user/.m2/repository/org/zkoss/zk/zul/!/metainfo/zk/zk.xml

delete flag offensive retag edit

3 Answers

Sort by » oldest newest most voted

answered 2022-05-14 19:56:11 +0800

dperez gravatar image dperez

More info.

i´ve added BREEZE to the zkspringboot-demo-jar project and i got the same problem.

Just add the breeze dependency in the pom.xml and setup the theme in the the zk.xml and the problem appears during the app start up.

I´m using eclipse STS.

Thanks in advance.

link publish delete flag offensive edit

answered 2022-05-16 15:09:11 +0800

MDuchemin gravatar image MDuchemin
2390 1 6
ZK Team

Hi there,

How do you add dependencies to your project? Are you adding the jars manually, or using a dependency management tool such as maven or gradle?

I can see in the error that you are adding breeze- to your project. If you are using the default ZK spring boot starter, the default ZK version of the starter is 9.6.0.

It is possible that the theme fails to register if the versions are not matching.

If you are using maven / gradle, I recommend building once from command line, just to make sure there is no exception when resolving the dependencies. Sometime Eclipse will hide stuff from you, which can cause projects not to work as expected.

The error showed here indicates that the config parser failed to parse the breeze theme jar config (which explains why the theme is not loaded). However, there should be a "caused by" clause further below that error stack. If you don't see that error in your log, you can try putting a breakpoint at org.zkoss.zk.ui.sys.ConfigParser.parseListener(Configuration, Element)

on the line:

 log.error("Unable to load a listener, " + el.getLocator(), ex);

and check the content of the exception object ex to find out the root cause of that failure to parse.

link publish delete flag offensive edit


Thanks for your answer. I´m using maven. Also i´ve just figured out that the problem only appears when the eclipse IDE launchs the spring-boot:run. If i run the app with java -jar the theme is loaded perfectly. It´s a incovenient for developing purposes.

dperez ( 2022-05-16 19:08:34 +0800 )edit

if that's the case, you could also try starting the application from Eclipse, by right-clicking the application class in your package explorer and selecting "run as... > Java Application". I'm not sure if that provides more utility, though.

MDuchemin ( 2022-05-17 15:08:15 +0800 )edit

Also, it would be interesting to know if running from command line with mvn clean spring-boot:run also reproduces the issue.

MDuchemin ( 2022-05-17 15:09:08 +0800 )edit

Yes the problem persists running the suggested command. I think the problem is in the org.zkoss.zk.ui.util.Configuration.addListener(Configuration.java:413) because there isn´t IF case for this kind of Listener.

dperez ( 2022-08-29 14:19:38 +0800 )edit

answered 2022-09-15 18:17:53 +0800

MDuchemin gravatar image MDuchemin
2390 1 6
ZK Team

FYI since there is at least two reported issues with similar error stacks / messages, I have created a ticket to centralize this debugging: https://tracker.zkoss.org/browse/ZK-5245

link publish delete flag offensive edit
Your answer
Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!

[hide preview]

Question tools




Asked: 2022-05-14 18:24:04 +0800

Seen: 14 times

Last updated: Sep 15 '22

Support Options
  • Email Support
  • Training
  • Consulting
  • Outsourcing
Learn More