0

Unknown listener: class org.zkoss.theme.iceblue_c.ThemeWebAppInit when use zkspringboot 2.5.12

asked 2022-06-29 15:18:25 +0800

jack3dot1415 gravatar image jack3dot1415
60 2
http://turbo00.7168.net/
<zkspringboot.version>2.5.12</zkspringboot.version>
<springboot.version>2.5.12</springboot.version>
<spring.version>5.3.20</spring.version>
<zk.version>9.6.0.1</zk.version>
<zkspring.version>3.2.0</zkspring.version>

in zk.xml,use the iceblue_c theme

<library-property>
    <name>org.zkoss.theme.preferred</name>
    <value>iceblue_c</value>
</library-property>

when i run Application or use mvn spring-run, my web app can startup, but the theme cannot take effect,there is a UiException when startup:

org.zkoss.zk.ui.UiException: Unknown listener: class org.zkoss.theme.iceblue_c.ThemeWebAppInit
    at org.zkoss.zk.ui.util.Configuration.addListener(Configuration.java:413) ~[zk-9.6.0.1.jar:9.6.0.1]
    at org.zkoss.zk.ui.sys.ConfigParser.parseListener(ConfigParser.java:288) ~[zk-9.6.0.1.jar:9.6.0.1]
    at org.zkoss.zk.ui.sys.ConfigParser.parseListeners(ConfigParser.java:282) ~[zk-9.6.0.1.jar:9.6.0.1]
    at org.zkoss.zk.ui.sys.ConfigParser.parseConfigXml(ConfigParser.java:220) ~[zk-9.6.0.1.jar:9.6.0.1]
    at org.zkoss.zk.ui.http.WebManager.<init>(WebManager.java:149) ~[zk-9.6.0.1.jar:9.6.0.1]
    at org.zkoss.zkspringboot.ZkAutoConfiguration$1.contextInitialized(ZkAutoConfiguration.java:95) ~[zkspringboot-autoconfig-2.5.12.jar:na]
    at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4766) ~[tomcat-embed-core-9.0.60.jar:9.0.60]
    ...
    at org.springframework.boot.devtools.restart.RestartLauncher.run(RestartLauncher.java:49) ~[spring-boot-devtools-2.5.12.jar:2.5.12]

but if I use this command:

spring-boot:run -Dspring-boot.run.fork=false

to startup my web app, there is no exception throw, the theme work well, I search on google why,but cannot find anything help, is anybody have the same problem?

delete flag offensive retag edit

2 Answers

Sort by ยป oldest newest most voted
1

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

MDuchemin gravatar image MDuchemin
2560 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

Comments

Nothing happened since 2015 :-(

holos ( 2024-03-18 19:25:59 +0800 )edit

Hi Holos, we still don't have a reproducing case to debug. if you have a runnable project reproducing this issue, can you provide a runnable sample?

MDuchemin ( 2024-03-20 17:38:50 +0800 )edit

Hi MDuchemin, I tried to boil down my example to a minimum and surprisingly the problem arises as soon as I add

restart.include.zklibs=/z[\w]+-[\w\d-.]+.jar

to file META-INF/spring-devtools.properties in order to get the labels reloaded after a soft restart (caused by spring-devtools).

holos ( 2024-03-21 00:43:08 +0800 )edit

If still needed, I can definitely provide you with an example!

holos ( 2024-03-21 00:45:12 +0800 )edit

Alright! that's great info! That would make sense actually, since the spring-boot devtools restart does have known limitations about not working well with objects deserialized from ObjectInputStream, which I guess could be what is happening here.

MDuchemin ( 2024-03-21 15:21:24 +0800 )edit
0

answered 2022-07-01 17:28:47 +0800

MDuchemin gravatar image MDuchemin
2560 1 6
ZK Team

From the error, your server is trying to locate the {themename}ThemeWebAppInit listener class and failing to do so. Class in github

Not sure why the class fails to resolve, but it looks similar to this question:

https://forum.zkoss.org/question/73399/unknown-listener-errors/

A bit old, but they seem to have a similar issue.

Based on that, do you tomcat endorsed directory? or other elements mentioned in that previous question?

link publish delete flag offensive edit

Comments

when I change to springboot(zkspringboot),this issue occurs.if I use the traditional web style app (xml based config files in webapp/WEB-INF) and jettty server,there is no problem.

jack3dot1415 ( 2022-07-06 14:35:39 +0800 )edit

Do you know if your springboot launch uses the springboot embedded tomcat, and if that tomcat has an endorsed directory configuration? (possibly in pom file, under the project properties?)

MDuchemin ( 2022-07-12 15:11:06 +0800 )edit
1

If the projects works as expected in jetty start, then it sounds like a configuration issue (as opposed to a project setup issue, or a dependency or compiling issue)

MDuchemin ( 2022-07-12 15:12:07 +0800 )edit

as i say,if i use this command to start: mvn spring-boot:run -Dspring-boot.run.fork=false there is no problem,but if use this command: mvn spring-boot:run the problem occurs

jack3dot1415 ( 2022-08-08 10:49:54 +0800 )edit

that's interesting, because fork should only cause a new JVM to be spun up to host the running application. do you have some global arguments in your JVM, maybe using JAVAOPTIONS or similar? Another test would be to check if this happen in other machines also, to rule out config issues.

MDuchemin ( 2022-08-18 16:08:16 +0800 )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

Follow
1 follower

RSS

Stats

Asked: 2022-06-29 15:18:25 +0800

Seen: 22 times

Last updated: Sep 15 '22

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