2017-03-24 27 views
-1

私は春のブートに慣れています。私はアプリを開発しており、問題なくIntellij IDEで動作します。実行可能なjarをデプロイして、コマンドウィンドウから実行したい。このため、私はそれぞれの関連フォルダで次のコマンドを適用:実行可能なファットjarファイルを実行しようとしているときに、春ブートログバックの問題

mvn clear 

mvn install  

私のアプリでは、私は2つの外部のjarファイルを使用することに注意してください。そのうちの1つはOracle db接続用のojdbc.jarであり、もう1つはApache Spark(cosinelsh.jar)を使用したScalaコードです。したがって、上記のコマンドはfat jarファイルを作成する必要があります。実際、このプロセスは順調に進みました。しかし(java -jar target/mlee.jar)ファイルを実行しようと、以下のエラーがスローされたとき:

SLF4J: Class path contains multiple SLF4J bindings. 
SLF4J: Found binding in [jar:file:/C:/Users/n12017/AppData/Local/Temp/mlee-exe-jar.jar-spring-boot-libs-65763e64-4a74-4d8f-b23a-0a20f028113c/cosinelsh-1.0.jar!/org/slf4j/impl/StaticLoggerBinder.class] 
SLF4J: Found binding in [jar:file:/C:/Users/n12017/IdeaProjects/LSH_USER/target/mlee-exe-jar.jar!/BOOT-INF/lib/logback-classic-1.1.9.jar!/org/slf4j/impl/StaticLoggerBinder.class] 
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation. 
SLF4J: Actual binding is of type [org.slf4j.impl.Log4jLoggerFactory] 
Exception in thread "main" java.lang.reflect.InvocationTargetException 
     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 
     at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) 
     at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) 
     at java.lang.reflect.Method.invoke(Unknown Source) 
     at org.springframework.boot.loader.MainMethodRunner.run(MainMethodRunner.java:48) 
     at org.springframework.boot.loader.Launcher.launch(Launcher.java:87) 
     at org.springframework.boot.loader.Launcher.launch(Launcher.java:50) 
     at org.springframework.boot.loader.JarLauncher.main(JarLauncher.java:51) 
Caused by: java.lang.IllegalArgumentException: LoggerFactory is not a Logback LoggerContext but Logback is on the classpath. Either remove Logback or the competing implementation (class org.slf4j.impl.Log4jLoggerFactory loaded from file:/C:/Users/n12017/AppData/Local/Temp/mlee-exe-jar.jar-spring-boot-libs-65763e64-4a74-4d8f-b23a-0a20f028113c/cosinelsh-1.0.jar). If you are using WebLogic you will need to add 'org.slf4j' to prefer-application-packages in WEB-INF/weblogic.xml Object of class [org.slf4j.impl.Log4jLoggerFactory] must be an instance of class ch.qos.logback.classic.LoggerContext 
     at org.springframework.util.Assert.isInstanceOf(Assert.java:346) 
     at org.springframework.boot.logging.logback.LogbackLoggingSystem.getLoggerContext(LogbackLoggingSystem.java:273) 
     at org.springframework.boot.logging.logback.LogbackLoggingSystem.beforeInitialize(LogbackLoggingSystem.java:97) 
     at org.springframework.boot.logging.LoggingApplicationListener.onApplicationStartingEvent(LoggingApplicationListener.java:230) 
     at org.springframework.boot.logging.LoggingApplicationListener.onApplicationEvent(LoggingApplicationListener.java:209) 
     at org.springframework.context.event.SimpleApplicationEventMulticaster.invokeListener(SimpleApplicationEventMulticaster.java:167) 
     at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:139) 
     at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:122) 
     at org.springframework.boot.context.event.EventPublishingRunListener.starting(EventPublishingRunListener.java:68) 
     at org.springframework.boot.SpringApplicationRunListeners.starting(SpringApplicationRunListeners.java:48) 
     at org.springframework.boot.SpringApplication.run(SpringApplication.java:303) 
     at org.springframework.boot.SpringApplication.run(SpringApplication.java:1162) 
     at org.springframework.boot.SpringApplication.run(SpringApplication.java:1151) 
     at softuniBlog.DemoApplication.main(DemoApplication.java:12) 
     ... 8 more 

