2016-08-30 4 views
0

Ich versuche SpringBoot Anwendung als jar von Linux-Maschine zu starten zu beginnen, und ich bin die folgenden Fehler bekommen, wo das Glas in Windows-Maschine funktioniert prima,Lage nicht SpringBoot App von Linux-Maschine

I Java-Version verwenden 1.8 und Spring-Boot-Abhängigkeiten mit 1.3.6.RELEASE.

12:03:16.266 [localhost-startStop-1] ERROR o.a.c.c.C.[.[localhost].[/myapp] - Exception sending context initialized event to listener instance of class org.apache.tomcat.websocket.server.WsContextListener 
java.lang.NoSuchMethodError: javax.servlet.ServletContext.getVirtualServerName()Ljava/lang/String; 
    at org.apache.tomcat.websocket.server.WsServerContainer.(WsServerContainer.java:149) 
    at org.apache.tomcat.websocket.server.WsSci.init(WsSci.java:131) 
    at org.apache.tomcat.websocket.server.WsContextListener.contextInitialized(WsContextListener.java:39) 
    at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4812) 
    at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5255) 
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:147) 
    at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1408) 
    at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1398) 
    at java.util.concurrent.FutureTask.run(FutureTask.java:266) 
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) 
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) 
    at java.lang.Thread.run(Thread.java:745) 
12:03:16.288 [localhost-startStop-1] ERROR o.a.catalina.core.StandardContext - One or more listeners failed to start. Full details will be found in the appropriate container log file 
12:03:25.928 [localhost-startStop-1] INFO o.a.c.util.SessionIdGeneratorBase - Creation of SecureRandom instance for session ID generation using [SHA1PRNG] took [9,636] milliseconds. 
12:03:25.932 [localhost-startStop-1] ERROR o.a.catalina.core.StandardContext - Context [/myapp] startup failed due to previous errors

<properties> 
    <start-class>com.myapp.Application</start-class> 
    <camunda.version>7.4.0</camunda.version> 
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> 
    <failOnMissingWebXml>false</failOnMissingWebXml> 
    <camunda.version>7.4.0</camunda.version> 
    <org.springframework.version>4.2.6.RELEASE</org.springframework.version> 
    <java.version>1.8</java.version> 
    <maven.compiler.source>${java.version}</maven.compiler.source> 
    <maven.compiler.target>${java.version}</maven.compiler.target> 
</properties> 


<dependencyManagement> 
    <dependencies> 
     <dependency> 
      <!-- Import dependency management from Spring Boot --> 
      <groupId>org.springframework.boot</groupId> 
      <artifactId>spring-boot-dependencies</artifactId> 
      <version>1.3.6.RELEASE</version> 
      <type>pom</type> 
      <scope>import</scope> 
     </dependency> 
    </dependencies> 
</dependencyManagement> 

