3

docker コンテナー (Container-A) に wildfly 10 インスタンスがインストールされています。同じエンジン (サーバー B、エンジン) の他のコンテナーからキューを検索しようとすると、すべて正常に動作します。

代わりに、コンテナーにマップされているポート 7080 でサーバー B の IP アドレスを使用して、エンジン (サーバー C) の同じネットワーク上にある仮想マシンからキューを検索しようとすると、問題が発生します (以下のトレースを参照)。 8080 ポート。

Server-C から Container-A への telnet 接続を開こうとしました (Server-B の IP アドレスと 7080 ポートを使用)。接続は問題ないようです。

誰でも私を助けることができますか??

C:\App>java -jar my-jar.jar
log4j:WARN No appenders could be found for logger (com.myApp.S
etUpBowcaster).
log4j:WARN Please initialize the log4j system properly.
log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more in
fo.
2017-05-30 18:44:01 INFO  SetUpBowcaster:? - PROCESSORS BUSES INITIALIZATION
2017-05-30 18:44:01 INFO  xnio:93 - XNIO version 3.3.4.Final
2017-05-30 18:44:01 INFO  nio:55 - XNIO NIO Implementation Version 3.3.4.Final
2017-05-30 18:44:01 INFO  remoting:73 - JBoss Remoting version 4.0.18.Final
2017-05-30 18:44:01 INFO  remoting:103 - EJBCLIENT000017: Received server versio
n 2 and marshalling strategies [river]
2017-05-30 18:44:01 INFO  remoting:219 - EJBCLIENT000013: Successful version han
dshake completed for receiver context EJBReceiverContext{clientContext=org.jboss
.ejb.client.EJBClientContext@15b3e5b, receiver=Remoting connection EJB receiver
[connection=Remoting connection <56467971>,channel=jboss.ejb,nodename=my-jms-master]} on channel Channel ID b9880cf2 (outbound) of Remoting connec
tion 71d15f18 to /10.0.0.247:7080
SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further detail
s.
2017-05-30 18:44:02 INFO  client:45 - JBoss EJB Client version 2.1.4.Final
2017-05-30 18:44:03 ERROR client:686 - AMQ214016: Failed to create netty connect
ion
java.nio.channels.UnresolvedAddressException
        at sun.nio.ch.Net.checkAddress(Net.java:123)
        at sun.nio.ch.SocketChannelImpl.connect(SocketChannelImpl.java:622)
        at io.netty.channel.socket.nio.NioSocketChannel.doConnect(NioSocketChann
el.java:209)
        at io.netty.channel.nio.AbstractNioChannel$AbstractNioUnsafe.connect(Abs
tractNioChannel.java:207)
        at io.netty.channel.DefaultChannelPipeline$HeadContext.connect(DefaultCh
annelPipeline.java:1097)
        at io.netty.channel.AbstractChannelHandlerContext.invokeConnect(Abstract
ChannelHandlerContext.java:471)
        at io.netty.channel.AbstractChannelHandlerContext.connect(AbstractChanne
lHandlerContext.java:456)
        at io.netty.channel.ChannelOutboundHandlerAdapter.connect(ChannelOutboun
dHandlerAdapter.java:47)
        at io.netty.channel.CombinedChannelDuplexHandler.connect(CombinedChannel
DuplexHandler.java:167)
        at io.netty.channel.AbstractChannelHandlerContext.invokeConnect(Abstract
ChannelHandlerContext.java:471)
        at io.netty.channel.AbstractChannelHandlerContext.connect(AbstractChanne
lHandlerContext.java:456)
        at io.netty.channel.ChannelDuplexHandler.connect(ChannelDuplexHandler.ja
va:50)
        at io.netty.channel.AbstractChannelHandlerContext.invokeConnect(Abstract
ChannelHandlerContext.java:471)
        at io.netty.channel.AbstractChannelHandlerContext.connect(AbstractChanne
lHandlerContext.java:456)
        at io.netty.channel.AbstractChannelHandlerContext.connect(AbstractChanne
lHandlerContext.java:438)
        at io.netty.channel.DefaultChannelPipeline.connect(DefaultChannelPipelin
e.java:908)
        at io.netty.channel.AbstractChannel.connect(AbstractChannel.java:203)
        at io.netty.bootstrap.Bootstrap$2.run(Bootstrap.java:166)
        at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(Single
ThreadEventExecutor.java:358)
        at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:357)
        at io.netty.util.concurrent.SingleThreadEventExecutor$2.run(SingleThread
EventExecutor.java:112)
        at java.lang.Thread.run(Thread.java:745)
