0

Может быть, вы могли бы помочь мне с этой проблемой:Весна Облако Angel.SR4 И Grails 3.0.9 Не работает

Я создаю проект Grails версию 3.0.10, и хочет, чтобы этот проект работать как Eureka Клиент. Я использую Spring Boot 1.3.1.RELEASE, и я пытаюсь использовать Spring Cloud Angel.SR4 Version.

У меня есть проект Java, который работает нормально, но при попытке применить зависимости и запускать мои Grails приложения это бросают некоторые проблемы:

это мой gradle.build файл, который я использую для моего проекта:

buildscript { 
 
    ext { 
 
     grailsVersion = project.grailsVersion 
 
\t \t // I have added this line 
 
\t \t springBootVersion = '1.3.1.RELEASE' 
 
    } 
 
    repositories { 
 
     mavenLocal() 
 
     maven { url "https://repo.grails.org/grails/core" } 
 
    } 
 
    dependencies { 
 
     classpath "org.grails:grails-gradle-plugin:$grailsVersion" 
 
     classpath "org.grails.plugins:hibernate:4.3.10.5" 
 
\t \t 
 
    } 
 
} 
 

 
plugins { 
 
    id "io.spring.dependency-management" version "0.4.2.RELEASE" 
 
} 
 

 
version "0.1" 
 
group "demograilsclient" 
 

 
apply plugin: "spring-boot" 
 
apply plugin: "war" 
 
apply plugin: 'eclipse' 
 
apply plugin: 'idea' 
 
apply plugin: "org.grails.grails-web" 
 

 
ext { 
 
    grailsVersion = project.grailsVersion 
 
    gradleWrapperVersion = project.gradleWrapperVersion 
 
} 
 

 
repositories { 
 
\t // I have added those two lines 
 
\t mavenCentral() 
 
\t jcenter() 
 
\t 
 
    mavenLocal() 
 
    maven { url "https://repo.grails.org/grails/core" } 
 
\t 
 
\t // I have added those two lines 
 
\t maven { url "https://repo.spring.io/snapshot" } 
 
\t maven { url "https://repo.spring.io/milestone" } 
 
} 
 

 
dependencyManagement { 
 
    imports { 
 
     mavenBom "org.grails:grails-bom:$grailsVersion" 
 
\t \t // I have added this line 
 
\t \t mavenBom 'org.springframework.cloud:spring-cloud-starter-parent:Angel.SR4' 
 
    } 
 
    applyMavenExclusions false 
 
} 
 

 
dependencies { 
 
\t 
 
\t // Spring cloud dependencies 
 
\t compile("org.springframework.cloud:spring-cloud-starter-config") 
 
\t compile("org.springframework.cloud:spring-cloud-starter-eureka") 
 
\t 
 
\t // not modified 
 
    compile "org.springframework.boot:spring-boot-starter-logging" 
 
    compile "org.springframework.boot:spring-boot-starter-actuator" 
 
    compile "org.springframework.boot:spring-boot-autoconfigure" 
 
    compile "org.springframework.boot:spring-boot-starter-tomcat" 
 
    compile "org.grails:grails-plugin-url-mappings" 
 
    compile "org.grails:grails-plugin-rest" 
 
    compile "org.grails:grails-plugin-interceptors" 
 
    compile "org.grails:grails-plugin-services" 
 
    compile "org.grails:grails-plugin-datasource" 
 
    compile "org.grails:grails-plugin-databinding" 
 
    compile "org.grails:grails-plugin-async" 
 
    compile "org.grails:grails-web-boot" 
 
    compile "org.grails:grails-logging" 
 

 
    compile "org.grails.plugins:hibernate" 
 
    compile "org.grails.plugins:cache" 
 
    compile "org.hibernate:hibernate-ehcache" 
 

 
    runtime "com.h2database:h2" 
 

 
    testCompile "org.grails:grails-plugin-testing" 
 
    testCompile "org.grails.plugins:geb" 
 

 
    console "org.grails:grails-console" 
 
} 
 

 
task wrapper(type: Wrapper) { 
 
    gradleVersion = gradleWrapperVersion 
 
}

И мой Application.yml является:

server: 
 
    port: 0 
 
    
 
info: 
 
    component: Grails App 
 
    
 
eureka: 
 
    instance: 
 
    lease-renewal-interval-in-seconds: 10 
 
    metadata-map: 
 
     instanceId: ${vcap.application.instance_id:${spring.application.name}:${spring.application.instance_id:${random.value}}} 
 
    client: 
 
    registry-fetch-interval-seconds: 5 
 
    service-url: 
 
     defaultZone: http://localhost:8761/eureka/ 
 

 
--- 
 

 

 

 
grails: 
 
    profile: web-api 
 
    codegen: 
 
     defaultPackage: demograilsclient 
 
info: 
 
    app: 
 
     name: '@[email protected]' 
 
     version: '@[email protected]' 
 
     grailsVersion: '@[email protected]' 
 
spring: 
 
    groovy: 
 
     template: 
 
      check-template-location: false 
 
    
 

 
..... 
 
... contine >>

И главный класс, используемый для платформы Grails, чтобы загрузить приложение, как это:

package demograilsclient 
 

 
import grails.boot.GrailsApp 
 
import grails.boot.config.GrailsAutoConfiguration 
 

 
import org.springframework.boot.autoconfigure.SpringBootApplication 
 
import org.springframework.cloud.netflix.eureka.EnableEurekaClient 
 

 

 
@SpringBootApplication 
 
@EnableEurekaClient 
 
class Application extends GrailsAutoConfiguration { 
 
    static void main(String[] args) { 
 
     GrailsApp.run(Application, args) 
 
    } 
 
}

и когда я исполню:

grails run-app

Это бросить следующее сообщение об ошибке:

FAILURE: Build failed with an exception. 
 

 
* What went wrong: 
 
Execution failed for task ':bootRun'. 
 
> A problem occurred starting process 'command 'C:\program files\Java\jdk1.8.0_6 
 
0\bin\java.exe'' 
 

 
* Try: 
 
Run with --stacktrace option to get the stack trace. Run with --info or --debug 
 
option to get more log output. 
 

 
BUILD FAILED 
 

 
Total time: 20.374 secs

Может быть, вы можете помочь мне,

Спасибо !!

+0

Можете ли вы запустить с опцией трассировки стека, чтобы получить след следа? –

ответ

1

Angel. * И Spring Boot 1.3.x несовместимы.

+0

Привет, spencergibb, Спасибо за ответ, вы знаете, могу ли я заставить это работать? Какая версия Spring Boot будет хорошо работать с Angel. * ?. Спасибо. –

+0

1.2.x ботинок будет работать. Brixton находится на M4 и совместим с весенним ботинком 1.3.x. Он выйдет в январе или феврале. – spencergibb

+0

Okey, но у меня есть Java-проект с Spring boot 1.3.1.RELEASE и Spring Cloud Angel.SR4, и он работает отлично. Я не знаю, какая версия Spring Boot использует мой проект Grails, версия, которую я использую для Grails, - 3.0.11. и когда я меняю Angel.SR4 на Brixton.M4 в grails. Это работает правильно. С другой стороны, когда я помещаю Angel.SR4, это не работает. –