设置spring xd时发生了非法的反射访问操作

时间:2018-07-23 19:19:12

标签: java spring java-8 java-9 spring-xd

我遵循指南Spring XD Guide在窗口7上设置spring xd。当我尝试启动运行时和XD Shell并输入./xd-singlenode时,它给了我以下警告和错误:< / p>

WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by org.codehaus.groovy.reflection.CachedClass$3$1 (file:/C:/Users/user/SpringXD/spring-xd-1.3.2.RELEASE/xd/lib/groovy-all-2.4.4.jar) to method java.lang.Object.finalize()
WARNING: Please consider reporting this to the maintainers of org.codehaus.groovy.reflection.CachedClass$3$1
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
????-??-??T??:??:??+0200 1.3.2.RELEASE INFO main singlenode.SingleNodeApplication - Starting SingleNodeApplication v1.3.2.RELEASE on user-PC with PID 4604 (C:\Users\user\SpringXD\spring-xd-1.3.2.RELEASE\xd\lib\spring-xd-dirt-1.3.2.RELEASE.jar started by user in C:\Users\user)
????-??-??T??:??:??+0200 1.3.2.RELEASE INFO main singlenode.SingleNodeApplication - Started SingleNodeApplication in 3.307 seconds (JVM running for 9.037)
????-??-??T??:??:??+0200 1.3.2.RELEASE INFO main singlenode.SingleNodeApplication - Starting SingleNodeApplication v1.3.2.RELEASE on user-PC with PID 4604 (C:\Users\user\SpringXD\spring-xd-1.3.2.RELEASE\xd\lib\spring-xd-dirt-1.3.2.RELEASE.jar started by user in C:\Users\user)
????-??-??T??:??:??+0200 1.3.2.RELEASE INFO main singlenode.SingleNodeApplication - Started SingleNodeApplication in 1.17 seconds (JVM running for 10.259)
????-??-??T??:??:??+0200 1.3.2.RELEASE WARN main annotation.AnnotationConfigApplicationContext - Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.boot.context.properties.ConfigurationPropertiesBindingPostProcessor': Invocation of init method failed; nested exception is javax.validation.ValidationException: Unable to instantiate Configuration.
????-??-??T??:??:??+0200 1.3.2.RELEASE ERROR main boot.SpringApplication - Application startup failed
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.boot.context.properties.ConfigurationPropertiesBindingPostProcessor': Invocation of init method failed; nested exception is javax.validation.ValidationException: Unable to instantiate Configuration.
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1578) ~[spring-beans-4.2.4.RELEASE.jar:4.2.4.RELEASE]
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:545) ~[spring-beans-4.2.4.RELEASE.jar:4.2.4.RELEASE]
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:482) ~[spring-beans-4.2.4.RELEASE.jar:4.2.4.RELEASE]
        at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:306) ~[spring-beans-4.2.4.RELEASE.jar:4.2.4.RELEASE]
        at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230) ~[spring-beans-4.2.4.RELEASE.jar:4.2.4.RELEASE]
        at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:302) ~[spring-beans-4.2.4.RELEASE.jar:4.2.4.RELEASE]
        at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:202) ~[spring-beans-4.2.4.RELEASE.jar:4.2.4.RELEASE]
        at org.springframework.context.support.PostProcessorRegistrationDelegate.registerBeanPostProcessors(PostProcessorRegistrationDelegate.java:207) ~[spring-context-4.2.4.RELEASE.jar:4.2.4.RELEASE]
        at org.springframework.context.support.AbstractApplicationContext.registerBeanPostProcessors(AbstractApplicationContext.java:687) ~[spring-context-4.2.4.RELEASE.jar:4.2.4.RELEASE]
        at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:523) ~[spring-context-4.2.4.RELEASE.jar:4.2.4.RELEASE]
        at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:686) ~[spring-boot-1.2.3.RELEASE.jar:1.2.3.RELEASE]
        at org.springframework.boot.SpringApplication.run(SpringApplication.java:320) ~[spring-boot-1.2.3.RELEASE.jar:1.2.3.RELEASE]
        at org.springframework.boot.builder.SpringApplicationBuilder.run(SpringApplicationBuilder.java:139) [spring-boot-1.2.3.RELEASE.jar:1.2.3.RELEASE]
        at org.springframework.boot.builder.SpringApplicationBuilder.run(SpringApplicationBuilder.java:129) [spring-boot-1.2.3.RELEASE.jar:1.2.3.RELEASE]
        at org.springframework.boot.builder.SpringApplicationBuilder.run(SpringApplicationBuilder.java:129) [spring-boot-1.2.3.RELEASE.jar:1.2.3.RELEASE]
        at org.springframework.xd.dirt.server.singlenode.SingleNodeApplication.run(SingleNodeApplication.java:83) [spring-xd-dirt-1.3.2.RELEASE.jar:1.3.2.RELEASE]
        at org.springframework.xd.dirt.server.singlenode.SingleNodeApplication.main(SingleNodeApplication.java:52) [spring-xd-dirt-1.3.2.RELEASE.jar:1.3.2.RELEASE]
