2016-05-01 7 views
0

私はスプリングブートアプリケーションをspring-boot-adminサーバーに登録します。ここで スプリングブート管理者、クライアント登録の結果が不正です

は私の SpringBootAdminApplication.java

@Configuration 
@EnableAutoConfiguration 
@EnableAdminServer 
public class SpringBootAdminApplication { 

    public static void main(String[] args) { 
     SpringApplication.run(SpringBootAdminApplication.class, args); 
    } 
} 

そしてpom.xml次のとおりです。

<dependencies> 
    <dependency> 
     <groupId>de.codecentric</groupId> 
     <artifactId>spring-boot-admin-example</artifactId> 
     <version>1.0.5</version> 
    </dependency> 
</dependencies> 

application.properties

server.port = 8080 

サーバーは現在実行されている:

enter image description here

さて、クライアント側で:

プロパティ:

spring.boot.admin.url=http://localhost:8080 
[email protected]@ 
spring.application.name=rest-module 

のpom.xml:私はクライアントからの春のブートを実行したときに、私が取得

<dependency> 
     <groupId>de.codecentric</groupId> 
     <artifactId>spring-boot-admin-starter-client</artifactId> 
     <version>1.3.0</version> 
</dependency> 

しかし、このエラー:

Created POST request for "http://localhost:8080/api/applications" 
Setting request Accept header to [application/json, application/json, application/*+json, application/*+json] 

Writing [Application [id=null, name=rest-module, managementUrl=http://Hayatloo-PC:8082, healthUrl=http://Hayatloo-PC:8082/health, serviceUrl=http://Hayatloo-PC:8082]] as "application/json" using [org.springfr[email protected]1637320b] 
Failed to register application as Application [id=null, name=rest-module, managementUrl=http://Hayatloo-PC:8082, healthUrl=http://Hayatloo-PC:8082/health, serviceUrl=http://Hayatloo-PC:8082] at spring-boot-admin (http://localhost:8080/api/applications): 400 Bad Request 

なぜid=null

答えて

2

あなたはバージョンを混乱させました。クライアントとサーバーを同じバージョンに更新してください。我々はあまりにも互換性を維持しようとするが、1.0.xから1.3.xにはあなたはチャンスがない。 Btwの現在のバージョンは1.3.2です。

追加サンプルを依存関係として使用しています。これは実際に動作しますが、私はそれをお勧めしません。このガイドに記載されているように、サーバーをより適切にセットアップしてください。 http://codecentric.github.io/spring-boot-admin/1.3.2/

+0

答えてくれてありがとう、私はガイドの依存関係を使用する場合、私は、サーバー側でこのerrroを得る:de.codecentric.boot.admin.config.HazelcastStoreConfiguration.applicationStore' 'はIllegalArgumentExceptionに 'エラー処理条件:@ConditionalOnMissingBean注釈には少なくとも1つのBean(タイプ、名前、または注釈)を指定する必要があります。 – Sajad

+0

最新のスプリングブートを使用していますか? – joshiste

+0

私の春のブートバージョンは '1.2.6.RELEASE' – Sajad