rohitghatol / spring-boot-microservices

Spring Boot Template for Micro services Architecture - Show cases how to use Zuul for API Gateway, Spring OAuth 2.0 as Auth Server, Multiple Resource (Web Services) Servers, Angular Web App, Eureka dor registration and Discover and Hystrix for circuit breaker
Apache License 2.0
1.76k stars 919 forks source link

Unable to run the project #8

Open lduparc opened 8 years ago

lduparc commented 8 years ago

Hi,

I'm trying to run the project with SpringBoot 1.3.0.BUILD-SNAPSHOT and docker. However, I encounter an issue with docker images 'anilallewar/xxxx' .

➜  spring-boot-microservices git:(master) ✗ docker run -d --name config-server -p 8888:8888 anilallewar/config-server
Unable to find image 'anilallewar/config-server:latest' locally
Pulling repository docker.io/anilallewar/config-server
Error: image anilallewar/config-server:latest not found
➜  spring-boot-microservices git:(master) ✗

When I want to build all subprojects with the command line :

./build-all-projects.sh
Erreur : impossible de trouver ou charger la classe principale org.gradle.wrapper.GradleWrapperMain
Erreur : impossible de trouver ou charger la classe principale org.gradle.wrapper.GradleWrapperMain

FAILURE: Build failed with an exception.

* Where:
Build file '/Users/xxxx/Projects/API/spring-boot-microservices/config-server/build.gradle' line: 43

* What went wrong:
A problem occurred evaluating root project 'config-server'.
> No such property: mainClassName for class: org.gradle.api.internal.project.DefaultProject_Decorated

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

BUILD FAILED

No such property: mainClassName for class: org.gradle.api.internal.project.DefaultProject_Decorated

Can you give me the keys in order to run the project with docker ?

Thanks

azarudeen90 commented 8 years ago

Before runing the build-all scripts. Add a line to create the wrapper jars to be added in your system.

gradle wrapper

Dior222 commented 8 years ago

Hi, I'm running your project, and I had the following problem.

错误: 找不到或无法加载主类 org.gradle.wrapper.GradleWrapperMain

I'm on Mac OS , and I've already installed gradle

annbigbig commented 8 years ago

Hi Dior222 I encountered the same problem with you , I have also installed gradle on my Linux machine, then I changed the build-all-projects.sh , insert 'gradle wrapper' command before each './gradlew clean build' like this

#!/bin/sh

cd api-gateway; gradle wrapper; ./gradlew clean build; cd ..
cd auth-server; gradle wrapper; ./gradlew clean build; cd ..
cd config-server; gradle wrapper; ./gradlew clean build; cd ..
cd task-webservice; gradle wrapper; ./gradlew clean build; cd ..
cd user-webservice; gradle wrapper; ./gradlew clean build; cd ..
cd web-portal; gradle wrapper; ./gradlew clean build; cd ..
cd webservice-registry; gradle wrapper; ./gradlew clean build; cd ..
cd comments-webservice; gradle wrapper; ./gradlew clean build; cd ..

then try to execute build-all-projects.sh again it's working for me, although I don't understand the tech detail.

tianyi2013 commented 8 years ago

The problem is that most of the projects' gradle/wrapper folder does not contain a gradle-wrapper jar. Copy that across and it builds fine.