Error on XWiki Initialization: Unexpected character '<' (code 60); expected a semi-colon after the reference for entity 'h' at [row,col {unknown-source}]: [92,67]

Hi all!

I am trying to deploy XWiki via Podman/Docker, and a PostgreSQL database on the host. This is intended to be an offline installation (although it could go through a Squid proxy).

Here is the output of podman generate kube xwiki. This should show all the values that have been set. The container is managed via Puppet.

---
apiVersion: v1
kind: Pod
metadata:
  creationTimestamp: "2024-01-17T15:26:55Z"
  labels:
    app: xwiki-pod
  name: xwiki-pod
spec:
  containers:
  - args:
    - xwiki
    env:
    - name: no_proxy
      value: prd.example.com, localhost, 127.0.0.1
    - name: ftp_proxy
      value: http://prdproxy.prd.example.com:3128
    - name: DB_DATABASE
      value: xwiki
    - name: http_proxy
      value: http://prdproxy.prd.example.com:3128
    - name: DB_HOST
      value: 10.20.16.112
    - name: DB_USER
      value: xwiki
    - name: https_proxy
      value: http://prdproxy.prd.example.com:3128
    - name: DB_PASSWORD
      value: <sanitized>
    image: docker.io/library/xwiki:lts-postgres-tomcat
    name: xwiki
    ports:
    - containerPort: 8080
      hostPort: 8080
    volumeMounts:
    - mountPath: /usr/local/xwiki
      name: data01-xwiki-data-host-0
  volumes:
  - hostPath:
      path: /data01/xwiki/data
      type: Directory
    name: data01-xwiki-data-host-0

The error (cropped in the middle because it’s too long to post entirely here) that I get when trying to load the web UI at https://wiki.prd.example.com/bin/view/Main:

 Unexpected character '<' (code 60); expected a semi-colon after the reference for entity 'h' at [row,col {unknown-source}]: [92,67]
class com.xpn.xwiki.XWikiException: Error number 0 in 3: Failed to initialize stores
    at com.xpn.xwiki.XWiki.initXWiki(XWiki.java:1332)
    at com.xpn.xwiki.XWiki.initXWiki(XWiki.java:1291)
    at com.xpn.xwiki.XWiki.<init>(XWiki.java:1264)
    at com.xpn.xwiki.internal.XWikiInitializerJob.runInternal(XWikiInitializerJob.java:103)
    at org.xwiki.job.AbstractJob.runInContext(AbstractJob.java:246)
    at org.xwiki.job.AbstractJob.run(AbstractJob.java:223)
    at java.base/java.lang.Thread.run(Unknown Source)
Caused by: class org.xwiki.component.manager.ComponentLookupException: Failed to lookup component [com.xpn.xwiki.store.XWikiHibernateStore] identified by type [interface com.xpn.xwiki.store.XWikiStoreInterface] and hint [hibernate]
    at org.xwiki.component.embed.EmbeddableComponentManager.getInstance(EmbeddableComponentManager.java:332)
    at org.xwiki.component.embed.EmbeddableComponentManager.getInstance(EmbeddableComponentManager.java:320)
    at com.xpn.xwiki.internal.store.StoreConfiguration.getStore(StoreConfiguration.java:80)
    at com.xpn.xwiki.internal.store.StoreConfiguration.getStore(StoreConfiguration.java:67)
    at com.xpn.xwiki.internal.store.StoreConfiguration.getXWikiStore(StoreConfiguration.java:106)
    at com.xpn.xwiki.XWiki.initializeStores(XWiki.java:1386)
    at com.xpn.xwiki.XWiki.initXWiki(XWiki.java:1330)
    at com.xpn.xwiki.XWiki.initXWiki(XWiki.java:1291)
    at com.xpn.xwiki.XWiki.<init>(XWiki.java:1264)
    at com.xpn.xwiki.internal.XWikiInitializerJob.runInternal(XWikiInitializerJob.java:103)
    at org.xwiki.job.AbstractJob.runInContext(AbstractJob.java:246)
    at org.xwiki.job.AbstractJob.run(AbstractJob.java:223)
    at java.base/java.lang.Thread.run(Unknown Source)

