9

JSONException: A JSONObject text must begin with { at character 0

I used spring-tool-suite-3.9.1.RELEASE-e4.7.1a-win32-x86_64, why can't I create a project directly in File->New->Spring Starter Project

I got the screenshot below.

enter image description here

Nemus
  • 3,879
  • 12
  • 38
  • 57
董嘉鹏
  • 91
  • 1
  • 1
  • 2
  • Spring tool suite is good. But I find Intellij .idea is more powerful and handy while developing Spring Project. – Saikat1529 Nov 20 '17 at 11:05
  • too expensive...... student lack of money – 董嘉鹏 Nov 20 '17 at 11:09
  • Looks like a bug or maybe you will need a proxy for the connection. – Patrick Nov 20 '17 at 12:36
  • You are a student, hence can get a [free copy of IntelliJ](https://www.jetbrains.com/student/)... So what is expensive about that? – M. Deinum Nov 20 '17 at 12:43
  • Thank you so much. I have not heard about this before. I have just got my licence from JetBeans.com and am looking forward to this new ide. Hope that this problem will not happen this time. – 董嘉鹏 Nov 20 '17 at 14:57

9 Answers9

37

It may be late, but others might find it useful. I faced the same issue when I was trying to create a project in eclipse using Spring Starter Project.

What I did was change the Service Url from http://start.spring.io/ to https://start.spring.io/. I just changed the http to https and it worked. I don't know if it is a security related error or what, but I was able to create a project.

Lauren Rutledge
  • 1,195
  • 5
  • 18
  • 27
Sree
  • 391
  • 3
  • 6
6

This is what I did:

  1. In eclipse go to -> window -> preferences -> General -> Network Connections.
  2. In Network Connections, select 'Direct' for Active Provider. And click Apply.
  3. Now try creating spring starter project with - https://start.spring.io/ url.

image

Community
  • 1
  • 1
5

Edit the URL to https://start.spring.io instead of http://start.spring.io (HTTP ⟶ HTTP/S).

Toby Speight
  • 27,591
  • 48
  • 66
  • 103
sunil maurya
  • 51
  • 1
  • 1
3

This looks like a connection problem with start.spring.io (or a proxy in between your machine and start.spring.io) - or a temporary problem on start.spring.io.

If this problem persists, you can easily workaround it by using your browser, go to http://start.spring.io, select the boot modules you would like to use, and download a ZIP of the project. Then unpack it locally and import it using "Import -> Maven -> Import as Existing Maven Project" into STS.

Martin Lippert
  • 5,988
  • 1
  • 15
  • 18
1
  • Go to http://start.spring.io/ and generate the project there; pull down the zip and extract into a folder (preferably with the top-most dir being the same as the Artifact)
  • Import the project

That worked for me ....

Isaac Riley
  • 290
  • 4
  • 5
1

Changing the URL from http://start.spring.io to https://start.spring.io works for me .

In my case, I am in a corporate, and for that first you need to set up the proxy in the eclipse IDE; only then will it work.

Toby Speight
  • 27,591
  • 48
  • 66
  • 103
  • Though we thank you for your answer, it would be better if it provided additional value on top of the other answers. In this case, your answer does not provide additional value, since another user already posted that solution. If a previous answer was helpful to you, you should vote it up instead of repeating the same information. – Toby Speight Feb 12 '20 at 11:24
  • Thanks I will make sure of it from next time thank you for helping me out. – sandeepnegi1996 Feb 13 '20 at 07:03
  • Hi @TobySpeight but I did mentioned that if you are inside the corporate you need to first go and set the proxy for the particular user since it can be really problematic like in my case – sandeepnegi1996 Apr 20 '20 at 05:20
0

just do the eclipse update . in eclipse menu: Help>> Check for update , accept and install .

B.Nbl
  • 556
  • 1
  • 5
  • 7
0

I had this same issue. Just connect to internet first and restart the STS.

The inbuilt wizard uses internet web service to work. See if this works for you!

mantri
  • 3,031
  • 4
  • 16
  • 19
0

Maybe it's too late but I solved it adding -Djavax.net.ssl.trustStore=/home/[user]/.sdkman/candidates/java/11.0.6-zulu/lib/security/cacerts line to STS.ini. I hope you can solve it too

  • Hi, can you please elaborate a bit on your answer? It appears not obvious why a JSON parsing error occurs due to the lack of ca certificates, especially why the specific ones that you mention are needed. – Richard Kiefer Apr 11 '20 at 11:42