-
FEATURED COMPONENTS
First time here? Check out the FAQ!
Hi I am trying to use ZKSpringboot starter - actually using the zkspringboot-minimal-war example. I have it setup in Eclipse - when I run it as Spring boot run everything works and startup loads the ZK Servlets. But when I try to run the project on Tomcat, I can see Spring start, but none of the ZK servlets start - nothing works.
Does anyone have a working ZK Spring demo that can run as a war on tomcat? Or any ideas why the startup on tomcat is not working - when I have everything in place that the zkspringboot-minimal-war example has.
when starting up as run Spring boot I see: Root WebApplicationContext: initialization completed in 616 ms ZK-Springboot: ServletRegistrationBean for DHtmlLayoutServlet with url pattern [*.zul, *.zhtml] ZK-Springboot: ServletRegistrationBean for DHtmlUpdateServlet with path /zkau Starting ZK 9.6.0 CE (build: 2021081016)
when starting under tomcat I only see: INFO: Initializing Spring embedded WebApplicationContext
I think it was mostly issues in my project after working on it for a while. I'll post some thoughts so if anyone else runs into similar, they might find something helpful.
1) I ran into issues with the POM following what is in GitHub (zkspringboot-minimal-war). Errors similar to (Could not initialize class org.apache.maven.plugin.war.util.WebappStructureSerializer) For me the only way to solve these issues were by adding the following in the build - plugins section of the pom (after the org.springframework.boot plugin):
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<version>3.3.1</version>
</plugin>
2) My spring starter had already created a seperate Servlet Initializer class in the same package as my SpringBootApplication class. If you look at the zkspringboot-minimal-war it has the SpringBootApplication class extend SpringBootServletInitializer and adds in
@Override
protected SpringApplicationBuilder configure(SpringApplicationBuilder application) {
return application.sources(DctmApplication.class);
}
So you need to get rid of the extra Initializer class if your spring starter created that.
3) I had to ignore the different startup messages displayed in Spring startup when using spring-boot: run - versus deployed on Tomcat. When deployed on Tomcat I don't see messages about ZK Servlet initializing. However it still is working
4) Difference in running on Tomcat container in Eclipse - versus packaged war deployed on Tomcat. When referencing the path in browser:
you'll see something like
<property name="context-root" value="rps-controller"/>
Chris
Asked: 2022-11-10 01:23:31 +0800
Seen: 8 times
Last updated: Nov 10 '22
Zk + Spring Security redirect to strange page after login
ZK Spring webflow and flowScope
Spring security doesn't return user inside event listener
ZK Spring 3.1.1 MVVM Use @Scope/@Component or No?
Upgrading from Spring3.1 to 3.1.1 Maven.. pulls in 3.0.x jars... issues
When would I want to use ThreadLocalListener?
ZKoss with springsecurity using database