Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

springboot3中无法完成设备注册,自定义实现类没有注入到处理逻辑的类中 #22

Open
wangran99 opened this issue Dec 12, 2023 · 3 comments

Comments

@wangran99
Copy link
Contributor

springboot3项目引用最新pom,sip common模块SipProxyAutoConfig类能够获取SipRequestProcessor子类的bean,但是SipRequestProcessor子类中负责具体处理REGISTER ,INVINT, BYE, MESSAGE的XXXProcessorServer字段的对象注入不成功。

image

比如register处理类ServerRegisterRequestProcessor类的registerProcessorServer一直为空。项目中已经自定义了RegisterProcessorServer实现类DefaultRegisterProcessorServer,并且指定类bean的名称,依然没能成功注入字段

image

@wangran99
Copy link
Contributor Author

另外,1:使用springboot2.7.14版本引用server会报错,luna-common的lombok版本太低
2:启动报错,缺少构件,自行引入下面的构件就能正常使用了:

        <dependency>
            <groupId>org.assertj</groupId>
            <artifactId>assertj-core</artifactId>
            <version>3.19.0</version> <!-- 版本号请根据你的需求进行调整 -->
        </dependency>

@lunasaw
Copy link
Owner

lunasaw commented Dec 13, 2023

另外,1:使用springboot2.7.14版本引用server会报错,luna-common的lombok版本太低

2:启动报错,缺少构件,自行引入下面的构件就能正常使用了:


        <dependency>

            <groupId>org.assertj</groupId>

            <artifactId>assertj-core</artifactId>

            <version>3.19.0</version> <!-- 版本号请根据你的需求进行调整 -->

        </dependency>

Springboot3这个我还没测过,可能依赖注入方式有所改变。现在是构造器注入的。有待测试

2.7.14这个可以升级试试,luna-common我升级Lombok试试

@wangran99
Copy link
Contributor Author

wangran99 commented Dec 14, 2023

1.缺少 assertj-core报错的问题,可能是因为这个依赖是在spring-boot-starter-test中引用到的,只有 test的时候才生效。这里可能需要单独把artifactId>assertj-core从spring-boot-starter-test中拿出来单独引用。

2.springboot3的@resource注入为啥没生效我也不知道为啥,只能通过反射强行把属性值的bean 给set进去。
目前官网貌似不大推荐用boot2了,我们的新项目也都用新的boot3了,虚拟线程引入之后并发量确实提升了几倍。

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants