Error starting ApplicationContext.오류 해결

1527 단어 springboot

springboot 프로젝트 시작 오류: ApplicationContext를 시작하는 중 오류가 발생했습니다.To display the auto-configuration report re-run your application with ‘debug’ enabled.


문제 설명:


springboot 프로젝트 시작 오류: Error starting ApplicationContext. To display the auto-configuration report re-run your application with 'debug' enabled 내 프로젝트에서 컨트롤러 아래에 알림이 있습니다.
Description:
Parameter 0 of method upload in com.comtop.pmmicro.attactmentUpload.controller.AttachmentUploadController required a bean of type 'org.springframework.web.multipart.MultipartFile' that could not be found.
Action:
Consider defining a bean of type 'org.springframework.web.multipart.MultipartFile' in your configuration.

나는 MultipartFile를 사용했기 때문에 여기는 org.springframework.web.multipart.MultipartFile, 네가 다른 종류를 사용하는 것은 아마도 네가 사용한 종류일 것이다. *

문제 해결:


나는 클래스에서 @Autowired, 도입import org.springframework.beans.factory.annotation.Autowired을 사용했고 도입된 이 가방을 제거한 후에 문제를 해결했다.

질문 요약:


내가 인터넷에서 찾아낸 이런 문제를 해결하는 방법은 다음과 같은 몇 가지가 있다.부팅 클래스@EnableAutoConfiguration 또는@SpringBootApplication에 추가(exclude = {DataSourceAutoConfiguration.class}) 또는(exclude ={DataSourceAutoConfiguration.class,HibernateJpaAutoConfiguration.class}), 이러한 autoconfig 2를 제외합니다.가져온 가방 지우기: import org.springframework.*.annotation.*3.springmvc 프로젝트의 경우 프로필에 MultipartFile을 설정해야 합니다

좋은 웹페이지 즐겨찾기