Skip to content

Spring Security fails in Windows 10 with Caused by: java.lang.ClassNotFoundException: sun.reflect.Reflection #9412

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
manueljordan opened this issue Feb 8, 2021 · 5 comments
Assignees
Labels
in: build An issue in the build status: declined A suggestion or change that we don't feel we should currently apply

Comments

@manueljordan
Copy link

Today (07 Feb 2021) in Windows 10 I cloned Spring Security and then:

  • git remote add upstream URL
  • git fetch upstream
  • git merge upstream/master

In the Terminal

> java -version
openjdk version "1.8.0_275"
OpenJDK Runtime Environment (AdoptOpenJDK)(build 1.8.0_275-b01)
OpenJDK 64-Bit Server VM (AdoptOpenJDK)(build 25.275-b01, mixed mode)

> javac -version
javac 1.8.0_275

And then:

  • gradlew.bat install
  • gradlew.bat build

The first passes well, but for the second always fails with:

FAILURE: Build completed with 2 failures.

1: Task failed with an exception.
-----------
* What went wrong:
Execution failed for task ':spring-security-itest-ldap-embedded-apacheds-default:integrationTest'.
> There were failing tests. See the report at: file:///C:/blueroom/sts-workspace-spring-security/spring-security/itest/ldap/embedded-ldap-apacheds-default/build/reports/tests/integrationTest/index.html

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

2: Task failed with an exception.
-----------
* What went wrong:
Execution failed for task ':spring-security-itest-ldap-embedded-mode-apacheds:integrationTest'.
> There were failing tests. See the report at: file:///C:/blueroom/sts-workspace-spring-security/spring-security/itest/ldap/embedded-ldap-mode-apacheds/build/reports/tests/integrationTest/index.html

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

* Get more help at https://help.gradle.org

Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/6.6.1/userguide/command_line_interface.html#sec:command_line_warnings

BUILD FAILED in 3m 41s
321 actionable tasks: 27 executed, 294 up-to-date

About the Test report, for the org.springframework.security.LdapServerBeanDefinitionParserTests class and for the apacheDirectoryServerIsStartedByDefault method shows:

org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.security.apacheDirectoryServerContainer': Invocation of init method failed; nested exception is java.lang.NoClassDefFoundError: sun/reflect/Reflection
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1788)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:609)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:531)
	at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:335)
	at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234)
	at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:333)
	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:208)
	at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:944)
	at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:923)
	at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:588)
	at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:144)
	at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:85)
	at org.springframework.security.LdapServerBeanDefinitionParserTests.setup(LdapServerBeanDefinitionParserTests.java:38)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
	at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
	at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
	at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
	at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:24)
	at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27)
	at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)
	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57)
	at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
	at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
	at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
	at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
	at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
	at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
	at org.gradle.api.internal.tasks.testing.junit.JUnitTestClassExecutor.runTestClass(JUnitTestClassExecutor.java:110)
	at org.gradle.api.internal.tasks.testing.junit.JUnitTestClassExecutor.execute(JUnitTestClassExecutor.java:58)
	at org.gradle.api.internal.tasks.testing.junit.JUnitTestClassExecutor.execute(JUnitTestClassExecutor.java:38)
	at org.gradle.api.internal.tasks.testing.junit.AbstractJUnitTestClassProcessor.processTestClass(AbstractJUnitTestClassProcessor.java:62)
	at org.gradle.api.internal.tasks.testing.SuiteTestClassProcessor.processTestClass(SuiteTestClassProcessor.java:51)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
	at org.gradle.internal.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:36)
	at org.gradle.internal.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:24)
	at org.gradle.internal.dispatch.ContextClassLoaderDispatch.dispatch(ContextClassLoaderDispatch.java:33)
	at org.gradle.internal.dispatch.ProxyDispatchAdapter$DispatchingInvocationHandler.invoke(ProxyDispatchAdapter.java:94)
	at com.sun.proxy.$Proxy2.processTestClass(Unknown Source)
	at org.gradle.api.internal.tasks.testing.worker.TestWorker.processTestClass(TestWorker.java:119)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
	at org.gradle.internal.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:36)
	at org.gradle.internal.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:24)
	at org.gradle.internal.remote.internal.hub.MessageHubBackedObjectConnection$DispatchWrapper.dispatch(MessageHubBackedObjectConnection.java:182)
	at org.gradle.internal.remote.internal.hub.MessageHubBackedObjectConnection$DispatchWrapper.dispatch(MessageHubBackedObjectConnection.java:164)
	at org.gradle.internal.remote.internal.hub.MessageHub$Handler.run(MessageHub.java:414)
	at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:64)
	at org.gradle.internal.concurrent.ManagedExecutorImpl$1.run(ManagedExecutorImpl.java:48)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
	at org.gradle.internal.concurrent.ThreadFactoryImpl$ManagedThreadRunnable.run(ThreadFactoryImpl.java:56)
	at java.base/java.lang.Thread.run(Thread.java:834)