<dependencies> 
    <dependency> 
     <groupId>org.springframework</groupId> 
     <artifactId>spring-web</artifactId> 
    </dependency> 
    <dependency> 
     <groupId>org.mockftpserver</groupId> 
     <artifactId>MockFtpServer</artifactId> 
     <version>2.4</version> 
     <scope>test</scope> 
     <exclusions> 
      <exclusion> 
       <groupId>org.slf4j</groupId> 
       <artifactId>slf4j-log4j12</artifactId> 
      </exclusion> 
      <exclusion> 
       <groupId>log4j</groupId> 
       <artifactId>log4j</artifactId> 
      </exclusion> 
     </exclusions> 
    </dependency> 
    <!-- http://mvnrepository.com/artifact/org.springframework/spring-test --> 
    <dependency> 
     <groupId>org.springframework</groupId> 
     <artifactId>spring-test</artifactId> 
    </dependency> 

    <dependency> 
     <groupId>org.springframework</groupId> 
     <artifactId>spring-core</artifactId> 
    </dependency> 
    <dependency> 
     <groupId>org.springframework</groupId> 
     <artifactId>spring-context-support</artifactId> 
    </dependency> 
    <dependency> 
     <groupId>org.springframework.integration</groupId> 
     <artifactId>spring-integration-ftp</artifactId> 
    </dependency> 

    <dependency> 
     <groupId>org.camunda.bpm.extension</groupId> 
     <artifactId>camunda-bpm-spring-boot-starter-webapp</artifactId> 
     <version>1.1.0</version> 
     <exclusions> 
      <exclusion> 
       <groupId>org.springframework</groupId> 
       <artifactId>spring-web</artifactId> 
      </exclusion> 
     </exclusions> 
    </dependency> 
    <dependency> 
     <groupId>org.springframework.boot</groupId> 
     <artifactId>spring-boot-starter-data-jpa</artifactId> 
    </dependency> 
    <dependency> 
     <groupId>org.aspectj</groupId> 
     <artifactId>aspectjweaver</artifactId> 
    </dependency> 

    <dependency> 
     <groupId>org.camunda.bpm.identity</groupId> 
     <artifactId>camunda-identity-ldap</artifactId> 
     <version>${camunda.version}</version> 
    </dependency> 

    <dependency> 
     <groupId>org.camunda.bpm</groupId> 
     <artifactId>camunda-engine-rest</artifactId> 
     <version>${camunda.version}</version> 
     <classifier>classes</classifier> 
    </dependency> 

    <dependency> 
     <groupId>net.sourceforge.jtds</groupId> 
     <artifactId>jtds</artifactId> 
     <version>1.3.0</version> 
    </dependency> 
    <dependency> 
     <groupId>org.codehaus.groovy</groupId> 
     <artifactId>groovy-all</artifactId> 
     <version>2.4.6</version> 
    </dependency> 

    <dependency> 
     <!-- AssertJ Testing Library --> 
     <groupId>org.camunda.bpm.extension</groupId> 
     <artifactId>camunda-bpm-assert</artifactId> 
     <version>1.2</version> 
     <scope>test</scope> 
    </dependency> 

    <dependency> 
     <groupId>javax.servlet</groupId> 
     <artifactId>javax.servlet-api</artifactId> 
     <version>3.0.1</version> 
     <scope>provided</scope> 
    </dependency> 


    <dependency> 
     <!-- Used to generate test coverage reports, see https://github.com/camunda/camunda-consulting/tree/master/snippets/process-test-coverage --> 
     <groupId>org.camunda.consulting.snippets</groupId> 
     <artifactId>process-test-coverage</artifactId> 
     <version>0.2.3</version> 
     <scope>test</scope> 
    </dependency> 

    <dependency> 
     <groupId>javax.ejb</groupId> 
     <artifactId>javax.ejb-api</artifactId> 
     <version>3.2</version> 
    </dependency> 


    <dependency> 
     <groupId>com.jcabi</groupId> 
     <artifactId>jcabi-aspects</artifactId> 
     <version>0.22.4</version> 
    </dependency> 

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

    <dependency> 
     <groupId>org.apache.commons</groupId> 
     <artifactId>commons-email</artifactId> 
     <version>1.4</version> 
    </dependency> 

    <dependency> 
     <groupId>com.fasterxml.uuid</groupId> 
     <artifactId>java-uuid-generator</artifactId> 
     <scope>provided</scope> 
     <version>3.1.2</version> 
    </dependency> 

    <!-- Required to use Spin dataformat support in unit tests --> 
    <dependency> 
     <groupId>org.camunda.spin</groupId> 
     <artifactId>camunda-spin-dataformat-all</artifactId> 
     <version>1.2.2</version> 
     <scope>test</scope> 
    </dependency> 
    <dependency> 
     <groupId>org.camunda.bpm</groupId> 
     <artifactId>camunda-engine-plugin-spin</artifactId> 
     <version>${camunda.version}</version> 
     <scope>test</scope> 
    </dependency> 
    <dependency> 
     <groupId>org.camunda.bpm</groupId> 
     <artifactId>camunda-engine-plugin-connect</artifactId> 
     <version>${camunda.version}</version> 
    </dependency> 
    <!-- DLI --> 
    <dependency> 
     <groupId>javax.ws.rs</groupId> 
     <artifactId>javax.ws.rs-api</artifactId> 
     <version>2.0</version> 
    </dependency> 

