[ https://issues.apache.org/jira/browse/WICKET-6971?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17522824#comment-17522824 ]
ASF subversion and git services commented on WICKET-6971: --------------------------------------------------------- Commit 07b08ffd10c3aabbf6f1d8f4e44d2b49c679152f in wicket's branch refs/heads/wicket-9.x from Ryo [ https://gitbox.apache.org/repos/asf?p=wicket.git;h=07b08ffd10 ] [WICKET-6971] NullPointerException in ModificationWatcher (#510) (cherry picked from commit 541615be7d6fec61db84e6f1f94fc65227d22eef) > NullPointerException in ModificationWatcher > ------------------------------------------- > > Key: WICKET-6971 > URL: https://issues.apache.org/jira/browse/WICKET-6971 > Project: Wicket > Issue Type: Bug > Environment: * Eclipse Version: 2021-12 (4.22.0) Build id: > 20211202-1639 > * Tomcat 9.0.44 > * Java11(amazon-corretto-11.0.10.9.1-windows-x64-jdk) > Reporter: Ryo Tsunoda > Priority: Minor > > Sometimes this exception occurs after I edit the CSS. > > ``` > 2022-04-09 19:28:48.252 | ERROR | [ModificationWatcher Task] | > org.apache.wicket.util.thread.Task | Unhandled exception thrown by user code > in task ModificationWatcher > java.lang.NullPointerException: null > at org.apache.wicket.util.io.Connections.close(Connections.java:133) > ~[wicket-util-8.14.0.jar:8.14.0] > at > org.apache.wicket.core.util.resource.UrlResourceStream.updateContentLength(UrlResourceStream.java:247) > ~[wicket-core-8.14.0.jar:8.14.0] > at > org.apache.wicket.core.util.resource.UrlResourceStream.lastModifiedTime(UrlResourceStream.java:224) > ~[wicket-core-8.14.0.jar:8.14.0] > at > org.apache.wicket.markup.MarkupResourceStream.lastModifiedTime(MarkupResourceStream.java:148) > ~[wicket-core-8.14.0.jar:8.14.0] > at > org.apache.wicket.util.watch.ModificationWatcher.checkModified(ModificationWatcher.java:157) > ~[wicket-util-8.14.0.jar:8.14.0] > at > org.apache.wicket.util.watch.ModificationWatcher$1.run(ModificationWatcher.java:143) > ~[wicket-util-8.14.0.jar:8.14.0] > at org.apache.wicket.util.thread.Task$1.run(Task.java:116) > [wicket-util-8.14.0.jar:8.14.0] > at java.lang.Thread.run(Thread.java:829) [?:?] > ``` > > connection.getInputStream() returns null. > Wicket can check null here. > [https://github.com/apache/wicket/blob/wicket-8.x/wicket-util/src/main/java/org/apache/wicket/util/io/Connections.java#L133] > > Tomcat's CachedResourceURLConnection#getInputStream() sometimes returns a > WebResource instance with no stream. > [https://github.com/apache/tomcat/blob/9.0.x/java/org/apache/catalina/webresources/CachedResource.java#L516] > > I don't know the conditions under which it can be reproduced. > -- This message was sent by Atlassian Jira (v8.20.1#820001)