Caused by: java.lang.NoClassDefFoundError: sun/reflect/Reflection
	at org.apache.directory.server.core.avltree.ArrayMarshaller.deserialize(ArrayMarshaller.java:153)
	at org.apache.directory.server.core.avltree.ArrayMarshaller.deserialize(ArrayMarshaller.java:43)
	at org.apache.directory.server.core.partition.impl.btree.jdbm.JdbmTable.getDupsContainer(JdbmTable.java:988)
	at org.apache.directory.server.core.partition.impl.btree.jdbm.JdbmTable.get(JdbmTable.java:382)
	at org.apache.directory.server.core.partition.impl.btree.jdbm.JdbmIndex.forwardLookup(JdbmIndex.java:436)
	at org.apache.directory.server.core.partition.impl.btree.jdbm.JdbmStore.getEntryId(JdbmStore.java:904)
	at org.apache.directory.server.xdbm.search.impl.DefaultSearchEngine.cursor(DefaultSearchEngine.java:99)
	at org.apache.directory.server.core.partition.impl.btree.BTreePartition.search(BTreePartition.java:243)
	at org.apache.directory.server.core.schema.SchemaPartitionDao.listSchemas(SchemaPartitionDao.java:208)
	at org.apache.directory.server.core.schema.SchemaPartitionDao.getSchemas(SchemaPartitionDao.java:168)
	at org.apache.directory.server.core.DefaultDirectoryService.initialize(DefaultDirectoryService.java:1548)
	at org.apache.directory.server.core.DefaultDirectoryService.startup(DefaultDirectoryService.java:971)
	at org.springframework.security.ldap.server.ApacheDSContainer.start(ApacheDSContainer.java:236)
	at org.springframework.security.ldap.server.ApacheDSContainer.afterPropertiesSet(ApacheDSContainer.java:155)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1847)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1784)
	... 60 more
Caused by: java.lang.ClassNotFoundException: sun.reflect.Reflection
	at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:581)
	at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178)
	at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:522)
	... 76 more

According with the README.adoc I must use Java 8, but it arises:

Caused by: java.lang.ClassNotFoundException: sun.reflect.Reflection

What is wrong?

@manueljordan manueljordan added status: waiting-for-triage An issue we've not yet triaged type: bug A general bug labels Feb 8, 2021
@jzheaux jzheaux self-assigned this Feb 8, 2021
@jzheaux jzheaux added in: build An issue in the build and removed status: waiting-for-triage An issue we've not yet triaged labels Feb 8, 2021
@jzheaux
Copy link
Contributor

jzheaux commented Feb 8, 2021

@manueljordan, our CI builds against JDK 8 and it passes. Building with JDK 11 will give you the error that you are reporting. sun.reflect.Reflection is on the JDK 8 classpath, so I'm left to wonder whether or not there is some way your Gradle runtime is using a different JDK version.

@jzheaux jzheaux added the status: waiting-for-feedback We need additional information before we can continue label Feb 8, 2021
@manueljordan
Copy link
Author

manueljordan commented Feb 8, 2021

I thought the same, but how I indicated in the same tab of the terminal I changed Java to 8 and both java[c] --version shows Java 8

so I'm left to wonder whether or not there is some way your Gradle runtime is using a different JDK version

How that would be possible? I am using the Gradle wrapper and according with:

contains:

distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.6.1-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists

I don't see a direct or indirect reference to JAVA_HOME. Of course, my OS has the JAVA_HOME defined how an environment variable to Java 11, it to be used for other tools in my machine, but for a specific tab/terminal with

  • set PATH=c:\mypath\Java\jdk1.8.0_###\bin;%PATH%

I change from JDK 11 to 8, sojava[c] --version shows Java 8.

