After setting the LDAP authentication in the Jasperserver, the application become unresponsive and the home page never loads

Document ID : KB000007336
Last Modified Date : 14/02/2018
Show Technical Document Details
Issue:

After setting the LDAP authentication in the Jasperserver the application become unresponsive and the home page never loads
The following error was captured in the jasperserver.log file

2017-07-13 14:57:47,283 ERROR ContextLoader,localhost-startStop-1:331 - Context initialization failed
org.springframework.beans.factory.xml.XmlBeanDefinitionStoreException: Line 77 in XML document from ServletContext resource [/WEB-INF/applicationContext-externalAuth-LDAP-mt.xml] is invalid; nested exception is org.xml.sax.SAXParseException; lineNumber: 77; columnNumber: 45; The entity name must immediately follow the '&' in the entity reference.
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:397)
...
Caused by: org.xml.sax.SAXParseException; lineNumber: 77; columnNumber: 45; The entity name must immediately follow the '&' in the entity reference.

Environment:
SD 14.1 or aboveCABI 6.3.2 or above
Cause:

The file applicationContext-externalAuth-LDAP-mt.xml has a missing value as states the log file in the indicated line.

<property name="groupSearchFilter" value="(&(objectCategory=person)(objectClass=user)(!(userAccountControl:1.2.840.113556.1.4.1941:=2)))"/>


The facelets are a XML based view technology which uses XHTML+XML to generate HTML output. XML has five special characters which has special treatment by the XML parser:

< the start of a tag.
> the end of a tag.
" the start and end of an attribute value.
' the alternative start and end of an attribute value.
& the start of an entity (which ends with ;).

In case of an & which is not followed by # (e.g. &#160;, &#xA0;, etc), the XML parser is implicitly looking for one of the five predefined entity names lt, gt, amp, quot and apos, or any manually defined entity name.

In this case the line had only & and missed the predefined entity name plus the ;

Resolution:

1. Modify the file applicationContext-externalAuth-LDAP-mt.xml in the specified line showed in the error message from:

<property name="groupSearchFilter" value="(&(objectCategory=person)(objectClass=user)(!(userAccountControl:1.2.840.113556.1.4.1941:=2)))"/>

to:

<property name="groupSearchFilter" value="(&amp;(objectCategory=person)(objectClass=user)(!(userAccountControl:1.2.840.113556.1.4.1941:=2)))"/>

2. Save the changes to the file and restart the Jaspersoft TOMCAT server.

Additional Information: