多模块Spring Boot应用程序立即关闭

时间:2018-10-24 10:24:58

标签: java spring maven spring-boot

我正在尝试将单春季应用程序迁移到多模块应用程序。这是几个重要文件

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <groupId>com.example</groupId>
    <artifactId>main</artifactId>
    <version>0.1.0</version>
    <packaging>pom</packaging>

    <modules>
        <module>web</module>
        <module>core</module>
        <module>api</module>
    </modules>

</project>

pom.xml [main]

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <groupId>com.example</groupId>
    <artifactId>web</artifactId>
    <version>0.0.1-SNAPSHOT</version>
    <packaging>jar</packaging>

    <parent>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-parent</artifactId>
        <version>2.0.5.RELEASE</version>
        <relativePath /> <!-- lookup parent getFormatFromXDocKind repository -->
    </parent>

    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <java.version>1.8</java.version>
    </properties>

    <dependencies>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-web</artifactId>
            <exclusions>
              <exclusion>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-starter-logging</artifactId>
              </exclusion>
            </exclusions>
        </dependency>
        <dependency>
          <groupId>org.springframework.boot</groupId>
          <artifactId>spring-boot-starter-log4j2</artifactId>
        </dependency>
        <dependency>
            <groupId>com.example</groupId>
            <artifactId>core</artifactId>
            <version>${project.version}</version>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-test</artifactId>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>commons-io</groupId>
            <artifactId>commons-io</artifactId>
            <version>2.6</version>
        </dependency>

        <dependency>
            <groupId>org.apache.commons</groupId>
            <artifactId>commons-lang3</artifactId>
            <version>3.8.1</version>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-maven-plugin</artifactId>
            </plugin>
        </plugins>
    </build>

</project>

pom.xml [web]

package com.example;

@SpringBootApplication(scanBasePackages = {"com.example"})
@EnableConfigurationProperties
public class MyApp {

  public static void main(String[] args) {
    final ConfigurableApplicationContext context = SpringApplication.run(MyApp.class, args);
  }


}

web \ src \ main \ java \ com \ example \ MyApp.java

RestController

