首页 > 其他分享 >Lottery学习记录

Lottery学习记录

时间:2023-12-06 17:34:20浏览次数:27  
标签:lang java 记录 na jar 学习 org RELEASE Lottery

进度

  1. 环境、配置、规范
  2. 搭建(DDD + RPC)架构
  3. 跑通广播模式RPC过程调用
  4. 抽奖活动策略库表设计
  5. 抽奖策略领域模块开发

遇到的问题

  1. (第三节)跑通RPC调用例子时失败,经过仔细比对+研究issue发现 是dubbo的服务端注解service是spring的,改为dubbo的service注解就可以了
  2. 用一台新电脑重新跑rpc启动服务端时,报bean注入失败与空指针,发现只有用alibaba那个注解才能启动成功,而原来的使用的apache的dubbo注解可以正常启动.
    经过一番研究后发现是JDK的锅。。。项目默认JDK用的是openJDK19 原来使用的是1.8的JDK.
    JDK19必须要使用alibaba那个dubbo注解才能跑起来
    1.8的对应apache的dubbo注解服务才能起来
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'providers:dubbo:cn.itedus.lottery.rpc.IActivityBooth': Instantiation of bean failed; nested exception is java.lang.ExceptionInInitializerError
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateBean(AbstractAutowireCapableBeanFactory.java:1318) ~[spring-beans-5.2.10.RELEASE.jar:5.2.10.RELEASE]
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1213) ~[spring-beans-5.2.10.RELEASE.jar:5.2.10.RELEASE]
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:556) ~[spring-beans-5.2.10.RELEASE.jar:5.2.10.RELEASE]
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:516) ~[spring-beans-5.2.10.RELEASE.jar:5.2.10.RELEASE]
	at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:324) ~[spring-beans-5.2.10.RELEASE.jar:5.2.10.RELEASE]
	at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234) ~[spring-beans-5.2.10.RELEASE.jar:5.2.10.RELEASE]
	at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:322) ~[spring-beans-5.2.10.RELEASE.jar:5.2.10.RELEASE]
	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:202) ~[spring-beans-5.2.10.RELEASE.jar:5.2.10.RELEASE]
	at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:897) ~[spring-beans-5.2.10.RELEASE.jar:5.2.10.RELEASE]
	at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:879) ~[spring-context-5.2.10.RELEASE.jar:5.2.10.RELEASE]
	at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:551) ~[spring-context-5.2.10.RELEASE.jar:5.2.10.RELEASE]
	at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:143) ~[spring-boot-2.3.5.RELEASE.jar:2.3.5.RELEASE]
	at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:758) ~[spring-boot-2.3.5.RELEASE.jar:2.3.5.RELEASE]
	at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:750) ~[spring-boot-2.3.5.RELEASE.jar:2.3.5.RELEASE]
	at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:405) ~[spring-boot-2.3.5.RELEASE.jar:2.3.5.RELEASE]
	at org.springframework.boot.SpringApplication.run(SpringApplication.java:315) ~[spring-boot-2.3.5.RELEASE.jar:2.3.5.RELEASE]
	at org.springframework.boot.SpringApplication.run(SpringApplication.java:1237) ~[spring-boot-2.3.5.RELEASE.jar:2.3.5.RELEASE]
	at org.springframework.boot.SpringApplication.run(SpringApplication.java:1226) ~[spring-boot-2.3.5.RELEASE.jar:2.3.5.RELEASE]
	at cn.itedus.lottery.LotteryApplication.main(LotteryApplication.java:16) ~[classes/:na]
