JDK11+spring批处理CommandLineJobRunner
有人知道那些警告是什么意思吗:
警告:发生了非法的反射访问操作警告:org.html" target="_blank">springframework.cglib.core.reflectutils$1(jar:file:/users/boru/downloads/spcljr/build/libs/spcljr-0.0.1-snapshot.jar!/boot-inf/lib/spring-core-5.0.5.release.jar!/)对方法java.lang.classloader.defineClass(java.lang.string,byte[],int,int,java.security.ProtectionDomain)的非法反射访问警告:请考虑将此报告给
I used this pom and my problem disappeared:
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.2.1.RELEASE</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<groupId>com.universidad.springboot.backend.academia</groupId>
<artifactId>academia</artifactId>
<version>0.0.1-SNAPSHOT</version>
<name>academia</name>
<description>Demo project for Spring Boot</description>
<properties>
<java.version>1.8</java.version>
<spring-cloud.version>Hoxton.RC2</spring-cloud.version>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-jpa</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<!-- https://mvnrepository.com/artifact/org.springframework.security.oauth/spring-security-oauth2
<dependency> <groupId>org.springframework.security.oauth</groupId> <artifactId>spring-security-oauth2</artifactId>
<version>2.3.4.RELEASE</version> </dependency> <https://mvnrepository.com/artifact/org.springframework.security/spring-security-jwt
<dependency> <groupId>org.springframework.security</groupId> <artifactId>spring-security-jwt</artifactId>
<version>1.0.9.RELEASE</version> </dependency> -->
<!-- https://mvnrepository.com/artifact/javax.xml.bind/jaxb-api -->
<dependency>
<groupId>javax.xml.bind</groupId>
<artifactId>jaxb-api</artifactId>
</dependency>
<!-- https://mvnrepository.com/artifact/org.glassfish.jaxb/jaxb-runtime -->
<dependency>
<groupId>org.glassfish.jaxb</groupId>
<artifactId>jaxb-runtime</artifactId>
</dependency>
<!-- https://mvnrepository.com/artifact/org.springframework.security/spring-security-test -->
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-test</artifactId>
<version>5.1.2.RELEASE</version><!--$NO-MVN-MAN-VER$ -->
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.h2database</groupId>
<artifactId>h2</artifactId>
<scope>test</scope>
<version>1.4.194</version><!--$NO-MVN-MAN-VER$ -->
</dependency>
<!-- https://mvnrepository.com/artifact/org.springframework.security.oauth/spring-security-oauth2
<dependency>
<groupId>org.springframework.security.oauth</groupId>
<artifactId>spring-security-oauth2</artifactId>
<version>2.4.0.RELEASE</version>
</dependency>
-->
<!-- https://mvnrepository.com/artifact/org.springframework.security/spring-security-jwt -->
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-jwt</artifactId>
<version>1.1.0.RELEASE</version>
</dependency>
<!-- https://mvnrepository.com/artifact/javax.xml.bind/jaxb-api -->
<dependency>
<groupId>javax.xml.bind</groupId>
<artifactId>jaxb-api</artifactId>
</dependency>
<!-- https://mvnrepository.com/artifact/org.glassfish.jaxb/jaxb-runtime -->
<dependency>
<groupId>org.glassfish.jaxb</groupId>
<artifactId>jaxb-runtime</artifactId>
</dependency>
<!-- https://mvnrepository.com/artifact/com.walterjwhite.java.dependencies/hikari-jdbc-connection-pool -->
<dependency>
<groupId>com.walterjwhite.java.dependencies</groupId>
<artifactId>hikari-jdbc-connection-pool</artifactId>
<version>0.0.17</version>
<type>pom</type>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
</project>
我相信这张票报上了。你可以看着这张票
https://github.com/spring-projects/spring-framework/issues/22814
如果您迫不及待,您可以尝试不同的版本
在Java9中有很多关于非法反射访问的问题。 我发现了很多关于如何处理错误消息的讨论,但我想知道非法反射访问实际上是什么。 所以我的问题是: 我认为这与Java9中引入的封装原则有关,但我找不到一个解释,说明它们是如何联系在一起的,是什么触发了警告,以及在什么场景中。
我正在使用反射来调用java.util.Stream.Stream上的方法,但由于实际实现(ReferencePipeline等)具有运行的实际代码,因此在调用时会收到非法的反射访问警告,如果没有该调用,它将无法工作。我想知道是否有一种方法可以自动将其委托给一个访问不非法的超级方法?也就是说,我想调用,其中是合法的,而不是或任何实现。 编辑这里是一些代码。是通过反射获得的流的具体实例。
最近升级到Java11并开始执行回归检查。当前在尝试调用时出现非法反射访问错误。目前在Itext版本5.5.13上,但也在Itext 7.0.0上试用过,出现了相同的问题。 有人对如何修复Java-11和iText之间的兼容性问题有什么建议吗? 警告:发生了非法反射访问操作警告:com.itextpdf.io.source.ByteBufferRandomAccessSource$1(文件:...
我正在使用Apache POI处理excel文件,从Java9开始,我得到了这条消息,根据这篇文章JDK9:发生了非法的反射访问操作。pySystemState我们应该等待开发人员修复这个问题,但是我应该在新的生产版本中保留它吗?我想跳过警告应该没问题。
在尝试构建时,。我按照其他人的建议添加了,但仍然得到相同的错误。 有什么建议吗? pom.xml