Приложение Tomcat не может быть запущено при развертывании из NetBeans - PullRequest
0 голосов
/ 28 декабря 2018

при развертывании приложения tomcat из Netbeans это регистрируется в окне сервера Tomcat:

***************************
APPLICATION FAILED TO START
***************************

Description:

Cannot determine embedded database driver class for database type NONE

Action:

If you want an embedded database please put a supported one on the classpath. If you have database settings to be loaded from a particular profile you may need to active it (no profiles are currently active).

28-Dec-2018 12:10:30.882 GRAVE [http-nio-8080-exec-7] org.apache.catalina.startup.HostConfig.deployDescriptor Error durante el despliegue del descriptor de configuración [C:\Program Files\Apache Software Foundation\Tomcat 9.0\conf\Catalina\localhost\myapp.xml]
 java.lang.IllegalStateException: Error starting child

Файл myapp.xml имеет следующее содержимое:

<?xml version="1.0" encoding="UTF-8"?>
<Context docBase="C:\thepath\app" path="/myapp"/>

И, наконец, C:Папка \ thepath \ app содержит папки WEB-INF и META-INF со всем содержимым.

Как мне ее решить?

С уважением, Jaime

РЕДАКТИРОВАТЬ:

Это основной класс:

package com.myapp;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.domain.EntityScan;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.boot.web.support.SpringBootServletInitializer;
import org.springframework.context.annotation.ComponentScan;

@SpringBootApplication
@EntityScan(basePackages = "myapp.model")
@ComponentScan(basePackageClasses = {CustomApplication.class})
public class CustomApplication extends SpringBootServletInitializer {

    @Override
    protected SpringApplicationBuilder configure(SpringApplicationBuilder application) {
        return application.sources(CustomApplication.class);
    }

    public static void main(String[] args) {
        SpringApplication.run(CustomApplication.class, args);
    }
}

и это файл application.parameters.yml:

---
# APP
server:
  address: 0.0.0.0
  port: 8080
  context-path: /myapp
  compression:
    enabled: false
  display-nombre: myapp

spring:
  application.name: myapp
  data:
    rest:
      defaultPageSize: 10
      maxPageSize: 50
  datasource:
    driverClassName: org.gjt.mm.mysql.Driver
    url: ${base.datasource.url}
    username: ${base.datasource.username}
    password: ${base.datasource.password}
    testWhileIdle: true
    validationQuery: SELECT 1
  jpa:
    hibernate:
      ddl-auto: update
      naming-strategy: org.hibernate.cfg.ImprovedNamingStrategy
    properties:
      hibernate:
        dialect: org.hibernate.dialect.MySQL5Dialect
    show-sql: ${base.jpa.show-sql}
  http:
    multipart:
      maxFileSize: ${base.maxUploadFileSize}
      maxRequestSize: ${base.maxUploadFileSize}

logging.level.org.hibernate: ${base.logging.level.org.hibernate}

debug: ${base.debug}

РЕДАКТИРОВАТЬ 2:

Этоjar-файл включен в зависимости:

enter image description here

РЕДАКТИРОВАТЬ 3:

Журнал, отображаемый до фактического исключения:

28-Dec-2018 13:39:19.277 INFORMATION [http-nio-8080-exec-57] org.apache.catalina.startup.HostConfig.undeploy Repliegue (undeploy) de la aplicación web que tiene como trayectoria de contexto [/salesforce]
28-Dec-2018 13:39:19.332 INFORMATION [http-nio-8080-exec-60] org.apache.catalina.startup.HostConfig.deployDescriptor Desplieque del descriptor de configuración [C:\Program Files\Apache Software Foundation\Tomcat 9.0\conf\Catalina\localhost\myapp.xml]
28-Dec-2018 13:39:19.334 WARNING[http-nio-8080-exec-60] org.apache.catalina.startup.HostConfig.deployDescriptor The path attribute with value [/myapp] in deployment descriptor [C:\Program Files\Apache Software Foundation\Tomcat 9.0\conf\Catalina\localhost\myapp.xml] has been ignored
ERROR StatusLogger No log4j2 configuration file found. Using default configuration: logging only errors to the console.

  .   ____          _            __ _ _
 /\\ / ___'_ __ _ _(_)_ __  __ _ \ \ \ \
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
 \\/  ___)| |_)| | | | | || (_| |  ) ) ) )
  '  |____| .__|_| |_|_| |_\__, | / / / /
 =========|_|==============|___/=/_/_/_/
 :: Spring Boot ::        (v1.4.5.RELEASE)

