Wildfly with Generic JMS shows error : SECURITY_EXCEPTION message=AMQ119031: Unable to validate user
n_nagraj321 Mar 10, 2018 5:47 AMI'm trying to use genericjms to connect to the activemq messaging server. Below is my configuration:
standalone-full.xml
<mdb>
<resource-adapter-ref resource-adapter-name="jms-ra.rar"/>
<bean-instance-pool-ref pool-name="mdb-strict-max-pool"/>
</mdb>
<subsystem xmlns="urn:jboss:domain:messaging-activemq:3.0">
<server name="default">
<security-setting name="#">
<role name="guest" send="true" consume="true" create-non-durable-queue="true" delete-non-durable-queue="true"/>
</security-setting>
<address-setting name="#" dead-letter-address="jms.queue.DLQ" expiry-address="jms.queue.ExpiryQueue" max-size-bytes="10485760" page-size-bytes="2097152" message-counter-history-day-limit="10"/>
<http-connector name="http-connector" socket-binding="http" endpoint="http-acceptor"/>
<http-connector name="http-connector-throughput" socket-binding="http" endpoint="http-acceptor-throughput">
<param name="batch-delay" value="50"/>
</http-connector>
<in-vm-connector name="in-vm" server-id="0">
<param name="buffer-pooling" value="false"/>
</in-vm-connector>
<http-acceptor name="http-acceptor" http-listener="default"/>
<http-acceptor name="http-acceptor-throughput" http-listener="default">
<param name="batch-delay" value="50"/>
<param name="direct-deliver" value="false"/>
</http-acceptor>
<in-vm-acceptor name="in-vm" server-id="0">
<param name="buffer-pooling" value="false"/>
</in-vm-acceptor>
<jms-queue name="ExpiryQueue" entries="java:/jms/queue/ExpiryQueue"/>
<jms-queue name="DLQ" entries="java:/jms/queue/DLQ"/>
<jms-queue name="com.netegrity.ims.msg.queue" entries="com.netegrity.ims.msg.queue java:jboss/exported/jms/com.netegrity.ims.msg.queue"/>
<jms-queue name="RuntimeStatusDetailQueue" entries="RuntimeStatusDetailQueue java:jboss/exported/jms/RuntimeStatusDetailQueue"/>
<jms-queue name="queue/wpEventQueue" entries="queue/wpEventQueue java:jboss/exported/jms/queue/wpEventQueue"/>
<jms-queue name="queue/wpServAutoActQueue" entries="queue/wpServAutoActQueue java:jboss/exported/jms/queue/wpServAutoActQueue"/>
<jms-queue name="queue/wpUtilQueue" entries="queue/wpUtilQueue java:jboss/exported/jms/queue/wpUtilQueue"/>
<jms-queue name="ac_endpoint_to_server" entries="ac_endpoint_to_server java:jboss/exported/jms/ac_endpoint_to_server"/>
<jms-queue name="ac_server_to_server" entries="ac_server_to_server java:jboss/exported/jms/ac_server_to_server"/>
<jms-queue name="queue/snapshots" entries="queue/snapshots java:jboss/exported/jms/queue/snapshots"/>
<jms-queue name="queue/audit" entries="queue/audit java:jboss/exported/jms/queue/audit"/>
<jms-queue name="ac_server_to_endpoint" entries="ac_server_to_endpoint java:jboss/exported/jms/ac_server_to_endpoint"/>
<jms-queue name="ac_server_to_server_local" entries="ac_server_to_server_local java:jboss/exported/jms/ac_server_to_server_local"/>
<jms-topic name="ServerCommandTopic" entries="ServerCommandTopic java:jboss/exported/jms/ServerCommandTopic"/>
<jms-topic name="ac_server_to_endpoint_broadcast" entries="ac_server_to_endpoint_broadcast"/>
<jms-topic name="ac_server_to_server_broadcast" entries="ac_server_to_server_broadcast"/>
<jms-topic name="ac_endpoint_to_server_broadcast" entries="ac_endpoint_to_server_broadcast"/>
<connection-factory name="InVmConnectionFactory" entries="java:/ConnectionFactory" connectors="in-vm"/>
<connection-factory name="RemoteConnectionFactory" entries="java:jboss/exported/jms/RemoteConnectionFactory" connectors="http-connector"/>
<connection-factory name="wpConnectionFactory" entries="jms/wpConnectionFactory wpConnectionFactory java:jboss/exported/jms/wpConnectionFactory" connectors="http-connector"/>
<pooled-connection-factory name="jms-ra" entries="java:/ActivemqJms" connectors="in-vm" transaction="xa"/>
</server>
</subsystem>
<resource-adapter id="jms-ra.rar">
<archive>
IdentityMinder.ear#generic-jms-ra-2.0.1.Final
</archive>
<!-- <module slot="main" id="org.jboss.genericjms"/> -->
<transaction-support>XATransaction</transaction-support>
<connection-definitions>
<connection-definition class-name="org.jboss.resource.adapter.jms.JmsManagedConnectionFactory" jndi-name="java:/ActivemqJms" enabled="true" use-java-context="true" pool-name="ActivemqJms" use-ccm="true">
<config-property name="SessionDefaultType">
javax.jms.Queue
</config-property>
<config-property name="ConnectionFactory">
ConnectionFactory
</config-property>
<config-property name="JndiParameters">
java.naming.security.principal=guest;java.naming.factory.initial=com.ca.jms.utils.ActiveMQJndiContextFactory;java.naming.provider.url=ssl://localhost:61616?socket.enabledProtocols=TLSv1.1,TLSv1.2
</config-property>
<xa-pool>
<min-pool-size>1</min-pool-size>
<max-pool-size>150</max-pool-size>
</xa-pool>
<security>
<security-domain>ActivemqRealm</security-domain>
</security>
<timeout>
<blocking-timeout-millis>32000</blocking-timeout-millis>
</timeout>
</connection-definition>
</connection-definitions>
</resource-adapter>
But when the wildfly server is started i could see the lost of following errors are logged in the console. I Have tried creating the user (using add-user.bat) and adding it in the server-identities definition <secret value="TjB0YWxsMHdlZA==" /> but no use.
C:\Users\Administrator\Desktop\wildfly\wildfly-12.0.0.Final\bin>add-user.bat
What type of user do you wish to add?
a) Management User (mgmt-users.properties)
b) Application User (application-users.properties)
(a): b
Enter the details of the new user to add.
Using realm 'ApplicationRealm' as discovered from the existing property files.
Username : reportserver
User 'reportserver' already exists and is enabled, would you like to...
a) Update the existing user password and roles
b) Disable the existing user
c) Type a new username
(a): a
Password recommendations are listed below. To modify these restrictions edit the add-user.properties configuration file.
- The password should be different from the username
- The password should not be one of the following restricted values {root, admin, administrator}
- The password should contain at least 8 characters, 1 alphabetic character(s), 1 digit(s), 1 non-alphanumeric symbol(s)
Password :
WFLYDM0102: Password should have at least 1 non-alphanumeric symbol.
Are you sure you want to use the password entered yes/no? y
Re-enter Password :
What groups do you want this user to belong to? (Please enter a comma separated list, or leave blank for none)[guest]: guest
Updated user 'reportserver' to file 'C:\Users\Administrator\Desktop\wildfly\wildfly-12.0.0.Final\standalone\configuration\application-users.properties'
Updated user 'reportserver' to file 'C:\Users\Administrator\Desktop\wildfly\wildfly-12.0.0.Final\domain\configuration\application-users.properties'
Updated user 'reportserver' with groups guest to file 'C:\Users\Administrator\Desktop\wildfly\wildfly-12.0.0.Final\standalone\configuration\application-roles.properties'
Updated user 'reportserver' with groups guest to file 'C:\Users\Administrator\Desktop\wildfly\wildfly-12.0.0.Final\domain\configuration\application-roles.properties'
Is this new user going to be used for one AS process to connect to another AS process?
e.g. for a slave host controller connecting to the master or for a Remoting connection for server to server EJB calls.
yes/no? yes
To represent the user add the following to the server-identities definition <secret value="TjB0YWxsMHdlZA==" />
Press any key to continue . . .
C:\Users\Administrator\Desktop\wildfly\wildfly-12.0.0.Final\bin>
Exception:
16:03:25,270 ERROR [org.apache.activemq.artemis.core.server] (Thread-1 (ActiveMQ-remoting-threads-ActiveMQServerImpl::serverUUID=6aac8df9-23bb-11e8-b3f7-0200bc2022cb-106784407)) AMQ224018: Failed to create session: ActiveMQSecurityException[errorType=SECURITY_EXCEPTION message=AMQ119031: Unable to validate user]
at org.apache.activemq.artemis.core.security.impl.SecurityStoreImpl.authenticate(SecurityStoreImpl.java:144)
at org.apache.activemq.artemis.core.server.impl.ActiveMQServerImpl.createSession(ActiveMQServerImpl.java:1283)
at org.apache.activemq.artemis.core.protocol.core.impl.ActiveMQPacketHandler.handleCreateSession(ActiveMQPacketHandler.java:158)
at org.apache.activemq.artemis.core.protocol.core.impl.ActiveMQPacketHandler.handlePacket(ActiveMQPacketHandler.java:81)
at org.apache.activemq.artemis.core.protocol.core.impl.ChannelImpl.handlePacket(ChannelImpl.java:633)
at org.apache.activemq.artemis.core.protocol.core.impl.RemotingConnectionImpl.doBufferReceived(RemotingConnectionImpl.java:379)
at org.apache.activemq.artemis.core.protocol.core.impl.RemotingConnectionImpl.bufferReceived(RemotingConnectionImpl.java:362)
at org.apache.activemq.artemis.core.remoting.server.impl.RemotingServiceImpl$DelegatingBufferHandler.bufferReceived(RemotingServiceImpl.java:621)
at org.apache.activemq.artemis.core.remoting.impl.invm.InVMConnection$1.run(InVMConnection.java:196)
at org.apache.activemq.artemis.utils.OrderedExecutorFactory$OrderedExecutor$ExecutorTask.run(OrderedExecutorFactory.java:122)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
16:03:25,272 ERROR [org.apache.activemq.artemis.core.server] (Thread-10 (ActiveMQ-remoting-threads-ActiveMQServerImpl::serverUUID=6aac8df9-23bb-11e8-b3f7-0200bc2022cb-106784407)) AMQ224018: Failed to create session: ActiveMQSecurityException[errorType=SECURITY_EXCEPTION message=AMQ119031: Unable to validate user]
at org.apache.activemq.artemis.core.security.impl.SecurityStoreImpl.authenticate(SecurityStoreImpl.java:144)
at org.apache.activemq.artemis.core.server.impl.ActiveMQServerImpl.createSession(ActiveMQServerImpl.java:1283)
at org.apache.activemq.artemis.core.protocol.core.impl.ActiveMQPacketHandler.handleCreateSession(ActiveMQPacketHandler.java:158)
at org.apache.activemq.artemis.core.protocol.core.impl.ActiveMQPacketHandler.handlePacket(ActiveMQPacketHandler.java:81)
at org.apache.activemq.artemis.core.protocol.core.impl.ChannelImpl.handlePacket(ChannelImpl.java:633)
at org.apache.activemq.artemis.core.protocol.core.impl.RemotingConnectionImpl.doBufferReceived(RemotingConnectionImpl.java:379)
at org.apache.activemq.artemis.core.protocol.core.impl.RemotingConnectionImpl.bufferReceived(RemotingConnectionImpl.java:362)
at org.apache.activemq.artemis.core.remoting.server.impl.RemotingServiceImpl$DelegatingBufferHandler.bufferReceived(RemotingServiceImpl.java:621)
at org.apache.activemq.artemis.core.remoting.impl.invm.InVMConnection$1.run(InVMConnection.java:196)
at org.apache.activemq.artemis.utils.OrderedExecutorFactory$OrderedExecutor$ExecutorTask.run(OrderedExecutorFactory.java:122)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)