मैं spring-boot
उपयोग कर रहा हूँ और Maven पोम में spring-web
निर्भरता कहा, RestTemplate
का उपयोग करना।बसंत-वेब के लिए वसंत-बूट स्वत: कॉन्फ़िगरेशन को कैसे रोकें?
अब वसंत एक EmbeddedServletContext
प्रारंभ करने की कोशिश करता है। मैं यह कैसे रोक सकता हूँ?
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:474)
at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.refresh(EmbeddedWebApplicationContext.java:118)
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:686)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:320)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:957)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:946)
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:183)
at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.createEmbeddedServletContainer(EmbeddedWebApplicationContext.java:156)
at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.onRefresh(EmbeddedWebApplicationContext.java:130)
... 8 more
मैं 'कोशिश की @EnableAutoConfiguration (को बाहर = WebMvcAutoConfiguration.class, EmbeddedServletContainerAutoConfiguration.class})' लेकिन अब भी वही त्रुटि ... यह अच्छा होगा 'वसंत-web' के लिए स्वत: विन्यास को संशोधित करने के बिना एनोटेशन द्वारा अक्षम किया जा सकता है अगर मेरा मुख्य स्टार्टर विधि ... – membersound
हालांकि आपका सुझाव काम करता है, धन्यवाद! लेकिन किसी भी तरह से केवल ऑटोकॉन्फिगरेशन एनोटेशन को निष्क्रिय करना अच्छा होगा। – membersound
'spring.main.web_environment = FALSE' हालांकि बेहतर है ... किसी भी जावा :-) –