I have an XWiki 11.1 installation below tomcat_ home\webapps\xwiki on a Windows10 desktop A and a freshly set up XWiki 11.1 installation below tomcat_home\webapps\marvin on another Windows10 desktop B. On B I’ve set xwiki.webapppath=marvin in xwiki.cfg. I exported the content of XWiki on A and imported it to the XWiki on B. Now on B the attachments are stored below permanent_directory/store/file/xwiki, but it seems that XWikiDocument.loadAttachements() expects the attachments below permanent_directory/store/file/marvin:
Caused by: com.xpn.xwiki.XWikiException: Error number 3002 in 3: The attachment [C:\kido\app\.marvin\store\file\marvin\1\5\eeb8a5779ea416f517621bd9244ab5\attachments\7\b\a19dd46704ef89490bd295809139b6\f.png] could not be found in the filesystem attachment store.
at org.xwiki.store.legacy.store.internal.FilesystemAttachmentStore.loadAttachmentContent(FilesystemAttachmentStore.java:214)
at com.xpn.xwiki.doc.XWikiAttachment.loadAttachmentContent(XWikiAttachment.java:1073)
at com.xpn.xwiki.doc.XWikiDocument.loadAttachments(XWikiDocument.java:4217)
at de.deka.marvin.internal.Archiver.archiveEntity(Archiver.java:239)
at de.deka.marvin.internal.Archiver.archive(Archiver.java:149)
... 168 more
And you don’t have any issue if you add a new attachment, or you got the same error? It feels like a bug on our side, but it should behave the same way for newly added attachment and imported ones.
So it’s just the new WebAppPath that causes the problem somehow. Would be great if you could provide an educated guess, what could be wrong. If you cannot, I’ll set up a small test case…
The difference between those two paths is the name of the wiki. Looks like the first one is stored in the wiki xwiki (the main wiki) and the second one in the wiki marvin.
Yes, that’s what I tried to say: I changed the wepapppath from xwiki to marvin and now the attachements are looked for in the wrong place or imported to the wrong place. I do not know.
The change here have nothing to do with the webpath (from attachment point of view at least). It’s the id of the subwiki where the attachment is supposed to be stored, looks like the attachment is searched in wiki marvin instead of wiki xwiki. Maybe the URL you are using makes XWiki identify it as the wrong wiki (could be a bug in the URL parser used for the /download/ action).
Could you paste the complete error with all the caused by.
By the way make sure you properly set xwiki.webapppath property in xwiki.cfg. You don’t seems to mention it in previous messages.