@manueljordan
Copy link
Author

manueljordan commented Feb 8, 2021

BTW really I did do:

echo %M2_REPO%
set M2_REPO=C:\whiteroom\apache\maven\repository\sts-workspace-spring-security\spring-security
echo %GRADLE_USER_HOME%
set GRADLE_USER_HOME=C:\whiteroom\gradle\repository\sts-workspace-spring-security\spring-security

So for any task the following structure/template works: gradlew.bat anyTask -Dmaven.repo.local=$M2_REPO

I can confirm all the dependencies go to each custom path to Gradle and Maven local repository

I use this approach in Mac (adapted to its environment syntax) and builds well

For example:

echo $M2_REPO
export M2_REPO=/Users/manueljordan/whiteroom/apache/maven/repository/sts-workspace-spring-security/spring security
echo $GRADLE_USER_HOME
export GRADLE_USER_HOME=/Users/manueljordan/whiteroom/gradle/repository/sts-workspace-spring-security/spring-security

observe is used export instead of set. Even if in windows in the terminal I write the bash command to load the git console (and define the path how in Mac - how export and not set) it happens the same behaviour

@spring-projects-issues spring-projects-issues added status: feedback-provided Feedback has been provided and removed status: waiting-for-feedback We need additional information before we can continue labels Feb 8, 2021
@manueljordan
Copy link
Author

I solved this using the following approach:

set JAVA_HOME=C:\whiteroom\java\openjdk\jdk8u275-b01
set PATH=%JAVA_HOME%\bin;%PATH%

changing and using the JAVA_HOME explicitly. Compare against: set PATH=c:\mypath\Java\jdk1.8.0_###\bin;%PATH% where the location was set directy (JAVA_HOME) was not involved. Ok, that error does not appear anymore. But I have others.

> Task :spring-security-samples-boot-oauth2resourceserver-opaque:integrationTest
2021-02-09 09:25:43.378  INFO 11960 --- [extShutdownHook] o.s.s.concurrent.ThreadPoolTaskExecutor  : Shutting down ExecutorService 'applicationTaskExecutor'

> Task :spring-security-samples-boot-oauth2webclient-webflux:test

sample.OAuth2WebClientControllerTests > implicitWhenAuthenticatedThenUsesDefaultRegistration FAILED
    java.lang.IllegalStateException at OAuth2WebClientControllerTests.java:69

> Task :spring-security-samples-boot-oauth2webclient:test
2021-02-09 09:26:04.142  INFO 20520 --- [extShutdownHook] o.s.s.concurrent.ThreadPoolTaskExecutor  : Shutting down ExecutorService 'applicationTaskExecutor'
2021-02-09 09:26:04.142  INFO 20520 --- [extShutdownHook] o.s.s.concurrent.ThreadPoolTaskExecutor  : Shutting down ExecutorService 'applicationTaskExecutor'

> Task :spring-security-samples-boot-oauth2webclient-webflux:test FAILED

9 tests completed, 1 failed

> Task :spring-security-samples-boot-oauth2webclient:test
2021-02-09 09:26:06.258  INFO 20520 --- [extShutdownHook] o.s.s.concurrent.ThreadPoolTaskExecutor  : Shutting down ExecutorService 'applicationTaskExecutor'

> Task :spring-security-samples-boot-saml2login:integrationTest
2021-02-09 09:26:11.969  INFO 388 --- [extShutdownHook] o.s.s.concurrent.ThreadPoolTaskExecutor  : Shutting down ExecutorService 'applicationTaskExecutor'
09:26:38.356 [scheduler_Worker-4] DEBUG org.quartz.core.JobRunShell - Calling execute on job DEFAULT.serviceRegistryReloaderJobDetail
09:26:38.357 [scheduler_Worker-4] INFO org.jasig.cas.services.DefaultServicesManagerImpl - Reloading registered services.
09:26:38.357 [scheduler_Worker-4] DEBUG org.jasig.cas.services.DefaultServicesManagerImpl - Adding registered service ^(https?|imaps?)://.*
09:26:38.357 [scheduler_Worker-4] INFO org.jasig.cas.services.DefaultServicesManagerImpl - Loaded 1 services.
09:28:38.356 [scheduler_Worker-5] DEBUG org.quartz.core.JobRunShell - Calling execute on job DEFAULT.serviceRegistryReloaderJobDetail
09:28:38.356 [scheduler_Worker-5] INFO org.jasig.cas.services.DefaultServicesManagerImpl - Reloading registered services.
09:28:38.356 [scheduler_Worker-5] DEBUG org.jasig.cas.services.DefaultServicesManagerImpl - Adding registered service ^(https?|imaps?)://.*
09:28:38.356 [scheduler_Worker-5] INFO org.jasig.cas.services.DefaultServicesManagerImpl - Loaded 1 services.