stackoverflowの中に同様の質問(Favoring LogBack over Log4j in spring-boot/ securityまたはDisable Logback in SpringBoot)から、私は同様のアプローチを試してみましたが、いつも失敗しました。ここで

は、依存関係ツリーです:

--- maven-dependency-plugin:2.10:tree (default-cli) @ demo --- 
[INFO] Blog:demo:jar:0.0.1-SNAPSHOT 
[INFO] +- org.springframework.boot:spring-boot-starter-jdbc:jar:1.5.1.RELEASE:compile 
[INFO] | +- org.apache.tomcat:tomcat-jdbc:jar:8.5.11:compile 
[INFO] | | \- org.apache.tomcat:tomcat-juli:jar:8.5.11:compile 
[INFO] | \- org.springframework:spring-jdbc:jar:4.3.6.RELEASE:compile 
[INFO] |  +- org.springframework:spring-beans:jar:4.3.6.RELEASE:compile 
[INFO] |  \- org.springframework:spring-tx:jar:4.3.6.RELEASE:compile 
[INFO] +- org.springframework.boot:spring-boot-starter-security:jar:1.5.1.RELEASE:compile 
[INFO] | +- org.springframework:spring-aop:jar:4.3.6.RELEASE:compile 
[INFO] | +- org.springframework.security:spring-security-config:jar:4.2.1.RELEASE:compile 
[INFO] | | \- org.springframework.security:spring-security-core:jar:4.2.1.RELEASE:compile 
[INFO] | \- org.springframework.security:spring-security-web:jar:4.2.1.RELEASE:compile 
[INFO] |  +- org.springframework:spring-expression:jar:4.3.6.RELEASE:compile 
[INFO] |  \- org.springframework:spring-web:jar:4.3.6.RELEASE:compile 
[INFO] +- org.springframework.boot:spring-boot-starter-thymeleaf:jar:1.5.1.RELEASE:compile 
[INFO] | +- org.springframework.boot:spring-boot-starter-web:jar:1.5.1.RELEASE:compile 
[INFO] | | +- org.springframework.boot:spring-boot-starter-tomcat:jar:1.5.1.RELEASE:compile 
[INFO] | | | +- org.apache.tomcat.embed:tomcat-embed-core:jar:8.5.11:compile 
[INFO] | | | +- org.apache.tomcat.embed:tomcat-embed-el:jar:8.5.11:compile 
[INFO] | | | \- org.apache.tomcat.embed:tomcat-embed-websocket:jar:8.5.11:compile 
[INFO] | | +- org.hibernate:hibernate-validator:jar:5.3.4.Final:compile 
[INFO] | | | +- javax.validation:validation-api:jar:1.1.0.Final:compile 
[INFO] | | | \- com.fasterxml:classmate:jar:1.3.3:compile 
[INFO] | | \- org.springframework:spring-webmvc:jar:4.3.6.RELEASE:compile 
[INFO] | +- org.thymeleaf:thymeleaf-spring4:jar:2.1.5.RELEASE:compile 
[INFO] | \- nz.net.ultraq.thymeleaf:thymeleaf-layout-dialect:jar:1.4.0:compile 
[INFO] |  \- org.codehaus.groovy:groovy:jar:2.4.7:compile 
[INFO] +- org.springframework.boot:spring-boot-starter:jar:1.5.1.RELEASE:compile 
[INFO] | +- org.springframework.boot:spring-boot:jar:1.5.1.RELEASE:compile 
[INFO] | +- org.springframework.boot:spring-boot-autoconfigure:jar:1.5.1.RELEASE:compile 
[INFO] | +- org.springframework.boot:spring-boot-starter-logging:jar:1.5.1.RELEASE:compile 
[INFO] | | +- ch.qos.logback:logback-classic:jar:1.1.9:compile 
[INFO] | | | \- ch.qos.logback:logback-core:jar:1.1.9:compile 
[INFO] | | +- org.slf4j:jcl-over-slf4j:jar:1.7.22:compile 
[INFO] | | +- org.slf4j:jul-to-slf4j:jar:1.7.22:compile 
[INFO] | | \- org.slf4j:log4j-over-slf4j:jar:1.7.22:compile 
[INFO] | +- org.springframework:spring-core:jar:4.3.6.RELEASE:compile 
[INFO] | \- org.yaml:snakeyaml:jar:1.17:runtime 
[INFO] +- org.springframework.boot:spring-boot-devtools:jar:1.5.1.RELEASE:runtime 
[INFO] +- mysql:mysql-connector-java:jar:5.1.40:runtime 
[INFO] +- com.microsoft.sqlserver:mssql-jdbc:jar:6.1.0.jre7:runtime 
[INFO] | \- com.microsoft.azure:azure-keyvault:jar:0.9.3:runtime 
[INFO] |  +- com.microsoft.azure:azure-core:jar:0.9.3:runtime 
[INFO] |  | +- commons-codec:commons-codec:jar:1.10:runtime 
[INFO] |  | +- commons-lang:commons-lang:jar:2.6:runtime 
[INFO] |  | +- com.sun.jersey:jersey-client:jar:1.13:runtime 
[INFO] |  | | \- com.sun.jersey:jersey-core:jar:1.13:runtime 
[INFO] |  | \- com.sun.jersey:jersey-json:jar:1.13:runtime 
[INFO] |  |  +- org.codehaus.jettison:jettison:jar:1.1:runtime 
[INFO] |  |  | \- stax:stax-api:jar:1.0.1:runtime 
[INFO] |  |  +- com.sun.xml.bind:jaxb-impl:jar:2.2.3-1:runtime 
[INFO] |  |  | \- javax.xml.bind:jaxb-api:jar:2.2.2:runtime 
[INFO] |  |  |  \- javax.xml.stream:stax-api:jar:1.0-2:runtime 
[INFO] |  |  +- org.codehaus.jackson:jackson-core-asl:jar:1.9.2:runtime 
[INFO] |  |  +- org.codehaus.jackson:jackson-mapper-asl:jar:1.9.2:runtime 
[INFO] |  |  +- org.codehaus.jackson:jackson-jaxrs:jar:1.9.2:runtime 
[INFO] |  |  \- org.codehaus.jackson:jackson-xc:jar:1.9.2:runtime 
[INFO] |  +- org.apache.httpcomponents:httpclient:jar:4.5.2:runtime 
[INFO] |  | \- org.apache.httpcomponents:httpcore:jar:4.4.6:runtime 
[INFO] |  +- javax.inject:javax.inject:jar:1:runtime 
[INFO] |  \- com.microsoft.azure:adal4j:jar:1.0.0:runtime 
[INFO] |  +- com.nimbusds:oauth2-oidc-sdk:jar:4.5:runtime 
[INFO] |  | +- net.jcip:jcip-annotations:jar:1.0:runtime 
[INFO] |  | +- org.apache.commons:commons-lang3:jar:3.3.1:runtime 
[INFO] |  | +- com.nimbusds:lang-tag:jar:1.4:runtime 
[INFO] |  | \- com.nimbusds:nimbus-jose-jwt:jar:3.1.2:runtime 
[INFO] |  |  \- org.bouncycastle:bcprov-jdk15on:jar:1.51:runtime 
[INFO] |  \- com.google.code.gson:gson:jar:2.8.0:runtime 
[INFO] +- org.springframework.boot:spring-boot-starter-test:jar:1.5.1.RELEASE:test 
[INFO] | +- org.springframework.boot:spring-boot-test:jar:1.5.1.RELEASE:test 
[INFO] | +- org.springframework.boot:spring-boot-test-autoconfigure:jar:1.5.1.RELEASE:test 
[INFO] | +- com.jayway.jsonpath:json-path:jar:2.2.0:test 
[INFO] | | \- net.minidev:json-smart:jar:2.2.1:runtime 
[INFO] | |  \- net.minidev:accessors-smart:jar:1.1:runtime 
[INFO] | |  \- org.ow2.asm:asm:jar:5.0.3:runtime 
[INFO] | +- junit:junit:jar:4.12:test 
[INFO] | +- org.assertj:assertj-core:jar:2.6.0:test 
[INFO] | +- org.mockito:mockito-core:jar:1.10.19:test 
[INFO] | | \- org.objenesis:objenesis:jar:2.1:test 
[INFO] | +- org.hamcrest:hamcrest-core:jar:1.3:test 
[INFO] | +- org.hamcrest:hamcrest-library:jar:1.3:test 
[INFO] | +- org.skyscreamer:jsonassert:jar:1.4.0:test 
[INFO] | | \- com.vaadin.external.google:android-json:jar:0.0.20131108.vaadin1:test 
[INFO] | \- org.springframework:spring-test:jar:4.3.6.RELEASE:test 
[INFO] +- org.springframework.boot:spring-boot-starter-data-jpa:jar:1.5.1.RELEASE:compile 
[INFO] | +- org.springframework.boot:spring-boot-starter-aop:jar:1.5.1.RELEASE:compile 
[INFO] | | \- org.aspectj:aspectjweaver:jar:1.8.9:compile 
[INFO] | +- org.hibernate:hibernate-core:jar:5.0.11.Final:compile 
[INFO] | | +- org.jboss.logging:jboss-logging:jar:3.3.0.Final:compile 
[INFO] | | +- org.hibernate.javax.persistence:hibernate-jpa-2.1-api:jar:1.0.0.Final:compile 
[INFO] | | +- org.javassist:javassist:jar:3.21.0-GA:compile 
[INFO] | | +- antlr:antlr:jar:2.7.7:compile 
[INFO] | | +- org.jboss:jandex:jar:2.0.0.Final:compile 
[INFO] | | +- dom4j:dom4j:jar:1.6.1:compile 
[INFO] | | \- org.hibernate.common:hibernate-commons-annotations:jar:5.0.1.Final:compile 
[INFO] | +- org.hibernate:hibernate-entitymanager:jar:5.0.11.Final:compile 
[INFO] | +- javax.transaction:javax.transaction-api:jar:1.2:compile 
[INFO] | +- org.springframework.data:spring-data-jpa:jar:1.11.0.RELEASE:compile 
[INFO] | | +- org.springframework.data:spring-data-commons:jar:1.13.0.RELEASE:compile 
[INFO] | | \- org.springframework:spring-orm:jar:4.3.6.RELEASE:compile 
[INFO] | \- org.springframework:spring-aspects:jar:4.3.6.RELEASE:compile 
[INFO] +- org.thymeleaf.extras:thymeleaf-extras-springsecurity4:jar:2.1.2.RELEASE:compile 
[INFO] | +- org.thymeleaf:thymeleaf:jar:2.1.5.RELEASE:compile 
[INFO] | | +- ognl:ognl:jar:3.0.8:compile 
[INFO] | | \- org.unbescape:unbescape:jar:1.1.0.RELEASE:compile 
[INFO] | \- org.slf4j:slf4j-api:jar:1.7.22:compile 
[INFO] +- com.oracle:ojdbc6:jar:11.2.0.4:compile 
[INFO] +- org.springframework.boot:spring-boot-starter-mail:jar:1.5.1.RELEASE:compile 
[INFO] | +- org.springframework:spring-context:jar:4.3.6.RELEASE:compile 
[INFO] | +- org.springframework:spring-context-support:jar:4.3.6.RELEASE:compile 
[INFO] | \- com.sun.mail:javax.mail:jar:1.5.6:compile 
[INFO] +- javax.mail:mail:jar:1.4.1:compile 
[INFO] | \- javax.activation:activation:jar:1.1:compile 
[INFO] +- org.scala-lang:scala-library:jar:2.10.0:compile 
[INFO] +- cosine-lsh:cosinelsh:jar:1.0:compile 
[INFO] \- com.fasterxml.jackson.core:jackson-databind:jar:2.4.4:compile 
[INFO] +- com.fasterxml.jackson.core:jackson-annotations:jar:2.8.0:compile 
[INFO] \- com.fasterxml.jackson.core:jackson-core:jar:2.8.6:compile 
[INFO] \- com.fasterxml.jackson.core:jackson-core:jar:2.8.6:compile 

