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.

Is not possible build Spring Security: java.lang.IllegalStateException: Could not load file 'etc/nohttp/allowlist.lines'

See original GitHub issue

Describe the bug [Problem] Is not possible Build Spring Security

To Reproduce

In MacOS and Windows I have the following situation

I have STS 4.9.0.RELEASE for a workspace dedicated for Spring Security. And configured for Java 8 according with the Building from Source section.

Therefore for the IDE itself:

01

NOTE: From above - I removed the JRE 15 included in the IDE to avoid problems

02

03 0

Prior to import Spring Security I did

  • git clone
  • added remote repository
  • git fetch
  • git merge upstream/master

So I am sure I have the latest and stable code of the project

Then Spring Security is imported and furthermore to be sure, I change for the Spring Security project its JRE from 15 to 8 as follows:

03 5 1

03 5 2

And furthermore is mandatory fix the following:

Remove JRE 15 (I) 05

Remove JRE 15 (II) 06

Add JDK 8 (I) 07

Add JDK 8 (II) 08 0

The importation project was successful and configured fine to work with JDK 8.

Just in case I do the following:

08 5

Now according with the Building from Source section is time to execute ./gradlew install, therefore through the IDE

It works fine as follows:

09

10

11

12

Therefore all the required dependencies are downloaded and available.

Now according with the Building from Source section is time to execute ./gradlew build, therefore through the IDE

13

So the process starts:

14

But it fails with:

15

The message is:

Execution failed for task ':checkstyleNohttp'.
> java.lang.IllegalStateException: Could not load file 'etc/nohttp/allowlist.lines' 

16

The same happens in other Machine on Windows 10, with a dedicated and isolated workspace for Spring Security.

88

Expected behavior It should Build without any problem.

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
jzheauxcommented, Jan 27, 2021

What appears to be happening is Eclipse isn’t propagating the working directory through to the underlying NoHttpCheck Checkstyle task when running build -> checkstyleNohttp.

You can can configure the build Run Configuration in Eclipse to skip the checkstyleNohttp task. In Project -> Run Configurations, find or create a Gradle Task where the task is build. Then, in its Project Settings, add -xcheckstyleNohttp as a program argument.

You can then run checkstyleNoHttp separately.

1reaction
jzheauxcommented, Jan 21, 2021

Thanks for the report, @manueljordan. I was able to reproduce the error you described, and I will take a look.

In the meantime, it sounds like you have a workaround, which is to build from the terminal.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Spring Security Error: java.lang.IllegalStateException: Can't ...
In my case a legacy application I was upgrading had a line .anyRequest().authenticated() and another one .anyRequest().authenticated().and().
Read more >
Spring Security without the WebSecurityConfigurerAdapter
Configuring HttpSecurity. In Spring Security 5.4 we introduced the ability to configure HttpSecurity by creating a SecurityFilterChain bean.
Read more >
How to fix `Failed to load ApplicationContext` in Spring (Boot ...
When building Spring (Boot) applications, it's almost inevitable to be hit with the reliable Failed to load ApplicationContext exception.
Read more >
JWS + JWK in a Spring Security OAuth2 Application - Baeldung
Learn about JSON Web Signature, and how it can be implemented using the JSON Web Key specification on applications configured with Spring ......
Read more >
Spring Security and Keycloak to Secure Spring Boot - A First ...
yml ) file will not work. To overcome this problem, we need to define a KeycloakSpringBootConfigResolver bean explicitly in a @Configuration ...
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