> Task :spring-security-config:test

org.springframework.security.config.web.server.OAuth2ResourceServerSpecTests > postWhenSignedThenReturnsOk FAILED
    java.lang.IllegalStateException at DefaultCacheAwareContextLoaderDelegate.java:132
        Caused by: org.springframework.beans.factory.BeanCreationException at AutowiredAnnotationBeanPostProcessor.java:405
            Caused by: java.io.UncheckedIOException at ResourceKeyConverterAdapter.java:87
                Caused by: java.io.FileNotFoundException at ClassPathResource.java:180

org.springframework.security.config.web.server.OAuth2ResourceServerSpecTests > introspectWhenValidThenReturnsOk FAILED
    java.lang.IllegalStateException at DefaultCacheAwareContextLoaderDelegate.java:132
        Caused by: org.springframework.beans.factory.BeanCreationException at AutowiredAnnotationBeanPostProcessor.java:405
            Caused by: java.io.UncheckedIOException at ResourceKeyConverterAdapter.java:87
                Caused by: java.io.FileNotFoundException at ClassPathResource.java:180

org.springframework.security.config.web.server.OAuth2ResourceServerSpecTests > getJwtDecoderWhenTwoBeansWiredAndDslWiredThenDslTakesPrecedence FAILED
    java.lang.IllegalStateException at DefaultCacheAwareContextLoaderDelegate.java:132
        Caused by: org.springframework.beans.factory.BeanCreationException at AutowiredAnnotationBeanPostProcessor.java:405
            Caused by: java.io.UncheckedIOException at ResourceKeyConverterAdapter.java:87
                Caused by: java.io.FileNotFoundException at ClassPathResource.java:180

org.springframework.security.config.web.server.OAuth2ResourceServerSpecTests > getWhenValidTokenAndPublicKeyInLambdaThenReturnsOk FAILED
    java.lang.IllegalStateException at DefaultCacheAwareContextLoaderDelegate.java:132
        Caused by: org.springframework.beans.factory.BeanCreationException at AutowiredAnnotationBeanPostProcessor.java:405
            Caused by: java.io.UncheckedIOException at ResourceKeyConverterAdapter.java:87
                Caused by: java.io.FileNotFoundException at ClassPathResource.java:180

org.springframework.security.config.web.server.OAuth2ResourceServerSpecTests > getWhenValidUsingPlaceholderThenReturnsOk FAILED
    java.lang.IllegalStateException at DefaultCacheAwareContextLoaderDelegate.java:132
        Caused by: org.springframework.beans.factory.BeanCreationException at AutowiredAnnotationBeanPostProcessor.java:405
            Caused by: java.io.UncheckedIOException at ResourceKeyConverterAdapter.java:87
                Caused by: java.io.FileNotFoundException at ClassPathResource.java:180

org.springframework.security.config.web.server.OAuth2ResourceServerSpecTests > getJwtDecoderWhenNoBeansAndNoDslWiredThenWiringException FAILED
    java.lang.IllegalStateException at DefaultCacheAwareContextLoaderDelegate.java:132
        Caused by: org.springframework.beans.factory.BeanCreationException at AutowiredAnnotationBeanPostProcessor.java:405
            Caused by: java.io.UncheckedIOException at ResourceKeyConverterAdapter.java:87
                Caused by: java.io.FileNotFoundException at ClassPathResource.java:180

org.springframework.security.config.web.server.OAuth2ResourceServerSpecTests > getWhenExpiredThenReturnsInvalidToken FAILED
    java.lang.IllegalStateException at DefaultCacheAwareContextLoaderDelegate.java:132
        Caused by: org.springframework.beans.factory.BeanCreationException at AutowiredAnnotationBeanPostProcessor.java:405
            Caused by: java.io.UncheckedIOException at ResourceKeyConverterAdapter.java:87
                Caused by: java.io.FileNotFoundException at ClassPathResource.java:180