とのpom.xml

<?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>Blog</groupId> 
    <artifactId>demo</artifactId> 
    <version>0.0.1-SNAPSHOT</version> 
    <packaging>jar</packaging> 

    <name>demo</name> 
    <description>Blog Project from the Software Technologies Course</description> 

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

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

    <dependencies> 

     <dependency> 
      <groupId>org.springframework.boot</groupId> 
      <artifactId>spring-boot-starter-jdbc</artifactId> 
     </dependency> 
     <dependency> 
      <groupId>org.springframework.boot</groupId> 
      <artifactId>spring-boot-starter-security</artifactId> 
     </dependency> 
     <dependency> 
      <groupId>org.springframework.boot</groupId> 
      <artifactId>spring-boot-starter-thymeleaf</artifactId> 
     </dependency> 

     <dependency> 
      <groupId>org.springframework.boot</groupId> 
      <artifactId>spring-boot-starter</artifactId> 
     </dependency> 

     <dependency> 
      <groupId>org.springframework.boot</groupId> 
      <artifactId>spring-boot-devtools</artifactId> 
      <scope>runtime</scope> 
     </dependency> 
     <dependency> 
      <groupId>mysql</groupId> 
      <artifactId>mysql-connector-java</artifactId> 
      <scope>runtime</scope> 
     </dependency> 
     <dependency> 
      <groupId>com.microsoft.sqlserver</groupId> 
      <artifactId>mssql-jdbc</artifactId> 
      <scope>runtime</scope> 
     </dependency> 
     <dependency> 
      <groupId>org.springframework.boot</groupId> 
      <artifactId>spring-boot-starter-test</artifactId> 
      <scope>test</scope> 
     </dependency> 
     <dependency> 
      <groupId>org.springframework.boot</groupId> 
      <artifactId>spring-boot-starter-data-jpa</artifactId> 
     </dependency> 
     <dependency> 
      <groupId>org.thymeleaf.extras</groupId> 
      <artifactId>thymeleaf-extras-springsecurity4</artifactId> 
      <version>2.1.2.RELEASE</version> 
     </dependency> 

     <dependency> 
      <groupId>com.oracle</groupId> 
      <artifactId>ojdbc6</artifactId> 
      <version>11.2.0.4</version> 
     </dependency> 

     <dependency> 
      <groupId>org.springframework.boot</groupId> 
      <artifactId>spring-boot-starter-mail</artifactId> 
      <!--<version>1.4.3.RELEASE</version>--> 
     </dependency> 

     <dependency> 
      <groupId>javax.mail</groupId> 
      <artifactId>mail</artifactId> 
      <version>1.4.1</version> 
     </dependency> 

     <dependency> 
      <groupId>org.scala-lang</groupId> 
      <artifactId>scala-library</artifactId> 
      <version>2.10.0</version> 
     </dependency> 

     <dependency> 
      <groupId>cosine-lsh</groupId> 
      <artifactId>cosinelsh</artifactId> 
      <version>1.0</version> 
     </dependency> 

     <dependency> 
      <groupId>com.fasterxml.jackson.core</groupId> 
      <artifactId>jackson-databind</artifactId> 
      <version>2.4.4</version> 
     </dependency> 

    </dependencies> 

    <build> 
     <finalName>mlee-exe-jar</finalName> 
     <plugins> 
      <plugin> 
       <groupId>org.springframework.boot</groupId> 
       <artifactId>spring-boot-maven-plugin</artifactId> 
       <configuration> 
        <requiresUnpack> 
         <dependency> 
          <groupId>cosine-lsh</groupId> 
          <artifactId>cosinelsh</artifactId> 
          <version>1.0</version> 
         </dependency> 
        </requiresUnpack> 
       </configuration> 
      </plugin> 
     </plugins> 
    </build> 


