• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Junilu Lacar
  • Tim Cooke
Saloon Keepers:
  • Carey Brown
  • Stephan van Hulst
  • Tim Holloway
  • Peter Rooke
  • Himai Minh
Bartenders:
  • Piet Souris
  • Mikalai Zaikin

Unable to start ServletWebServerApplicationContext

 
Ranch Hand
Posts: 538
3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'm trying to run my application but I am receiving this error.
My pom file:

My SpringBootApplication:

Error log:

Thanks in advance.
 
Cezar Apulchro
Ranch Hand
Posts: 538
3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Really I need help.
 
Cezar Apulchro
Ranch Hand
Posts: 538
3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Nobody to help me?
 
Saloon Keeper
Posts: 14857
334
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Why does your application extend SpringBootServletInitializer?

Why is your application packaged as a war?
 
Cezar Apulchro
Ranch Hand
Posts: 538
3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I can't understand your question, my application is a web project and I learned that the application must extend SpringBootServletInitializer.
 
Stephan van Hulst
Saloon Keeper
Posts: 14857
334
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
No. Web projects don't need to extend SpringBootServletInitializer. It works fine without it. You should only extend this class if you want to override the default configuration, which is not necessary.

On the other hand, even though your application is a web application, it needs to be packaged as a jar and not a war, because you are using Spring Boot to create a self-contained application.
 
Cezar Apulchro
Ranch Hand
Posts: 538
3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'll try and the result I'll show you later.
 
Cezar Apulchro
Ranch Hand
Posts: 538
3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
After making changes from war to jar and removing the extends from SpringBootApplication the problem still the same.

Log:

 
Cezar Apulchro
Ranch Hand
Posts: 538
3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Forget what I said, I made a mistake when running the application. Excuse me. I'm trying to run correct application.
 
Stephan van Hulst
Saloon Keeper
Posts: 14857
334
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Glad that you fixed it. But note that your use of @EnableAutoConfiguration and @ComponentScan is superfluous. They are already implied by @SpringBootApplication. Remove them.
 
Cezar Apulchro
Ranch Hand
Posts: 538
3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Now the project is correct but the problem remains the same.

Log error:

and of course war for jar in pom file.
 
Stephan van Hulst
Saloon Keeper
Posts: 14857
334
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Your Tomcat and Spring versions are not compatible.
 
Cezar Apulchro
Ranch Hand
Posts: 538
3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
What's version I must use of Tomcat?
 
Stephan van Hulst
Saloon Keeper
Posts: 14857
334
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
That's not for me to decide.

YOU must choose a Tomcat version to use. I recommend picking a Spring version based on the Tomcat version you want to use, not the other way around.
 
Cezar Apulchro
Ranch Hand
Posts: 538
3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
After change apache-tomcat-9.0.14 to apache-tomcat-9.0.59 version the was solved.
Thanks.
 
Cezar Apulchro
Ranch Hand
Posts: 538
3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
sorry, the problem was solved.
 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I solved it running Spring as Admin
 
Saloon Keeper
Posts: 26894
192
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Bbazz Is wrote:I solved it running Spring as Admin



That is not a solution. It's a security exploit waiting to happen.

Besides, I really doubt you had the same problem, as the OP is prone to not following instructions.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic