I have a project with several modules , and it's tomcat project.I need to convert to spring boot project.
Here is a xml file with follow bean : I have used @ImportResource("classpath:xxx.xml").
Here throws exception:
APPLICATION FAILED TO START
Description:
Parameter 0 of constructor in xxxService required a bean named 'servletContext' that could not be found.
Action:
Consider defining a bean named 'servletContext' in your configuration.
I have no idea about this problems almost three days. Please help me if you have any experiences about this, thanks a lot !
Just implement ServletContextAware interface instead of directly autowiring
ServletContext