</project> 

私が捕まってしまいました!誰かが助けることができますか?

ありがとうございます! jarファイルは、コマンドウィンドウを介して実行されている場合しかし、それは数秒後に開始と終了

<dependency> 
    <groupId>org.springframework.boot</groupId> 
    <artifactId>spring-boot-starter</artifactId> 
    <exclusions> 
     <exclusion> 
      <groupId>org.springframework.boot</groupId> 
      <artifactId>spring-boot-starter-logging</artifactId> 
     </exclusion> 
    </exclusions> 
</dependency> 

:ジェームズ・フライは、以下のように示唆したように、私は結合ログを取り除くことができ

EDIT

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. 

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

EDIT 2

org.springframework.context.ApplicationContextException: Unable to start embedded container; nested exception is org.springframework.boot.context.embedded.EmbeddedServletContainerException: Unable to start embedded Tomcat 
     at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.onRefresh(EmbeddedWebApplicationContext.java:137) ~[spring-boot-1.5.1.RELEASE.jar!/:1.5.1.RELEASE] 
     at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:536) ~[spring-context-4.3.6.RELEASE.jar!/:4.3.6.RELEASE] 
     at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.refresh(EmbeddedWebApplicationContext.java:122) ~[spring-boot-1.5.1.RELEASE.jar!/:1.5.1.RELEASE] 
     at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:737) [spring-boot-1.5.1.RELEASE.jar!/:1.5.1.RELEASE] 
     at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:370) [spring-boot-1.5.1.RELEASE.jar!/:1.5.1.RELEASE] 
     at org.springframework.boot.SpringApplication.run(SpringApplication.java:314) [spring-boot-1.5.1.RELEASE.jar!/:1.5.1.RELEASE] 
     at org.springframework.boot.SpringApplication.run(SpringApplication.java:1162) [spring-boot-1.5.1.RELEASE.jar!/:1.5.1.RELEASE] 
     at org.springframework.boot.SpringApplication.run(SpringApplication.java:1151) [spring-boot-1.5.1.RELEASE.jar!/:1.5.1.RELEASE] 
     at softuniBlog.DemoApplication.main(DemoApplication.java:12) [classes!/:0.0.1-SNAPSHOT] 
     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_121] 
     at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[na:1.8.0_121] 
     at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[na:1.8.0_121] 
     at java.lang.reflect.Method.invoke(Unknown Source) ~[na:1.8.0_121] 
     at org.springframework.boot.loader.MainMethodRunner.run(MainMethodRunner.java:48) [mlee-exe-jar.jar:0.0.1-SNAPSHOT] 
     at org.springframework.boot.loader.Launcher.launch(Launcher.java:87) [mlee-exe-jar.jar:0.0.1-SNAPSHOT] 
     at org.springframework.boot.loader.Launcher.launch(Launcher.java:50) [mlee-exe-jar.jar:0.0.1-SNAPSHOT] 
     at org.springframework.boot.loader.JarLauncher.main(JarLauncher.java:51) [mlee-exe-jar.jar:0.0.1-SNAPSHOT] 
