I can reproduce on the latest (current ones on 27th of February) versions of XWiki 15.10.6 and 16.1 with Java 21 not only by visiting Skin page, but copy/paste the below code on Sandbox or any Test pages.
{code} {{attachmentSelector classname="XWiki.XWikiUsers" property="image" filter="png,jpeg,jpg,gif" displayImage="true" buttontext="choose" width="123" cssClass="myCSSClass"/}} {code}
That which raises same warning in logs
{code} 2024-02-27 11:56:21,842 [http-nio-7635-exec-6 - http://localhost:7635/xwiki/bin/download/XWiki/DefaultSkin/filename] WARN c.x.x.p.XWikiPluginManager - downloadAttachment failed for plugin [image]: Cannot invoke "com.xpn.xwiki.doc.XWikiAttachment.getMimeType(com.xpn.xwiki.XWikiContext)" because "attachment" is null 2024-02-27 11:56:21,842 [http-nio-7635-exec-6 - http://localhost:7635/xwiki/bin/download/XWiki/DefaultSkin/filename] WARN c.x.x.p.XWikiPluginManager - downloadAttachment failed for plugin [zipexplorer]: Cannot invoke "com.xpn.xwiki.doc.XWikiAttachment.getReference()" because "attachment" is null {code}
But copy/paste the code below on Sandbox or any test pages and click on the button "Choose an attachment".
{code} {{attachmentSelector classname="XWiki.XWikiUsers" property="avatar" savemode="direct" displayImage="true" width="120" link="true" filter="png,jpg,gif" defaultValue="XWiki.XWikiUserSheet@noavatar.png"/}} {code}
This prints warning {code} 2024-02-27 15:17:27,669 [qtp278934944-41 - http://192.168.150.86:8080/xwiki/bin/download/XWiki/XWikiUserSheet/noavatar.png?version=1.1&width=180&rev=1.1] WARN c.x.x.p.i.ImagePlugin - Failed to transform image attachment. java.lang.NullPointerException: Cannot invoke "java.awt.Image.getWidth(java.awt.image.ImageObserver)" because "image" is null {code}
Note, that if I remove *displayImage="true"* my XWiki console won't have any warnings |
|