##### CROPPED #####

Caused by: class com.ctc.wstx.exc.WstxUnexpectedCharException: Unexpected character '<' (code 60); expected a semi-colon after the reference for entity 'h'
 at [row,col {unknown-source}]: [92,67]
    at com.ctc.wstx.sr.StreamScanner.throwUnexpectedChar(StreamScanner.java:666)
    at com.ctc.wstx.sr.StreamScanner.parseEntityName(StreamScanner.java:2079)
    at com.ctc.wstx.sr.StreamScanner.fullyResolveEntity(StreamScanner.java:1536)
    at com.ctc.wstx.sr.BasicStreamReader.readTextSecondary(BasicStreamReader.java:4786)
    at com.ctc.wstx.sr.BasicStreamReader.finishToken(BasicStreamReader.java:3810)
    at com.ctc.wstx.sr.BasicStreamReader.next(BasicStreamReader.java:1131)
    at com.ctc.wstx.evt.WstxEventReader.nextEvent(WstxEventReader.java:283)
    at java.xml/javax.xml.stream.util.EventReaderDelegate.nextEvent(Unknown Source)
    at org.hibernate.boot.cfgxml.internal.JaxbCfgProcessor$NamespaceAddingEventReader.nextEvent(JaxbCfgProcessor.java:246)
    at com.sun.xml.bind.v2.runtime.unmarshaller.StAXEventConnector.bridge(StAXEventConnector.java:116)
    at com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallerImpl.unmarshal0(UnmarshallerImpl.java:430)
    at com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallerImpl.unmarshal(UnmarshallerImpl.java:405)
    at org.hibernate.boot.cfgxml.internal.JaxbCfgProcessor.unmarshal(JaxbCfgProcessor.java:127)
    at org.hibernate.boot.cfgxml.internal.JaxbCfgProcessor.unmarshal(JaxbCfgProcessor.java:66)
    at org.hibernate.boot.cfgxml.internal.ConfigLoader.loadConfigXmlUrl(ConfigLoader.java:94)
    at org.hibernate.boot.registry.StandardServiceRegistryBuilder.configure(StandardServiceRegistryBuilder.java:262)
    at org.hibernate.cfg.Configuration.configure(Configuration.java:285)
    at com.xpn.xwiki.internal.store.hibernate.HibernateStoreConfiguration.<init>(HibernateStoreConfiguration.java:51)
    at com.xpn.xwiki.internal.store.hibernate.HibernateStore.initialize(HibernateStore.java:234)
    at org.xwiki.component.embed.InitializableLifecycleHandler.handle(InitializableLifecycleHandler.java:39)
    at org.xwiki.component.embed.EmbeddableComponentManager.createInstance(EmbeddableComponentManager.java:550)
    at org.xwiki.component.embed.EmbeddableComponentManager.getComponentInstance(EmbeddableComponentManager.java:636)
    at org.xwiki.component.embed.EmbeddableComponentManager.getInstance(EmbeddableComponentManager.java:329)
    at org.xwiki.component.embed.EmbeddableComponentManager.getInstance(EmbeddableComponentManager.java:320)
    at org.xwiki.component.embed.EmbeddableComponentManager.getDependencyInstance(EmbeddableComponentManager.java:591)
    at org.xwiki.component.embed.EmbeddableComponentManager.createInstance(EmbeddableComponentManager.java:540)
    at org.xwiki.component.embed.EmbeddableComponentManager.getComponentInstance(EmbeddableComponentManager.java:636)
    at org.xwiki.component.embed.EmbeddableComponentManager.getInstance(EmbeddableComponentManager.java:329)
    at org.xwiki.component.embed.EmbeddableComponentManager.getInstance(EmbeddableComponentManager.java:320)
    at org.xwiki.component.embed.EmbeddableComponentManager.getDependencyInstance(EmbeddableComponentManager.java:591)
    at org.xwiki.component.embed.EmbeddableComponentManager.createInstance(EmbeddableComponentManager.java:540)
    at org.xwiki.component.embed.EmbeddableComponentManager.getComponentInstance(EmbeddableComponentManager.java:636)
    at org.xwiki.component.embed.EmbeddableComponentManager.getInstance(EmbeddableComponentManager.java:329)
    at org.xwiki.component.embed.EmbeddableComponentManager.getInstance(EmbeddableComponentManager.java:320)
    at org.xwiki.component.embed.EmbeddableComponentManager.getDependencyInstance(EmbeddableComponentManager.java:591)
    at org.xwiki.component.embed.EmbeddableComponentManager.createInstance(EmbeddableComponentManager.java:540)
    at org.xwiki.component.embed.EmbeddableComponentManager.getComponentInstance(EmbeddableComponentManager.java:636)
    at org.xwiki.component.embed.EmbeddableComponentManager.getInstance(EmbeddableComponentManager.java:329)
    at org.xwiki.component.embed.EmbeddableComponentManager.getInstance(EmbeddableComponentManager.java:320)
    at org.xwiki.component.embed.EmbeddableComponentManager.getDependencyInstance(EmbeddableComponentManager.java:584)
    at org.xwiki.component.embed.EmbeddableComponentManager.createInstance(EmbeddableComponentManager.java:540)
    at org.xwiki.component.embed.EmbeddableComponentManager.getComponentInstance(EmbeddableComponentManager.java:636)
    at org.xwiki.component.embed.EmbeddableComponentManager.getInstance(EmbeddableComponentManager.java:329)
    at org.xwiki.component.embed.EmbeddableComponentManager.getInstance(EmbeddableComponentManager.java:320)
    at org.xwiki.component.embed.EmbeddableComponentManager.getDependencyInstance(EmbeddableComponentManager.java:591)
    at org.xwiki.component.embed.EmbeddableComponentManager.createInstance(EmbeddableComponentManager.java:540)
    at org.xwiki.component.embed.EmbeddableComponentManager.getComponentInstance(EmbeddableComponentManager.java:636)
    at org.xwiki.component.embed.EmbeddableComponentManager.getInstance(EmbeddableComponentManager.java:329)
    at org.xwiki.component.embed.EmbeddableComponentManager.getInstance(EmbeddableComponentManager.java:320)
    at org.xwiki.component.embed.EmbeddableComponentManager.getDependencyInstance(EmbeddableComponentManager.java:591)
    at org.xwiki.component.embed.EmbeddableComponentManager.createInstance(EmbeddableComponentManager.java:540)
    at org.xwiki.component.embed.EmbeddableComponentManager.getComponentInstance(EmbeddableComponentManager.java:636)
    at org.xwiki.component.embed.EmbeddableComponentManager.getInstance(EmbeddableComponentManager.java:329)
    at org.xwiki.component.embed.EmbeddableComponentManager.getInstance(EmbeddableComponentManager.java:320)
    at com.xpn.xwiki.internal.store.StoreConfiguration.getStore(StoreConfiguration.java:80)
    at com.xpn.xwiki.internal.store.StoreConfiguration.getStore(StoreConfiguration.java:67)
    at com.xpn.xwiki.internal.store.StoreConfiguration.getXWikiStore(StoreConfiguration.java:106)
    at com.xpn.xwiki.XWiki.initializeStores(XWiki.java:1386)
    at com.xpn.xwiki.XWiki.initXWiki(XWiki.java:1330)
    at com.xpn.xwiki.XWiki.initXWiki(XWiki.java:1291)
    at com.xpn.xwiki.XWiki.<init>(XWiki.java:1264)
    at com.xpn.xwiki.internal.XWikiInitializerJob.runInternal(XWikiInitializerJob.java:103)
    at org.xwiki.job.AbstractJob.runInContext(AbstractJob.java:246)
    at org.xwiki.job.AbstractJob.run(AbstractJob.java:223)
    at java.base/java.lang.Thread.run(Unknown Source)

Apologies for the long post. Hopefully someone can point me in the right direction, as I can’t seem to find anyone with a similar problem, and the error is rather cryptic.

Cheers,
Alex

Turns out the & character in the password I generated for the database user/connection was causing the issue!

The issue appears to be solved after changing the password to letters and numbers only.