Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to start EmbeddedWebApplicationContext due to missing EmbeddedServletContainerFactory bean #6

Open
YongDongWu opened this issue Jan 9, 2018 · 6 comments

Comments

@YongDongWu
Copy link

I have some exceptions when i import this project. The exceptions is as follows:
_SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.

Exception in thread "main" org.springframework.context.ApplicationContextException: Unable to start embedded container; nested exception is org.springframework.context.ApplicationContextException: Unable to start EmbeddedWebApplicationContext due to missing EmbeddedServletContainerFactory bean.
at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.onRefresh(EmbeddedWebApplicationContext.java:133)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:532)
at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.refresh(EmbeddedWebApplicationContext.java:118)
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:766)
at org.springframework.boot.SpringApplication.createAndRefreshContext(SpringApplication.java:361)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:307)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1191)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1180)
at com.penninkhof.odata.Application.main(Application.java:28)
Caused by: org.springframework.context.ApplicationContextException: Unable to start EmbeddedWebApplicationContext due to missing EmbeddedServletContainerFactory bean.
at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.getEmbeddedServletContainerFactory(EmbeddedWebApplicationContext.java:185)
at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.createEmbeddedServletContainer(EmbeddedWebApplicationContext.java:158)
at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.onRefresh(EmbeddedWebApplicationContext.java:130)
... 8 more_
Best Regards!

@YongDongWu
Copy link
Author

I found the lack of configuration files in the project, can you provide missing files odata-mapping.xml. Think you.

@binhudakhalid
Copy link

binhudakhalid commented Mar 26, 2018

you can run it with this command while you are in the root directory:

mvn spring-boot:run -P jar

-P tell the maven to use profile.

@mjza
Copy link

mjza commented May 14, 2020

@binhudakhalid Could you please explain how can I build this project as a 'war' file for deploying in Tomcat.

@binhudakhalid
Copy link

binhudakhalid commented May 14, 2020

@mjza
If you look at the pom.xml file, you will see that it has two profile tags.
One profile to create jar packaging and one to create war.

To create war packaging you need to select the first profile
mvn spring-boot:run -P hcp

we use -P to select a profile.

@mjza
Copy link

mjza commented May 14, 2020

@binhudakhalid Yes, you are absolutely right. However that is not anymore my problem, and the hcp is the default as I see in the code.

My problem at the moment is that I cannot deploy it in the Tomcat. Please check this issue:
#8

@otgonbayarv
Copy link

otgonbayarv commented Aug 25, 2022

Thank you Guys. Same problem #8. It works.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants