2

I have a spring boot application. This app need to listen to the messages from JMS topics deployed in another application (let’s say this application name is Topic) . This topic application runs on wildfly 11 and uses ActiveMQ Artemis.

Did the following things,

Pointed my JNDI properties to the Topic application’s address like below,

java.naming.factory.initial=org.jboss.naming.remote.client.InitialContextFactory
java.naming.provider.url=http-remoting://topic-application-address:port
java.naming.security.principal=username
java.naming.security.credentials=password

Included the ActiveMQ Artemis related libraries in the Spring Boot application.

Gradle build:

compile group: 'org.springframework.boot', name: 'spring-boot-starter-artemis', version: '2.1.3.RELEASE'
compile group: 'org.apache.activemq', name: 'artemis-commons', version: '2.6.4'
compile group: 'org.apache.activemq', name: 'artemis-core-client', version: '2.6.4'
compile group: 'org.apache.activemq', name: 'artemis-jms-client', version: '2.6.4'
compile group: 'javax.json', name: 'javax.json-api', version: '1.1.4'
compile group: 'io.netty', name: 'netty-all', version: '4.1.33.Final'

When I start the Spring Boot application ,

I’m getting the below exception

2019-02-21 10:58:43.519  INFO 12925 --- [main] o.s.c.support.DefaultLifecycleProcessor  : Starting beans in phase 2147483647
2019-02-21 10:58:43.676  WARN 12925 --- [main] s.c.a.AnnotationConfigApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.context.ApplicationContextException: Failed to start bean 'org.springframework.jms.config.internalJmsListenerEndpointRegistry'; nested exception is java.lang.NoSuchFieldError: WRITE_BUFFER_WATER_MARK
2019-02-21 10:58:43.683  INFO 12925 --- [main] o.s.s.c.ThreadPoolTaskScheduler          : Shutting down ExecutorService 'threadPoolTaskScheduler'
2019-02-21 10:58:43.692  INFO 12925 --- [main] j.LocalContainerEntityManagerFactoryBean : Closing JPA EntityManagerFactory for persistence unit 'default'
2019-02-21 10:58:43.693  INFO 12925 --- [main] com.zaxxer.hikari.HikariDataSource       : HikariPool-1 - Shutdown initiated...
2019-02-21 10:58:43.702  INFO 12925 --- [main] com.zaxxer.hikari.HikariDataSource       : HikariPool-1 - Shutdown completed.

Though the field is available in the jar netty-all-4.1.33.Final.jar (in io.netty.channe.ChannelOption class), I’m not sure why it is unable to find the field. How to fix this issue.

Justin Bertram
  • 29,372
  • 4
  • 21
  • 43
Heisenberg
  • 147
  • 1
  • 4
  • 14
  • What happens if you use Netty 4.1.24.Final? This is the actual Netty dependency defined for ActiveMQ Artemis 2.6.4. See https://search.maven.org/artifact/org.apache.activemq/artemis-pom/2.6.4/pom. – Justin Bertram Feb 21 '19 at 15:32
  • @JustinBertram Tried both Netty 4.1.24 Final and some older version like 4.1.9 Final . Still getting the same exception. – Heisenberg Feb 22 '19 at 09:17

0 Answers0