0
我搜索stackoverflow相當多,但沒有找到解決方案,我的問題。 我GTE以下錯誤部署SpringBoot應用程序爲WAR文件到Tomcat 8時,localy它做工精細SpringBoot需要一個無法找到的'boolean'類型的bean
***************************|
APPLICATION FAILED TO START|
***************************|
Description:
Parameter 0 of method getJobapplicationDTO in
com.tts.scp.converter.config.ScpDestinationConfig required a bean of
type 'boolean' that could not be found.
Action:
Consider defining a bean of type 'boolean' in your configuration.
有一個接口
public interface HttpProviderConfig {
JobApplicationDTO getJobapplicationDTO(boolean printResume, boolean
printCoverletter, boolean printAttachments, String jobApplicationId);
}
和兩個實現類
@Configuration
@Profile("production")
public class ScpDestinationConfig implements HttpProviderConfig{
private static final Logger logger =
LoggerFactory.getLogger(ScpDestinationConfig.class);
@Override
@Bean
public JobApplicationDTO getJobapplicationDTO (boolean resume, boolean coverletter ...
and second class
@Configuration
@Profile("dev")
public class LocalDestinationConfig implements HttpProviderConfig{
private static final Logger logger =
LoggerFactory.getLogger(LocalDestinationConfig.class);
@Override
@Bean
public JobApplicationDTO getJobapplicationDTO (boolean resume, boolean coverletter ...
和停靠服務
@RestController
public class ConverterController {
private static final Logger logger =
LoggerFactory.getLogger(ConverterController.class);
@Autowired
@Lazy
private HttpProviderConfig client;
@GetMapping(path = "/convertDocuments", produces=MediaType.APPLICATION_PDF_VALUE)
public void convertedDocument(@RequestParam(defaultValue = "true") String printResume,
@RequestParam(defaultValue = "true") String printCoverLetter,
@RequestParam(defaultValue = "true") String printAttachments, @RequestParam String jobApplicationId,
HttpServletResponse response) throws IOException {
JobApplicationDTO jobApplicationDTO = client.getJobapplicationDTO(
所以啥子我不明白的Tomcat怎麼也找不到原始數據類型像布爾,爲什麼它不工作時,我在本地運行。
任何幫助,將不勝感激
問候 馬蒂亞斯
這是正確的。在他的情況豆看起來應該像'@Bean HttpProviderConfig httpProviderConfig(){return new ScpDestinationConfig} .'我不認爲@Mathias Maerker完全理解bean和配置如何工作。一些參考:https://docs.spring.io/spring-javaconfig/docs/1.0.0.M4/reference/html/ch02s02.html – CrazySabbath
是的你的權利我不完全明白我在這裏做什麼;)但感謝你們兩位的幫助! –