org.springframework.security.config.web.server.OAuth2ResourceServerSpecTests > getWhenCustomDecoderThenAuthenticatesAccordingly FAILED
    java.lang.IllegalStateException at DefaultCacheAwareContextLoaderDelegate.java:132
        Caused by: org.springframework.beans.factory.BeanCreationException at AutowiredAnnotationBeanPostProcessor.java:405
            Caused by: java.io.UncheckedIOException at ResourceKeyConverterAdapter.java:87
                Caused by: java.io.FileNotFoundException at ClassPathResource.java:180

org.springframework.security.config.web.server.OAuth2ResourceServerSpecTests > postWhenMissingTokenThenReturnsForbidden FAILED
    java.lang.IllegalStateException at DefaultCacheAwareContextLoaderDelegate.java:132
        Caused by: org.springframework.beans.factory.BeanCreationException at AutowiredAnnotationBeanPostProcessor.java:405
            Caused by: java.io.UncheckedIOException at ResourceKeyConverterAdapter.java:87
                Caused by: java.io.FileNotFoundException at ClassPathResource.java:180

org.springframework.security.config.web.server.OAuth2ResourceServerSpecTests > getJwtDecoderWhenBeanWiredAndDslWiredThenDslTakesPrecedence FAILED
    java.lang.IllegalStateException at DefaultCacheAwareContextLoaderDelegate.java:132
        Caused by: org.springframework.beans.factory.BeanCreationException at AutowiredAnnotationBeanPostProcessor.java:405
            Caused by: java.io.UncheckedIOException at ResourceKeyConverterAdapter.java:87
                Caused by: java.io.FileNotFoundException at ClassPathResource.java:180

org.springframework.security.config.web.server.OAuth2ResourceServerSpecTests > getWhenExpiredTokenAndPublicKeyInLambdaThenReturnsInvalidToken FAILED
    java.lang.IllegalStateException at DefaultCacheAwareContextLoaderDelegate.java:132
        Caused by: org.springframework.beans.factory.BeanCreationException at AutowiredAnnotationBeanPostProcessor.java:405
            Caused by: java.io.UncheckedIOException at ResourceKeyConverterAdapter.java:87
                Caused by: java.io.FileNotFoundException at ClassPathResource.java:180

org.springframework.security.config.web.server.OAuth2ResourceServerSpecTests > getWhenUsingCustomAuthenticationManagerInLambdaThenUsesItAccordingly FAILED
    java.lang.IllegalStateException at DefaultCacheAwareContextLoaderDelegate.java:132
        Caused by: org.springframework.beans.factory.BeanCreationException at AutowiredAnnotationBeanPostProcessor.java:405
            Caused by: java.io.UncheckedIOException at ResourceKeyConverterAdapter.java:87
                Caused by: java.io.FileNotFoundException at ClassPathResource.java:180

org.springframework.security.config.web.server.OAuth2ResourceServerSpecTests > getWhenValidThenReturnsOk FAILED
    java.lang.IllegalStateException at DefaultCacheAwareContextLoaderDelegate.java:132
        Caused by: org.springframework.beans.factory.BeanCreationException at AutowiredAnnotationBeanPostProcessor.java:405
            Caused by: java.io.UncheckedIOException at ResourceKeyConverterAdapter.java:87
                Caused by: java.io.FileNotFoundException at ClassPathResource.java:180

org.springframework.security.config.web.server.OAuth2ResourceServerSpecTests > getWhenUsingCustomAuthenticationManagerResolverThenUsesItAccordingly FAILED
    java.lang.IllegalStateException at DefaultCacheAwareContextLoaderDelegate.java:132
        Caused by: org.springframework.beans.factory.BeanCreationException at AutowiredAnnotationBeanPostProcessor.java:405
            Caused by: java.io.UncheckedIOException at ResourceKeyConverterAdapter.java:87
                Caused by: java.io.FileNotFoundException at ClassPathResource.java:180

org.springframework.security.config.web.server.OAuth2ResourceServerSpecTests > getWhenTokenHasInsufficientScopeThenReturnsInsufficientScope FAILED
    java.lang.IllegalStateException at DefaultCacheAwareContextLoaderDelegate.java:132
        Caused by: org.springframework.beans.factory.BeanCreationException at AutowiredAnnotationBeanPostProcessor.java:405
            Caused by: java.io.UncheckedIOException at ResourceKeyConverterAdapter.java:87
                Caused by: java.io.FileNotFoundException at ClassPathResource.java:180