Caused by: java.lang.ExceptionInInitializerError: null
	at java.base/jdk.internal.misc.Unsafe.ensureClassInitialized0(Native Method) ~[na:na]
	at java.base/jdk.internal.misc.Unsafe.ensureClassInitialized(Unsafe.java:1160) ~[na:na]
	at java.base/jdk.internal.reflect.MethodHandleAccessorFactory.ensureClassInitialized(MethodHandleAccessorFactory.java:300) ~[na:na]
	at java.base/jdk.internal.reflect.MethodHandleAccessorFactory.newConstructorAccessor(MethodHandleAccessorFactory.java:103) ~[na:na]
	at java.base/jdk.internal.reflect.ReflectionFactory.newConstructorAccessor(ReflectionFactory.java:201) ~[na:na]
	at java.base/java.lang.reflect.Constructor.acquireConstructorAccessor(Constructor.java:547) ~[na:na]
	at java.base/java.lang.reflect.Constructor.newInstanceWithCaller(Constructor.java:497) ~[na:na]
	at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:484) ~[na:na]
	at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:204) ~[spring-beans-5.2.10.RELEASE.jar:5.2.10.RELEASE]
	at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:87) ~[spring-beans-5.2.10.RELEASE.jar:5.2.10.RELEASE]
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateBean(AbstractAutowireCapableBeanFactory.java:1310) ~[spring-beans-5.2.10.RELEASE.jar:5.2.10.RELEASE]
	... 18 common frames omitted
Caused by: java.lang.IllegalStateException: Failed to create adaptive instance: java.lang.IllegalStateException: Can't create adaptive extension interface org.apache.dubbo.rpc.Protocol, cause: 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 @5fdcaa40
	at org.apache.dubbo.common.extension.ExtensionLoader.getAdaptiveExtension(ExtensionLoader.java:482) ~[dubbo-2.7.1.jar:2.7.1]
	at org.apache.dubbo.config.ServiceConfig.<clinit>(ServiceConfig.java:90) ~[dubbo-2.7.1.jar:2.7.1]
	... 29 common frames omitted
Caused by: java.lang.IllegalStateException: Can't create adaptive extension interface org.apache.dubbo.rpc.Protocol, cause: 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 @5fdcaa40
	at org.apache.dubbo.common.extension.ExtensionLoader.createAdaptiveExtension(ExtensionLoader.java:843) ~[dubbo-2.7.1.jar:2.7.1]
	at org.apache.dubbo.common.extension.ExtensionLoader.getAdaptiveExtension(ExtensionLoader.java:478) ~[dubbo-2.7.1.jar:2.7.1]
	... 30 common frames omitted
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 @5fdcaa40
	at java.base/java.lang.reflect.AccessibleObject.throwInaccessibleObjectException(AccessibleObject.java:387) ~[na:na]
	at java.base/java.lang.reflect.AccessibleObject.checkCanSetAccessible(AccessibleObject.java:363) ~[na:na]
	at java.base/java.lang.reflect.AccessibleObject.checkCanSetAccessible(AccessibleObject.java:311) ~[na:na]
	at java.base/java.lang.reflect.Method.checkCanSetAccessible(Method.java:201) ~[na:na]
	at java.base/java.lang.reflect.Method.setAccessible(Method.java:195) ~[na:na]
	at javassist.ClassPool.toClass2(ClassPool.java:1181) ~[javassist-3.20.0-GA.jar:na]
	at javassist.ClassPool.toClass(ClassPool.java:1164) ~[javassist-3.20.0-GA.jar:na]
	at javassist.CtClass.toClass(CtClass.java:1305) ~[javassist-3.20.0-GA.jar:na]
	at org.apache.dubbo.common.compiler.support.JavassistCompiler.doCompile(JavassistCompiler.java:83) ~[dubbo-2.7.1.jar:2.7.1]
	at org.apache.dubbo.common.compiler.support.AbstractCompiler.compile(AbstractCompiler.java:59) ~[dubbo-2.7.1.jar:2.7.1]
	at org.apache.dubbo.common.compiler.support.AdaptiveCompiler.compile(AdaptiveCompiler.java:45) ~[dubbo-2.7.1.jar:2.7.1]
	at org.apache.dubbo.common.extension.ExtensionLoader.createAdaptiveExtensionClass(ExtensionLoader.java:859) ~[dubbo-2.7.1.jar:2.7.1]
	at org.apache.dubbo.common.extension.ExtensionLoader.getAdaptiveExtensionClass(ExtensionLoader.java:852) ~[dubbo-2.7.1.jar:2.7.1]
	at org.apache.dubbo.common.extension.ExtensionLoader.createAdaptiveExtension(ExtensionLoader.java:841) ~[dubbo-2.7.1.jar:2.7.1]
	... 31 common frames omitted