Caused by: org.springframework.boot.context.embedded.EmbeddedServletContainerException: Unable to start embedded Tomcat 
     at org.springframework.boot.context.embedded.tomcat.TomcatEmbeddedServletContainer.initialize(TomcatEmbeddedServletContainer.java:117) ~[spring-boot-1.5.1.RELEASE.jar!/:1.5.1.RELEASE] 
     at org.springframework.boot.context.embedded.tomcat.TomcatEmbeddedServletContainer.<init>(TomcatEmbeddedServletContainer.java:84) ~[spring-boot-1.5.1.RELEASE.jar!/:1.5.1.RELEASE] 
     at org.springframework.boot.context.embedded.tomcat.TomcatEmbeddedServletContainerFactory.getTomcatEmbeddedServletContainer(TomcatEmbeddedServletContainerFactory.java:537) ~[spring-boot-1.5.1.RELEASE.jar!/:1.5.1.RELEASE] 
     at org.springframework.boot.context.embedded.tomcat.TomcatEmbeddedServletContainerFactory.getEmbeddedServletContainer(TomcatEmbeddedServletContainerFactory.java:179) ~[spring-boot-1.5.1.RELEASE.jar!/:1.5.1.RELEASE] 
     at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.createEmbeddedServletContainer(EmbeddedWebApplicationContext.java:164) ~[spring-boot-1.5.1.RELEASE.jar!/:1.5.1.RELEASE] 
     at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.onRefresh(EmbeddedWebApplicationContext.java:134) ~[spring-boot-1.5.1.RELEASE.jar!/:1.5.1.RELEASE] 
     ... 16 common frames omitted 
