Class not found so assuming code is running on a pre-Java 9 JVM
问题描述:
idea进行springboot开发时,进行日志输出模式修改,之前没有对日志的级别进行设置,启动的时候也没有发现有什么问题。当把日志级别调整到debug时,启动springboot项目问题出现了,我当时用的jdk是1.8
Class not found so assuming code is running on a pre-Java 9 JVM
翻译:
找不到类,所以假设代码运行在java 9之前的jvm上
完整的异常信息:
2020-06-21 17:44:19.102 DEBUG 5524 --- [ restartedMain] o.apache.tomcat.util.compat.Jre9Compat : Class not found so assuming code is running on a pre-Java 9 JVMjava.lang.ClassNotFoundException: java.lang.reflect.InaccessibleObjectExceptionat java.net.URLClassLoader.findClass(URLClassLoader.java:382) ~[na:1.8.0_241]at java.lang.ClassLoader.loadClass(ClassLoader.java:418) ~[na:1.8.0_241]at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:355) ~[na:1.8.0_241]at java.lang.ClassLoader.loadClass(ClassLoader.java:351) ~[na:1.8.0_241]at java.lang.Class.forName0(Native Method) ~[na:1.8.0_241]at java.lang.Class.forName(Class.java:264) ~[na:1.8.0_241]at org.apache.tomcat.util.compat.Jre9Compat.<clinit>(Jre9Compat.java:81) ~[tomcat-embed-core-9.0.36.jar:9.0.36]at org.apache.tomcat.util.compat.JreCompat.<clinit>(JreCompat.java:55) [tomcat-embed-core-9.0.36.jar:9.0.36]at org.apache.catalina.startup.Tomcat.<clinit>(Tomcat.java:1276) [tomcat-embed-core-9.0.36.jar:9.0.36]at org.springframework.boot.web.embedded.tomcat.TomcatServletWebServerFactory.getWebServer(TomcatServletWebServerFactory.java:177) [spring-boot-2.3.1.RELEASE.jar:2.3.1.RELEASE]at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.createWebServer(ServletWebServerApplicationContext.java:178) [spring-boot-2.3.1.RELEASE.jar:2.3.1.RELEASE]at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.onRefresh(ServletWebServerApplicationContext.java:158) [spring-boot-2.3.1.RELEASE.jar:2.3.1.RELEASE]at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:545) [spring-context-5.2.7.RELEASE.jar:5.2.7.RELEASE]at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:143) [spring-boot-2.3.1.RELEASE.jar:2.3.1.RELEASE]at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:758) [spring-boot-2.3.1.RELEASE.jar:2.3.1.RELEASE]at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:750) [spring-boot-2.3.1.RELEASE.jar:2.3.1.RELEASE]at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:397) [spring-boot-2.3.1.RELEASE.jar:2.3.1.RELEASE]at org.springframework.boot.SpringApplication.run(SpringApplication.java:315) [spring-boot-2.3.1.RELEASE.jar:2.3.1.RELEASE]at org.springframework.boot.SpringApplication.run(SpringApplication.java:1237) [spring-boot-2.3.1.RELEASE.jar:2.3.1.RELEASE]at org.springframework.boot.SpringApplication.run(SpringApplication.java:1226) [spring-boot-2.3.1.RELEASE.jar:2.3.1.RELEASE]at com.lej.gmall.user.GmallUserApplication.main(GmallUserApplication.java:12) [classes/:na]at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_241]at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_241]at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_241]at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_241]at org.springframework.boot.devtools.restart.RestartLauncher.run(RestartLauncher.java:49) [spring-boot-devtools-2.3.1.RELEASE.jar:2.3.1.RELEASE]
解决方法:
jdk更换更高的版本,我当时为了验证自己的猜测,在官网上下载了jdk11,然后重新设置项目的jdk,问题没有再出现,但是又出现了一个其他问题:org.apache.tomcat.jni.LibraryNotFoundError: Can't load library: C:\Users\IdeaProjects\springbootstudy\bin\tcnative-1.dll, Can't load library: 这个问题就是springboot自带的tomcat中应该没有tcnative-1.dll,于是才出现了这个问题,解决方法:从tomcat(tcnative-1.dll这个是分32位或者64位的,根据系统进行下载相关文件) bin目录中找该文件然后放到自己系统Windows\system32\目录下,然后重新启动程序,问题没再出现。
Class not found so assuming code is running on a pre-Java 9 JVM相关推荐
- java tm 插件_VS Code 中有哪些好用的 Java 插件?
说到写 Java,想必做 Java 开发的童鞋,蛮多都是会用 IntelliJ, Eclipse 或是 Netbeans.许多童鞋也许会问,VS Code 也能写 Java? 是的,没错,VS Cod ...
- java code large_Java中的“代码太大”编译错误(“Code too large” compilation error in Java)...
Java中的"代码太大"编译错误("Code too large" compilation error in Java) Java中的代码是否有最大大小? 我写 ...
- Checking if your code is running on 64-bit PHP
Check the PHP_INT_SIZE constant. It'll vary based on the size of the register (i.e. 32-bit vs 64-bit ...
- vscode写java没有提示_VS Code报错Language Support for Java(TM)插件显示需要JDK11 写java代码没有提示...
鉴于IDEA的打开速度(电脑的垃圾),平常刷LeetCode都是在VSCode上,结果这几天老是打开给我报错 Java 11 or more recent is required to run. Pl ...
- Java HotSpot VM 命令行参数【官方版】
2019独角兽企业重金招聘Python工程师标准>>> Java HotSpot VM Command-Line Options Command-line options that ...
- java检查版本_如何检查Java版本
java检查版本 Sometimes we need to check the Java version while executing a java program. We could be dev ...
- 如何使用Visual Studio Code作为Git的默认编辑器
本文翻译自:How to use Visual Studio Code as Default Editor for Git When using git at the command line, I ...
- Characterizing, exploiting, and detecting DMA code injection vulnerabilities,Eurosys2021
Characterizing, exploiting, and detecting DMA code injection vulnerabilities in the presence of an I ...
- 整理:使用 Visual Studio Code (vscode) 编写、运行、 调试 Java 应用程序
作为一个喜欢折腾的人,最近抽空折腾一下VScode怎么写java程序.不断更新中.. 附一个原来写的C++的:这两个链接,第二个稍微简单一些 1)Visual Studio Code配置C.C++环境 ...
- 作为JavaScript开发人员,这些必备的VS Code插件你都用过吗
本文翻译自:https://www.sitepoint.com/vs-code-extensions-java-developers/ 转载请注明出处:葡萄城官网,葡萄城为开发者提供专业的开发工具.解 ...
最新文章
- go 用的不多的命令
- HealthKit开发教程之HealthKit的辅助数据
- jQuery Mobile 图标无法显示
- 关于汇编跟C/C++已经java的内存理解
- CPU-bound(计算密集型) 和I/O bound(I/O密集型)
- linux 常用操作指令(随时更新)
- vs2019新建android生成app,VS2017 VS2019创建离线安装包
- android mtk 按键,Android 4.0 虚拟按键、手机模式、平板模式(转)
- markdown与latex:如何写出像数学书里的大于等于\geqslant和小于等于\leqslant
- DarkAngels勒索病毒分析
- java sql小区物业管理系统_小区物业管理系统javasql.doc
- FPGA UART串口协议
- [推荐系统]互联网推荐系统比较研究
- 安卓模拟器最优选择+抖音检测全绕过简述
- mac游戏排行榜,mac好玩的游戏推荐 (一)
- 有三顶红帽子和两顶蓝帽子逻辑推理
- python获取当前进程pid_Python获取系统所有进程PID及进程名称的方法示例
- window系统杀死进程方法
- 《中国集成电路产业人才白皮书(2017-2018)》在京发布
- clickhouse-backup 备份恢复测试