Caused by: javax.validation.ValidationException: Unable to instantiate Configuration.
        at javax.validation.Validation$GenericBootstrapImpl.configure(Validation.java:279) ~[validation-api-1.1.0.Final.jar:na]
        at org.springframework.validation.beanvalidation.LocalValidatorFactoryBean.afterPropertiesSet(LocalValidatorFactoryBean.java:223) ~[spring-context-4.2.4.RELEASE.jar:4.2.4.RELEASE]
        at org.springframework.boot.context.properties.ConfigurationPropertiesBindingPostProcessor$Jsr303ValidatorFactory.run(ConfigurationPropertiesBindingPostProcessor.java:381) ~[spring-boot-1.2.3.RELEASE.jar:1.2.3.RELEASE]
        at org.springframework.boot.context.properties.ConfigurationPropertiesBindingPostProcessor.afterPropertiesSet(ConfigurationPropertiesBindingPostProcessor.java:174) ~[spring-boot-1.2.3.RELEASE.jar:1.2.3.RELEASE]
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1637) ~[spring-beans-4.2.4.RELEASE.jar:4.2.4.RELEASE]
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1574) ~[spring-beans-4.2.4.RELEASE.jar:4.2.4.RELEASE]
        ... 16 common frames omitted
Caused by: java.lang.ArrayIndexOutOfBoundsException: 1
        at org.hibernate.validator.internal.util.Version.getJavaRelease(Version.java:36) ~[hibernate-validator-5.2.1.Final.jar:5.2.1.Final]
        at org.hibernate.validator.internal.engine.ConfigurationImpl.<init>(ConfigurationImpl.java:119) ~[hibernate-validator-5.2.1.Final.jar:5.2.1.Final]
        at org.hibernate.validator.internal.engine.ConfigurationImpl.<init>(ConfigurationImpl.java:95) ~[hibernate-validator-5.2.1.Final.jar:5.2.1.Final]
        at org.hibernate.validator.HibernateValidator.createGenericConfiguration(HibernateValidator.java:31) ~[hibernate-validator-5.2.1.Final.jar:5.2.1.Final]
        at javax.validation.Validation$GenericBootstrapImpl.configure(Validation.java:276) ~[validation-api-1.1.0.Final.jar:na]
        ... 21 common frames omitted
Exception in thread "main" org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.boot.context.properties.ConfigurationPropertiesBindingPostProcessor': Invocation of init method failed; nested exception is javax.validation.ValidationException: Unable to instantiate Configuration.
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1578)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:545)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:482)
        at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:306)
        at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)
        at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:302)
        at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:202)
        at org.springframework.context.support.PostProcessorRegistrationDelegate.registerBeanPostProcessors(PostProcessorRegistrationDelegate.java:207)
        at org.springframework.context.support.AbstractApplicationContext.registerBeanPostProcessors(AbstractApplicationContext.java:687)
        at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:523)
        at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:686)
        at org.springframework.boot.SpringApplication.run(SpringApplication.java:320)
        at org.springframework.boot.builder.SpringApplicationBuilder.run(SpringApplicationBuilder.java:139)
        at org.springframework.boot.builder.SpringApplicationBuilder.run(SpringApplicationBuilder.java:129)
        at org.springframework.boot.builder.SpringApplicationBuilder.run(SpringApplicationBuilder.java:129)
        at org.springframework.xd.dirt.server.singlenode.SingleNodeApplication.run(SingleNodeApplication.java:83)
        at org.springframework.xd.dirt.server.singlenode.SingleNodeApplication.main(SingleNodeApplication.java:52)
