Comments (17)
Did you start from the initial configuration and copy-and-paste bits from the guide or did you start with the completed section?
from gs-rest-service.
@gregturn I followed this guide http://spring.io/guides/gs/rest-service/ step by step, created the folders, copy-and-paste the java code, until successfully I ran "mvn clean package", but the last step was failed when I ran "java -jar target/gs-rest-service-0.1.0.jar". I was using jdk 1.8.0_77.
from gs-rest-service.
@gregturn I've tried another guide http://spring.io/guides/gs/messaging-rabbitmq/ in the same environment as the previous one, I got the jar file, but it didn't work successfully either.It almost drives me crazy. I just want to figure one of them out, just one, buddy, then the others would be easier. So please help me.
from gs-rest-service.
@gregturn BTW, I love spring so much, and the guides listed on the index page are amazing, even though I haven't succeeded in the first one, but thank you guys anyway.
from gs-rest-service.
Switched to the "complete" version and run that see if it works.
from gs-rest-service.
@gregturn Yeah, I've already switched to the "complete" version and it ran perfectly, I've been trying to find the difference.
from gs-rest-service.
@only-gale Would you be willing to push your copy that doesn't work to a separate place in github so I can peek at it?
from gs-rest-service.
sorry,what is "complete"? I have a similar problem with you.
ide: eclipse jdk:1.8 maven:3.5.2
from gs-rest-service.
This guide like many others has two folders, initial and complete. Complete one has all the code for the solution.
from gs-rest-service.
Hi!
I had troubles with this guide as well, after few tries the best way to deal with this was to remove:
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>1.5.8.RELEASE</version>
</parent>
from pom.xml. As the consequence maven will download some additional libraries.
Basically the root cause is difference between used spring versions.
My first attempt was to remove versions from each of the spring dependency after which the project started to work UNTIL I invalidated Cache and restarted my Intellij.
So far everything is working for me now.
Edit: I also moved the java files into separated package instead of my original src-main-java folder
from gs-rest-service.
Hi guys, as someone who has the same issue, can you please share any information if you got this solved?
email : [email protected]
from gs-rest-service.
Hi Guys,
I am having a problem running the Spring Rest Service Tutorial... gs-rest-service
(See: "https://spring.io/guides/gs/rest-service/")
There appears to be issues around mapping Java/JSON.
The error I get is...
"No converter found for return value of type: class hello.Greeting"
The URL I'm using...
"http://localhost:8080/greeting?name=User"
I'm running the app from within STS as...
"Spring Boot App"
My environment is:
- Windows 7
- Java 8 (1.8.0_144)
- Maven 3.5.2
- Spring Tool Suite Version: 3.9.1.RELEASE ( Platform: Eclipse Oxygen.1a (4.7.1a) )
It happens with both the self-built "gs-rest-service-initial" and the completed version "gs-rest-service-complete"
These are things I've already checked after reading other peoples suggestions...
- Yes, the Greeting does have getters
- The jackson databind, annotaions and core libraries are present (all at version 2.8.10)
- I tried commenting out the org.springframework.boot in the pom.xml but it made it worse
- I also tried restarting STS but it had no effect
I also tied exporting it as a jar to run outside of STS but I got all kinds of issues but that may have been my "jar-ing"
I did an export as runnable jar with the option "Package required libraries into generated jar"
Anyone have any ideas?
Thanks
from gs-rest-service.
If you put your Application.java in the default package, that might be the reason.
from gs-rest-service.
The guide leaves a few crucial details unclear to those of us only vaguely familiar with gradle and the OSX terminal. These comments are based on the directions provided in the "Building a RESTful Web service" guide - https://spring.io/guides/gs/rest-service/
If you get the error "Main class name has not been configured and it could not be resolved", run "gradle bootRun --info" from the "hello" directory and check the "Task:CompileJava" section to ensure you have everything in the correct directories (described below).
- The initial gradle build file (build.gradle) should be placed in the eclipse-workspace folder, NOT the source/main/java/hello folder.
- The Greeting.java, GreetingController.java and Application.java files should be placed, as indicated, in the source/main/java/hello. They do not need to be compiled (and compilation will fail for GreetingController.java and Application.java).
- run "gradle build" from the eclipse-workspace folder - it will create the gs-rest-service-0.1.0.jar in eclipse-workspace/build/libs.
- from the eclipse-workspace folder, run "java -jar build/libs/gs-rest-service-0.1.0.jar". After some messages, the service is up and running. You can proceed to http://localhost:8080/greeting to test the results.
from gs-rest-service.
I'm having problems with this guide too. Over and over again it has been saying that I do not have a main method defined. I removed one of the default plugins that the original POM file came with and now I am getting an error that says that an exception occurred while running.
from gs-rest-service.
Update: I tried this again using their version with the complete Maven build, and it did not work for me when I tried to use ./mvnw spring-boot:run
I was able to build the jar file but then when I tried to run the jar file... nada.
I'm just gonna move on to another guide. I don't know what I'm doing wrong.
from gs-rest-service.
This is now a collection of many different gripes and user errors. No-one so far has provided any steps to reproduce their problem or sample projects. I'm going to close this issue. Please open a new one if you have trouble building the samples in the guide (and be sure to check out the code and run it from the "complete" sample).
from gs-rest-service.
Related Issues (20)
- Send dynamic JSON HOT 1
- Example code includes broken on production GS site! HOT 1
- Rest Service guide is missing source code for RestServiceApplication.java HOT 5
- Getting Whitelabel Error Page with status "404" While running Spring Boot Application HOT 2
- Application finishing & exiting immediately HOT 1
- complete and initial samples have duplicated project name HOT 1
- pom.xml is not xml?!
- Aprender Sprin boot
- https://github.com/spring-guides/gs-rest-service.git HOT 3
- Plugin 'jetty' not found with gradle
- Upgrade Spring Boot to the latest version HOT 2
- Update Spring Boot version HOT 1
- Jackson links in README need updating
- complete version seems to missing bean validator implementation HOT 1
- Cannot GET /greeting when running the complete folder
- Session "Build with Maven" doesn't expand when clicked on Firefox HOT 1
- HTTP 404 Status with spring boot 1.5.17.RELEASE HOT 1
- Caused by: java.lang.ClassNotFoundException: org.springframework.data.repository.CrudRepository HOT 1
- java.lang.IllegalStateException: Unable to find a @SpringBootConfiguration HOT 4
- What is the usage of initial directory? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gs-rest-service.