2016-08-10 2 views
1

私はOpenshiftで非常に簡単なSpring-Bootアプリケーションを展開しようとしています。 作成中Tomcat 7(JBoss EWS 2.0)カートリッジブラウザからopenshiftをオンラインで使用しています。Openshift - Spring Boot - 新しいアプリケーションの作成中にエラーが発生しました - 実行に失敗しました: 'control start'

作成中に次のエラーが発生します。 enter image description here

enter image description here

は、そのための任意の解決策を見つけることができませんでした。誰かがここで間違っていることを助けることができますか?

GitのURL:エラーの正確な理由は何かhttps://github.com/bhaskey/testingcloud

答えて

1

わかりません。しかし、私はあなたのコードで次の問題を見つける。あなたがTomcatサーバーにデプロイしている

  • JavaバージョンのJBoss EWS 2.0(1.7に生成されたのpom.xmlのdeafultsで)1.7をサポートしているかどうかわからない
  • は、しかしspring-boot-starter-webspring-boot-starter-tomcatに推移依存性を有します。あなたはtomcat依存関係を提供するように設定する必要があります。
  • あなたのパッキングはjarです。あなたは春のブート・メイヴン・プラグインがわからないのですが、それはtomcatサーバーのwebappsディレクトリにどのように展開されるのでしょうか。プロジェクトを構築するためにオープンシフトプロファイルを使用します。あなたのオープンシフトのプロファイルが期待どおりに機能しない可能性があります。
  • 春ブーツは、外部のアプリケーションサーバー上で実行するためには、あなたは私がopenshiftする春のブートプロジェクトに展開を作成するには、次の手順に従いますを示唆しているがextends SpringBootServletInitializer

でメインクラスを拡張する必要があります。

  1. WebコンソールまたはEclipse openshiftプラグインからTomcat 7(JBoss EWS 2.0)カートリッジを作成します。
  2. ローカルマシンにプロジェクトをクローンします。
  3. pom.xmlを変更し、春のブート親の依存関係を追加し、依存関係のみを追加します。プラグインはそのままの状態にしてください。 更新されたpom.xmlは次のようになります。あなたのアプリケーションは、あなたがwebappsディレクトリ

    の下に、すべてのHTML、CSS、JSのリソースを配置する必要があるかもしれませんプラグインスプリングブートを使用しないため

    <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/maven-v4_0_0.xsd"> 
    <modelVersion>4.0.0</modelVersion> 
    <groupId>com.openshif</groupId> 
    <artifactId>cloudemo</artifactId> 
    <packaging>war</packaging> 
    <version>1.0</version> 
    <name>cloudemo</name> 
    <parent> 
        <groupId>org.springframework.boot</groupId> 
        <artifactId>spring-boot-starter-parent</artifactId> 
        <version>1.4.0.RELEASE</version> 
        <relativePath /> <!-- lookup parent from repository --> 
    </parent> 
    <repositories> 
        <repository> 
         <id>eap</id> 
         <url>http://maven.repository.redhat.com/techpreview/all</url> 
         <releases> 
          <enabled>true</enabled> 
         </releases> 
         <snapshots> 
          <enabled>true</enabled> 
         </snapshots> 
        </repository> 
    </repositories> 
    <pluginRepositories> 
        <pluginRepository> 
         <id>eap</id> 
         <url>http://maven.repository.redhat.com/techpreview/all</url> 
         <releases> 
          <enabled>true</enabled> 
         </releases> 
         <snapshots> 
          <enabled>true</enabled> 
         </snapshots> 
        </pluginRepository> 
    </pluginRepositories> 
    <properties> 
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> 
        <maven.compiler.source>1.6</maven.compiler.source> 
        <maven.compiler.target>1.6</maven.compiler.target> 
        <java.version>1.6</java.version> 
    </properties> 
    <dependencies> 
    
        <dependency> 
         <groupId>org.springframework.boot</groupId> 
         <artifactId>spring-boot-starter-thymeleaf</artifactId> 
        </dependency> 
    
        <dependency> 
         <groupId>org.springframework.boot</groupId> 
         <artifactId>spring-boot-starter-web</artifactId> 
        </dependency> 
    
        <dependency> 
         <groupId>org.springframework.boot</groupId> 
         <artifactId>spring-boot-starter-tomcat</artifactId> 
         <scope>provided</scope> 
        </dependency> 
        <dependency> 
         <groupId>org.springframework.boot</groupId> 
         <artifactId>spring-boot-starter-test</artifactId> 
         <scope>test</scope> 
        </dependency> 
        <dependency> 
         <groupId>javax.servlet</groupId> 
         <artifactId>javax.servlet-api</artifactId> 
         <scope>provided</scope> 
        </dependency> 
    </dependencies> 
    <profiles> 
        <profile> 
         <!-- When built in OpenShift the 'openshift' profile will be used when 
          invoking mvn. --> 
         <!-- Use this profile for any OpenShift specific customization your app 
          will need. --> 
         <!-- By default that is to put the resulting archive into the 'webapps' 
          folder. --> 
         <!-- http://maven.apache.org/guides/mini/guide-building-for-different-environments.html --> 
         <id>openshift</id> 
         <build> 
          <finalName>cloudemo</finalName> 
          <plugins> 
           <plugin> 
            <artifactId>maven-war-plugin</artifactId> 
            <version>2.1.1</version> 
            <configuration> 
             <outputDirectory>webapps</outputDirectory> 
             <warName>ROOT</warName> 
            </configuration> 
           </plugin> 
          </plugins> 
         </build> 
        </profile> 
    </profiles> 
    

  4. 修正MainClass

    @SpringBootApplication 
    public class CloudemoApplication extends SpringBootServletInitializer { 
    
    
    @Override 
    protected SpringApplicationBuilder configure(SpringApplicationBuilder builder) { 
    
        return builder.sources(CloudemoApplication.class); 
    } 
    
    public static void main(String[] args) { 
        SpringApplication.run(CloudemoApplication.class, args); 
    } 
    
  5. を提出

+0

このような詳細についてお返事ありがとうございます。私はこのように働くことを試みます。 –

関連する問題