question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[BUG] NullPointerException when loading configuration

See original GitHub issue
Description

I have an automatic build pipeline that uses the openapi generator to create a python-flask server. Today the builds started failing with a NullPointerException and the below mentioned stack-trace.

openapi-generator version

I use the following Docker Image: openapitools/openapi-generator-cli latest 132da9168d58

OpenAPI declaration file content or url

Seems to be irrelevant, also happens with the swagger petstore.

Generation Details
docker run --rm -u $(id -u) -v "$(pwd):/local" openapitools/openapi-generator-cli generate -i /local/openapi.yaml -g python-flask -o /local/app -c /local/config.json --package-name PKGNAM --skip-operation-example

Contents of config.json:

{
        "packageName": "PKGNAM",
        "serverPort": "8080"
}
Output
Exception in thread "main" java.lang.NullPointerException
	at java.base/java.lang.String.concat(Unknown Source)
	at org.openapitools.codegen.CodegenConfigLoader.forName(CodegenConfigLoader.java:48)
	at org.openapitools.codegen.config.CodegenConfigurator.fromFile(CodegenConfigurator.java:94)
	at org.openapitools.codegen.cmd.Generate.execute(Generate.java:272)
	at org.openapitools.codegen.cmd.OpenApiGeneratorCommand.run(OpenApiGeneratorCommand.java:32)
	at org.openapitools.codegen.OpenAPIGenerator.main(OpenAPIGenerator.java:66)

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:13
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
idkCppcommented, Jan 13, 2022

I now use openapitools/openapi-generator-cli:latest-release instead of openapitools/openapi-generator-cli:latest. For me this works fine.

1reaction
provokateurincommented, Jan 13, 2022

Hello, I’m also facing this issue and did a bisect and found out that commit dd3bba8c9442f2ee40d6ea8f0872ab0be43714b9 broke it. @spacether pinging you as the author of the commit.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to Fix and Avoid NullPointerException in Java - Rollbar
The NullPointerException occurs due to a situation in application code where an uninitialized object is attempted to be accessed or modified.
Read more >
Error while loading the grid -null pointer exception [duplicate]
Null pointer exception : When ever a program code tried to access the data/object which is not present or not set or set...
Read more >
Java NullPointerException - Detect, Fix, and Best Practices
When we run the above program, it throws the following NullPointerException error message. Exception in thread "main" java.lang.
Read more >
Receive Error 500: java.lang.NullPointerException when ... - IBM
NullPointerException when accessing Case Manager Builder using SSL with TLSv1.2 configured in the application server. Symptom. When opening Case ...
Read more >
java.lang.NullPointerException when loading plugin config
I'm coding a bungeecord plugin and I get this error (apparently on the line where I load the config): 11:54:43 [WARNING] Exception ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found