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.

NPEs from scan() on ProxyingInputStream.close()

See original GitHub issue

Using ClassGraph 4.8.138 and Narcissus 1.0.7, on Java 17 under linux. Code begins ClassGraph.CIRCUMVENT_ENCAPSULATION = CircumventEncapsulationMethod.NARCISSUS; ClassGraph classGraph = new ClassGraph(); //classGraph.enableClassInfo(); classGraph.enableAllInfo(); try (ScanResult scanResult = classGraph.scan()) { And the scan call throws NPE from numerous threads ClassGraph-worker-XX threads.

I read something about some special handling wrt Tomcat, and I’m using Tomcat 8.5. So my first thought is whether since I’m using such an old version of Tomcat I might be out of the bounds of what you’re handling…

I’ll turn on verbose and get the logging data.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:11 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
lukehutchcommented, Jan 11, 2022

Sorry, you’re right… I updated the points. Thanks.

1reaction
lukehutchcommented, Jan 11, 2022

@ericjs Great, thanks, this was indeed a bug, although it probably didn’t affect anything, since I think exceptions in close() are pretty universally ignored. Fixed in https://github.com/classgraph/classgraph/commit/45d5b991aed611abd228efcd2ecd40ba02489f24 .

Read more comments on GitHub >

github_iconTop Results From Across the Web

What is the correct way to silently close InputStream in finally ...
Best way is to use Java 7 and use try with resources, or do same thing manualy and add exception from closing as...
Read more >
TeeInputStream (Apache Commons IO 2.5 API)
The proxied input stream is closed when the close() method is called on this proxy. It is configurable whether the associated output stream...
Read more >
Right way to Close InputStream and OutputStream in Java
It provides a closeQuitetly() method to close streams quietly i.e. above finally block can be re-written by using IOUtils.closeQuietly() as following. try{ .......
Read more >
Re: [jetty-announce] Jetty 9.0.1.v20130408 Released! - Eclipse
+ 401150 close input stream used from cached resource + 401806 spdy ... scanFile() dies with an NPE if listFiles() returns null +...
Read more >
Resin Change Log
keySet() for linking issues (#6288, rep by A. Thai); server: on HMUX requests, ... hessian: close of Hessian proxy stream when result is...
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