eclipse - 在 Tomcat 上的 Eclipse 中启动 Springboot 应用程序
问题描述
我正在尝试在 Eclipse 的嵌入式 Tomcat 服务器上运行 springboot 应用程序。该项目已成功添加到服务器,但它永远不会启动。
我的应用程序代码如下:
import java.util.Properties;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.ImportResource;
import org.springframework.boot.Banner;
@SpringBootApplication
@ImportResource("classpath:simple-camel.xml")
public class CamelApplication {
private static final String DEFAULT_XML_ROUTE_CONFIG_FILES = "classpath:/routes/*.xml";
public static void main(String[] args) {
System.out.println("********************* inside the project ******************");
SpringApplication app = new SpringApplication(CamelApplication.class);
app.setDefaultProperties(getDefaultProperties());
app.run(args);
}
private static Properties getDefaultProperties() {
Properties props = new Properties();
props.setProperty("camel.springboot.main-run-controller", "true");
return props;
}
}
我的 build.gradle 如下:
plugins {
id 'groovy'
id 'java'
id "org.springframework.boot" version "2.2.6.RELEASE"
}
group 'com.firas'
version '1.0-SNAPSHOT'
apply plugin: "org.springframework.boot"
apply plugin: "java"
repositories {
mavenCentral()
}
dependencies {
compile "org.apache.camel:camel-bom:2.25.0"
compile "org.apache.camel:camel-core:2.25.0"
compile "org.apache.camel:camel-spring-boot-dependencies:2.25.0"
compile "org.apache.camel:camel-spring-boot-starter:2.25.0"
compile "org.springframework:spring-aop:4.0.4.RELEASE"
compile "org.springframework:spring-context:4.0.4.RELEASE"
compile "org.springframework:spring-tx:4.0.4.RELEASE"
compile "org.apache.camel.springboot:camel-timer-starter:2.25.0"
compile "org.springframework.boot:spring-boot-starter-tomcat:2.2.6.RELEASE"
testCompile group: 'junit', name: 'junit', version: '4.13'
}
springBoot {
mainClassName = 'CamelApplication'
}
bootJar {
mainClassName = 'CamelApplication'
manifest {
attributes 'Start-Class': 'CamelApplication'
}
}
下面是我的部署程序集配置的屏幕截图:
有关如何修复它的任何提示或指导?我在日志中没有看到任何错误,所以我在这里盲目飞行。
解决方案
推荐阅读
- javascript - 修复 CSS 文本替换动画中的跳跃
- javascript - 在 PHP 邮件程序中使用 HTML jquery ajax 请求
- javascript - Javascript:函数返回数组的最后一个元素
- python - 在 Tkinter 中单击按钮后如何更新标签?
- c - 将缓冲区强制转换为 uint32_t 会导致访问未对齐
- python - 登录成功后如何获取授权码--Linkedin OAuth - Django, Python
- spring-cloud-dataflow - 如何在组合任务中设置我的应用程序属性?
- python - 在 .txt 文件中打开 JSON 格式文件
- python - 使用 python docker sdk 构建 docker 镜像
- java - 如何将下面的 Json 转换为 Java Pojo 类?