question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Strange behavior of STS 4.9.0 with Spring Security importation and Gradle synchronization

See original GitHub issue

Please consider this how a strange situation, not sure if is a bug

I spent some days trying to find a solution and nothing. I do not post this in StackOverflow because is not a specific technical question and is a perfect candidate to be closed quickly by its moderators

I have STS 4.9.0 installed in

  • Mac (El Capitan)
  • Windows 10

Both PCs have the same configuration, about JDK versions (8,11,15 - included STS) and all plugins (all of them currently updated)

Practically for each project, I create a dedicated workspace, for example, one for Spring Integration, Spring Boot, Hazelcast etc … it for custom isolation for the local repositories.

Now, something important, I only have one STS installation and each workspace is started through command with:

$STS_HOME/SpringToolSuite4.app/Contents/MacOS/SpringToolSuite4 -data ${WORKSPACE_DIRECTORY} -vmargs -Xms512M -Xmx4G

Two weeks ago, I cloned and imported the Spring Security project (based on Gradle) into STS - for contribution purposes, it worked in peace for short time, but suddenly it stop to work, it does not open as is expected anymore. Even when I deleted the workspace directory (goodbye .metadata directory and the project itself) and repeat all the steps for importation purposes:

  • create new workspace
  • git clone
  • git remote add REMOTE_URL
  • git fetch upstream
  • git merge upstream/master

happens the following:

It loads as follows (does not show each sub module)

01

If I delete the project from the workspace as follows:

02

03

Therefore the workspace is empty, as follows:

04

So, if I close and open the IDE loads as follows, shows the sub modules but not how should be (Figure Alpha):

05

If I do the following (it after to be built the project by the console/terminal)

  • Gradle -> Refresh Gradle Project

06

Arises the following error:

07

08

Note: I reported this error to Buildship, but now here, because in Windows all work fine

And then the project structure changes as follows: (btw - compare against Alpha):

09

If I again do Gradle -> Refresh Gradle Project happens again

10

Now, Spring Security asks for Java 8 and the STS comes with JDK 15. In the previous figures, for the imported project, it always has itsJRE System Library by default pointing to 15, even having the STS configured to work with JDK 8 (figures about this later). Therefore from the beginning and always (even in Windows) the imported project has/targets to JRE 15 by default.

Observation: (delta scenario) something interesting, if create a new workspace from the scratch, and prior to import the project, I delete the included JDK 15, with the importation and with Gradle -> Refresh Gradle Project, all happens again about the error, and the imported tries to refer the JDK 15 (shows an error because does not exist - it was deleted)

My IDE global or Preferences configuration for Java 8 is as follows (here JDK 15 exists, but is ignored)

11

12

13

So, after to import the project, I change all manually from JDK 15 to 8 as follows:

14

15

16

17

18

19

So, if in this point If I do again Gradle -> Refresh Gradle Project appears the message error, and the project refers again to JDK 15, so the previous configurations from JDK 15 to 8 are totally reseted - even if the delta scenario was applied or not.

So:

  • Why the project always tries to refer to JDK 15?, even if was deleted prior to import the project.
  • Why appears that error message when Gradle tries to synchronize? and how to fix it?

Note this problem happened suddenly I am absolutely sure that I did not do an update to the Buildship plugin. And like I said, all work (for the moment) in Windows 10

Note I execute all the Gradle tasks commands by console/terminal because I am able to apply later (.gradlew --stop). STS creates its own Gradle Daemons that only appears with the jps command, I am going to create other issue about this to ask for that STS includes a new view to show its own Gradle Daemons and let the developer to stop it.

Your experience and guidance is extremely valuable.

Thanks for your understanding

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:6 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
martinlippertcommented, Feb 18, 2021

@manueljordan First of all, thanks for sharing all the details here with the community and glad to hear that you found a way to make this work again. I am also wondering why the presence of the spring-javaformat plugin causes this, so will need to do a bit of investigation on this.

0reactions
manueljordancommented, Feb 18, 2021

Hi @martinlippert , remember I got an error from the beginning with the creation/importation of that project for a new and custom workspace, then I installed the plugin thinking that was mandatory. But that did not work. The details are in that link.

Thanks for the support in advance.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Classpath issue with OSGI Resources in STS 4.9.0
It was a chain of dependencies that led to this strange behavior: In my STS I have installed the Jaspersoft Studio.
Read more >
Synchronize Gradle projects with workspace failed due to an ...
I'm trying to create a new Spring Starter Project but at the end of the procedure I've this error: "Synchronize Gradle projects with ......
Read more >
Bug List
getService(BundleContext, Class<T>) supports bad OSGi behavior, 2022-01-25 ... Strange error message while updating a plugin from Eclipse Marketplace in ...
Read more >
Chapter 9. Issues Resolved in Fuse 7.0
Sync weaving behavior between root and child instances ... Adapt karaf.webconsole package-imports/exports to felix.webconsole all-in-one bundle.
Read more >
Search Results - CVE
A cross-site request forgery (CSRF) vulnerability in Jenkins Security Inspector Plugin 117.v6eecc36919c2 and earlier allows attackers to replace the generated ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found