Deploy a Spring Boot Application into Tomcat’
Create a Spring Boot app with Java 11 and deploy into Tomcat 9.
Deploy a Spring Boot Application into Tomcat’
Create a Spring Boot app with Java 11 and deploy into Tomcat 9.
edu
Great tutorial. Unfortunately when I try to login on dev-750378.okta.com using my user and temporary password received the login page give me an error access failed message.
Matt Raible
Is there any additional information in your logs? Did you create a brand new developer account? I went through this tutorial today and everything worked fine for me on macOS.
Guillaume Husta
Maybe a reference to this link would also be valuable : https://spring.io/guides/gs…
edu
Thanks for the reply Matt. I´m sure your tutorial is correct, the browser console does not show any log error. Looks some trouble with the first access using a fresh dev account and the temporary password received by email. I also typed an aleatory username and password and the error message was the same so I requested a password recovery to try again. I made a 30sec screencast with the error https://www.dropbox.com/s/v…
Matt Raible
Hmmm, that’s strange. Can you please send an email to developers@okta.com with this information? We should be able to fix your account.
CBCRUNCH
context path issue with /demo, this is not working with saml based sso. Can someone help me out how to implement this.
Matt Raible
Can you please ask this question on our developer forums? This post doesn’t have anything to do with SAML and more people will see your question on the forums.
Andrew Arefyev
…I’m sorry… Way? What for?
We started to build wars + servlet container inside of single jar for microservices. Oooook.
Zurückgehen?
maiello
I’m agree with you!!!. Spring Boot web applications include a pre-configured, embedded web server by default!!!
Abhimanu Handoo
Error deploying as a war in tomcat
Matt Raible
Please provide more information about the error you’re seeing. It’s tough to help you if you don’t provide us steps to reproduce! Are you just cloning this post’s repo and trying to run it, or did you start the tutorial from scratch? If you started from scratch, are you using Spring Boot 2.1.4 like this tutorial does?
Abhimanu Handoo
I am following the steps mentioned in the post and have not cloned from repo. I am using Spring boot version 2.1.15 as mentioned in the pom.xml file of this post. I am using jdk version 8.
What I have done till now
update the java code added below method
@Override
protected SpringApplicationBuilder configure(SpringApplicationBuilder application) {
return application.sources(DemoApplication.class);
}
removed the declaration of the spring-boot-maven-plugin plugin in pom.xml file.
After that I am getting below error
Caused by: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/demo-0.0.1-SNAPSHOT]]
at org.apache.catalina.util.LifecycleBase.handleSubClassException(LifecycleBase.java:440)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:198)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:717)
… 44 more
Caused by: java.lang.IllegalArgumentException: Cannot instantiate interface org.springframework.context.ApplicationListener : org.springframework.cloud.bootstrap.BootstrapApplicationListener
at org.springframework.boot.SpringApplication.createSpringFactoriesInstances(SpringApplication.java:439)
at org.springframework.boot.SpringApplication.getSpringFactoriesInstances(SpringApplication.java:421)
at org.springframework.boot.SpringApplication.getSpringFactoriesInstances(SpringApplication.java:414)
at org.springframework.boot.SpringApplication.<init>(SpringApplication.java:270)
at org.springframework.boot.SpringApplication.<init>(SpringApplication.java:250)
at org.springframework.boot.builder.SpringApplicationBuilder.createSpringApplication(SpringApplicationBuilder.java:105)
at org.springframework.boot.builder.SpringApplicationBuilder.<init>(SpringApplicationBuilder.java:93)
at org.springframework.boot.web.servlet.support.SpringBootServletInitializer.createSpringApplicationBuilder(SpringBootServletInitializer.java:142)
at org.springframework.boot.web.servlet.support.SpringBootServletInitializer.createRootApplicationContext(SpringBootServletInitializer.java:107)
at org.springframework.boot.web.servlet.support.SpringBootServletInitializer.onStartup(SpringBootServletInitializer.java:91)
at org.springframework.web.SpringServletContainerInitializer.onStartup(SpringServletContainerInitializer.java:172)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5128)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
… 45 more
Caused by: java.lang.IllegalArgumentException: class org.springframework.cloud.bootstrap.BootstrapApplicationListener is not assignable to interface org.springframework.context.ApplicationListener
at org.springframework.util.Assert.assignableCheckFailed(Assert.java:673)
at org.springframework.util.Assert.isAssignable(Assert.java:604)
at org.springframework.util.Assert.isAssignable(Assert.java:635)
at org.springframework.boot.SpringApplication.createSpringFactoriesInstances(SpringApplication.java:433)
… 57 more
Abhimanu Handoo
I also tried with the post’s repo as well, however now for that I am getting below error
Caused by: java.lang.IllegalArgumentException: class org.springframework.boot.cloud.CloudFoundryVcapEnvironmentPostProcessor is not assignable to interface org.springframework.context.ApplicationListener
at org.springframework.util.Assert.assignableCheckFailed(Assert.java:673)
at org.springframework.util.Assert.isAssignable(Assert.java:604)
at org.springframework.util.Assert.isAssignable(Assert.java:635)
at org.springframework.boot.SpringApplication.createSpringFactoriesInstances(SpringApplication.java:443)
… 57 more
Abhimanu Handoo
I cloned from repository and still getting error. Below is the error
Caused by: java.lang.IllegalArgumentException: Cannot instantiate interface org.springframework.context.ApplicationListener : org.springframework.boot.cloud.CloudFoundryVcapEnvironmentPostProcessor
at org.springframework.boot.SpringApplication.createSpringFactoriesInstances(SpringApplication.java:450)
at org.springframework.boot.SpringApplication.getSpringFactoriesInstances(SpringApplication.java:429)
at org.springframework.boot.SpringApplication.getSpringFactoriesInstances(SpringApplication.java:420)
at org.springframework.boot.SpringApplication.<init>(SpringApplication.java:270)
at org.springframework.boot.SpringApplication.<init>(SpringApplication.java:249)
at org.springframework.boot.builder.SpringApplicationBuilder.createSpringApplication(SpringApplicationBuilder.java:104)
at org.springframework.boot.builder.SpringApplicationBuilder.<init>(SpringApplicationBuilder.java:92)
at org.springframework.boot.web.servlet.support.SpringBootServletInitializer.createSpringApplicationBuilder(SpringBootServletInitialize…:148)
at org.springframework.boot.web.servlet.support.SpringBootServletInitializer.createRootApplicationContext(SpringBootServletInitialize…:110)
at org.springframework.boot.web.servlet.support.SpringBootServletInitializer.onStartup(SpringBootServletInitialize…:91)
at org.springframework.web.SpringServletContainerInitializer.onStartup(SpringServletContainerIniti…:171)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5128)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
… 45 more
Caused by: java.lang.IllegalArgumentException: class org.springframework.boot.cloud.CloudFoundryVcapEnvironmentPostProcessor is not assignable to interface org.springframework.context.ApplicationListener
at org.springframework.util.Assert.assignableCheckFailed(Assert.java:673)
at org.springframework.util.Assert.isAssignable(Assert.java:604)
at org.springframework.util.Assert.isAssignable(Assert.java:635)
at org.springframework.boot.SpringApplication.createSpringFactoriesInstances(SpringApplication.java:443)
… 57 more
Can you please help ?
Abhimanu Handoo
I’m just cloning this post’s repo and trying to run it still getting error’s.
Matt Raible
I just tried it and it worked for me. You’ll need to follow the instructions in the README to create an account on Okta and add its values to your application.yml
file.
Brian Sheely
I have a Vaadin and Spring Boot app that runs in the Tomcat instance on a local server. Whenever I deploy it to the Tomcat instance on a virtual server hosted by a provider, it get a 404 and the application log isn’t created. There are no errors in any Tomcat logs and Tomcat manager shows the app as running. I’ve deployed another Vaadin / Spring Boot app to that same Tomcat instance that’s just a static html page and it both runs and creates an application log. I’ve ran the app on an old mac with the same amount of memory as the virtual server just to rule out a memory issue. Both my local server and the virtual server are running Debian with the same versions of Java and Tomcat. The only software difference I’m aware of is my local server is Debian 10 and the virtual server is Debian 9. No other software has been installed except UFW which is disabled. The virtual server has no other firewalls. How do I debug this?
Matt Raible
Hello Brian,
I’m not sure what the problem could be. I’ve had lots of success running Tomcat in various environments, but it’s been awhile since I deployed to a virtual server. You could try running your virtual server with “$TOMCAT_HOME/bin/catalina.sh run
” so the log prints to your console.
If that doesn’t help, I’d suggest your post this question on Stack Overflow with a tomcat tag. A lot more Tomcat experts will see it if you post it there.