我将servicemix从4.4.2升级到5.5.0。我似乎缺少一些安全配置。 servicemix中的ActiveMQ版本现在为5.12。我在日志文件中看到以下异常。
2016-01-19 12:30:47,760 | WARN | 2.23:54741@61616 |Service | 95 - org.apache.activemq.activemq-osgi - 5.11.1 | Security Error occurred: User name [defaultUser] or password is invalid.
2016-01-19 12:30:49,759 | INFO | q-broker] Task-2 | TransportConnection | 95 - org.apache.activemq.activemq-osgi - 5.11.1 | Stopping tcp://<APPServerIP>:54742 because Failed with SecurityException: User name [defaultUser] or password is invalid.
2016-01-19 12:31:17,767 | WARN | 2.23:54746@61616 | TransportConnection | 95 - org.apache.activemq.activemq-osgi - 5.11.1 | Failed to add Connection
ID:dkdl7011.dcsgomni.com-47989-1449791490993-0:21948
java.lang.SecurityException: User name [defaultUser] or password is invalid.
at org.apache.activemq.security.SimpleAuthenticationBroker.addConnection(SimpleAuthenticationBroker.java:85)[95:org.apache.activemq.activemq-osgi:5.11.1]
at org.apache.activemq.broker.BrokerFilter.addConnection(BrokerFilter.java:97)[95:org.apache.activemq.activemq-osgi:5.11.1]
日志中显示的IP是我的WebsphereServer。 activeMQ控制台将其显示为队列的使用者。
我可以找出正在使用的[defaultUser]是什么?我在activemq.xml中启用了匿名用户访问。 activemq.xml的一部分粘贴在下面。
<plugins>
<simpleAuthenticationPlugin anonymousAccessAllowed="true">
<users>
<authenticationUser username="smx" password="pwd" groups="users,admins"/>
<authenticationUser username="karaf" password="pwd" groups="users,admins"/>
<authenticationUser username="system" password="pwd" groups="users,admins"/>
<authenticationUser username="user" password="pwd" groups="users,admins"/>
<authenticationUser username="defaultUser" password="pwd" groups="users,admins"/>
</users>
</simpleAuthenticationPlugin>
<authorizationPlugin>
<map>
<authorizationMap>
<authorizationEntries>
<authorizationEntry queue=">" write="users,admins,anonymous" read="users,admins,anonymous" admin="users,admins,anonymous" />
<authorizationEntry topic=">" write="users,admins,anonymous" read="users,admins,anonymous" admin="users,admins,anonymous" />
<authorizationEntry topic="ActiveMQ.Advisory.>" read="users,admins,anonymous" write="users,admins,anonymous" admin="users,admins,anonymous"/>
</authorizationEntries>
</authorizationMap>
</map>
</authorizationPlugin>
</plugins>
答案 0 :(得分:0)
这link有帮助。默认凭据为defaultUser / defaultPassword。我在activemq.xml中更新了它,它现在正在运行。
答案 1 :(得分:0)
对我来说,通过确保在activemq.xml [mypwd]和凭据.properties中定义了相同的密码,可以解决此问题
activemq.xml
<simpleAuthenticationPlugin>
<users>
<authenticationUser username="system" password="**mypwd**" groups="users,admins"/>
</users>
</simpleAuthenticationPlugin >
credentials.properties
activemq.username=system
activemq.password=password