国产 无码 综合区,色欲AV无码国产永久播放,无码天堂亚洲国产AV,国产日韩欧美女同一区二区

Caused by: java.lang.reflect.InaccessibleObjectException: Unable to make protected final java.lang.C

這篇具有很好參考價值的文章主要介紹了Caused by: java.lang.reflect.InaccessibleObjectException: Unable to make protected final java.lang.C。希望對大家有所幫助。如果存在錯誤或未考慮完全的地方,請大家不吝賜教,您也可以點(diǎn)擊"舉報違法"按鈕提交疑問。

最近在學(xué)習(xí)JDK17的時候遇到這么一個問題,springBoot啟動失敗,日志如下:

Exception in thread "main" java.lang.IllegalArgumentException: Unable to instantiate factory class [com.ctrip.framework.apollo.spring.boot.ApolloApplicationContextInitializer] for factory type [org.springframework.context.ApplicationContextInitializer]
	at org.springframework.core.io.support.SpringFactoriesLoader$FailureHandler.lambda$throwing$0(SpringFactoriesLoader.java:650)
	at org.springframework.core.io.support.SpringFactoriesLoader$FailureHandler.lambda$handleMessage$3(SpringFactoriesLoader.java:674)
	at org.springframework.core.io.support.SpringFactoriesLoader.instantiateFactory(SpringFactoriesLoader.java:231)
	at org.springframework.core.io.support.SpringFactoriesLoader.load(SpringFactoriesLoader.java:206)
	at org.springframework.core.io.support.SpringFactoriesLoader.load(SpringFactoriesLoader.java:160)
	at org.springframework.boot.SpringApplication.getSpringFactoriesInstances(SpringApplication.java:459)
	at org.springframework.boot.SpringApplication.getSpringFactoriesInstances(SpringApplication.java:455)
	at org.springframework.boot.SpringApplication.<init>(SpringApplication.java:273)
	at org.springframework.boot.SpringApplication.<init>(SpringApplication.java:252)
	at com.zzz.train.business.BusinessApplication.main(BusinessApplication.java:20)
Caused by: java.lang.reflect.InvocationTargetException
	at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
	at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:77)
	at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
	at java.base/java.lang.reflect.Constructor.newInstanceWithCaller(Constructor.java:499)
	at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:480)
	at org.springframework.core.io.support.SpringFactoriesLoader$FactoryInstantiator.instantiate(SpringFactoriesLoader.java:381)
	at org.springframework.core.io.support.SpringFactoriesLoader.instantiateFactory(SpringFactoriesLoader.java:228)
	... 7 more
Caused by: com.ctrip.framework.apollo.exceptions.ApolloConfigException: Unable to load instance for com.ctrip.framework.apollo.spring.config.ConfigPropertySourceFactory!
	at com.ctrip.framework.apollo.spring.util.SpringInjector.getInstance(SpringInjector.java:40)
	at com.ctrip.framework.apollo.spring.boot.ApolloApplicationContextInitializer.<init>(ApolloApplicationContextInitializer.java:48)
	... 14 more
Caused by: com.ctrip.framework.apollo.exceptions.ApolloConfigException: Unable to initialize Apollo Spring Injector!
	at com.ctrip.framework.apollo.spring.util.SpringInjector.getInjector(SpringInjector.java:24)
	at com.ctrip.framework.apollo.spring.util.SpringInjector.getInstance(SpringInjector.java:37)
	... 15 more
Caused by: com.google.common.util.concurrent.ExecutionError: java.lang.ExceptionInInitializerError
	at com.google.common.cache.LocalCache$Segment.get(LocalCache.java:2201)
	at com.google.common.cache.LocalCache.get(LocalCache.java:3937)
	at com.google.common.cache.LocalCache.getOrLoad(LocalCache.java:3941)
	at com.google.common.cache.LocalCache$LocalLoadingCache.get(LocalCache.java:4824)
	at com.google.common.cache.LocalCache$LocalLoadingCache.getUnchecked(LocalCache.java:4830)
	at com.google.inject.internal.FailableCache.get(FailableCache.java:48)
	at com.google.inject.internal.ConstructorInjectorStore.get(ConstructorInjectorStore.java:50)
	at com.google.inject.internal.ConstructorBindingImpl.initialize(ConstructorBindingImpl.java:138)
	at com.google.inject.internal.InjectorImpl.initializeBinding(InjectorImpl.java:536)
	at com.google.inject.internal.AbstractBindingProcessor$Processor$1.run(AbstractBindingProcessor.java:160)
	at com.google.inject.internal.ProcessedBindingData.initializeBindings(ProcessedBindingData.java:44)
	at com.google.inject.internal.InternalInjectorCreator.initializeStatically(InternalInjectorCreator.java:123)
	at com.google.inject.internal.InternalInjectorCreator.build(InternalInjectorCreator.java:107)
	at com.google.inject.Guice.createInjector(Guice.java:99)
	at com.google.inject.Guice.createInjector(Guice.java:73)
	at com.google.inject.Guice.createInjector(Guice.java:62)
	at com.ctrip.framework.apollo.spring.util.SpringInjector.getInjector(SpringInjector.java:22)
	... 16 more
