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.

NullPointerException for MediaType.getSchema()

See original GitHub issue

I’m facing a NullPointerException issue.

The command that I ran was: ./cats.jar --contract=openapi.yaml --server=https://subdomain.domain-name --paths=/v1/endpoint --headers=headers.yaml

Result Info

[********* ][*****] ● note     Proxy configuration to be used: DIRECT
[********* ][*****] ▶ start    Starting CATS, version 6.0.4, build-time 2021-07-23T06:05:54.116 UTC
[********* ][*****] ● note     Processing configuration...
[********* ][*****] ℹ info     No security custom Fuzzer file. SecurityFuzzer will be skipped!
[********* ][*****] ℹ info     No custom Fuzzer file. CustomFuzzer will be skipped!
[********* ][*****] ℹ info     No reference data file was supplied! Payloads supplied by Fuzzers will remain unchanged!
[********* ][*****] ▶ start    skipXXXForPath supplied arguments: []. Matching with registered fuzzers...
[********* ][*****] ☑ complete skipXXXForPath list after matching with registered fuzzers: []
[********* ][*****] ✖ error    Something went wrong while running CATS!
java.lang.NullPointerException: Cannot invoke "" because the return value of "" is null
	at com.endava.cats.CatsMain.addToSchemas(
	at com.endava.cats.CatsMain.lambda$getSchemas$0(
	at java.base/java.util.LinkedHashMap.forEach(
	at com.endava.cats.CatsMain.getSchemas(
	at com.endava.cats.CatsMain.fuzzPath(
	at com.endava.cats.CatsMain.startFuzzing(
	at com.endava.cats.CatsMain.doLogic(
	at org.springframework.boot.SpringApplication.callRunner(
	at org.springframework.boot.SpringApplication.callRunners(
	at com.endava.cats.CatsMain.main(
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(
	at java.base/java.lang.reflect.Method.invoke(
	at org.springframework.boot.loader.Launcher.launch(
	at org.springframework.boot.loader.Launcher.launch(
	at org.springframework.boot.loader.PropertiesLauncher.main(

How can I fix this issue?

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

en-miliecommented, Aug 25, 2021

@8luebottle I fixed this. For now CATS does not support other content types outside applixation/json. In your example the request body is a multipart/form-data. CATS will now print a warning instead of failing with NPE.

8luebottlecommented, Aug 26, 2021

@en-milie Got it. I appreciate your help.

Read more comments on GitHub >

github_iconTop Results From Across the Web

java.lang.NullPointerException at io.swagger.v3.parser ...
NullPointerException at io.swagger.v3.parser.converter. ... description: Album information associated with the media type: string artist: ...
Read more >
io.swagger.v3.parser.util.OpenAPIDeserializer.getSchema ...
ObjectNode schema = (ObjectNode) schemaValue; Schema schemaObj = getSchema(schema, String.format("%s.%s", location, schemaName), result);
Read more >
NullPointerException MediaType in RestTemplate Spring boot
This is problem from 2.2.0 spring-boot. They set deprecation for default charset encoding. Try replacing with followingFor both type. json ...
Read more >
Example usage for java.lang NullPointerException getMessage
Introduction. In this page you can find the example usage for java.lang NullPointerException getMessage. Prototype. public String getMessage().
Read more >
Solr - java.lang.NullPointerException : createMainQuery
I ran into issues indexing a csv document, in the schema config i had specified a uniqueKey value, for some reason it kept...
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 Post

No results found

github_iconTop Related Hashnode Post

No results found