Запуск приложения Springboot в Eclipse на Tomcat - PullRequest
0 голосов
/ 01 мая 2020

Я пытаюсь запустить приложение Springboot на встроенном сервере Tomcat в Eclipse. Проект успешно добавлен на сервер, но никогда не запускается.

Код моего приложения указан ниже:

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'
    }
}

и ниже - снимок экрана моей конфигурации сборки развертывания:

enter image description here

Любые подсказки или руководство как это исправить? Я не вижу никаких ошибок в журнале, поэтому я летаю вслепую.

Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...