org.springframework.security.config.web.server.OAuth2ResourceServerSpecTests > getJwtDecoderWhenTwoBeansWiredThenThrowsWiringException FAILED
    java.lang.IllegalStateException at DefaultCacheAwareContextLoaderDelegate.java:132
        Caused by: org.springframework.beans.factory.BeanCreationException at AutowiredAnnotationBeanPostProcessor.java:405
            Caused by: java.io.UncheckedIOException at ResourceKeyConverterAdapter.java:87
                Caused by: java.io.FileNotFoundException at ClassPathResource.java:180

org.springframework.security.config.web.server.OAuth2ResourceServerSpecTests > configureWhenUsingBothAuthenticationManagerResolverAndOpaqueThenWiringException FAILED
    java.lang.IllegalStateException at DefaultCacheAwareContextLoaderDelegate.java:132
        Caused by: org.springframework.beans.factory.BeanCreationException at AutowiredAnnotationBeanPostProcessor.java:405
            Caused by: java.io.UncheckedIOException at ResourceKeyConverterAdapter.java:87
                Caused by: java.io.FileNotFoundException at ClassPathResource.java:180

org.springframework.security.config.web.server.OAuth2ResourceServerSpecTests > getWhenCustomBearerTokenEntryPointThenResponds FAILED
    java.lang.IllegalStateException at DefaultCacheAwareContextLoaderDelegate.java:132
        Caused by: org.springframework.beans.factory.BeanCreationException at AutowiredAnnotationBeanPostProcessor.java:405
            Caused by: java.io.UncheckedIOException at ResourceKeyConverterAdapter.java:87
                Caused by: java.io.FileNotFoundException at ClassPathResource.java:180

org.springframework.security.config.web.server.OAuth2ResourceServerSpecTests > getWhenUsingJwkSetUriThenConsultsAccordingly FAILED
    java.lang.IllegalStateException at DefaultCacheAwareContextLoaderDelegate.java:132
        Caused by: org.springframework.beans.factory.BeanCreationException at AutowiredAnnotationBeanPostProcessor.java:405
            Caused by: java.io.UncheckedIOException at ResourceKeyConverterAdapter.java:87
                Caused by: java.io.FileNotFoundException at ClassPathResource.java:180

org.springframework.security.config.web.server.OAuth2ResourceServerSpecTests > getWhenEmptyBearerTokenThenReturnsInvalidToken FAILED
    java.lang.IllegalStateException at DefaultCacheAwareContextLoaderDelegate.java:132
        Caused by: org.springframework.beans.factory.BeanCreationException at AutowiredAnnotationBeanPostProcessor.java:405
            Caused by: java.io.UncheckedIOException at ResourceKeyConverterAdapter.java:87
                Caused by: java.io.FileNotFoundException at ClassPathResource.java:180

org.springframework.security.config.web.server.OAuth2ResourceServerSpecTests > getWhenSignedAndCustomConverterThenConverts FAILED
    java.lang.IllegalStateException at DefaultCacheAwareContextLoaderDelegate.java:132
        Caused by: org.springframework.beans.factory.BeanCreationException at AutowiredAnnotationBeanPostProcessor.java:405
            Caused by: java.io.UncheckedIOException at ResourceKeyConverterAdapter.java:87
                Caused by: java.io.FileNotFoundException at ClassPathResource.java:180

org.springframework.security.config.web.server.OAuth2ResourceServerSpecTests > getWhenUsingJwkSetUriInLambdaThenConsultsAccordingly FAILED
    java.lang.IllegalStateException at DefaultCacheAwareContextLoaderDelegate.java:132
        Caused by: org.springframework.beans.factory.BeanCreationException at AutowiredAnnotationBeanPostProcessor.java:405
            Caused by: java.io.UncheckedIOException at ResourceKeyConverterAdapter.java:87
                Caused by: java.io.FileNotFoundException at ClassPathResource.java:180