Caused by: org.apache.catalina.LifecycleException: Failed to initialize component [StandardServer[-1]] 
     at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:112) ~[tomcat-embed-core-8.5.11.jar!/:8.5.11] 
     at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:140) ~[tomcat-embed-core-8.5.11.jar!/:8.5.11] 
     at org.apache.catalina.startup.Tomcat.start(Tomcat.java:343) ~[tomcat-embed-core-8.5.11.jar!/:8.5.11] 
     at org.springframework.boot.context.embedded.tomcat.TomcatEmbeddedServletContainer.initialize(TomcatEmbeddedServletContainer.java:98) ~[spring-boot-1.5.1.RELEASE.jar!/:1.5.1.RELEASE] 
     ... 21 common frames omitted 
Caused by: javax.xml.parsers.FactoryConfigurationError: Provider for class javax.xml.parsers.SAXParserFactory cannot be created 
     at javax.xml.parsers.FactoryFinder.findServiceProvider(Unknown Source) ~[na:1.8.0_121] 
     at javax.xml.parsers.FactoryFinder.find(Unknown Source) ~[na:1.8.0_121] 
     at javax.xml.parsers.SAXParserFactory.newInstance(Unknown Source) ~[na:1.8.0_121] 
     at org.apache.tomcat.util.digester.Digester.getFactory(Digester.java:432) ~[tomcat-embed-core-8.5.11.jar!/:8.5.11] 
     at org.apache.tomcat.util.digester.Digester.getParser(Digester.java:617) ~[tomcat-embed-core-8.5.11.jar!/:8.5.11] 
     at org.apache.tomcat.util.digester.Digester.getXMLReader(Digester.java:809) ~[tomcat-embed-core-8.5.11.jar!/:8.5.11] 
     at org.apache.tomcat.util.digester.Digester.parse(Digester.java:1477) ~[tomcat-embed-core-8.5.11.jar!/:8.5.11] 
     at org.apache.tomcat.util.modeler.modules.MbeansDescriptorsDigesterSource.execute(MbeansDescriptorsDigesterSource.java:170) ~[tomcat-embed-core-8.5.11.jar!/:8.5.11] 
     at org.apache.tomcat.util.modeler.modules.MbeansDescriptorsDigesterSource.loadDescriptors(MbeansDescriptorsDigesterSource.java:149) ~[tomcat-embed-core-8.5.11.jar!/:8.5.11] 
     at org.apache.tomcat.util.modeler.Registry.load(Registry.java:590) ~[tomcat-embed-core-8.5.11.jar!/:8.5.11] 
     at org.apache.tomcat.util.modeler.Registry.loadDescriptors(Registry.java:669) ~[tomcat-embed-core-8.5.11.jar!/:8.5.11] 
     at org.apache.tomcat.util.modeler.Registry.findDescriptor(Registry.java:703) ~[tomcat-embed-core-8.5.11.jar!/:8.5.11] 
     at org.apache.tomcat.util.modeler.Registry.findManagedBean(Registry.java:479) ~[tomcat-embed-core-8.5.11.jar!/:8.5.11] 
     at org.apache.tomcat.util.modeler.Registry.registerComponent(Registry.java:622) ~[tomcat-embed-core-8.5.11.jar!/:8.5.11] 
     at org.apache.catalina.util.LifecycleMBeanBase.register(LifecycleMBeanBase.java:161) ~[tomcat-embed-core-8.5.11.jar!/:8.5.11] 
     at org.apache.catalina.util.LifecycleMBeanBase.initInternal(LifecycleMBeanBase.java:61) ~[tomcat-embed-core-8.5.11.jar!/:8.5.11] 
     at org.apache.catalina.core.StandardServer.initInternal(StandardServer.java:829) ~[tomcat-embed-core-8.5.11.jar!/:8.5.11] 
     at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:107) ~[tomcat-embed-core-8.5.11.jar!/:8.5.11] 
     ... 24 common frames omitted 
