This issue has been created
 
 
Cristal Integration / cid:jira-generated-image-avatar-98180333-174f-4198-8fcf-aef504f8c4fa CRISTALINT-34 Open

Cristal Integration fails when XWiki is deployed at the root context

 
View issue   ยท   Add comment
 

Issue created

 
cid:jira-generated-image-avatar-c31e8595-f57e-4854-83e6-6591c880cfe0 Enrique created this issue on 17/Aug/26 09:41
 
Summary: Cristal Integration fails when XWiki is deployed at the root context
Issue Type: cid:jira-generated-image-avatar-98180333-174f-4198-8fcf-aef504f8c4fa Bug
Affects Versions: 1.8.0
Assignee: Unassigned
Components: Cristal Skin
Created: 17/Aug/26 09:41
Priority: cid:jira-generated-image-static-major-9414634c-82a3-4e60-8fb9-de230855bc56 Major
Reporter: Enrique
Description:

Cristal Integration currently assumes that XWiki is deployed under the /xwiki context. In version 1.8.0, baseURL is hard-coded to ${window.location.origin}/xwiki:

Source code

On an XWiki installation deployed at the root context, the normal URLs are:

/bin/view/Main/
/rest/wikis/xwiki/...
/cristal/

The Cristal UI loads from /cristal/, but subsequent requests are sent to:

/xwiki/rest/...
/xwiki/bin/get/...
/xwiki/bin/login/...

These URLs return HTML error or redirect pages, which causes JSON parsing errors such as:

SyntaxError: Unexpected token '<', "<!DOCTYPE "... is not valid JSON

I reproduced the problem on two installations using XWiki 18.5.0 and Cristal Integration 1.8.0.

The "Switch to Cristal" action also points to /xwiki/cristal/, so it does not work on root-context installations either.

Cristal Integration should derive the servlet context dynamically so that both root-context and /xwiki deployments work.

This is related to CRISTALINT-3, but covers the specific case of XWiki being deployed at the root context.