从Netbeans部署时无法启动Tomcat应用程序

时间:2018-12-28 15:27:27

标签: java tomcat netbeans

从Netbeans部署tomcat应用程序时,此消息记录在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文件夹,其中包含所有内容。

我该如何解决?

问候 海梅

编辑:

这是主要课程:

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 :(得分:0)

最后,问题是由于变量插值引起的。我已经在同一文件中定义了用法之前的变量,并且可以正常工作。

问候 海梅