I have followed the sample client tutorial from https://spring.io/guides/gs/consuming-web-service/ and I successfully built the project on my Windows 8 HP Elitebook laptop where I installed gradle 2.6.
The objective I have is to generate with JAXB objects in Java from web service endpoints and these are only accessible from an internal Linux server environment without Internet connections.
I have to build a web service consumer against 3 web services that reside in a VPN.
I have installed STS on a linux redhat 6 server and I connect to it via Xming and Putty successfully. I have installed gradle 2.6 (2.6_all.zip) on the linux server and i can run gradle build on the server. The server has no internet connectivity, so what I did was copy ./m2/repository and .gradle/ from my windows laptop to the linux server so that the local repositories are copied over.
I get the following error on running in a putty window:
[root@ukbilsvllib063 modeloffice-consuming-service]# gradle --refresh-dependencies --debug build
23:10:37.319 [ERROR] [org.gradle.BuildExceptionReporter]
23:10:37.322 [ERROR] [org.gradle.BuildExceptionReporter] FAILURE: Build failed with an exception.
23:10:37.325 [ERROR] [org.gradle.BuildExceptionReporter]
23:10:37.326 [ERROR] [org.gradle.BuildExceptionReporter] * What went wrong:
23:10:37.327 [ERROR] [org.gradle.BuildExceptionReporter] A problem occurred configuring root project ‘modeloffice-consuming-service’.
23:10:37.329 [ERROR] [org.gradle.BuildExceptionReporter] > Could not resolve all dependencies for configuration ‘:classpath’.
23:10:37.331 [ERROR] [org.gradle.BuildExceptionReporter] > Could not resolve org.springframework.boot:spring-boot-gradle-plugin:1.2.5.RELEASE.
23:10:37.332 [ERROR] [org.gradle.BuildExceptionReporter] Required by:
23:10:37.334 [ERROR] [org.gradle.BuildExceptionReporter] :modeloffice-consuming-service:unspecified
23:10:37.336 [ERROR] [org.gradle.BuildExceptionReporter] > Could not resolve org.springframework.boot:spring-boot-gradle-plugin:1.2.5.RELEASE.
23:10:37.337 [ERROR] [org.gradle.BuildExceptionReporter] > Could not get resource ‘https://repo1.maven.org/maven2/org/springframework/boot/spring-boot-gradle-plugin/1.2.5.RELEASE/spring-boot-gradle-plugin-1.2.5.RELEASE.pom’.
23:10:37.339 [ERROR] [org.gradle.BuildExceptionReporter] > Could not HEAD ‘https://repo1.maven.org/maven2/org/springframework/boot/spring-boot-gradle-plugin/1.2.5.RELEASE/spring-boot-gradle-plugin-1.2.5.RELEASE.pom’.
23:10:37.341 [ERROR] [org.gradle.BuildExceptionReporter] > repo1.maven.org: Temporary failure in name resolution
23:10:37.343 [ERROR] [org.gradle.BuildExceptionReporter] > Could not resolve io.spring.gradle:dependency-management-plugin:0.5.2.RELEASE.
23:10:37.344 [ERROR] [org.gradle.BuildExceptionReporter] Required by:
23:10:37.346 [ERROR] [org.gradle.BuildExceptionReporter] :modeloffice-consuming-service:unspecified
23:10:37.347 [ERROR] [org.gradle.BuildExceptionReporter] > Could not resolve io.spring.gradle:dependency-management-plugin:0.5.2.RELEASE.
23:10:37.349 [ERROR] [org.gradle.BuildExceptionReporter] > Could not get resource ‘https://repo1.maven.org/maven2/io/spring/gradle/dependency-management-plugin/0.5.2.RELEASE/dependency-management-plugin-0.5.2.RELEASE.pom’.
23:10:37.351 [ERROR] [org.gradle.BuildExceptionReporter] > Could not HEAD ‘https://repo1.maven.org/maven2/io/spring/gradle/dependency-management-plugin/0.5.2.RELEASE/dependency-management-plugin-0.5.2.RELEASE.pom’.
23:10:37.352 [ERROR] [org.gradle.BuildExceptionReporter] > repo1.maven.org
23:10:37.354 [ERROR] [org.gradle.BuildExceptionReporter] > Could not resolve org.springframework.ws:spring-ws-test:2.2.2.RELEASE.
23:10:37.356 [ERROR] [org.gradle.BuildExceptionReporter] Required by:
23:10:37.357 [ERROR] [org.gradle.BuildExceptionReporter] :modeloffice-consuming-service:unspecified
23:10:37.359 [ERROR] [org.gradle.BuildExceptionReporter] > Could not resolve org.springframework.ws:spring-ws-test:2.2.2.RELEASE.
23:10:37.360 [ERROR] [org.gradle.BuildExceptionReporter] > Could not get resource ‘https://repo1.maven.org/maven2/org/springframework/ws/spring-ws-test/2.2.2.RELEASE/spring-ws-test-2.2.2.RELEASE.pom’.
23:10:37.362 [ERROR] [org.gradle.BuildExceptionReporter] > Could not HEAD ‘https://repo1.maven.org/maven2/org/springframework/ws/spring-ws-test/2.2.2.RELEASE/spring-ws-test-2.2.2.RELEASE.pom’.
23:10:37.363 [ERROR] [org.gradle.BuildExceptionReporter] > repo1.maven.org
23:10:37.365 [ERROR] [org.gradle.BuildExceptionReporter]
23:10:37.366 [ERROR] [org.gradle.BuildExceptionReporter] * Try:
23:10:37.367 [ERROR] [org.gradle.BuildExceptionReporter] Run with --stacktrace option to get the stack trace.
23:10:37.370 [LIFECYCLE] [org.gradle.BuildResultLogger]
23:10:37.371 [LIFECYCLE] [org.gradle.BuildResultLogger] BUILD FAILED
23:10:37.373 [LIFECYCLE] [org.gradle.BuildResultLogger]
23:10:37.374 [LIFECYCLE] [org.gradle.BuildResultLogger] Total time: 1 mins 37.388 secs
23:10:37.379 [DEBUG] [org.gradle.cache.internal.DefaultCacheAccess] Cache Plugin Resolution Cache (/root/.gradle/caches/2.6/plugin-resolution) was closed 0 times.
23:10:37.382 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Releasing lock on cp_proj class cache for build file ‘/home/hpatcar/workspace/modeloffice-consuming-service/build.gradle’ (/root/.gradle/caches/2.6/scripts/build_aw09pmgzy3q4rrqwzpw5qr27e/cp_proj).
23:10:37.385 [DEBUG] [org.gradle.cache.internal.btree.BTreePersistentIndexedCache] Closing cache artifact-at-url.bin (/root/.gradle/caches/modules-2/metadata-2.15/artifact-at-url.bin)
23:10:37.386 [DEBUG] [org.gradle.cache.internal.btree.BTreePersistentIndexedCache] Closing cache module-metadata.bin (/root/.gradle/caches/modules-2/metadata-2.15/module-metadata.bin)
23:10:37.387 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Releasing lock on artifact cache (/root/.gradle/caches/modules-2).
23:10:37.389 [DEBUG] [org.gradle.api.internal.artifacts.ivyservice.ivyresolve.memcache.InMemoryCachedRepositoryFactory] In-memory dependency metadata cache closed. Repos cached: 1, cache instances: 1, modules served from cache: 0, artifacts: 0
23:10:37.390 [DEBUG] [org.gradle.api.internal.artifacts.ivyservice.resolveengine.store.CachedStoreFactory] Resolved configuration cache closed. Cache reads: 0, disk reads: 0 (avg: 0.0 secs, total: 0.0 secs)
23:10:37.391 [DEBUG] [org.gradle.api.internal.artifacts.ivyservice.resolveengine.store.CachedStoreFactory] Resolution result cache closed. Cache reads: 0, disk reads: 0 (avg: 0.0 secs, total: 0.0 secs)
23:10:37.392 [DEBUG] [org.gradle.api.internal.artifacts.ivyservice.resolveengine.store.ResolutionResultsStoreFactory] Deleted 2 resolution results binary files in 0.002 secs
[root@ukbilsvllib063 modeloffice-consuming-service]#
my gradle.build file is:
configurations {
jaxb
}
buildscript {
ext {
springBootVersion = ‘1.2.5.RELEASE’
}
repositories {
mavenCentral()
}
dependencies {
classpath(“org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}”)
classpath(“io.spring.gradle:dependency-management-plugin:0.5.2.RELEASE”)
classpath(“org.springframework.ws:spring-ws-test:2.2.2.RELEASE”)
}
}
apply plugin: 'java’
apply plugin: 'eclipse-wtp’
apply plugin: 'idea’
apply plugin: 'spring-boot’
apply plugin: 'io.spring.dependency-management’
apply plugin: ‘war’
war {
baseName = 'modeloffice’
version = ‘0.0.1-SNAPSHOT’
}
// tag::wsdl[]
task genJaxb {
ext.sourcesDir = "${buildDir}/generated-sources/jaxb"
ext.classesDir = "${buildDir}/classes/jaxb"
ext.schema = “http://30.185.15.16:8093/SOAPServiceBinding/productOptions/productOptions.wsdl”
outputs.dir classesDir
doLast() {
project.ant {
taskdef name: "xjc", classname: "com.sun.tools.xjc.XJCTask",
classpath: configurations.jaxb.asPath
mkdir(dir: sourcesDir)
mkdir(dir: classesDir)
repositories {
mavenCentral()
}
configurations {
providedRuntime
}
dependencies {
compile(“org.springframework.boot:spring-boot-starter”)
compile(“org.springframework.ws:spring-ws-core”)
compile(“org.springframework.ws:spring-ws-test”)
compile(“org.springframework.boot:spring-boot-starter-data-rest”)
compile(“org.springframework.boot:spring-boot-starter-web”)
compile(“org.springframework.boot:spring-boot-starter-ws”)
providedRuntime(“org.springframework.boot:spring-boot-starter-tomcat”)
testCompile(“org.springframework.boot:spring-boot-starter-test”)
compile(files(genJaxb.classesDir).builtBy(genJaxb))
jaxb "com.sun.xml.bind:jaxb-xjc:2.1.7"
}
jar {
from genJaxb.classesDir
}
eclipse {
classpath {
containers.remove(‘org.eclipse.jdt.launching.JRE_CONTAINER’)
containers ‘org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8’
}
}
task wrapper(type: Wrapper) {
gradleVersion = ‘2.3’
}
task afterEclipseImport {
dependsOn genJaxb
}
task showMeCache << {
configurations.compile.each { println it }
}
Can you tell me if I am doing something blatantly wrong here and what I could try to correct?