0

zk spring boot payara 5 deployment error

asked 2020-11-29 06:18:37 +0800

RomanZK gravatar image RomanZK
1 1

updated 2020-11-29 15:56:31 +0800

I get the following error when deploying my zk spring boot app to payara 5 app server.

Caused by: java.lang.IllegalStateException: ServletConfig has not been initialized at javax.servlet.GenericServlet.getServletContext(GenericServlet.java:200) at org.springframework.web.servlet.FrameworkServlet.destroy(FrameworkServlet.java:863) at org.apache.catalina.core.StandardWrapper.unload(StandardWrapper.java:1797) ... 78 more ----- Root Cause -----

Caused by: java.lang.IllegalStateException: ZK WebManager already exists. Could not initialize via Spring Boot configuration. at org.zkoss.zkspringboot.ZkAutoConfiguration$1.contextInitialized(ZkAutoConfiguration.java:90) at org.apache.catalina.core.StandardContext.contextListenerStart(StandardContext.java:5178) at com.sun.enterprise.web.WebModule.contextListenerStart(WebModule.java:681) at org.apache.catalina.core.StandardContext.start(StandardContext.java:5756) ... 73 more

This only happens when I use the zk spring boot starter. I have deployed a normal spring mvc app (i.e. without zk) to payara 5 and it works fine.

I have been able to trace the exact line to ZkAutoConfiguration.java:90 in the zk spring boot autoconfig jar.

I have no intention of using zats for this deployment to payara 5. Any ideas what could be the issue ?

Would appreciate help on this.

I am using zk 9.0.0.1 CE.

Regards,

delete flag offensive retag edit

11 Answers

Sort by ยป oldest newest most voted
0

answered 2020-12-09 00:00:22 +0800

RomanZK gravatar image RomanZK
1 1

updated 2020-12-14 10:12:38 +0800

cor3000 gravatar image cor3000
6280 2 7

I implemented your approach it works fine. What I did earlier was something like this.

zk.springbootPackaging=war
zk.zul-view-resolver-enabled=false


@Configuration
@EnableConfigurationProperties({ZkProperties.class})
public class MyZkWebMvcConfiguration implements WebMvcConfigurer 
{

}

it appears that the zk.zul-view-resolver-enabled property will equally disable this new resolver as well.

Thanks.

link publish delete flag offensive edit

Comments

I am glad you found a solution. Still I can't follow the reasoning or your example. It doesn't contain a view resolver to be disabled: https://github.com/zkoss/zkspringboot/blob/v2.3.1/zkspringboot-autoconfig/src/main/java/org/zkoss/zkspringboot/ZkWebMvcConfiguration.java#L25 - the flag is used here

cor3000 ( 2020-12-14 10:22:26 +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: 2020-11-29 06:18:37 +0800

Seen: 20 times

Last updated: Dec 14 '20

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