我在文件旁边有core,主要服务在DEBUG StatusLogger Using ShutdownCallbackRegistry class org.apache.logging.log4j.core.util.DefaultShutdownCallbackRegistry INFO StatusLogger Log4j appears to be running in a Servlet environment, but there's no log4j-web module available. If you want better web container support, please add the log4j-web JAR to your web archive or server lib directory. INFO StatusLogger Log4j appears to be running in a Servlet environment, but there's no log4j-web module available. If you want better web container support, please add the log4j-web JAR to your web archive or server lib directory. DEBUG StatusLogger Took 0,074115 seconds to load 207 plugins from sun.misc.Launcher$AppClassLoader@18b4aac2 DEBUG StatusLogger PluginManager 'Converter' found 45 plugins DEBUG StatusLogger Starting OutputStreamManager SYSTEM_OUT.false.false-1 DEBUG StatusLogger Starting LoggerContext[name=18b4aac2, org.apache.logging.log4j.core.LoggerContext@2f943d71]... DEBUG StatusLogger Reconfiguration started for context[name=18b4aac2] at URI null (org.apache.logging.log4j.core.LoggerContext@2f943d71) with optional ClassLoader: null INFO StatusLogger Log4j appears to be running in a Servlet environment, but there's no log4j-web module available. If you want better web container support, please add the log4j-web JAR to your web archive or server lib directory. DEBUG StatusLogger PluginManager 'ConfigurationFactory' found 5 plugins INFO StatusLogger Log4j appears to be running in a Servlet environment, but there's no log4j-web module available. If you want better web container support, please add the log4j-web JAR to your web archive or server lib directory. INFO StatusLogger Log4j appears to be running in a Servlet environment, but there's no log4j-web module available. If you want better web container support, please add the log4j-web JAR to your web archive or server lib directory. DEBUG StatusLogger Missing dependencies for Yaml support, ConfigurationFactory org.apache.logging.log4j.core.config.yaml.YamlConfigurationFactory is inactive INFO StatusLogger Log4j appears to be running in a Servlet environment, but there's no log4j-web module available. If you want better web container support, please add the log4j-web JAR to your web archive or server lib directory. INFO StatusLogger Log4j appears to be running in a Servlet environment, but there's no log4j-web module available. If you want better web container support, please add the log4j-web JAR to your web archive or server lib directory. INFO StatusLogger Log4j appears to be running in a Servlet environment, but there's no log4j-web module available. If you want better web container support, please add the log4j-web JAR to your web archive or server lib directory. DEBUG StatusLogger Using configurationFactory org.apache.logging.log4j.core.config.ConfigurationFactory$Factory@6b57696f TRACE StatusLogger Trying to find [log4j2-test18b4aac2.properties] using context class loader sun.misc.Launcher$AppClassLoader@18b4aac2 ... TRACE StatusLogger Trying to find [log4j2.xml] using context class loader sun.misc.Launcher$AppClassLoader@18b4aac2. INFO StatusLogger Log4j appears to be running in a Servlet environment, but there's no log4j-web module available. If you want better web container support, please add the log4j-web JAR to your web archive or server lib directory. DEBUG StatusLogger Initializing configuration XmlConfiguration[location=C:\Users\Me\IdeaProjects\example\web\target\classes\log4j2.xml] DEBUG StatusLogger Installed 1 script engine DEBUG StatusLogger Oracle Nashorn version: 1.8.0_181, language: ECMAScript, threading: Not Thread Safe, compile: true, names: [nashorn, Nashorn, js, JS, JavaScript, javascript, ECMAScript, ecmascript], factory class: jdk.nashorn.api.scripting.NashornScriptEngineFactory DEBUG StatusLogger PluginManager 'Core' found 116 plugins DEBUG StatusLogger PluginManager 'Level' found 0 plugins DEBUG StatusLogger Building Plugin[name=property, class=org.apache.logging.log4j.core.config.Property]. TRACE StatusLogger TypeConverterRegistry initializing. DEBUG StatusLogger PluginManager 'TypeConverter' found 26 plugins DEBUG StatusLogger createProperty(name="LOG_PATTERN", value="%d{yyyy-MM-dd HH:mm:ss.SSS} %5p VRS --- [%15.15t] %-40.40c{1.} : %m%n%ex") DEBUG StatusLogger Building Plugin[name=properties, class=org.apache.logging.log4j.core.config.PropertiesPlugin]. DEBUG StatusLogger configureSubstitutor(={LOG_PATTERN=%d{yyyy-MM-dd HH:mm:ss.SSS} %5p VRS --- [%15.15t] %-40.40c{1.} : %m%n%ex}, Configuration(C:\Users\Me\IdeaProjects\example\web\target\classes\log4j2.xml)) DEBUG StatusLogger PluginManager 'Lookup' found 13 plugins DEBUG StatusLogger Building Plugin[name=layout, class=org.apache.logging.log4j.core.layout.PatternLayout]. DEBUG StatusLogger PatternLayout$Builder(pattern="%d{yyyy-MM-dd HH:mm:ss.SSS} %5p VRS --- [%15.15t] %-40.40c{1.} : %m%n%ex", PatternSelector=null, Configuration(C:\Users\Me\IdeaProjects\example\web\target\classes\log4j2.xml), Replace=null, charset="null", alwaysWriteExceptions="null", disableAnsi="null", noConsoleNoAnsi="null", header="null", footer="null") DEBUG StatusLogger PluginManager 'Converter' found 45 plugins DEBUG StatusLogger Building Plugin[name=appender, class=org.apache.logging.log4j.core.appender.ConsoleAppender]. DEBUG StatusLogger ConsoleAppender$Builder(target="SYSTEM_OUT", follow="true", direct="null", bufferedIo="null", bufferSize="null", immediateFlush="null", ignoreExceptions="null", PatternLayout(%d{yyyy-MM-dd HH:mm:ss.SSS} %5p VRS --- [%15.15t] %-40.40c{1.} : %m%n%ex), name="ConsoleAppender", Configuration(C:\Users\Me\IdeaProjects\example\web\target\classes\log4j2.xml), Filter=null) DEBUG StatusLogger Starting OutputStreamManager SYSTEM_OUT.true.false DEBUG StatusLogger Building Plugin[name=appenders, class=org.apache.logging.log4j.core.config.AppendersPlugin]. DEBUG StatusLogger createAppenders(={ConsoleAppender}) DEBUG StatusLogger Building Plugin[name=AppenderRef, class=org.apache.logging.log4j.core.config.AppenderRef]. DEBUG StatusLogger createAppenderRef(ref="ConsoleAppender", level="null", Filter=null) DEBUG StatusLogger Building Plugin[name=root, class=org.apache.logging.log4j.core.config.LoggerConfig$RootLogger]. DEBUG StatusLogger createLogger(additivity="null", level="INFO", includeLocation="null", ={ConsoleAppender}, ={}, Configuration(C:\Users\Me\IdeaProjects\example\web\target\classes\log4j2.xml), Filter=null) DEBUG StatusLogger Building Plugin[name=AppenderRef, class=org.apache.logging.log4j.core.config.AppenderRef]. DEBUG StatusLogger createAppenderRef(ref="ConsoleAppender", level="null", Filter=null) DEBUG StatusLogger Building Plugin[name=logger, class=org.apache.logging.log4j.core.config.LoggerConfig]. DEBUG StatusLogger createLogger(additivity="false", level="DEBUG", name="com.example", includeLocation="null", ={ConsoleAppender}, ={}, Configuration(C:\Users\Me\IdeaProjects\example\web\target\classes\log4j2.xml), Filter=null) DEBUG StatusLogger Building Plugin[name=AppenderRef, class=org.apache.logging.log4j.core.config.AppenderRef]. DEBUG StatusLogger createAppenderRef(ref="ConsoleAppender", level="null", Filter=null) DEBUG StatusLogger Building Plugin[name=logger, class=org.apache.logging.log4j.core.config.LoggerConfig]. DEBUG StatusLogger createLogger(additivity="false", level="DEBUG", name="fr.opensagres.xdocreport.core.logging.LogUtils", includeLocation="null", ={ConsoleAppender}, ={}, Configuration(C:\Users\Me\IdeaProjects\example\web\target\classes\log4j2.xml), Filter=null) DEBUG StatusLogger Building Plugin[name=loggers, class=org.apache.logging.log4j.core.config.LoggersPlugin]. DEBUG StatusLogger createLoggers(={root, com.example, fr.opensagres.xdocreport.core.logging.LogUtils}) DEBUG StatusLogger Configuration XmlConfiguration[location=C:\Users\Me\IdeaProjects\example\web\target\classes\log4j2.xml] initialized DEBUG StatusLogger Starting configuration XmlConfiguration[location=C:\Users\Me\IdeaProjects\example\web\target\classes\log4j2.xml] DEBUG StatusLogger Started configuration XmlConfiguration[location=C:\Users\Me\IdeaProjects\example\web\target\classes\log4j2.xml] OK. TRACE StatusLogger Stopping org.apache.logging.log4j.core.config.DefaultConfiguration@e580929... TRACE StatusLogger DefaultConfiguration notified 1 ReliabilityStrategies that config will be stopped. TRACE StatusLogger DefaultConfiguration stopping root LoggerConfig. TRACE StatusLogger DefaultConfiguration notifying ReliabilityStrategies that appenders will be stopped. TRACE StatusLogger DefaultConfiguration stopping remaining Appenders. DEBUG StatusLogger Shutting down OutputStreamManager SYSTEM_OUT.false.false-1 DEBUG StatusLogger Shut down OutputStreamManager SYSTEM_OUT.false.false-1, all resources released: true DEBUG StatusLogger Appender DefaultConsole-1 stopped with status true TRACE StatusLogger DefaultConfiguration stopped 1 remaining Appenders. TRACE StatusLogger DefaultConfiguration cleaning Appenders from 1 LoggerConfigs. DEBUG StatusLogger Stopped org.apache.logging.log4j.core.config.DefaultConfiguration@e580929 OK TRACE StatusLogger Reregistering MBeans after reconfigure. Selector=org.apache.logging.log4j.core.selector.ClassLoaderContextSelector@394a2528 TRACE StatusLogger Reregistering context (1/1): '18b4aac2' org.apache.logging.log4j.core.LoggerContext@2f943d71 TRACE StatusLogger Unregistering but no MBeans found matching 'org.apache.logging.log4j2:type=18b4aac2' TRACE StatusLogger Unregistering but no MBeans found matching 'org.apache.logging.log4j2:type=18b4aac2,component=StatusLogger' TRACE StatusLogger Unregistering but no MBeans found matching 'org.apache.logging.log4j2:type=18b4aac2,component=ContextSelector' TRACE StatusLogger Unregistering but no MBeans found matching 'org.apache.logging.log4j2:type=18b4aac2,component=Loggers,name=*' TRACE StatusLogger Unregistering but no MBeans found matching 'org.apache.logging.log4j2:type=18b4aac2,component=Appenders,name=*' TRACE StatusLogger Unregistering but no MBeans found matching 'org.apache.logging.log4j2:type=18b4aac2,component=AsyncAppenders,name=*' TRACE StatusLogger Unregistering but no MBeans found matching 'org.apache.logging.log4j2:type=18b4aac2,component=AsyncLoggerRingBuffer' TRACE StatusLogger Unregistering but no MBeans found matching 'org.apache.logging.log4j2:type=18b4aac2,component=Loggers,name=*,subtype=RingBuffer' DEBUG StatusLogger Registering MBean org.apache.logging.log4j2:type=18b4aac2 DEBUG StatusLogger Registering MBean org.apache.logging.log4j2:type=18b4aac2,component=StatusLogger DEBUG StatusLogger Registering MBean org.apache.logging.log4j2:type=18b4aac2,component=ContextSelector DEBUG StatusLogger Registering MBean org.apache.logging.log4j2:type=18b4aac2,component=Loggers,name= DEBUG StatusLogger Registering MBean org.apache.logging.log4j2:type=18b4aac2,component=Loggers,name=fr.opensagres.xdocreport.core.logging.LogUtils DEBUG StatusLogger Registering MBean org.apache.logging.log4j2:type=18b4aac2,component=Loggers,name=com.example DEBUG StatusLogger Registering MBean org.apache.logging.log4j2:type=18b4aac2,component=Appenders,name=ConsoleAppender TRACE StatusLogger Using default SystemClock for timestamps. TRACE StatusLogger Using DummyNanoClock for nanosecond timestamps. DEBUG StatusLogger Reconfiguration complete for context[name=18b4aac2] at URI C:\Users\Me\IdeaProjects\example\web\target\classes\log4j2.xml (org.apache.logging.log4j.core.LoggerContext@2f943d71) with optional ClassLoader: null DEBUG StatusLogger Shutdown hook enabled. Registering a new one. DEBUG StatusLogger LoggerContext[name=18b4aac2, org.apache.logging.log4j.core.LoggerContext@2f943d71] started OK. log4j:WARN No appenders could be found for logger (org.springframework.web.context.support.StandardServletEnvironment). log4j:WARN Please initialize the log4j system properly. log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info. DEBUG StatusLogger Reconfiguration started for context[name=18b4aac2] at URI null (org.apache.logging.log4j.core.LoggerContext@2f943d71) with optional ClassLoader: null DEBUG StatusLogger Using configurationFactory org.apache.logging.log4j.core.config.ConfigurationFactory$Factory@6b57696f TRACE StatusLogger Trying to find [log4j2-test18b4aac2.properties] using context class loader sun.misc.Launcher$AppClassLoader@18b4aac2 ... TRACE StatusLogger Trying to find [log4j2.xml] using context class loader sun.misc.Launcher$AppClassLoader@18b4aac2. INFO StatusLogger Log4j appears to be running in a Servlet environment, but there's no log4j-web module available. If you want better web container support, please add the log4j-web JAR to your web archive or server lib directory. DEBUG StatusLogger Initializing configuration XmlConfiguration[location=C:\Users\Me\IdeaProjects\example\web\target\classes\log4j2.xml] DEBUG StatusLogger Installed 1 script engine DEBUG StatusLogger Oracle Nashorn version: 1.8.0_181, language: ECMAScript, threading: Not Thread Safe, compile: true, names: [nashorn, Nashorn, js, JS, JavaScript, javascript, ECMAScript, ecmascript], factory class: jdk.nashorn.api.scripting.NashornScriptEngineFactory DEBUG StatusLogger PluginManager 'Core' found 116 plugins DEBUG StatusLogger PluginManager 'Level' found 0 plugins DEBUG StatusLogger Building Plugin[name=property, class=org.apache.logging.log4j.core.config.Property]. DEBUG StatusLogger createProperty(name="LOG_PATTERN", value="%d{yyyy-MM-dd HH:mm:ss.SSS} %5p VRS --- [%15.15t] %-40.40c{1.} : %m%n%ex") DEBUG StatusLogger Building Plugin[name=properties, class=org.apache.logging.log4j.core.config.PropertiesPlugin]. DEBUG StatusLogger configureSubstitutor(={LOG_PATTERN=%d{yyyy-MM-dd HH:mm:ss.SSS} %5p VRS --- [%15.15t] %-40.40c{1.} : %m%n%ex}, Configuration(C:\Users\Me\IdeaProjects\example\web\target\classes\log4j2.xml)) DEBUG StatusLogger PluginManager 'Lookup' found 13 plugins DEBUG StatusLogger Building Plugin[name=layout, class=org.apache.logging.log4j.core.layout.PatternLayout]. DEBUG StatusLogger PatternLayout$Builder(pattern="%d{yyyy-MM-dd HH:mm:ss.SSS} %5p VRS --- [%15.15t] %-40.40c{1.} : %m%n%ex", PatternSelector=null, Configuration(C:\Users\Me\IdeaProjects\example\web\target\classes\log4j2.xml), Replace=null, charset="null", alwaysWriteExceptions="null", disableAnsi="null", noConsoleNoAnsi="null", header="null", footer="null") DEBUG StatusLogger PluginManager 'Converter' found 45 plugins DEBUG StatusLogger Building Plugin[name=appender, class=org.apache.logging.log4j.core.appender.ConsoleAppender]. DEBUG StatusLogger ConsoleAppender$Builder(target="SYSTEM_OUT", follow="true", direct="null", bufferedIo="null", bufferSize="null", immediateFlush="null", ignoreExceptions="null", PatternLayout(%d{yyyy-MM-dd HH:mm:ss.SSS} %5p VRS --- [%15.15t] %-40.40c{1.} : %m%n%ex), name="ConsoleAppender", Configuration(C:\Users\Me\IdeaProjects\example\web\target\classes\log4j2.xml), Filter=null) DEBUG StatusLogger Building Plugin[name=appenders, class=org.apache.logging.log4j.core.config.AppendersPlugin]. DEBUG StatusLogger createAppenders(={ConsoleAppender}) DEBUG StatusLogger Building Plugin[name=AppenderRef, class=org.apache.logging.log4j.core.config.AppenderRef]. DEBUG StatusLogger createAppenderRef(ref="ConsoleAppender", level="null", Filter=null) DEBUG StatusLogger Building Plugin[name=root, class=org.apache.logging.log4j.core.config.LoggerConfig$RootLogger]. DEBUG StatusLogger createLogger(additivity="null", level="INFO", includeLocation="null", ={ConsoleAppender}, ={}, Configuration(C:\Users\Me\IdeaProjects\example\web\target\classes\log4j2.xml), Filter=null) DEBUG StatusLogger Building Plugin[name=AppenderRef, class=org.apache.logging.log4j.core.config.AppenderRef]. DEBUG StatusLogger createAppenderRef(ref="ConsoleAppender", level="null", Filter=null) DEBUG StatusLogger Building Plugin[name=logger, class=org.apache.logging.log4j.core.config.LoggerConfig]. DEBUG StatusLogger createLogger(additivity="false", level="DEBUG", name="com.example", includeLocation="null", ={ConsoleAppender}, ={}, Configuration(C:\Users\Me\IdeaProjects\example\web\target\classes\log4j2.xml), Filter=null) DEBUG StatusLogger Building Plugin[name=AppenderRef, class=org.apache.logging.log4j.core.config.AppenderRef]. DEBUG StatusLogger createAppenderRef(ref="ConsoleAppender", level="null", Filter=null) DEBUG StatusLogger Building Plugin[name=logger, class=org.apache.logging.log4j.core.config.LoggerConfig]. DEBUG StatusLogger createLogger(additivity="false", level="DEBUG", name="fr.opensagres.xdocreport.core.logging.LogUtils", includeLocation="null", ={ConsoleAppender}, ={}, Configuration(C:\Users\Me\IdeaProjects\example\web\target\classes\log4j2.xml), Filter=null) DEBUG StatusLogger Building Plugin[name=loggers, class=org.apache.logging.log4j.core.config.LoggersPlugin]. DEBUG StatusLogger createLoggers(={root, com.example, fr.opensagres.xdocreport.core.logging.LogUtils}) DEBUG StatusLogger Configuration XmlConfiguration[location=C:\Users\Me\IdeaProjects\example\web\target\classes\log4j2.xml] initialized DEBUG StatusLogger Starting configuration XmlConfiguration[location=C:\Users\Me\IdeaProjects\example\web\target\classes\log4j2.xml] DEBUG StatusLogger Started configuration XmlConfiguration[location=C:\Users\Me\IdeaProjects\example\web\target\classes\log4j2.xml] OK. TRACE StatusLogger Stopping XmlConfiguration[location=C:\Users\Me\IdeaProjects\example\web\target\classes\log4j2.xml]... TRACE StatusLogger XmlConfiguration notified 4 ReliabilityStrategies that config will be stopped. TRACE StatusLogger XmlConfiguration stopping 3 LoggerConfigs. TRACE StatusLogger XmlConfiguration stopping root LoggerConfig. TRACE StatusLogger XmlConfiguration notifying ReliabilityStrategies that appenders will be stopped. TRACE StatusLogger XmlConfiguration stopping remaining Appenders. DEBUG StatusLogger Appender ConsoleAppender stopped with status true TRACE StatusLogger XmlConfiguration stopped 1 remaining Appenders. TRACE StatusLogger XmlConfiguration cleaning Appenders from 4 LoggerConfigs. DEBUG StatusLogger Stopped XmlConfiguration[location=C:\Users\Me\IdeaProjects\example\web\target\classes\log4j2.xml] OK TRACE StatusLogger Reregistering MBeans after reconfigure. Selector=org.apache.logging.log4j.core.selector.ClassLoaderContextSelector@394a2528 TRACE StatusLogger Reregistering context (1/1): '18b4aac2' org.apache.logging.log4j.core.LoggerContext@2f943d71 TRACE StatusLogger Unregistering 1 MBeans: [org.apache.logging.log4j2:type=18b4aac2] TRACE StatusLogger Unregistering 1 MBeans: [org.apache.logging.log4j2:type=18b4aac2,component=StatusLogger] TRACE StatusLogger Unregistering 1 MBeans: [org.apache.logging.log4j2:type=18b4aac2,component=ContextSelector] TRACE StatusLogger Unregistering 3 MBeans: [org.apache.logging.log4j2:type=18b4aac2,component=Loggers,name=fr.opensagres.xdocreport.core.logging.LogUtils, org.apache.logging.log4j2:type=18b4aac2,component=Loggers,name=, org.apache.logging.log4j2:type=18b4aac2,component=Loggers,name=com.example] TRACE StatusLogger Unregistering 1 MBeans: [org.apache.logging.log4j2:type=18b4aac2,component=Appenders,name=ConsoleAppender] TRACE StatusLogger Unregistering but no MBeans found matching 'org.apache.logging.log4j2:type=18b4aac2,component=AsyncAppenders,name=*' TRACE StatusLogger Unregistering but no MBeans found matching 'org.apache.logging.log4j2:type=18b4aac2,component=AsyncLoggerRingBuffer' TRACE StatusLogger Unregistering but no MBeans found matching 'org.apache.logging.log4j2:type=18b4aac2,component=Loggers,name=*,subtype=RingBuffer' DEBUG StatusLogger Registering MBean org.apache.logging.log4j2:type=18b4aac2 DEBUG StatusLogger Registering MBean org.apache.logging.log4j2:type=18b4aac2,component=StatusLogger DEBUG StatusLogger Registering MBean org.apache.logging.log4j2:type=18b4aac2,component=ContextSelector DEBUG StatusLogger Registering MBean org.apache.logging.log4j2:type=18b4aac2,component=Loggers,name= DEBUG StatusLogger Registering MBean org.apache.logging.log4j2:type=18b4aac2,component=Loggers,name=fr.opensagres.xdocreport.core.logging.LogUtils DEBUG StatusLogger Registering MBean org.apache.logging.log4j2:type=18b4aac2,component=Loggers,name=com.example DEBUG StatusLogger Registering MBean org.apache.logging.log4j2:type=18b4aac2,component=Appenders,name=ConsoleAppender TRACE StatusLogger Using DummyNanoClock for nanosecond timestamps. DEBUG StatusLogger Reconfiguration complete for context[name=18b4aac2] at URI C:\Users\Me\IdeaProjects\example\web\target\classes\log4j2.xml (org.apache.logging.log4j.core.LoggerContext@2f943d71) with optional ClassLoader: null . ____ _ __ _ _ /\\ / ___'_ __ _ _(_)_ __ __ _ \ \ \ \ ( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \ \\/ ___)| |_)| | | | | || (_| | ) ) ) ) ' |____| .__|_| |_|_| |_\__, | / / / / =========|_|==============|___/=/_/_/_/ :: Spring Boot :: (v2.0.5.RELEASE) DEBUG StatusLogger AsyncLogger.ThreadNameStrategy=UNCACHED (user specified null, default is UNCACHED) 2018-10-24 12:05:53.563 INFO VRS --- [ main] o.a.c.h.Http11NioProtocol : Initializing ProtocolHandler ["http-nio-8080"] TRACE StatusLogger Using default SystemClock for timestamps. 2018-10-24 12:05:53.573 INFO VRS --- [ main] o.a.c.c.StandardService : Starting service [Tomcat] 2018-10-24 12:05:53.573 INFO VRS --- [ main] o.a.c.c.StandardEngine : Starting Servlet Engine: Apache Tomcat/8.5.34 2018-10-24 12:05:53.576 INFO VRS --- [ost-startStop-1] o.a.c.c.AprLifecycleListener : The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: [C:\Program Files\Java\jdk1.8.0_181\bin;C:\windows\Sun\Java\bin;C:\windows\system32;C:\windows;C:\Program Files (x86)\Common Files\Oracle\Java\javapath;C:\Program Files (x86)\Intel\iCLS Client\;C:\Program Files\Intel\iCLS Client\;C:\windows\system32;C:\windows;C:\windows\System32\Wbem;C:\windows\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Program Files\nodejs\;C:\Program Files\Git\cmd;C:\Users\Me\AppData\Local\Microsoft\WindowsApps;C:\Users\Me\AppData\Roaming\npm;C:\Users\Me\AppData\Local\Programs\Microsoft VS Code\bin;.] 2018-10-24 12:05:53.629 INFO VRS --- [ost-startStop-1] o.a.c.c.C.[.[.[/] : Initializing Spring embedded WebApplicationContext 2018-10-24 12:05:53.708 INFO VRS --- [ main] o.a.c.c.StandardService : Stopping service [Tomcat] Process finished with exit code 1 中。但是,当我尝试运行我的应用程序时:

private void DebAddBut_Click(object sender, EventArgs e)
    {
        string connectionString = @"Data Source=(LocalDB)\MSSQLLocalDB;AttachDbFilename=C:\Users\simeo\source\repos\SparesPOS\SparesPOS\PartsPosDB.mdf;Integrated Security=True";

        StringBuilder strSQL = new StringBuilder();
        strSQL.Append("Insert into DebtorData values(");
        strSQL.Append("@DebtorID, @DebtorName,@DebtorPhone1,@DebtorPhone2,");
        strSQL.Append("@DebtorFax,@DebtorEmail,@DebtorAddr1,@DebtorAddr2,");
        strSQL.Append("@DebtorAddr3,@DebtorAddr4,@DebtorPostCode,@DebtorContact1,");
        strSQL.Append("@DebtorContact2,@DebtorLimit)");

        using (SqlConnection sqlConn = new SqlConnection(connectionString))
        {
            SqlCommand cmd = new SqlCommand();
            cmd.Parameters.Add("@DebtorID", SqlDbType.Int).Value = DebIDtxt.Text;
            cmd.Parameters.Add("@DebtorName", SqlDbType.VarChar, 50).Value = DebNametxt.Text;
            cmd.Parameters.Add("@DebtorPhone1", SqlDbType.VarChar, 50).Value = DebPh1txt.Text;
            cmd.Parameters.Add("@DebtorPhone2", SqlDbType.VarChar, 50).Value = DebPh2txt.Text;
            cmd.Parameters.Add("@DebtorFax", SqlDbType.VarChar, 50).Value = DebFaxtxt.Text;
            cmd.Parameters.Add("@DebtorEmail", SqlDbType.VarChar, 50).Value = DebEmtxt.Text;
            cmd.Parameters.Add("@DebtorAddr1", SqlDbType.VarChar, 50).Value = DebAdr1txt.Text;
            cmd.Parameters.Add("@DebtorAddr2", SqlDbType.VarChar, 50).Value = DebAdr2txt.Text;
            cmd.Parameters.Add("@DebtorAddr3", SqlDbType.VarChar, 50).Value = DebAdr3txt.Text;
            cmd.Parameters.Add("@DebtorAddr4", SqlDbType.VarChar, 50).Value = DebAdr4txt.Text;
            cmd.Parameters.Add("@DebtorPostCode", SqlDbType.VarChar, 50).Value = debPosCtxt.Text;
            cmd.Parameters.Add("@DebtorContact1", SqlDbType.VarChar, 50).Value = DebCont1txt.Text;
            cmd.Parameters.Add("@DebtorContact2", SqlDbType.VarChar, 50).Value = DebCont2txt.Text;
            cmd.Parameters.Add("@DebtorLimit", SqlDbType.VarChar, 50).Value = DebLimittxt.Text;

            cmd.CommandType = CommandType.Text;
            cmd.CommandText = strSQL.ToString();
            cmd.Connection = sqlConn;
            cmd.Connection.Open();

            try
            {

                cmd.ExecuteNonQuery();
            }
            catch { }
        }
        Debtors form = new Debtors();

        form.Refresh();
        form.Show();
    }

0 个答案:

没有答案