org.springframework.security.config.web.server.OAuth2ResourceServerSpecTests > getWhenUsingCustomAuthenticationManagerThenUsesItAccordingly FAILED
    java.lang.IllegalStateException at DefaultCacheAwareContextLoaderDelegate.java:132
        Caused by: org.springframework.beans.factory.BeanCreationException at AutowiredAnnotationBeanPostProcessor.java:405
            Caused by: java.io.UncheckedIOException at ResourceKeyConverterAdapter.java:87
                Caused by: java.io.FileNotFoundException at ClassPathResource.java:180

org.springframework.security.config.web.server.OAuth2ResourceServerSpecTests > getWhenCustomBearerTokenServerAuthenticationConverterThenResponds FAILED
    java.lang.IllegalStateException at DefaultCacheAwareContextLoaderDelegate.java:132
        Caused by: org.springframework.beans.factory.BeanCreationException at AutowiredAnnotationBeanPostProcessor.java:405
            Caused by: java.io.UncheckedIOException at ResourceKeyConverterAdapter.java:87
                Caused by: java.io.FileNotFoundException at ClassPathResource.java:180

org.springframework.security.config.web.server.OAuth2ResourceServerSpecTests > introspectWhenValidAndIntrospectionInLambdaThenReturnsOk FAILED
    java.lang.IllegalStateException at DefaultCacheAwareContextLoaderDelegate.java:132
        Caused by: org.springframework.beans.factory.BeanCreationException at AutowiredAnnotationBeanPostProcessor.java:405
            Caused by: java.io.UncheckedIOException at ResourceKeyConverterAdapter.java:87
                Caused by: java.io.FileNotFoundException at ClassPathResource.java:180

org.springframework.security.config.web.server.OAuth2ResourceServerSpecTests > getWhenUnsignedThenReturnsInvalidToken FAILED
    java.lang.IllegalStateException at DefaultCacheAwareContextLoaderDelegate.java:132
        Caused by: org.springframework.beans.factory.BeanCreationException at AutowiredAnnotationBeanPostProcessor.java:405
            Caused by: java.io.UncheckedIOException at ResourceKeyConverterAdapter.java:87
                Caused by: java.io.FileNotFoundException at ClassPathResource.java:180

org.springframework.security.config.web.server.OAuth2ResourceServerSpecTests > getWhenCustomBearerTokenDeniedHandlerThenResponds FAILED
    java.lang.IllegalStateException at DefaultCacheAwareContextLoaderDelegate.java:132
        Caused by: org.springframework.beans.factory.BeanCreationException at AutowiredAnnotationBeanPostProcessor.java:405
            Caused by: java.io.UncheckedIOException at ResourceKeyConverterAdapter.java:87
                Caused by: java.io.FileNotFoundException at ClassPathResource.java:180

1938 tests completed, 27 failed

> Task :spring-security-config:test FAILED

FAILURE: Build completed with 2 failures.

1: Task failed with an exception.
-----------
* What went wrong:
Execution failed for task ':spring-security-samples-boot-oauth2webclient-webflux:test'.
> There were failing tests. See the report at: file:///C:/blueroom/sts-workspace-spring-security/spring-security/samples/boot/oauth2webclient-webflux/build/reports/tests/test/index.html

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

2: Task failed with an exception.
-----------
* What went wrong:
Execution failed for task ':spring-security-config:test'.
> There were failing tests. See the report at: file:///C:/blueroom/sts-workspace-spring-security/spring-security/config/build/reports/tests/test/index.html

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

* Get more help at https://help.gradle.org

Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/6.6.1/userguide/command_line_interface.html#sec:command_line_warnings

BUILD FAILED in 12m 20s
534 actionable tasks: 408 executed, 3 from cache, 123 up-to-date

A build scan was not published as you have not authenticated with server 'ge.spring.io'.

88

The complete ourput is:

