1

我正在尝试使用 spring 使用 hornetq ( jboss 上的 jms )。但我无法对用户进行身份验证。似乎我在将用户信用发送到 hornetq 身份验证界面时遇到问题。我的弹簧配置:

<bean id="jmsJndiTemplate" class="org.springframework.jndi.JndiTemplate">
    <property name="environment">
        <props>
            <prop key="java.naming.factory.initial">${jms.jndi.initialContextFactory}</prop>
            <prop key="java.naming.provider.url">${jms.jndi.providerUrl}</prop>
            <prop key="java.naming.security.principal">${jms.jndi.username}</prop>
            <prop key="java.naming.security.credentials">${jms.jndi.password}</prop>                
            <prop key="java.naming.factory.url.pkgs">${jms.jndi.packagePrefixes}</prop>
        </props>
    </property>
</bean>
<bean id="jmsConnectionFactory" class="org.springframework.jndi.JndiObjectFactoryBean">
    <property name="jndiTemplate" ref="jmsJndiTemplate"/>
    <property name="jndiName" value="${jms.connectionFactory}"/>
</bean>
<bean id="jmsIletisimRawDataSendDestination" class="org.springframework.jndi.JndiObjectFactoryBean">
    <property name="jndiTemplate" ref="jmsJndiTemplate"/>
    <property name="jndiName" value="${jms.iletisim.rawdata.send}"/>
</bean>

<bean id="jmsConnectionExceptionListener" class="com.marti.jms.ConnectionExceptionListener">
</bean>

<bean id="jmsConnectionPool" class="com.marti.jms.PoolFTConnection" init-method="initConnection" destroy-method="destroyConnection">
    <property name="cf" ref="jmsConnectionFactory"/>
    <property name="exceptionListener" ref="jmsConnectionExceptionListener"/>
    <property name="poolSize" value="${jms.poolSize}"/>           
</bean>

<bean id="iletisimRawDataSender" class="com.marti.jms.MessageSender" depends-on="jmsConnectionPool" init-method="setupSender" destroy-method="destroySender">
    <property name="connections" ref="jmsConnectionPool"/>
    <property name="destination" ref="jmsIletisimRawDataSendDestination"/>
    <property name="sessionsPerConnection" value="${jms.sessionPerConnection}"/>
    <property name="messageTTL" value="${jms.ttl}"/>
</bean>

我用错了吗?(显然是:))

这是堆栈跟踪;