</dependencies> 

<repositories> 
    <repository> 
     <id>camunda-bpm-nexus</id> 
     <name>Camunda BPM Maven Repository</name> 
     <url>https://app.camunda.com/nexus/content/groups/public</url> 
    </repository> 
</repositories> 

<build> 
    <finalName>${project.artifactId}</finalName> 
    <plugins> 
     <!-- Following plugin executes the testng tests --> 
     <plugin> 
      <groupId>org.apache.maven.plugins</groupId> 
      <artifactId>maven-surefire-plugin</artifactId> 
      <version>2.14.1</version> 
      <configuration> 
       <!-- Suite testng xml file to consider for test execution --> 
       <suiteXmlFiles> 
        <suiteXmlFile>testng.xml</suiteXmlFile> 
       </suiteXmlFiles> 
      </configuration> 
     </plugin> 
     <plugin> 
      <groupId>org.apache.maven.plugins</groupId> 
      <artifactId>maven-compiler-plugin</artifactId> 
      <configuration> 
       <source>${java.version}</source> 
       <target>${java.version}</target> 
      </configuration> 
     </plugin> 
     <plugin> 
      <groupId>org.springframework.boot</groupId> 
      <artifactId>spring-boot-maven-plugin</artifactId> 
      <version>1.3.6.RELEASE</version> 
      <configuration> 
       <mainClass>${start-class}</mainClass> 
       <layout>ZIP</layout> 
      </configuration> 
      <executions> 
       <execution> 
        <goals> 
         <goal>repackage</goal> 
        </goals> 
       </execution> 
      </executions> 
     </plugin> 

Bitte lassen Sie mich wissen, warum ich dieses Problem bin vor. Hier finden Sie die Screenshots für die verwendeten Abhängigkeiten

[![Dependencies][1]][1] 
[![Dependencies2][2]][2] 
[![Dependencies3][3]][3] 

    [1]: http://i.stack.imgur.com/6mqr8.jpg 
    [2]: http://i.stack.imgur.com/ybBmS.jpg 
    [3]: http://i.stack.imgur.com/RveD5.jpg 
+0

Scheint, als ob Sie nicht die Servlet 3.0-Spezifikation auf Ihrem Klassenpfad haben. Vielleicht wäre es eine gute Idee, Ihre Abhängigkeiten zu überprüfen, wenn eine andere, ältere Servlet-Spec herum lauert. –

+0

Könnten Sie weitere Informationen hinzufügen? Befehl, den Sie verwenden. Abhängigkeiten (pom.xml oder etwas anderes). – emoleumassi

+0

Bitte überprüfen Sie auch http://Stackoverflow.com/a/8611825/6372139 –

Antwort

0

vom Frühling Zitiert website

Das Setup nicht Sie einzelne Abhängigkeiten mithilfe einer Eigenschaft außer Kraft setzen lässt, wie oben erläutert. Um das gleiche Ergebnis zu erhalten, müssen Sie einen Eintrag im dependencyManagement Ihres Projekts vor dem Eintrag spring-boot-dependencies hinzufügen. Um beispielsweise zu einem anderen Spring Data Release-Zug zu wechseln, fügen Sie Ihrer pom.xml Folgendes hinzu:

Ich glaube nicht, dass der Servlet-Container ordnungsgemäß importiert wird. Können Sie STS oder eine andere IDE verwenden, um das Maven-Abhängigkeitsverwaltungsdiagramm anzuzeigen? Wäre hilfreich, wenn Sie es weitergeben können.

+0

Danke !! Es funktioniert gut mit Eclipse & IDE in Windows, aber nach der Bereitstellung in Linux Maschine bin ich mit dem Problem konfrontiert und ich habe Screenshots für die Abhängigkeiten erstellt. – user3428736

+0

Zusätzliche Abhängigkeiten als Screenshot in der folgenden URL, [1]: http://i.stack.imgur.com/6mqr8.jpg [2]: http://i.stack.imgur.com/ybBmS.jpg [3]: http://i.stack.imgur.com/RveD5.jpg – user3428736