java.lang.IllegalStateException: Timeout on blocking read for 5000000000 NANOSECONDS
	at reactor.core.publisher.BlockingSingleSubscriber.blockingGet(BlockingSingleSubscriber.java:123)
	at reactor.core.publisher.Mono.block(Mono.java:1703)
	at org.springframework.test.web.reactive.server.DefaultWebTestClient$DefaultRequestBodyUriSpec.exchange(DefaultWebTestClient.java:354)
	at sample.OAuth2WebClientControllerTests.implicitWhenAuthenticatedThenUsesDefaultRegistration(OAuth2WebClientControllerTests.java:69)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:59)
	at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
	at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:56)
	at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
	at org.springframework.test.context.junit4.statements.RunBeforeTestExecutionCallbacks.evaluate(RunBeforeTestExecutionCallbacks.java:74)
	at org.springframework.test.context.junit4.statements.RunAfterTestExecutionCallbacks.evaluate(RunAfterTestExecutionCallbacks.java:84)
	at org.springframework.test.context.junit4.statements.RunBeforeTestMethodCallbacks.evaluate(RunBeforeTestMethodCallbacks.java:75)
	at org.springframework.test.context.junit4.statements.RunAfterTestMethodCallbacks.evaluate(RunAfterTestMethodCallbacks.java:86)
	at org.springframework.test.context.junit4.statements.SpringRepeat.evaluate(SpringRepeat.java:84)
	at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:366)
	at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:251)
	at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:97)
	at org.junit.runners.ParentRunner$4.run(ParentRunner.java:331)
	at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:79)
	at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:329)
	at org.junit.runners.ParentRunner.access$100(ParentRunner.java:66)
	at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:293)
	at org.springframework.test.context.junit4.statements.RunBeforeTestClassCallbacks.evaluate(RunBeforeTestClassCallbacks.java:61)
	at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27)
	at org.springframework.test.context.junit4.statements.RunAfterTestClassCallbacks.evaluate(RunAfterTestClassCallbacks.java:70)
	at org.junit.runners.ParentRunner$3.evaluate(ParentRunner.java:306)
	at org.junit.runners.ParentRunner.run(ParentRunner.java:413)
	at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.run(SpringJUnit4ClassRunner.java:190)
	at org.gradle.api.internal.tasks.testing.junit.JUnitTestClassExecutor.runTestClass(JUnitTestClassExecutor.java:110)
	at org.gradle.api.internal.tasks.testing.junit.JUnitTestClassExecutor.execute(JUnitTestClassExecutor.java:58)
	at org.gradle.api.internal.tasks.testing.junit.JUnitTestClassExecutor.execute(JUnitTestClassExecutor.java:38)
	at org.gradle.api.internal.tasks.testing.junit.AbstractJUnitTestClassProcessor.processTestClass(AbstractJUnitTestClassProcessor.java:62)
	at org.gradle.api.internal.tasks.testing.SuiteTestClassProcessor.processTestClass(SuiteTestClassProcessor.java:51)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.gradle.internal.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:36)
	at org.gradle.internal.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:24)
	at org.gradle.internal.dispatch.ContextClassLoaderDispatch.dispatch(ContextClassLoaderDispatch.java:33)
	at org.gradle.internal.dispatch.ProxyDispatchAdapter$DispatchingInvocationHandler.invoke(ProxyDispatchAdapter.java:94)
	at com.sun.proxy.$Proxy2.processTestClass(Unknown Source)
	at org.gradle.api.internal.tasks.testing.worker.TestWorker.processTestClass(TestWorker.java:119)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.gradle.internal.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:36)
	at org.gradle.internal.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:24)
	at org.gradle.internal.remote.internal.hub.MessageHubBackedObjectConnection$DispatchWrapper.dispatch(MessageHubBackedObjectConnection.java:182)
	at org.gradle.internal.remote.internal.hub.MessageHubBackedObjectConnection$DispatchWrapper.dispatch(MessageHubBackedObjectConnection.java:164)
	at org.gradle.internal.remote.internal.hub.MessageHub$Handler.run(MessageHub.java:414)
	at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:64)
	at org.gradle.internal.concurrent.ManagedExecutorImpl$1.run(ManagedExecutorImpl.java:48)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
	at org.gradle.internal.concurrent.ThreadFactoryImpl$ManagedThreadRunnable.run(ThreadFactoryImpl.java:56)
	at java.lang.Thread.run(Thread.java:748)

BTW - I have the same results even after to:

  • gradlew.bat clean -Dmaven.repo.local=$M2_REPO
  • gradlew.bat build -Dmaven.repo.local=$M2_REPO

I am going to create a new issue.

@manueljordan
Copy link
Author

Reported on #9421

@jzheaux jzheaux added status: declined A suggestion or change that we don't feel we should currently apply and removed status: feedback-provided Feedback has been provided type: bug A general bug labels Feb 10, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: build An issue in the build status: declined A suggestion or change that we don't feel we should currently apply
Projects
None yet
Development

No branches or pull requests

3 participants