2018-12-28 13:39:31.408  INFO 17740 --- [io-8080-exec-60] c.p.e.m.s.CustomApplication         : Starting CustomApplication on MANAGER with PID 17740 (C:\thepath\app\WEB-INF\classes started by Jaime in C:\Program Files\Apache Software Foundation\Tomcat 9.0\bin)
2018-12-28 13:39:31.414  INFO 17740 --- [io-8080-exec-60] c.p.e.m.s.SalesforceWSApplication        : No active profile set, falling back to default profiles: default
2018-12-28 13:39:31.533  INFO 17740 --- [io-8080-exec-60] ationConfigEmbeddedWebApplicationContext : Refreshing org.springframework.boot.context.embedded.AnnotationConfigEmbeddedWebApplicationContext@3128ac95: startup date [Fri Dec 28 13:39:31 CLST 2018]; root of context hierarchy
2018-12-28 13:39:40.725  INFO 17740 --- [io-8080-exec-60] trationDelegate$BeanPostProcessorChecker : Bean 'org.springframework.ws.config.annotation.DelegatingWsConfiguration' of type [org.springframework.ws.config.annotation.DelegatingWsConfiguration$$EnhancerBySpringCGLIB$$f486f241] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2018-12-28 13:39:40.965  INFO 17740 --- [io-8080-exec-60] .w.s.a.s.AnnotationActionEndpointMapping : Supporting [WS-Addressing August 2004, WS-Addressing 1.0]
2018-12-28 13:39:41.130  INFO 17740 --- [io-8080-exec-60] trationDelegate$BeanPostProcessorChecker : Bean 'org.springframework.transaction.annotation.ProxyTransactionManagementConfiguration' of type [org.springframework.transaction.annotation.ProxyTransactionManagementConfiguration$$EnhancerBySpringCGLIB$$4fef2d42] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2018-12-28 13:39:41.609  INFO 17740 --- [io-8080-exec-60] o.s.w.c.ContextLoader                    : Root WebApplicationContext: initialization completed in 10077 ms
2018-12-28 13:39:45.015  INFO 17740 --- [io-8080-exec-60] o.s.b.w.s.ServletRegistrationBean        : Mapping servlet: 'dispatcherServlet' to [/]
2018-12-28 13:39:45.017  INFO 17740 --- [io-8080-exec-60] o.s.b.w.s.ServletRegistrationBean        : Mapping servlet: 'messageDispatcherServlet' to [/services/*]
2018-12-28 13:39:45.018  INFO 17740 --- [io-8080-exec-60] o.s.b.w.s.FilterRegistrationBean         : Mapping filter: 'errorPageFilter' to: [/*]
2018-12-28 13:39:45.018  INFO 17740 --- [io-8080-exec-60] o.s.b.w.s.FilterRegistrationBean         : Mapping filter: 'characterEncodingFilter' to: [/*]
2018-12-28 13:39:45.018  INFO 17740 --- [io-8080-exec-60] o.s.b.w.s.FilterRegistrationBean         : Mapping filter: 'hiddenHttpMethodFilter' to: [/*]
2018-12-28 13:39:45.018  INFO 17740 --- [io-8080-exec-60] o.s.b.w.s.FilterRegistrationBean         : Mapping filter: 'httpPutFormContentFilter' to: [/*]
2018-12-28 13:39:45.018  INFO 17740 --- [io-8080-exec-60] o.s.b.w.s.FilterRegistrationBean         : Mapping filter: 'requestContextFilter' to: [/*]
2018-12-28 13:39:45.512  WARN 17740 --- [io-8080-exec-60] ationConfigEmbeddedWebApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'org.springframework.boot.autoconfigure.orm.jpa.HibernateJpaAutoConfiguration': Unsatisfied dependency expressed through constructor parameter 0; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dataSource' defined in class path resource [org/springframework/boot/autoconfigure/jdbc/DataSourceConfiguration$Tomcat.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.apache.tomcat.jdbc.pool.DataSource]: Factory method 'dataSource' threw exception; nested exception is org.springframework.boot.autoconfigure.jdbc.DataSourceProperties$DataSourceBeanCreationException: Cannot determine embedded database driver class for database type NONE. If you want an embedded database please put a supported one on the classpath. If you have database settings to be loaded from a particular profile you may need to active it (no profiles are currently active).
2018-12-28 13:39:45.527  INFO 17740 --- [io-8080-exec-60] utoConfigurationReportLoggingInitializer : 

Error starting ApplicationContext. To display the auto-configuration report re-run your application with 'debug' enabled.
2018-12-28 13:39:45.535 ERROR 17740 --- [io-8080-exec-60] o.s.b.d.LoggingFailureAnalysisReporter   : 

***************************
APPLICATION FAILED TO START
***************************

1 Ответ

0 голосов
/ 29 декабря 2018

Наконец проблема была из-за переменной интерполяции.Я определил переменные перед использованием в том же файле, и это сработало.

С уважением, Хайме

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