Ich suche stackoverflow ziemlich viel, aber habe keine Lösung für mein Problem gefunden. I gte die folgende Fehlermeldung, wenn eine SpringBoot App als WAR-Datei auf Tomcat 8, localy funktioniert es feinSpringBoot benötigt eine Bean vom Typ 'boolean', die nicht gefunden werden konnte
***************************|
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.
Es gibt eine Schnittstelle
public interface HttpProviderConfig {
JobApplicationDTO getJobapplicationDTO(boolean printResume, boolean
printCoverletter, boolean printAttachments, String jobApplicationId);
}
und zwei implementierenden Klassen
@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 ...
Bereitstellung
und zweite Klasse
@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 ...
Und ein Rest Service
@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(
So waht Ich verstehe nicht, wie Tomcat nicht primitive Datentypen wie boolean finden können und warum es funktioniert, wenn ich es lokal ausgeführt.
würde jede mögliche Hilfe
Grüße Mathias
Das ist richtig. Die Bohnen in seinem Fall sollten wie folgt aussehen: @Bean HttpProviderConfig httpProviderConfig() {return new ScpDestinationConfig}. Ich glaube nicht, dass @Mathias Maerker vollständig versteht, wie Beans und Configuration funktionieren. Einige Referenzen: https://docs.spring.io/spring-javaconfig/docs/1.0.0.M4/reference/html/ch02s02.html – CrazySabbath
Ja dein Recht Ich verstehe nicht ganz, was ich hier mache;) aber Danke euch beiden für eure Hilfe! –