本文介紹了在我的Spring Boot應用程序中運行Azure應用程序洞察代理時,我不斷收到IlLegalStateException的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!
問題描述
我的Spring Boot應用運行正常,日志被正確推送到Azure應用程序洞察。但由于未映射的關系,我一直看到IlLegalStateException,幾乎每分鐘都會填滿我的控制臺。我想不出這個錯誤的原因是什么。以下是完整的堆棧跟蹤。如果有人知道如何修復或抑制此問題。
java -javaagent:C:Users********DocumentsHUBJavahub_apiuildapplicationinsights-agent-3.1.1.jar -jar C:Users********DocumentsHUBJavahub_apiuildlibshub_api-0.0.1-SNAPSHOT.jar
2021-09-03 13:40:14.714+05 INFO c.m.applicationinsights.agent - ApplicationInsights Java Agent 3.1.1 started successfully
. ____ _ __ _ _
/\ / ___'_ __ _ _(_)_ __ __ _
( ( )\___ | '_ | '_| | '_ / _` |
\/ ___)| |_)| | | | | || (_| | ) ) ) )
' |____| .__|_| |_|_| |_\__, | / / / /
=========|_|==============|___/=/_/_/_/
:: Spring Boot :: (v2.6.0-SNAPSHOT)
2021-09-03 13:40:17.343 INFO 6496 --- [ main] c.h.HubApplication : Starting HubApplication using Java 11.0.12 on DESKTOP-******* with PID **** (C:Users********DocumentsHUBJavahub_apiuildlibshub_api-0.0.1-SNAPSHOT.jar started by husarkar in C:Users********DocumentsHUBJavahub_api)
2021-09-03 13:40:17.359 INFO 6496 --- [ main] c.h.HubApplication : No active profile set, falling back to default profiles: default
2021-09-03 13:40:18.964 INFO 6496 --- [ main] .s.d.r.c.RepositoryConfigurationDelegate : Bootstrapping Spring Data JPA repositories in DEFAULT mode.
2021-09-03 13:40:19.073 INFO 6496 --- [ main] .s.d.r.c.RepositoryConfigurationDelegate : Finished Spring Data repository scanning in 94 ms. Found 1 JPA repository interfaces.
2021-09-03 13:40:20.050 INFO 6496 --- [ main] o.s.b.w.e.t.TomcatWebServer : Tomcat initialized with port(s): 8080 (http)
2021-09-03 13:40:20.078 INFO 6496 --- [ main] o.a.c.c.StandardService : Starting service [Tomcat]
2021-09-03 13:40:20.079 INFO 6496 --- [ main] o.a.c.c.StandardEngine : Starting Servlet engine: [Apache Tomcat/9.0.52]
2021-09-03 13:40:20.200 INFO 6496 --- [ main] o.a.c.c.C.[.[.[/api] : Initializing Spring embedded WebApplicationContext
2021-09-03 13:40:20.200 INFO 6496 --- [ main] w.s.c.ServletWebServerApplicationContext : Root WebApplicationContext: initialization completed in 2756 m
2021-09-03 13:40:20.774 INFO 6496 --- [ main] o.h.j.i.u.LogHelper : HHH000204: Processing PersistenceUnitInfo [name: default]
2021-09-03 13:40:20.932 INFO 6496 --- [ main] o.h.Version : HHH000412: Hibernate ORM core version 5.5.6.Final
2021-09-03 13:40:21.277 INFO 6496 --- [ main] o.h.a.c.Version : HCANN000001: Hibernate Commons Annotations {5.1.2.Final}
2021-09-03 13:40:21.536 INFO 6496 --- [ main] c.z.h.HikariDataSource : HikariPool-1 - Starting...
2021-09-03 13:40:23.563 INFO 6496 --- [ main] c.z.h.HikariDataSource : HikariPool-1 - Start completed.
2021-09-03 13:40:23.626 INFO 6496 --- [ main] o.h.d.Dialect : HHH000400: Using dialect: org.hibernate.dialect.SQLServer2012Dialect
2021-09-03 13:40:24.936 INFO 6496 --- [ main] o.h.e.t.j.p.i.JtaPlatformInitiator : HHH000490: Using JtaPlatform implementation: [org.hibernate.engine.transaction.jta.platform.internal.NoJtaPlatform]
2021-09-03 13:40:24.950 INFO 6496 --- [ main] j.LocalContainerEntityManagerFactoryBean : Initialized JPA EntityManagerFactory for persistence unit 'default'
2021-09-03 13:40:25.417 WARN 6496 --- [ main] JpaBaseConfiguration$JpaWebConfiguration : spring.jpa.open-in-view is enabled by default. Therefore, database queries may be performed during view rendering. Explicitly configure spring.jpa.open-in-view to disable this warning
2021-09-03 13:40:25.970 INFO 6496 --- [ main] o.s.b.w.e.t.TomcatWebServer : Tomcat started on port(s): 8080 (http) with context path '/api
2021-09-03 13:40:25.981 INFO 6496 --- [ main] c.h.HubApplication : Started HubApplication in 9.538 seconds (JVM running for 13.477)
2021-09-03 13:41:13.942+05 ERROR c.m.a.i.p.PerformanceCounterContainer - Exception while reporting performance counter 'JSDK_OshiPerformanceCounter'
java.lang.IllegalStateException: Unmapped relationship: 7
at com.sun.jna.platform.win32.WinNT$SYSTEM_LOGICAL_PROCESSOR_INFORMATION_EX.fromPointer(WinNT.java:3033)
at com.sun.jna.platform.win32.Kernel32Util.getLogicalProcessorInformationEx(Kernel32Util.java:715)
at oshi.driver.windows.LogicalProcessorInformation.getLogicalProcessorInformationEx(LogicalProcessorInformation.java:61)
at oshi.hardware.platform.windows.WindowsCentralProcessor.initProcessorCounts(WindowsCentralProcessor.java:155)
at oshi.hardware.common.AbstractCentralProcessor.<init>(AbstractCentralProcessor.java:74)
at oshi.hardware.platform.windows.WindowsCentralProcessor.<init>(WindowsCentralProcessor.java:66)
at oshi.hardware.platform.windows.WindowsHardwareAbstractionLayer.createProcessor(WindowsHardwareAbstractionLayer.java:60)
at oshi.util.Memoizer$1.get(Memoizer.java:87)
at oshi.hardware.common.AbstractHardwareAbstractionLayer.getProcessor(AbstractHardwareAbstractionLayer.java:68)
at com.microsoft.applicationinsights.internal.perfcounter.OshiPerformanceCounter.report(OshiPerformanceCounter.java:60)
at com.microsoft.applicationinsights.internal.perfcounter.PerformanceCounterContainer$1.run(PerformanceCounterContainer.java:231)
at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
at java.base/java.util.concurrent.FutureTask.runAndReset(FutureTask.java:305)
at java.base/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:305)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.base/java.lang.Thread.run(Thread.java:834)
2021-09-03 13:42:13.597+05 ERROR c.m.a.i.p.PerformanceCounterContainer - Exception while reporting performance counter 'JSDK_OshiPerformanceCounter'
java.lang.IllegalStateException: Unmapped relationship: 7
at com.sun.jna.platform.win32.WinNT$SYSTEM_LOGICAL_PROCESSOR_INFORMATION_EX.fromPointer(WinNT.java:3033)
at com.sun.jna.platform.win32.Kernel32Util.getLogicalProcessorInformationEx(Kernel32Util.java:715)
at oshi.driver.windows.LogicalProcessorInformation.getLogicalProcessorInformationEx(LogicalProcessorInformation.java:61)
at oshi.hardware.platform.windows.WindowsCentralProcessor.initProcessorCounts(WindowsCentralProcessor.java:155)
at oshi.hardware.common.AbstractCentralProcessor.<init>(AbstractCentralProcessor.java:74)
at oshi.hardware.platform.windows.WindowsCentralProcessor.<init>(WindowsCentralProcessor.java:66)
at oshi.hardware.platform.windows.WindowsHardwareAbstractionLayer.createProcessor(WindowsHardwareAbstractionLayer.java:60)
at oshi.util.Memoizer$1.get(Memoizer.java:87)
at oshi.hardware.common.AbstractHardwareAbstractionLayer.getProcessor(AbstractHardwareAbstractionLayer.java:68)
at com.microsoft.applicationinsights.internal.perfcounter.OshiPerformanceCounter.report(OshiPerformanceCounter.java:60)
at com.microsoft.applicationinsights.internal.perfcounter.PerformanceCounterContainer$1.run(PerformanceCounterContainer.java:231)
at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
at java.base/java.util.concurrent.FutureTask.runAndReset(FutureTask.java:305)
at java.base/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:305)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.base/java.lang.Thread.run(Thread.java:834)
2021-09-03 13:43:13.611+05 ERROR c.m.a.i.p.PerformanceCounterContainer - Exception while reporting performance counter 'JSDK_OshiPerformanceCounter'
java.lang.IllegalStateException: Unmapped relationship: 7
at com.sun.jna.platform.win32.WinNT$SYSTEM_LOGICAL_PROCESSOR_INFORMATION_EX.fromPointer(WinNT.java:3033)
at com.sun.jna.platform.win32.Kernel32Util.getLogicalProcessorInformationEx(Kernel32Util.java:715)
at oshi.driver.windows.LogicalProcessorInformation.getLogicalProcessorInformationEx(LogicalProcessorInformation.java:61)
at oshi.hardware.platform.windows.WindowsCentralProcessor.initProcessorCounts(WindowsCentralProcessor.java:155)
at oshi.hardware.common.AbstractCentralProcessor.<init>(AbstractCentralProcessor.java:74)
at oshi.hardware.platform.windows.WindowsCentralProcessor.<init>(WindowsCentralProcessor.java:66)
at oshi.hardware.platform.windows.WindowsHardwareAbstractionLayer.createProcessor(WindowsHardwareAbstractionLayer.java:60)
at oshi.util.Memoizer$1.get(Memoizer.java:87)
at oshi.hardware.common.AbstractHardwareAbstractionLayer.getProcessor(AbstractHardwareAbstractionLayer.java:68)
at com.microsoft.applicationinsights.internal.perfcounter.OshiPerformanceCounter.report(OshiPerformanceCounter.java:60)
at com.microsoft.applicationinsights.internal.perfcounter.PerformanceCounterContainer$1.run(PerformanceCounterContainer.java:231)
at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
at java.base/java.util.concurrent.FutureTask.runAndReset(FutureTask.java:305)
at java.base/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:305)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.base/java.lang.Thread.run(Thread.java:834)
2021-09-03 13:44:13.585+05 ERROR c.m.a.i.p.PerformanceCounterContainer - Exception while reporting performance counter 'JSDK_OshiPerformanceCounter'
java.lang.IllegalStateException: Unmapped relationship: 7
at com.sun.jna.platform.win32.WinNT$SYSTEM_LOGICAL_PROCESSOR_INFORMATION_EX.fromPointer(WinNT.java:3033)
at com.sun.jna.platform.win32.Kernel32Util.getLogicalProcessorInformationEx(Kernel32Util.java:715)
at oshi.driver.windows.LogicalProcessorInformation.getLogicalProcessorInformationEx(LogicalProcessorInformation.java:61)
at oshi.hardware.platform.windows.WindowsCentralProcessor.initProcessorCounts(WindowsCentralProcessor.java:155)
at oshi.hardware.common.AbstractCentralProcessor.<init>(AbstractCentralProcessor.java:74)
at oshi.hardware.platform.windows.WindowsCentralProcessor.<init>(WindowsCentralProcessor.java:66)
at oshi.hardware.platform.windows.WindowsHardwareAbstractionLayer.createProcessor(WindowsHardwareAbstractionLayer.java:60)
at oshi.util.Memoizer$1.get(Memoizer.java:87)
at oshi.hardware.common.AbstractHardwareAbstractionLayer.getProcessor(AbstractHardwareAbstractionLayer.java:68)
at com.microsoft.applicationinsights.internal.perfcounter.OshiPerformanceCounter.report(OshiPerformanceCounter.java:60)
at com.microsoft.applicationinsights.internal.perfcounter.PerformanceCounterContainer$1.run(PerformanceCounterContainer.java:231)
at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
at java.base/java.util.concurrent.FutureTask.runAndReset(FutureTask.java:305)
at java.base/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:305)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.base/java.lang.Thread.run(Thread.java:834)
2021-09-03 13:45:13.548+05 ERROR c.m.a.i.p.PerformanceCounterContainer - Exception while reporting performance counter 'JSDK_OshiPerformanceCounter'
java.lang.IllegalStateException: Unmapped relationship: 7
at com.sun.jna.platform.win32.WinNT$SYSTEM_LOGICAL_PROCESSOR_INFORMATION_EX.fromPointer(WinNT.java:3033)
at com.sun.jna.platform.win32.Kernel32Util.getLogicalProcessorInformationEx(Kernel32Util.java:715)
at oshi.driver.windows.LogicalProcessorInformation.getLogicalProcessorInformationEx(LogicalProcessorInformation.java:61)
at oshi.hardware.platform.windows.WindowsCentralProcessor.initProcessorCounts(WindowsCentralProcessor.java:155)
at oshi.hardware.common.AbstractCentralProcessor.<init>(AbstractCentralProcessor.java:74)
at oshi.hardware.platform.windows.WindowsCentralProcessor.<init>(WindowsCentralProcessor.java:66)
at oshi.hardware.platform.windows.WindowsHardwareAbstractionLayer.createProcessor(WindowsHardwareAbstractionLayer.java:60)
at oshi.util.Memoizer$1.get(Memoizer.java:87)
at oshi.hardware.common.AbstractHardwareAbstractionLayer.getProcessor(AbstractHardwareAbstractionLayer.java:68)
at com.microsoft.applicationinsights.internal.perfcounter.OshiPerformanceCounter.report(OshiPerformanceCounter.java:60)
at com.microsoft.applicationinsights.internal.perfcounter.PerformanceCounterContainer$1.run(PerformanceCounterContainer.java:231)
at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
at java.base/java.util.concurrent.FutureTask.runAndReset(FutureTask.java:305)
at java.base/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:305)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.base/java.lang.Thread.run(Thread.java:834)
推薦答案
2021-09-03 13:41:13.942+05錯誤c.m.a.i.p.PerformanceCounterContainer
報告性能計數器‘JSDK_OshiPerformanceCounter’java.lang.IlLegalStateException時異常:
未映射關系:7
在com.sun.jna.platform.win32.WinNT$SYSTEM_LOGICAL_PROCESSOR_INFORMATION_EX.fromPointer(WinNT.java:3033)
在com.sun.jna.platform.win32.Kernel32Util.getLogicalProcessorInformationEx(Kernel32Util.java:715)
基于上述共享堆棧錯誤消息看起來像是";的問題Windows正在向Logical_Processor_Relationship枚舉添加新的關系值&q;&;此問題正在下面的Git Hub社區中積極討論。
https://github.com/java-native-access/jna/issues/1324
我建議您仔細閱讀并更新Git Hub討論(如果您遇到此問題)。
這篇關于在我的Spring Boot應用程序中運行Azure應用程序洞察代理時,我不斷收到IlLegalStateException的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,