2017-01-01 4 views
1

私はjhipsterを使用しています。私はwebappに春バッチ管理コンソールを統合したいと思います。 (例えばhttp://localhost:8080/batch-console春バッチ管理コンソールを統合する方法

テストのために、これらのプロパティIハードコードした場合

org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'loggingConfiguration': Injection of autowired dependencies failed; nested exception is java.lang.IllegalArgumentException: Could not resolve placeholder 'spring.application.name' in string value "${spring.application.name}" 
    at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:355) 
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1219) 
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:543) 
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:482) 
    at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:306) 
    at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230) 
    at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:302) 
    at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:197) 
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:751) 
    at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:861) 
    at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:541) 
    at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.refresh(EmbeddedWebApplicationContext.java:122) 
    at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:761) 
    at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:371) 
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:315) 
    at com.mycompany.myapp.JhipsterApp.main(JhipsterApp.java:64) 
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) 
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) 
    at java.lang.reflect.Method.invoke(Method.java:497) 
    at org.springframework.boot.devtools.restart.RestartLauncher.run(RestartLauncher.java:49) 

Caused by: java.lang.IllegalArgumentException: Could not resolve placeholder 'spring.application.name' in string value "${spring.application.name}" 
    at org.springframework.util.PropertyPlaceholderHelper.parseStringValue(PropertyPlaceholderHelper.java:174) 
    at org.springframework.util.PropertyPlaceholderHelper.replacePlaceholders(PropertyPlaceholderHelper.java:126) 
    at org.springframework.beans.factory.config.PropertyPlaceholderConfigurer$PlaceholderResolvingStringValueResolver.resolveStringValue(PropertyPlaceholderConfigurer.java:258) 
    at org.springframework.beans.factory.support.AbstractBeanFactory.resolveEmbeddedValue(AbstractBeanFactory.java:813) 
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1076) 
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1056) 
    at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:566) 
    at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:88) 
    at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:349) 
    ... 20 common frames omitted 

(プロパティがロードされていないことのようです)私は私のjhipsterのWebアプリケーションIs there a way to integrate spring-batch-admin and spring-boot properly?で、次の応答を統合しようとしたが、私は次のエラーを取得します、私のjhipsterアプリケーションが起動しますが、私は得る:

リクエストURLを:http://localhost:8080/ リクエストメソッド:GET ステータスコード:403禁止

JhipsterアプリにSpringバッチ管理機能を統合するにはどうすればいいですか?

私のpomに次の依存関係を追加する必要がありますか?

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

春のブートバージョン:1.4.1.RELEASE Jhipsterバージョン:3.8.0

おかげ

答えて

0

あなたは春ブートを追加する必要はありません。 JHipsterはスプリングブートアプリケーションです。私がドキュメントに見ているのはspring-batch-adminですが、実際にはJHipsterスタックの一部でもあるSpring MVCを使ったWeb UIですが、JHipsterはAngelaJSを使ってクライアントとしてRESTサービスを利用しています。バッチ管理アプリを統合する際に問題があります。

あなた

リクエストURL:http://localhost:8080/要求メソッド:ステータスコードを取得:403それは、いくつかの http://localhost:8080/ので、あなたの承認に変更するとJHipsterアプリで通常のエントリポイントであることを示しを禁止。

解決策として、micro service approachを使用することをお勧めします。 spring-batch-adminのドキュメントには、RESTful(JSON)APIがあることが示されています。これはマイクロサービスアプリに完全に適合します。

+0

ありがとうduderoot – Vincent

+0

私はマイクロサービスアーキテクチャbuを使用すると考えていた私のjhipsterアプリ(私の顧客のjhipsterアプリ)はモノリシックなアプリです。 https://github.com/codecentric/spring-batch-admin-spring-bootの後に私は春のブートアプリケーションで春のバッチ管理を使用することができるので、私はそれがモノリシックアーキテクチャでjhipsterで使用することが可能だと思ったが、私は上記のエラーを取得します。アイデアやお薦めはありますか? – Vincent

+0

充実したサンプルプロジェクトを見て、私はspring-bootとの統合が主に埋め込みTomcatを使用していると言うことができます。私が見ているバネバッチ管理者は、バネバッチのUIです。このUiはAngularJSを使用しておらず、JHipsterはAngularJSを使用しています。ですから、REST APIがspring-batch-adminをポーランド語にしていることを見て、JHipster UIでそれらを消費しようとする必要があります。また、構成をオーバーライドしないように、バネ - バッチ - 管理を見ておく必要があります。承認、JHipsterのアプリ内のエントリポイント。おそらく、JHipsterとの統合をプラグインとして開始することができます。 – duderoot

関連する問題