14:52:13,408 错误 [org.hornetq.core.protocol.core.impl.HornetQPacketHandler](旧 I/O 服务器工作者(parentId:29291087,[id:0x01bef24f,/0.0.0.0:5445]))创建失败session : HornetQException[errorCode=105 message=Unable to validate user: null] at org.hornetq.core.security.impl.SecurityStoreImpl.authenticate(SecurityStoreImpl.java:147) [hornetq-core-2.2.13.Final.jar: ] 在 org.hornetq.core.server.impl.HornetQServerImpl.createSession(HornetQServerImpl.java:807) [hornetq-core-2.2.13.Final.jar:] 在 org.hornetq.core.protocol.core.impl.HornetQPacketHandler .handleCreateSession(HornetQPacketHandler.java:187) [hornetq-core-2.2.13.Final.jar:] at org.hornetq.core.protocol.core.impl.HornetQPacketHandler.handlePacket(HornetQPacketHandler.java:85) [hornetq-core -2.2.13.Final.jar:] 在 org.hornetq.core.protocol.core.impl。ChannelImpl.handlePacket(ChannelImpl.java:508) [hornetq-core-2.2.13.Final.jar:] at org.hornetq.core.protocol.core.impl.RemotingConnectionImpl.doBufferReceived(RemotingConnectionImpl.java:556) [hornetq- core-2.2.13.Final.jar:] at org.hornetq.core.protocol.core.impl.RemotingConnectionImpl.bufferReceived(RemotingConnectionImpl.java:517) [hornetq-core-2.2.13.Final.jar:] at org org.hornetq.core.remoting.impl.netty 上的 .hornetq.core.remoting.server.impl.RemotingServiceImpl$DelegatingBufferHandler.bufferReceived(RemotingServiceImpl.java:533) [hornetq-core-2.2.13.Final.jar:]。 HornetQChannelHandler.messageReceived(HornetQChannelHandler.java:73) [hornetq-core-2.2.13.Final.jar:] at org.jboss.netty.channel.SimpleChannelHandler.handleUpstream(SimpleChannelHandler.java:100) [netty-3.2.6. Final.jar:] 在 org.jboss.netty.channel。StaticChannelPipeline.sendUpstream(StaticChannelPipeline.java:372) [netty-3.2.6.Final.jar:] at org.jboss.netty.channel.StaticChannelPipeline$StaticChannelHandlerContext.sendUpstream(StaticChannelPipeline.java:534) [netty-3.2.6. Final.jar:] 在 org.jboss.netty.channel.Channels.fireMessageReceived(Channels.java:287) [netty-3.2.6.Final.jar:] 在 org.hornetq.core.remoting.impl.netty.HornetQFrameDecoder2 .decode(HornetQFrameDecoder2.java:169) [hornetq-core-2.2.13.Final.jar:] at org.hornetq.core.remoting.impl.netty.HornetQFrameDecoder2.messageReceived(HornetQFrameDecoder2.java:134) [hornetq-core -2.2.13.Final.jar:] at org.jboss.netty.channel.SimpleChannelUpstreamHandler.handleUpstream(SimpleChannelUpstreamHandler.java:80) [netty-3.2.6.Final.jar:] at org.jboss.netty.channel。静态通道管道。sendUpstream(StaticChannelPipeline.java:372) [netty-3.2.6.Final.jar:] at org.jboss.netty.channel.StaticChannelPipeline.sendUpstream(StaticChannelPipeline.java:367) [netty-3.2.6.Final.jar: ] 在 org.jboss.netty.channel.Channels.fireMessageReceived(Channels.java:274) [netty-3.2.6.Final.jar:] 在 org.jboss.netty.channel.Channels.fireMessageReceived(Channels.java:261 ) [netty-3.2.6.Final.jar:] at org.jboss.netty.channel.socket.oio.OioWorker.run(OioWorker.java:100) [netty-3.2.6.Final.jar:] at org .jboss.netty.util.ThreadRenamingRunnable.run(ThreadRenamingRunnable.java:108) [netty-3.2.6.Final.jar:] at org.jboss.netty.util.internal.DeadLockProofWorker$1.run(DeadLockProofWorker.java:44 ) [netty-3.2.6.Final.jar:] at org.jboss.netty.util.VirtualExecutorService$ChildExecutorRunnable.run(VirtualExecutorService.java:181) [netty-3.2.6.Final.jar:] 在 java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) [classes.jar:1.6.0_37] 在 java.util.concurrent.ThreadPoolExecutor $Worker.run(ThreadPoolExecutor.java:908) [classes.jar:1.6.0_37] at java.lang.Thread.run(Thread.java:680) [classes.jar:1.6.0_37]

4

2 回答 2

2

这是一个临时的或变通的解决方案,但谁想要解决这个问题或不想遇到同样的问题;这是解决方案:

  • 在 jboss 管理界面点击屏幕右上角的 Profile。
  • 单击左侧树形菜单上的消息传递 -> 消息传递提供程序。
  • 在右侧窗格中,单击您尝试连接的提供商的“查看”。
  • 然后编辑“JMS Provider Configurations”的设置,将 Security Enabled 设置为“false”。
于 2013-01-25T19:16:01.253 回答
0

您只是收到身份验证错误吗?

您只需使用 JBoss 附带的 addUser 脚本将用户和密码添加到用户组。

如果您遇到不同的错误,我需要更多详细信息(例如您的异常堆栈跟踪)。

于 2013-01-21T15:22:39.913 回答