Caused by: java.lang.RuntimeException: Provider for class javax.xml.parsers.SAXParserFactory cannot be created 
     ... 42 common frames omitted 
Caused by: java.util.ServiceConfigurationError: javax.xml.parsers.SAXParserFactory: Error reading configuration file 
     at java.util.ServiceLoader.fail(Unknown Source) ~[na:1.8.0_121] 
     at java.util.ServiceLoader.parse(Unknown Source) ~[na:1.8.0_121] 
     at java.util.ServiceLoader.access$200(Unknown Source) ~[na:1.8.0_121] 
     at java.util.ServiceLoader$LazyIterator.hasNextService(Unknown Source) ~[na:1.8.0_121] 
     at java.util.ServiceLoader$LazyIterator.hasNext(Unknown Source) ~[na:1.8.0_121] 
     at java.util.ServiceLoader$1.hasNext(Unknown Source) ~[na:1.8.0_121] 
     at javax.xml.parsers.FactoryFinder$1.run(Unknown Source) ~[na:1.8.0_121] 
     at java.security.AccessController.doPrivileged(Native Method) ~[na:1.8.0_121] 
     ... 42 common frames omitted 
Caused by: java.io.FileNotFoundException: JAR entry META-INF/services/javax.xml.parsers.SAXParserFactory not found in C:\Users\n12017\AppData\Local\Temp\mlee-exe-jar.jar-spring-boot-libs-7a6ac511-970e-415f-bccb-432a1d0c7cee\cosinelsh-1.0.jar 
     at org.springframework.boot.loader.jar.JarURLConnection.throwFileNotFound(JarURLConnection.java:185) ~[mlee-exe-jar.jar:0.0.1-SNAPSHOT] 
     at org.springframework.boot.loader.jar.JarURLConnection.connect(JarURLConnection.java:104) ~[mlee-exe-jar.jar:0.0.1-SNAPSHOT] 
     at org.springframework.boot.loader.jar.JarURLConnection.getInputStream(JarURLConnection.java:169) ~[mlee-exe-jar.jar:0.0.1-SNAPSHOT] 
     at java.net.URL.openStream(Unknown Source) ~[na:1.8.0_121] 
     ... 49 common frames omitted 