Caused by: java.lang.ExceptionInInitializerError
	at com.google.inject.internal.cglib.reflect.$FastClass$Generator.getProtectionDomain(FastClass.java:73)
	at com.google.inject.internal.cglib.core.$AbstractClassGenerator.create(AbstractClassGenerator.java:206)
	at com.google.inject.internal.cglib.reflect.$FastClass$Generator.create(FastClass.java:65)
	at com.google.inject.internal.BytecodeGen.newFastClassForMember(BytecodeGen.java:252)
	at com.google.inject.internal.BytecodeGen.newFastClassForMember(BytecodeGen.java:203)
	at com.google.inject.internal.DefaultConstructionProxyFactory.create(DefaultConstructionProxyFactory.java:53)
	at com.google.inject.internal.ProxyFactory.create(ProxyFactory.java:158)
	at com.google.inject.internal.ConstructorInjectorStore.createConstructor(ConstructorInjectorStore.java:90)
	at com.google.inject.internal.ConstructorInjectorStore.access$000(ConstructorInjectorStore.java:29)
	at com.google.inject.internal.ConstructorInjectorStore$1.create(ConstructorInjectorStore.java:37)
	at com.google.inject.internal.ConstructorInjectorStore$1.create(ConstructorInjectorStore.java:33)
	at com.google.inject.internal.FailableCache$1.load(FailableCache.java:37)
	at com.google.common.cache.LocalCache$LoadingValueReference.loadFuture(LocalCache.java:3527)
	at com.google.common.cache.LocalCache$Segment.loadSync(LocalCache.java:2319)
	at com.google.common.cache.LocalCache$Segment.lockedGetOrLoad(LocalCache.java:2282)
	at com.google.common.cache.LocalCache$Segment.get(LocalCache.java:2197)
	... 32 more
Caused by: java.lang.reflect.InaccessibleObjectException: Unable to make protected final java.lang.Class java.lang.ClassLoader.defineClass(java.lang.String,byte[],int,int,java.security.ProtectionDomain) throws java.lang.ClassFormatError accessible: module java.base does not "opens java.lang" to unnamed module @d35dea7
	at java.base/java.lang.reflect.AccessibleObject.checkCanSetAccessible(AccessibleObject.java:354)
	at java.base/java.lang.reflect.AccessibleObject.checkCanSetAccessible(AccessibleObject.java:297)
	at java.base/java.lang.reflect.Method.checkCanSetAccessible(Method.java:199)
	at java.base/java.lang.reflect.Method.setAccessible(Method.java:193)
	at com.google.inject.internal.cglib.core.$ReflectUtils$1.run(ReflectUtils.java:52)
	at java.base/java.security.AccessController.doPrivileged(AccessController.java:318)
	at com.google.inject.internal.cglib.core.$ReflectUtils.<clinit>(ReflectUtils.java:42)
	... 48 more

Process finished with exit code 1

原因:這是由于 JDK 8 中有關(guān)反射相關(guān)的功能自從 JDK 9 開始就已經(jīng)被限制了,為了兼容原先的版本,需要在運(yùn)行項目時添加?--add-opens java.base/java.lang=ALL-UNNAMED?選項來開啟這種默認(rèn)不被允許的行為。

解決方案:

caused by: java.lang.reflect.inaccessibleobjectexception: unable to make pro,java

結(jié)果:

caused by: java.lang.reflect.inaccessibleobjectexception: unable to make pro,java文章來源地址http://www.zghlxwxcb.cn/news/detail-772642.html

到了這里,關(guān)于Caused by: java.lang.reflect.InaccessibleObjectException: Unable to make protected final java.lang.C的文章就介紹完了。如果您還想了解更多內(nèi)容,請在右上角搜索TOY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!

本文來自互聯(lián)網(wǎng)用戶投稿,該文觀點(diǎn)僅代表作者本人,不代表本站立場。本站僅提供信息存儲空間服務(wù),不擁有所有權(quán),不承擔(dān)相關(guān)法律責(zé)任。如若轉(zhuǎn)載,請注明出處: 如若內(nèi)容造成侵權(quán)/違法違規(guī)/事實(shí)不符,請點(diǎn)擊違法舉報進(jìn)行投訴反饋,一經(jīng)查實(shí),立即刪除!

領(lǐng)支付寶紅包贊助服務(wù)器費(fèi)用