Caused by: javax.validation.ValidationException: Unable to instantiate Configuration.
        at javax.validation.Validation$GenericBootstrapImpl.configure(Validation.java:279)
        at org.springframework.validation.beanvalidation.LocalValidatorFactoryBean.afterPropertiesSet(LocalValidatorFactoryBean.java:223)
        at org.springframework.boot.context.properties.ConfigurationPropertiesBindingPostProcessor$Jsr303ValidatorFactory.run(ConfigurationPropertiesBindingPostProcessor.java:381)
        at org.springframework.boot.context.properties.ConfigurationPropertiesBindingPostProcessor.afterPropertiesSet(ConfigurationPropertiesBindingPostProcessor.java:174)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1637)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1574)
        ... 16 more
Caused by: java.lang.ArrayIndexOutOfBoundsException: 1
        at org.hibernate.validator.internal.util.Version.getJavaRelease(Version.java:36)
        at org.hibernate.validator.internal.engine.ConfigurationImpl.<init>(ConfigurationImpl.java:119)
        at org.hibernate.validator.internal.engine.ConfigurationImpl.<init>(ConfigurationImpl.java:95)
        at org.hibernate.validator.HibernateValidator.createGenericConfiguration(HibernateValidator.java:31)
        at javax.validation.Validation$GenericBootstrapImpl.configure(Validation.java:276)
        ... 21 more

注意:

  1. 我正在使用Windows 7命令行提示符。
  2. i在系统设置的路径中附加了Java 8和Java 9 bin目录。

  3. i搜索了类似的问题,但没有得到类似 what is an illegal reflective accessAn illegal reflective access operation has occurred Apache POI

  4. 的结果。

那我该怎么办或我想念什么??

我设法通过将JAVA_HOME用户变量设置为jdk8文件夹的路径(例如C:\ Program Files \ Java \ jdk1.8)来解决此问题,因为jdk9不支持某些spring依赖项。

1 个答案:

答案 0 :(得分:1)

这里的理想建议是信任该库的开发人员,并如上所述迁移到Cloud Data Flow

  

注意 :此项目自2017年7月以来一直处于EOL / EOS状态。请   回顾Spring Cloud Data Flow和项目生态系统   进一步的研究,探索和用例实现。

为帮助您解决此问题,请参见 migrating-from-spring-xd-to-spring-data-cloud-flow上的指南。


另一方面,要详细说明您共享的日志的详细信息-

  1.   

    警告:   org.codehaus.groovy.reflection.CachedClass $ 3 $ 1   (文件:/ C:/Users/user/SpringXD/spring-xd-1.3.2.RELEASE/xd/lib/groovy-all-2.4.4.jar)   方法java.lang.Object.finalize()

         

    警告:请考虑   向维护者报告   org.codehaus.groovy.reflection.CachedClass $ 3 $ 1

    是一种警告您有关illegal reflective access的JDK9 +方法,它没有比“考虑向org.codehaus.groovy.reflection.CachedClass的维护者报告此内容”更合适的内容了。 / em>。

  2.   

    原因:java.lang.ArrayIndexOutOfBoundsException:1           在org.hibernate.validator.internal.util.Version.getJavaRelease(Version.java:36)   〜[hibernate-validator-5.2.1.Final.jar:5.2.1.Final]

    是您的应用程序失败的实际原因,原因是spring-xd中缺少兼容性修补程序。尽管spring-data-cloud-flow doesn't seem to have solved it completely either仍然处于still be made to work的状态。