Skip to content

Program running reported null pointer exception, resulting in stack overflow #2388

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

Closed
Truly-Zheng opened this issue Sep 26, 2023 · 8 comments
Labels
incomplete incomplete description: Make sure you Provide a Minimal, Reproducible Example - with HelloController

Comments

@Truly-Zheng
Copy link

image
image

My entity class extend the com.baomidou.mybatisplus.extension.activerecord.Model class, the runtime found a null pointer exception, this Model class uses generic references.

image

When I remove the extends class, the program works fine.hope to resolve the problem soon.
thanks a lot.

@marcospds
Copy link

Good evening, I was unable to simulate this problem, could you provide an example project of the error?
I tried it here: https://github.com/marcospds/springdoc-stack-overflow

@uc4w6c
Copy link
Collaborator

uc4w6c commented Oct 6, 2023

This ticket will be closed and can be reopened if the relevant information are provided.

@uc4w6c uc4w6c closed this as completed Oct 6, 2023
@uc4w6c uc4w6c added the incomplete incomplete description: Make sure you Provide a Minimal, Reproducible Example - with HelloController label Oct 6, 2023
@Truly-Zheng
Copy link
Author

Truly-Zheng commented Oct 10, 2023

@marcospds
Hello, you added this configuration
springdoc.default-flat-param-object=true

The above error will occur.

@uc4w6c uc4w6c reopened this Oct 10, 2023
@marcospds
Copy link

Good evening @Truly-Zheng, I couldn't replicate your issue. I updated my project with the parameter you mentioned, and I also made some changes to make it more similar to your screenshots, but the error still doesn't occur. Another thing I noticed is that your SysUser class doesn't have the @entity and @id annotations, your project must have some other peculiarity causing the problem. Could you provide your project as an example or create a fork of the sample to show how your project is set up so that we can replicate the issue?

@Truly-Zheng
Copy link
Author

Truly-Zheng commented Oct 12, 2023 via email

@Truly-Zheng
Copy link
Author

Truly-Zheng commented Oct 12, 2023

Hello,good morning @marcospds
I have a demo here that you can refer to.
springboot 2.7.15
java 8
knife4j 4.3.0

https://github.com/Truly-Zheng/springdoc-stack-overflow.git

Start the program first, then access url: http://localhost:8080/doc.html

when i remove the config springdoc.default-flat-param-object=true or change config springdoc.default-flat-param-object=false
the program works fine.

@marcospds
Copy link

Hello @Truly-Zheng, your project is using springdoc-openapi 1.7 which is no longer supported, @uc4w6c could confirm?

Disclaimer:

springdoc-openapi v1.7.0 is the latest Open Source release supporting Spring Boot 2.x and 1.x.
An extended support for springdoc-openapi v1 project is now available for organizations that need support beyond 2023.
For more details, feel free to reach out: [email protected]

@uc4w6c
Copy link
Collaborator

uc4w6c commented Oct 13, 2023

@marcospds
Thank you.
But if v2.2.0 occur issue too, after we fix it, we release v2.2.1 or v2.3.0.

@Truly-Zheng
This issue was already fixed it #2291.
But v1 is not supported. Could you use v2.
Alternatively, by separating the Bean that receives data through RequestBody from the Bean responsible for database operations, you can resolve the issue.

@uc4w6c uc4w6c closed this as completed Oct 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
incomplete incomplete description: Make sure you Provide a Minimal, Reproducible Example - with HelloController
Projects
None yet
Development

No branches or pull requests

3 participants