Ich habe eine Komponentenklasse: < /p>
Code: Select all
@Component
public class myRouteBuilder extends RouteBuilder {
from("jetty:http://0.0.0.0:8080/").log("Request received.").setBody(simple("Huhu y'all!"));
}
< /code>
, der von einer Springboot -Starterklasse gestartet wird: < /p>
@SpringBootApplication
public class RestServiceApplication {
private static CountDownLatch _stopLatch = null;
public static void main(String[] args) {
SpringApplication theApp = new SpringApplication(myRouteBuilder.class);
// variant 1 causing to happen nothing
theApp.setWebApplicationType(WebApplicationType.NONE);
// variant 2 causing an execption
theApp.setWebApplicationType(WebApplicationType.SERVLET);
try {
ConfigurableApplicationContext appContext = theApp.run();
appContext.registerShutdownHook();
} catch (Exception e) {
...
return;
}
_stopLatch = new CountDownLatch(1);
try {
_stopLatch.await();
} catch (InterruptedException e) {
...
}
}
}
Variante 2 verursacht Ausnahme < /p>
Der Webserver kann nicht starten. Eine verschachtelte Ausnahme ist org.springframework.boot.web.context.missingweberverfactoryBeanException: Keine Qualifikation von Typ 'org.springframework ean
< /blockquote>
POM -Abhängigkeiten: < /p>
org.apache.camel.springboot
camel-servlet-starter
org.apache.camel
camel-jetty
org.apache.camel.springboot
camel-jetty-starter
org.springframework.boot
spring-boot-starter-web
< /code>
Ich muss zugeben, dass ich nicht verstanden habe, wie Springboot und all dies funktioniert. Deshalb kopierte ich so weit, aber jetzt brauche ich einige Anleitung. Wie kann