标签:lang,java,记录,na,jar,学习,org,RELEASE,Lottery
From: https://www.cnblogs.com/xiaolibiji/p/17880030.html

相关文章

  • 2023最新高级java面试题,包含答案。刷题必备!记录一下。
    好记性不如烂笔头内容来自面试宝典-高级java面试题合集问:能否描述一下Java的垃圾回收机制及其工作原理?当然可以。Java的垃圾回收机制:Java的垃圾回收(GarbageCollection,简称GC)机制是Java虚拟机(JVM)的一部分,它自动处理应用程序不再使用的对象的内存。该机制帮助开发者避免......
  • 2023-2024-1 20231320 《计算机基础与程序设计》第十周学习总结
    2023-2024-120231320《计算机基础与程序设计》第十周学习总结作业信息这个作业属于哪个课程<班级的链接>(2023-2024-1计算机基础与程序设计)这个作业要求在哪里<作业要求的链接>(2022-2023-1计算机基础与程序设计第十周作业)这个作业的目标<自学《计算机基础与......
  • 2023最新Spring Boot面试题,包含答案。刷题必备!记录一下。
    好记性不如烂笔头内容来自面试宝典-SpringBoot面试题合集问:SpringBoot有哪些优点?SpringBoot具有一系列的优点,包括:简化配置:SpringBoot提供了许多自动配置,可以让你更方便地开发应用程序。快速开发:SpringBoot具有许多微服务构建工具,可以让你快速开发和部署应用程序......
  • Groovy学习
    一、数据类型下面的是内置数据类型,一旦定义后无法修改变量类型1byte-这是用来表示字节值。例如2。2short-这是用来表示一个短整型。例如10。3int-这是用来表示整数。例如1234。4long-这是用来表示一个长整型。例如10000090。5float-这是用来表示32位浮点数。例如......
  • 记录一下自己博客美化的过程
    1、首先博客皮肤选择SimpleMemory 2、修改基础样式看了很多博客,都是放成品,想修改一下也无从下手,F12看了看代码,干脆在原来样式基础上修改一下吧。这个【禁用模版默认CSS】不能勾选上哈,不然所有样式都要自己重新写一遍了,在样式里把下面粘贴上去就ok,此时可以看看样式有了很大......
  • 《Java编程思想第四版》学习笔记44--关于按钮组
    //:ButtonGroups.java//Usesreflectiontocreategroupsofdifferent//typesofAbstractButton.packagec13.swing;importjava.awt.*;importjava.awt.event.*;importjavax.swing.*;importjavax.swing.border.*;importjava.lang.reflect.*;publicclassB......
  • 【机器学习】自动微分
    标量变量的反向传播以下举两个例子说明标量变量的反向传播如何实现。非标量变量的反向传播在上述的例子中,x是向量,而y是标量,这种类型为标量变量的反向传播。但当y不是标量时,比如y=x*x,当求向量y关于另一个向量x的导数时,结果通常就是一个矩阵,被称为雅可比矩阵,或......
  • 补题记录
    https://codeforces.com/contest/1903/problem/E交互题GeoGamehttps://codeforces.com/contest/1903/problem/F2-sat图论题Babysittinghttps://codeforces.com/contest/1903/problem/D2一个奇怪的题目https://atcoder.jp/contests/abc331/tasks/abc331_f线段......
  • linux学习-6
    文件共享1.FTP服务构建FTP服务是一种文件共享服务,依照FTP协议提供服务,默认使用端口20、21。其中端口20用于传输数据,端口21用于客户端发出相关的FTP指令。FTP协议有以下两种工作模式:①主动模式:FTP服务器主动向客户端发送连接请求。②被动模式:FTP的默认工作模式,FTP服务器等待......
  • Solidity基本概念学习2
    文档:https://solidity-by-example.org/视频教程:https://www.youtube.com/watch?v=xv9OmztShIw&list=PLO5VPQH6OWdVQwpQfw9rZ67O6Pjfo6q-p说明看视频没注意有文档,前面写了一篇好多废话,之后结合文档+视频去做笔记和写代码,做记录...常量(constant)常量是不能修改的......