There are 2 comments.
 
 
XWiki Commons / cid:jira-generated-image-avatar-fb13e9ab-ecc8-47f0-83a9-416e204879a8 XCOMMONS-3615 In Progress

XWiki fails to start on Tomcat on Windows because critical resource files cannot be loaded

 
View issue   ยท   Add comment
 

2 comments

 
cid:jira-generated-image-avatar-9f34b3c6-08bd-4aa8-b78c-ea28e1f19b82 Marius Dumitru Florea on 07/Apr/26 07:34
 

The problem is here https://github.com/xwiki/xwiki-commons/blob/xwiki-commons-17.10.6/xwiki-commons-core/xwiki-commons-environment/xwiki-commons-environment-servlet/src/main/java/org/xwiki/environment/internal/ServletEnvironment.java#L450-L457 . That code adds an extra file separator (backslash) at the end of the path on Windows, leading to:

D:\Win 10 Backup\LUCRU_D\TOMCAT_HOME 11.0.20 - 17.10.6 PostgreSQL\webapps\xwiki\\

Ilie Andriuta Nikita Petrenko you can try setting environment.servlet.allowedRealPaths to your XWiki instance path as a workaround, in xwiki.properties. Something like:

environment.servlet.allowedRealPaths=D:\Win 10 Backup\LUCRU_D\TOMCAT_HOME 11.0.20 - 17.10.6 PostgreSQL\webapps\xwiki\

Replace with your actual path that appears in the logs, making sure to leave a single backslash at the end. Please confirm.

I'm fixing the problem in the meantime, which is easy. The tricky part writing a unit test to cover both Linux and Windows. I have to do a bit of refactoring to be able to "mock" File.separatorChar.

 
cid:jira-generated-image-avatar-56dfd7ed-ad24-44e3-baca-c4b14a576b06 Nikita Petrenko on 07/Apr/26 07:42
 

Ilie Andriuta Nikita Petrenko you can try setting environment.servlet.allowedRealPaths to your XWiki instance path as a workaround, in xwiki.properties. Something like:

environment.servlet.allowedRealPaths=D:\Win 10 Backup\LUCRU_D\TOMCAT_HOME 11.0.20 - 17.10.6 PostgreSQL\webapps\xwiki\

Replace with your actual path that appears in the logs, making sure to leave a single backslash at the end. Please confirm.

I'll try later this evening, yesterday pasting exact the same as path to permanent directory with

\webapps\xwiki

in the end, didn't resolve it.