相關(guān)文章

  • java.lang.reflect.InaccessibleObjectException

    低版本springboot應(yīng)用使用高版本JDK報以下異常: Caused by: java.lang.reflect.InaccessibleObjectException: Unable to make protected final java.lang.Class java.lang.ClassLoader.defineClass(java.lang.String,byte[],int,int,java.security.ProtectionDomain) throws java.lang.ClassFormatError accessible: module java.base does not \\\"opens java.lang\\\" to un

    2024年04月28日
    瀏覽(165)
  • 關(guān)于java.lang.reflect.InaccessibleObjectException異常

    關(guān)于java.lang.reflect.InaccessibleObjectException異常

    在使用javassist插件的時候,jdk版本大于8的時候沒有對應(yīng)的包會導(dǎo)致出現(xiàn)以下異常 java.lang.reflect.InaccessibleObjectException ? 點(diǎn)擊后選擇Edit Configurations... ?修改如下信息即可 --add-opens java.base/java.lang=ALL-UNNAMED --add-opens java.base/sun.net.util=ALL-UNNAMED? 修改后記得將構(gòu)造選擇為對應(yīng)的內(nèi)容

    2024年02月13日
    瀏覽(92)
  • jdk 8以上版本報錯 :Unable to make field protected java.lang.reflect.InvocationHandler java.lang.reflect...

    具體報錯信息: Unable to make field protected java.lang.reflect.InvocationHandler java.lang.reflect.Proxy.h accessible: module java.base does not \\\"opens java.lang.reflect\\\" to unnamed module @7674f035 需要設(shè)置啟動參數(shù) --add-opens java.base/java.lang.reflect=ALL-UNNAMED

    2024年02月20日
    瀏覽(131)
  • 解決Caused by: java.lang.IllegalStateException:

    目錄 問題描述 解決方案 1. 修改JVM的-Xss參數(shù) 2. 檢查循環(huán)繼承依賴項 3. 更新相關(guān)庫和依賴 總結(jié) 在使用Java開發(fā)Web應(yīng)用程序時,我們有時會遇到? ?Caused by: java.lang.IllegalStateException? ??異常,其中包含一個關(guān)于StackOverflow錯誤的描述。這種錯誤可能會導(dǎo)致無法完成對Web應(yīng)用程

    2024年02月03日
    瀏覽(517)
  • 出現(xiàn)Caused by: java.lang.NullPointerException異常的解決方法

    出現(xiàn)Caused by: java.lang.NullPointerException異常的解決方法

    拿到老師的項目,項目啟動時正常,網(wǎng)頁提交數(shù)據(jù)時出現(xiàn)Caused by: 報錯, 上一條日志顯示 是連接mysql的時候出現(xiàn)bug導(dǎo)致的, 查了一下是數(shù)據(jù)庫版本不匹配問題, 于是我看了一下自己電腦的mysql版本 哇哦,是mysql8.0,再看一下依賴?yán)锏膍ysql版本 是mysql5.1.32,這倆版本不匹配,

    2024年02月11日
    瀏覽(114)
  • Caused by: java.lang.IllegalStateException: No DataSource set

    如果Nacos連不上數(shù)據(jù)庫,還哪都配置正確,請注意時區(qū) serverTimezone=Asia/Shanghai

    2024年02月11日
    瀏覽(160)
  • Tomcat Caused by: java.lang.ClassNotFoundException: java.util.logging.Logger

    本質(zhì)原因:JRE_HOME的環(huán)境變量配置不正確 進(jìn)入jdk文件夾 windows下執(zhí)行: binjlink.exe --module-path jmods --add-modules java.desktop --output jre linux下執(zhí)行: bin/jlink --module-path jmods --add-modules java.desktop --output jre JRE_HOME: java8 需要加上jre目錄,java 11 只需要與JAVA_HOME保持一致即可

    2024年02月16日
    瀏覽(181)
  • Caused by: java.lang.IllegalStateException: Failed to introspect Class

    Caused by: java.lang.IllegalStateException: Failed to introspect Class

    1、問題報錯如下: 2、問題解析: 意思是:未能反射rabbitmq類包(就是添加了依賴沒加載進(jìn)去);需與ClassNotFindException的錯誤區(qū)分,此異常是引用了沒有依賴的類。 3、解決方案: 方案一(如果導(dǎo)入的依賴“scope”標(biāo)簽為值provided,則修改如下): 改為如下所示:(去掉scop

    2024年02月11日
    瀏覽(94)
  • 解決Caused by: java.lang.IllegalStateException: Ambiguous mapping. Cannot map ‘inteController‘

    解決Caused by: java.lang.IllegalStateException: Ambiguous mapping. Cannot map ‘inteController‘

    出現(xiàn)這個錯也可能會出現(xiàn)項目無法啟動的錯誤。完整錯誤是 一、錯誤出現(xiàn)原因 : ? ? ? ? controller層出現(xiàn)了重復(fù)的方法映射 ???????? ????????可以看到圖片中兩個方法的映射是一樣的,這是問題所在 解決方法也很簡單,既然已經(jīng)知道了問題所在那么解決起來也很簡單

    2024年02月10日
    瀏覽(95)
  • Caused by: java.lang.UnsupportedClassVersionError: org/mybatis/spring/boot/autoconfigure/MybatisDepe

    最近搭建了Maven+Springboot項目,啟動報錯

    2024年02月12日
    瀏覽(123)

覺得文章有用就打賞一下文章作者

支付寶掃一掃打賞

博客贊助

微信掃一掃打賞

請作者喝杯咖啡吧~博客贊助

支付寶掃一掃領(lǐng)取紅包,優(yōu)惠每天領(lǐng)

二維碼1

領(lǐng)取紅包

二維碼2

領(lǐng)紅包