Exception in thread "main" com.myApp.exceptions.ProcessorStart
upException: javax.jms.JMSException: Failed to create session factory
        at com.myApp.SetUpBowcaster.main(Unknown Source)
Caused by: javax.jms.JMSException: Failed to create session factory
        at org.apache.activemq.artemis.jms.client.ActiveMQConnectionFactory.crea
teConnectionInternal(ActiveMQConnectionFactory.java:727)
        at org.apache.activemq.artemis.jms.client.ActiveMQConnectionFactory.crea
teQueueConnection(ActiveMQConnectionFactory.java:284)
        at com.myApp.applicationLayer.jms.BowcasterProcessorsH
andlersManager.setUpJmsConnection(Unknown Source)
        at com.myApp.applicationLayer.jms.BowcasterProcessorsH
andlersManager.<init>(Unknown Source)
        at com.myApp.applicationLayer.jms.BowcasterProcessorsH
andlersManager.getInstance(Unknown Source)
        ... 1 more
Caused by: ActiveMQNotConnectedException[errorType=NOT_CONNECTED message=AMQ1190
07: Cannot connect to server(s). Tried with all available servers.]
        at org.apache.activemq.artemis.core.client.impl.ServerLocatorImpl.create
SessionFactory(ServerLocatorImpl.java:777)
        at org.apache.activemq.artemis.jms.client.ActiveMQConnectionFactory.crea
teConnectionInternal(ActiveMQConnectionFactory.java:724)
        ... 5 more
2017-05-30 18:44:03 INFO  remoting:482 - EJBCLIENT000016: Channel Channel ID b98
80cf2 (outbound) of Remoting connection 71d15f18 to /10.0.0.247:7080 can no long
er process messages
4

2 に答える 2

2

この方法で接続を作成することで解決しました:

Map<String, Object> connectionParams = new HashMap<String, Object>();
connectionParams.put(org.apache.activemq.artemis.core.remoting.impl.netty.TransportConstants.HOST_PROP_NAME, nattedIp); // <-- PUT THE NATTED IP HERE!
connectionParams.put(org.apache.activemq.artemis.core.remoting.impl.netty.TransportConstants.PORT_PROP_NAME, nattedPort);
connectionParams.put(org.apache.activemq.artemis.core.remoting.impl.netty.TransportConstants.HTTP_UPGRADE_ENABLED_PROP_NAME, "true");
connectionParams.put(org.apache.activemq.artemis.core.remoting.impl.netty.TransportConstants.HTTP_UPGRADE_ENDPOINT_PROP_NAME, "http-acceptor");

TransportConfiguration transportConfiguration = new org.apache.activemq.artemis.api.core.TransportConfiguration(JMS_NETTY_CONNECTOR_FACTORY_PROPERTY_NAME, connectionParams);

ActiveMQConnectionFactory jmsConnnectionFactory =     ActiveMQJMSClient.createConnectionFactoryWithoutHA(JMSFactoryType.TOPIC_CF, transportConfiguration);

if (jmsConnnectionFactory != null) {    
    jmsConnnection = jmsConnnectionFactory.createConnection();
}
于 2017-07-13T15:34:43.933 に答える