2017-01-01 1 views
1

Ich benutze jhipster und ich möchte Feder Batch Admin-Konsole in meinem Webapp integrieren.Wie zu integrieren Feder Batch Admin Konsole

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 

Wenn ich hart Code dieser Eigenschaften zum Testen (http://localhost:8080/batch-console zum Beispiel)

Ich habe versucht, die folgende Antwort in meinem jhipster Webapp zu integrieren Is there a way to integrate spring-batch-admin and spring-boot properly? aber ich bekomme die folgende Fehlermeldung (nicht geladen werden Eigenschaften scheinen) , meine jhipster Anwendung startet, aber ich erhalte:

Anforderungs-URL: http://localhost:8080/ anfordern Methode: Den Status Code: 403 Verbote

Was muss ich tun, um Spring Batch Admin in meiner Zhipster App zu integrieren?

Muss ich die folgende Abhängigkeit zu meinem Pom hinzufügen?

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

Frühling Boot-Version: 1.4.1.RELEASE Jhipster Version: 3.8.0

Dank

Antwort

0

Sie müssen keine Feder-boot hinzuzufügen. JHipster ist eine Spring-Boot-App. Wie für spring-batch-admin für was ich in der Dokumentation sehe, ist eine Web-UI mit Spring MVC, die tatsächlich auch ein Teil des JHipster-Stack ist, aber JHipster verwendet als Client eine einzelne Seite App mit AngularJS, die REST-Dienste verbraucht, dh Sie können Probleme bei der Integration Ihrer Batch-Admin-App haben.

Ihre

Anforderungs-URL: http://localhost:8080/ anfordern Methode: Status Code: 403 Verbote zeigt es, dass es seit http://localhost:8080/ einige Wechseln bei Ihrer Genehmigung ist der normale Eintrittspunkt in einer JHipster App.

Als Lösung empfehle ich diezu verwenden. Die Dokumentation von spring-batch-admin zeigt an, dass es eine RESTful (JSON) API gibt. Dies passt perfekt in die Micro Services App.

+0

Danke duderoot – Vincent

+0

Ich dachte über Microservice Architektur bu meine Zhipster App (Zhipster App meines Kunden) ist eine monolithische App. Nach https://github.com/codecentric/spring-batch-admin-spring-boot kann ich Spring Batch Admin mit Spring Boot App verwenden, also dachte ich, es war möglich, es mit Zhipster in einer monolithischen Architektur zu benutzen, aber ich Bekomme die oben erwähnten Fehler. Hast du eine Idee/Empfehlung? – Vincent

+0

Nach einem Blick auf das überarbeitete expample-Projekt kann ich sagen, dass die Integration mit Spring-Boot hauptsächlich mit einem eingebetteten Tomcat erfolgte. Der Frühling-Batch-Admin von dem, was ich sehe, ist ein Ui für Frühling-Batch. Dieses UI verwendet nicht AngularJS und JHipster UI verwendet AngularJS. Daher müssen Sie einen Blick darauf werfen, welche REST-API Spring-Batch-Admin verwendet und versuchen, sie in JHipster zu konsumieren. Sie müssen sich auch Spring-Batch-Admin ansehen, um die Konfiguration nicht zu übersteuern, z. Autorisierung, Einstiegspunkt in der App von JHipster. Vielleicht könntest du die Integration mit JHipster als Plugin starten. – duderoot

Verwandte Themen