You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The activemq.xsd advertises userPasswords and userGroups as xs:string attributes on <simpleAuthenticationPlugin>, but the
actual org.apache.activemq.security.SimpleAuthenticationPlugin
class in 5.16.8 has:
— i.e., the setters take Map, not String. There is no custom
property editor registered, so Spring's BeanWrapper rejects the
activemq.xml bean init with:
ConversionNotSupportedException: Failed to convert property value of type
'java.lang.String' to required type 'java.util.Map' for property
'userGroups': no matching editors or conversion strategy found
The XSD's <xs:attribute name='userPasswords' type='xs:string'/> is a
documentation bug in activemq-spring-5.16.8.jar. PR #213 used the
attribute form because that's what the XSD implied; that form is
unusable. The correct way to express users in XBean is the <users> / <authenticationUser> child-element pattern:
<authenticationUser> is the helper class org.apache.activemq.security.AuthenticationUser (3-arg constructor String username, String password, String groups plus the matching
setters), declared in the same activemq.xsd as a child of the
plugin's <users> element.
Plan
Replace the broken userPasswords="..." userGroups="..." attribute
pair with a <users><authenticationUser .../></users> child
element. Keep anonymousAccessAllowed="false".
Summary
The activemq.xsd advertises
userPasswordsanduserGroupsasxs:stringattributes on<simpleAuthenticationPlugin>, but theactual
org.apache.activemq.security.SimpleAuthenticationPluginclass in 5.16.8 has:
— i.e., the setters take
Map, notString. There is no customproperty editor registered, so Spring's
BeanWrapperrejects theactivemq.xml bean init with:
The XSD's
<xs:attribute name='userPasswords' type='xs:string'/>is adocumentation bug in activemq-spring-5.16.8.jar. PR #213 used the
attribute form because that's what the XSD implied; that form is
unusable. The correct way to express users in XBean is the
<users>/<authenticationUser>child-element pattern:<authenticationUser>is the helper classorg.apache.activemq.security.AuthenticationUser(3-arg constructorString username, String password, String groupsplus the matchingsetters), declared in the same activemq.xsd as a child of the
plugin's
<users>element.Plan
userPasswords="..." userGroups="..."attributepair with a
<users><authenticationUser .../></users>childelement. Keep
anonymousAccessAllowed="false".ear/WEB-INF/jetty-env.xml) are unchanged — they still work.
bugfix/<this-issue>-activemq-users-child-element; commit,GPG-sign, push, open PR.
Verification
python3 -c "import xml.etree.ElementTree as ET; ET.parse('activemq.xml')"— well-formed.xmllint --schema activemq.xsd activemq.xml --noout— exits 0.grep -c "Failed to load: class path resource \[activemq.xml\]" .../server.log— 0grep -c "User name \[null\] or password is invalid" .../server.log— 0grep -c "Failed to convert property value" .../server.log— 0