+0

それはあなたのように聞こえますロギングの問題とは無関係に新しい問題が発生しています。このコマンドの出力は何ですか? '$ jar -tvf cosinelsh-1.0.jar | grep SAXParserFactory'? – Gary

+0

Windowsの@Gary私はあなたの提案に次のように感謝しました: '' jar -tvf cosinelsh-1.0.jar | findstr SAXParserFactory''ここに私が持っているもの: '' 2701 Thu Jul 09 00:59:52 CEST 2015 org/apache/xerces/jaxp/SAXParserFactoryImpl.class 44 Thu Jul 09 00:59:52 CEST 2015 META-INF/services/javax.xml.parsers.SAXParserFactory'' –

+0

あなたはcosinelshライブラリと競合しているようです。おそらくバージョンの不一致を伴うクラスも含まれています。一般に、fatjarの依存関係は、実際に何があるのか​​を管理することができないため、このようなプロジェクトに依存関係を組み込むのは難しくなります。 @James Fryが言及したように、SAXParserのようなものはそこに詰め込まれているものよりも削除されています。 – Gary

答えて

0

あなたは、問題のインポートから、他の実装を除外すべきである - この場合には、あなたのcosinelshジャーはSLF4Jロガーバインディングだけでなく、春ブーツ経由で持ち込まれますlogback-古典-1.1.9.jarが含まれています。

私は、あなたができる場合は(例えば、スコープを "提供された"または同様のものに設定することによって)これらの依存関係のないCosinelsh Jarを構築することが正しいと考えています。それができない場合、あなたは(春・ブート・スターター経由で持ち込ま)春ブート・スターターロギング依存から春ブーツ提供するライブラリ、例えばを除去することができる場合があります。

 <dependency> 
      <groupId>org.springframework.boot</groupId> 
      <artifactId>spring-boot-starter</artifactId> 
      <exclusions> 
       <exclusion> 
        <groupId>org.springframework.boot</groupId> 
        <artifactId>spring-boot-starter-logging</artifactId> 
       </exclusion> 
      </exclusions> 
     </dependency> 
+0

ありがとう@ジェイムズフライ!クラスパスからロギングを除外すると、ローカルのcompでコードを実行することができます。ただし、デプロイされたjarファイルをコマンドウィンドウで実行しようとすると、プログラムが起動しますが、数秒後に停止します。私の上記の編集をご覧ください。 –

+0

また、ログバックを削除する代わりに、cosinelsh jarファイルから手動でログファイルを削除することもできます。しかし、今回は編集2で上記のようなエラーが発生しました。 –

+0

最後に、「JARエントリMETA-INF/services/javax.xml.parsers.SAXParserFactoryがC:\ Users \ n12017 \ AppData \ Local \ Temp \ mlee-exe-jar.jar-spring-boot-libs-7a6ac511-970e-415f-bccb-432a1d0c7cee \ cosinelsh-1.0.jar」を参照してください。しかし、それは与えられたフォルダに存在します。 –

関連する問題