I am trying to send to ActiveMQ Artemis running in localhost from a Spring Boot app container via AMQP. My yml config is as follows:
spring:
activemq:
broker-url: amqp://${HOST_NAME:localhost}:5672
I am passing HOST_NAME as host.docker.internal, but I am getting the following exception:
Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Request processing failed; nested exception is org.springframework.jms.UncategorizedJmsException: Uncategorized exception occurred during JMS processing; nested exception is javax.jms.JMSException: finishConnect(..) failed: Connection refused: host.docker.internal/192.168.65.2:5672] with root cause
host.docker.internal worked for connecting to MySql running on local host but not working for ActiveMQ Artemis. I am using Docker desktop for Windows, Docker version 20+.
Related
We have some existing source code which connect to JMS using TCP protocol . We are providing EMS URL as shown below in properties file:
tib.ems.url=tcp://UK_ONES_DEV_0000.ldn.mywork.com:9222
Now our EMS URL has been changed to SSL but when we are making any changes to ems URL in properties file, it is changing SSL to TCP automatically and failing connection. I am wondering if we need to make any changes for SSL connection.
<bean id="orcaReplayConnectionFactory"
class="org.springframework.jms.connection.UserCredentialsConnectionFactoryAdapter">
<property name="targetConnectionFactory" ref="orcaProviderReplayConnectionFactory"/>
<property name="username" value="${jms.orca.username}"/>
<property name="password" value="${jms.orca.password}"/>
</bean>
<jee:jndi-lookup id="orcaProviderReplayConnectionFactory"
jndi-name="${jndi.orca.name.replay}">
<jee:environment>
java.naming.factory.initial=com.tibco.tibjms.naming.TibjmsInitialContextFactory
java.naming.provider.url=${jndi.orca.url}
java.naming.factory.url.pkgs=com.tibco.tibjms.naming
</jee:environment>
</jee:jndi-lookup>
15:43:12.923 [main] INFO o.s.s.c.ThreadPoolTaskScheduler -Initializing ExecutorService 'taskScheduler'
15:43:13.528 [main] WARN o.s.c.s.ClassPathXmlApplicationContext -Exception encountered during context initialization - cancelling refresh attempt
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.jms.listener.DefaultMessageListenerContainer#0': Cannot resolve reference to bean 'orcaConnectionFactory_v2' while setting bean property 'connectionFactory'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'orcaConnectionFactory_v2' defined in class path resource [spring/integration-context.xml]: Cannot resolve reference to bean 'orcaProviderConnectionFactory_v2' while setting bean property 'targetConnectionFactory'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'orcaProviderConnectionFactory_v2': Invocation of init method failed; nested exception is javax.naming.ServiceUnavailableException: Failed to query JNDI: Failed to connect to the server at tcp://UK_ONES_UAT_0000.ldn.mywork.com:9222 [Root exception is javax.jms.JMSException: Failed to connect to the server at tcp://UK_ONES_UAT_0000.ldn.mywork.com:9222]
Normally, when using JNDI, the connection URL is configured in the provider not the JNDI client. You need to fix the url in the provider.
After adding highlighted configuration while doing JNDI l, issue is resolved
<jee:environment>
java.naming.factory.initial=com.tibco.tibjms.naming.TibjmsInitialContextFactory
java.naming.provider.url=${jndi.orca.url}
java.naming.factory.url.pkgs=com.tibco.tibjms.naming
**com.tibco.tibjms.naming.security_protocol=ssl
com.tibco.tibjms.naming.ssl_enable_verify_host=false**
java.naming.security.principal=${jms.orca.username}
java.naming.security.credentials=${jms.orca.password}
</jee:environment>
After following all the steps for setting up a JMS client ( How to configure JMS in JBoss EAP 7?),
I have the following lines of errors:
javax.naming.CommunicationException: WFNAM00018: Failed to connect to remote host [Root exception is java.io.IOException: JBREM000202: Abrupt close on Remoting connection 3c6a9a86 to /127.0.0.1:8080 of endpoint (anonymous) <13805618>]
Caused by: java.io.IOException: JBREM000202: Abrupt close on Remoting connection 3c6a9a86 to /127.0.0.1:8080 of endpoint (anonymous) <13805618>
JBoss Version : Wildfly 10
Kafka Version : 10.1.1
I am running basic producer , consumer application on JBoss. Initally I got error
"Caused by: javax.ejb.EJBException: org.apache.kafka.common.KafkaException: File jar:file:/Users/ratha/projects/wildfly-10.0.0.Final/modules/system/layers/base/org/picketbox/main/picketbox-4.9.4.Final.jar!/auth.confcannot be read."
After that searching on stack overflow I used https://stackoverflow.com/questions/36761018/jboss-gives-org-apache-kafka-common-kafkaexception-auth-conf-cannot-be-read#
Now I am getting ACL Exception
00:44:09,106 INFO [kafka.consumer.ZookeeperConsumerConnector] (ServerService Thread Pool -- 64) [transactioneventconsumer_ip-172-31-12-90.us-west-2.compute.internal-1497933848284-89131e85], exception during rebalance : org.I0Itec.zkclient.exception.ZkException: org.apache.zookeeper.KeeperException$InvalidACLException: KeeperErrorCode = InvalidACL for /consumers/transactioneventconsumer/owners/transaction_event_data/0
at org.I0Itec.zkclient.exception.ZkException.create(ZkException.java:68)
at org.I0Itec.zkclient.ZkClient.retryUntilConnected(ZkClient.java:1000)
at org.I0Itec.zkclient.ZkClient.create(ZkClient.java:527)
at org.I0Itec.zkclient.ZkClient.createEphemeral(ZkClient.java:570)
at kafka.utils.ZkPath$.createEphemeral(ZkUtils.scala:970)
at kafka.utils.ZkUtils.createEphemeralPath(ZkUtils.scala:446)
at kafka.utils.ZkUtils.createEphemeralPathExpectConflict(ZkUtils.scala:460)
at kafka.consumer.ZookeeperConsumerConnector$ZKRebalancerListener$$anonfun$18.apply(ZookeeperConsumerConnector.scala:849)
at kafka.consumer.ZookeeperConsumerConnector$ZKRebalancerListener$$anonfun$18.apply(ZookeeperConsumerConnector.scala:843)
at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:234)
at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:234)
at scala.collection.mutable.HashMap$$anonfun$foreach$1.apply(HashMap.scala:99)
at scala.collection.mutable.HashMap$$anonfun$foreach$1.apply(HashMap.scala:99)
at scala.collection.mutable.HashTable$class.foreachEntry(HashTable.scala:230)
at scala.collection.mutable.HashMap.foreachEntry(HashMap.scala:40)
at scala.collection.mutable.HashMap.foreach(HashMap.scala:99)
at scala.collection.TraversableLike$class.map(TraversableLike.scala:234)
at scala.collection.AbstractTraversable.map(Traversable.scala:104)
at kafka.consumer.ZookeeperConsumerConnector$ZKRebalancerListener.reflectPartitionOwnershipDecision(ZookeeperConsumerConnector.scala:843)
I have a block of code, that sends email by connecting to SMTP server. (Grails 2.4.4 project)
When i run it in eclipse, everything works fine,
When i run in intellij idea (2016.1.2), I get MailSendException
org.springframework.mail.MailSendException: Mail server connection failed; nested exception is javax.mail.MessagingException: Exception reading response;
nested exception is:
java.net.SocketException: Connection reset. Failed messages: javax.mail.MessagingException: Exception reading response;
nested exception is:
java.net.SocketException: Connection reset; message exception details (1) are:
Failed message 1:
javax.mail.MessagingException: Exception reading response;
Does any one have any idea of what is going on?
I have synchronized my session baeans with the jboss server. But on running the client,
i am getting the following exception. pls tell me the solution if anyone knows!!
javax.naming.Communication Exception: Could not obtain connection to any of these urls: localhost:8080 and discovery failed with error: javax.naming.CommunicationException: Receive timed out [Root exception is java.net.SocketTimeoutException: Receive timed out] [Root exception is javax.naming.Communication Exception: Failed to retrieve stub from server localhost:8080 [Root exception is java.io.EOFException]]
Check the host and port where your jboss is running.