ERROR: java.lang.NoClassDefFoundError: co/elastic/apm/api/ElasticApm

Kibana version: 8.6.2

Elasticsearch version: 8.6.2

APM Server version: 8.6.2

APM Agent language and version: 1.43.0

Original install method (e.g. download page, yum, deb, from source, etc.) and version: Docker stack from registry

Fresh install or upgraded from other version? Fresh install

Is there anything special in your setup? Nothing in specific

Description of the problem including expected versus actual behavior. Please include screenshots (if relevant):

Hello guys.

We run our application with WildFly (Servlet container info = WildFly 1.0.2.Final - 1.2.9.Final) and this behavior only with it.

Now we're running with java agent 1.43.0, but we tested with some older versions and get the same behavior too.

We're using java agent with arguments in JAVA_OPTS environment with co.elastic.apm package at same time.

The problem only happens when we try to set labels using API/Code practices. Without it, no problems happen.

We used this approach with spring boot applications and we have no problems.

We try to set labels on transaction like this:

...
import co.elastic.apm.api.ElasticApm;
import co.elastic.apm.api.Transaction;
import org.apache.log4j.Logger;

public class Apm {

  private static final Logger LOGGER = Logger.getLogger(Apm.class);

  private Apm() {
  }

  public static void applyLabelsCurrentTransaction(CalculosTributarios calculo) {
    try {
      applyLabels(ElasticApm.currentTransaction(), calculo); // Problem here: java.lang.NoClassDefFoundError: co/elastic/apm/api/ElasticApm
    } catch (Exception e) {
      String message = "Problem to set apm labels" + calculo.getId();
      if (LOGGER.isDebugEnabled()) {
        LOGGER.debug(message, e);
      } else {
        LOGGER.warn(message);
      }
    } catch (Error e) {// issue NoClassDefError
      LOGGER.warn("Error to set apm labels", e);
    }
  }

  public static void applyLabels(Transaction transaction, CalculosTributarios calculo) {
    try {
      transaction.setLabel("database", String.valueOf(calculo.getDatabaseId()));
      transaction.setLabel("idCalculo", String.valueOf(calculo.getId()));

      TipoCadastro tipoCadastro = calculo.getCreditosTributarios().getTipoCadastro();

      transaction.setLabel("tipoCadastro", tipoCadastro.toValue());
      transaction.setLabel("tipoCadastroDescription", tipoCadastro.getDescription());
    } catch (Exception e) {
      String message = "Problem to set apm labels: " + calculo.getId();
      if (LOGGER.isDebugEnabled()) {
        LOGGER.debug(message, e);
      } else {
        LOGGER.warn(message);
      }
    } catch (Error e) {// Problema com NoClassDefError
      LOGGER.warn("Error to set apm labels", e);
    }
  }
}

And the pom file has:

<dependency>
  <groupId>co.elastic.apm</groupId>
  <artifactId>apm-agent-api</artifactId>
  <version>1.43.0</version>
  <scope>compile</scope>
</dependency>

We're using it in another class. When we try to use, we get this log below:

10:43:17,624 INFO  [stdout] (default-threads - 12) 2023-11-29 10:43:17,624 [default-threads - 12] DEBUG co.elastic.apm.agent.impl.transaction.AbstractSpan - increment references to 'HomologacaoProcessamentoMessageDriveBean#onMessage' 00-07dde9d21602103e45857e5c089d3fbf-7fe83f8c2a36c9b0-01 (351406ac) (2)
10:43:17,624 INFO  [stdout] (default-threads - 12) 2023-11-29 10:43:17,624 [default-threads - 12] DEBUG co.elastic.apm.agent.impl.ElasticApmTracer - endSpan 'HomologacaoProcessamentoMessageDriveBean#onMessage' 00-07dde9d21602103e45857e5c089d3fbf-7fe83f8c2a36c9b0-01 (351406ac)
10:43:17,624 INFO  [stdout] (default-threads - 12) 2023-11-29 10:43:17,624 [default-threads - 12] DEBUG co.elastic.apm.agent.impl.transaction.AbstractSpan - decrement references to 'SQS RECEIVE from test-tributos-calculo-homologacao-processamento' 00-07dde9d21602103e45857e5c089d3fbf-373a00a2dac28731-01 (39ed9a9e) (7)
10:43:17,624 INFO  [stdout] (default-threads - 12) 2023-11-29 10:43:17,624 [default-threads - 12] DEBUG co.elastic.apm.agent.impl.transaction.AbstractSpan - decrement references to 'SqsAuthInterceptor#intercept' 00-07dde9d21602103e45857e5c089d3fbf-cc95aa407d248c9b-01 (66789320) (2)
10:43:17,624 INFO  [stdout] (default-threads - 12) 2023-11-29 10:43:17,624 [default-threads - 12] DEBUG co.elastic.apm.agent.impl.transaction.AbstractSpan - decrement references to 'SQS RECEIVE from test-tributos-calculo-homologacao-processamento' 00-07dde9d21602103e45857e5c089d3fbf-373a00a2dac28731-01 (39ed9a9e) (6)
10:43:17,624 INFO  [stdout] (default-threads - 12) 2023-11-29 10:43:17,624 [default-threads - 12] DEBUG co.elastic.apm.agent.impl.transaction.AbstractSpan - decrement references to 'HomologacaoProcessamentoMessageDriveBean#onMessage' 00-07dde9d21602103e45857e5c089d3fbf-7fe83f8c2a36c9b0-01 (351406ac) (1)
10:43:17,625 INFO  [stdout] (default-threads - 12) 2023-11-29 10:43:17,625 [default-threads - 12] DEBUG co.elastic.apm.agent.impl.ActiveStack - Deactivating 'SqsAuthInterceptor#intercept' 00-07dde9d21602103e45857e5c089d3fbf-cc95aa407d248c9b-01 (66789320) on thread 224
10:43:17,625 INFO  [stdout] (default-threads - 12) 2023-11-29 10:43:17,625 [default-threads - 12] DEBUG co.elastic.apm.agent.impl.transaction.AbstractSpan - decrement references to 'SQS RECEIVE from test-tributos-calculo-homologacao-processamento' 00-07dde9d21602103e45857e5c089d3fbf-373a00a2dac28731-01 (39ed9a9e) (5)
10:43:17,625 INFO  [stdout] (default-threads - 12) 2023-11-29 10:43:17,625 [default-threads - 12] DEBUG co.elastic.apm.agent.impl.transaction.AbstractSpan - decrement references to 'SqsAuthInterceptor#intercept' 00-07dde9d21602103e45857e5c089d3fbf-cc95aa407d248c9b-01 (66789320) (1)
10:43:17,625 INFO  [stdout] (default-threads - 12) 2023-11-29 10:43:17,625 [default-threads - 12] DEBUG co.elastic.apm.agent.impl.transaction.AbstractSpan - increment references to 'SQS RECEIVE from test-tributos-calculo-homologacao-processamento' 00-07dde9d21602103e45857e5c089d3fbf-373a00a2dac28731-01 (39ed9a9e) (6)
10:43:17,625 INFO  [stdout] (default-threads - 12) 2023-11-29 10:43:17,625 [default-threads - 12] DEBUG co.elastic.apm.agent.impl.transaction.AbstractSpan - increment references to 'SqsAuthInterceptor#intercept' 00-07dde9d21602103e45857e5c089d3fbf-cc95aa407d248c9b-01 (66789320) (2)
10:43:17,625 INFO  [stdout] (default-threads - 12) 2023-11-29 10:43:17,625 [default-threads - 12] DEBUG co.elastic.apm.agent.impl.ElasticApmTracer - endSpan 'SqsAuthInterceptor#intercept' 00-07dde9d21602103e45857e5c089d3fbf-cc95aa407d248c9b-01 (66789320)
10:43:17,626 INFO  [stdout] (default-threads - 12) 2023-11-29 10:43:17,626 [default-threads - 12] DEBUG co.elastic.apm.agent.impl.transaction.AbstractSpan - decrement references to 'SQS RECEIVE from test-tributos-calculo-homologacao-processamento' 00-07dde9d21602103e45857e5c089d3fbf-373a00a2dac28731-01 (39ed9a9e) (5)
10:43:17,626 INFO  [stdout] (default-threads - 12) 2023-11-29 10:43:17,626 [default-threads - 12] DEBUG co.elastic.apm.agent.impl.transaction.AbstractSpan - decrement references to 'SQS RECEIVE from test-tributos-calculo-homologacao-processamento' 00-07dde9d21602103e45857e5c089d3fbf-373a00a2dac28731-01 (39ed9a9e) (4)
10:43:17,626 INFO  [stdout] (default-threads - 12) 2023-11-29 10:43:17,626 [default-threads - 12] DEBUG co.elastic.apm.agent.impl.transaction.AbstractSpan - decrement references to 'SqsAuthInterceptor#intercept' 00-07dde9d21602103e45857e5c089d3fbf-cc95aa407d248c9b-01 (66789320) (1)
10:43:17,627 ERROR [org.jboss.as.ejb3.invocation] (default-threads - 12) WFLYEJB0034: EJB Invocation failed on component HomologacaoProcessamentoMessageDriveBean for method public void com.betha.arrecadacao.calculostributarios.messagebean.HomologacaoProcessamentoMessageDriveBean.onMessage(com.betha.plataforma.amazonsqs.ra.AmazonSQSMessage): javax.ejb.EJBTransactionRolledbackException: WFLYEJB0442: Unexpected Error
	at org.jboss.as.ejb3.tx.CMTTxInterceptor.handleInCallerTx(CMTTxInterceptor.java:159)
	at org.jboss.as.ejb3.tx.CMTTxInterceptor.invokeInCallerTx(CMTTxInterceptor.java:256)
	at org.jboss.as.ejb3.tx.CMTTxInterceptor.required(CMTTxInterceptor.java:329)
	at org.jboss.as.ejb3.tx.CMTTxInterceptor.processInvocation(CMTTxInterceptor.java:239)
	at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)
	at org.jboss.as.ejb3.component.interceptors.CurrentInvocationContextInterceptor.processInvocation(CurrentInvocationContextInterceptor.java:41)
	at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)
	at org.jboss.as.ejb3.component.invocationmetrics.WaitTimeInterceptor.processInvocation(WaitTimeInterceptor.java:43)
	at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)
	at org.jboss.as.ejb3.security.SecurityContextInterceptor.processInvocation(SecurityContextInterceptor.java:100)
	at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)
	at org.jboss.as.ejb3.component.interceptors.ShutDownInterceptorFactory$1.processInvocation(ShutDownInterceptorFactory.java:64)
	at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)
	at org.jboss.as.ejb3.deployment.processors.EjbSuspendInterceptor.processInvocation(EjbSuspendInterceptor.java:53)
	at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)
	at org.jboss.as.ejb3.component.interceptors.LoggingInterceptor.processInvocation(LoggingInterceptor.java:66)
	at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)
	at org.jboss.as.ee.component.NamespaceContextInterceptor.processInvocation(NamespaceContextInterceptor.java:50)
	at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)
	at org.jboss.as.ejb3.component.interceptors.AdditionalSetupInterceptor.processInvocation(AdditionalSetupInterceptor.java:54)
	at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)
	at org.jboss.as.ejb3.component.messagedriven.MessageDrivenComponentDescription$5$1.processInvocation(MessageDrivenComponentDescription.java:213)
	at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)
	at org.jboss.invocation.ContextClassLoaderInterceptor.processInvocation(ContextClassLoaderInterceptor.java:64)
	at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)
	at org.jboss.invocation.InterceptorContext.run(InterceptorContext.java:356)
	at org.wildfly.security.manager.WildFlySecurityManager.doChecked(WildFlySecurityManager.java:634)
	at org.jboss.invocation.AccessCheckingInterceptor.processInvocation(AccessCheckingInterceptor.java:61)
	at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)
	at org.jboss.invocation.InterceptorContext.run(InterceptorContext.java:356)
	at org.jboss.invocation.PrivilegedWithCombinerInterceptor.processInvocation(PrivilegedWithCombinerInterceptor.java:80)
	at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)
	at org.jboss.invocation.ChainedInterceptor.processInvocation(ChainedInterceptor.java:61)
	at org.jboss.as.ee.component.ViewService$View.invoke(ViewService.java:195)
	at org.jboss.as.ee.component.ViewDescription$1.processInvocation(ViewDescription.java:185)
	at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)
	at org.jboss.invocation.ChainedInterceptor.processInvocation(ChainedInterceptor.java:61)
	at org.jboss.as.ee.component.ProxyInvocationHandler.invoke(ProxyInvocationHandler.java:73)
	at com.betha.arrecadacao.calculostributarios.messagebean.HomologacaoProcessamentoMessageDriveBean$$$view41.onMessage(Unknown Source)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.jboss.as.ejb3.inflow.MessageEndpointInvocationHandler.doInvoke(MessageEndpointInvocationHandler.java:139)
	at org.jboss.as.ejb3.inflow.AbstractInvocationHandler.invoke(AbstractInvocationHandler.java:73)
	at com.betha.arrecadacao.calculostributarios.messagebean.HomologacaoProcessamentoMessageDriveBean$$$endpoint7.onMessage(Unknown Source)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at com.betha.plataforma.amazonsqs.ra.inbound.SQSSession.dispatchMessage(SQSSession.java:182)
	at java.util.Collection.removeIf(Collection.java:414)
	at com.betha.plataforma.amazonsqs.ra.inbound.SQSSession.run(SQSSession.java:133)
	at org.jboss.jca.core.workmanager.WorkWrapper.run(WorkWrapper.java:226)
	at org.jboss.threads.SimpleDirectExecutor.execute(SimpleDirectExecutor.java:33)
	at org.jboss.threads.QueueExecutor.runTask(QueueExecutor.java:808)
	at org.jboss.threads.QueueExecutor.access$100(QueueExecutor.java:45)
	at org.jboss.threads.QueueExecutor$Worker.run(QueueExecutor.java:828)
	at java.lang.Thread.run(Thread.java:748)
	at org.jboss.threads.JBossThread.run(JBossThread.java:320)
Caused by: javax.ejb.EJBException: WFLYEJB0442: Unexpected Error
	at org.jboss.as.ejb3.tx.CMTTxInterceptor.handleExceptionInNoTx(CMTTxInterceptor.java:210)
	at org.jboss.as.ejb3.tx.CMTTxInterceptor.invokeInNoTx(CMTTxInterceptor.java:265)
	at org.jboss.as.ejb3.tx.CMTTxInterceptor.notSupported(CMTTxInterceptor.java:308)
	at org.jboss.as.ejb3.tx.CMTTxInterceptor.processInvocation(CMTTxInterceptor.java:237)
	at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)
	at org.jboss.as.ejb3.component.interceptors.CurrentInvocationContextInterceptor.processInvocation(CurrentInvocationContextInterceptor.java:41)
	at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)
	at org.jboss.as.ejb3.component.invocationmetrics.WaitTimeInterceptor.processInvocation(WaitTimeInterceptor.java:43)
	at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)
	at org.jboss.as.ejb3.security.SecurityContextInterceptor.processInvocation(SecurityContextInterceptor.java:100)
	at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)
	at org.jboss.as.ejb3.component.interceptors.ShutDownInterceptorFactory$1.processInvocation(ShutDownInterceptorFactory.java:64)
	at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)
	at org.jboss.as.ejb3.component.interceptors.LoggingInterceptor.processInvocation(LoggingInterceptor.java:66)
	at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)
	at org.jboss.as.ee.component.NamespaceContextInterceptor.processInvocation(NamespaceContextInterceptor.java:50)
	at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)
	at org.jboss.as.ejb3.component.interceptors.AdditionalSetupInterceptor.processInvocation(AdditionalSetupInterceptor.java:54)
	at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)
	at org.jboss.invocation.ContextClassLoaderInterceptor.processInvocation(ContextClassLoaderInterceptor.java:64)
	at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)
	at org.jboss.invocation.InterceptorContext.run(InterceptorContext.java:356)
	at org.wildfly.security.manager.WildFlySecurityManager.doChecked(WildFlySecurityManager.java:634)
	at org.jboss.invocation.AccessCheckingInterceptor.processInvocation(AccessCheckingInterceptor.java:61)
	at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)
	at org.jboss.invocation.InterceptorContext.run(InterceptorContext.java:356)
	at org.jboss.invocation.PrivilegedWithCombinerInterceptor.processInvocation(PrivilegedWithCombinerInterceptor.java:80)
	at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)
	at org.jboss.invocation.ChainedInterceptor.processInvocation(ChainedInterceptor.java:61)
	at org.jboss.as.ee.component.ViewService$View.invoke(ViewService.java:195)
	at org.jboss.as.ee.component.ViewDescription$1.processInvocation(ViewDescription.java:185)
	at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)
	at org.jboss.invocation.ChainedInterceptor.processInvocation(ChainedInterceptor.java:61)
	at org.jboss.as.ee.component.ProxyInvocationHandler.invoke(ProxyInvocationHandler.java:73)
	at com.betha.arrecadacao.calculostributarios.business.homologacao.HomologacaoBusiness$$$view38.homologar(Unknown Source)
	at com.betha.arrecadacao.calculostributarios.messagebean.HomologacaoProcessamentoMessageDriveBean.onMessage(HomologacaoProcessamentoMessageDriveBean.java:51)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.jboss.as.ee.component.ManagedReferenceMethodInterceptor.processInvocation(ManagedReferenceMethodInterceptor.java:52)
	at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)
	at org.jboss.invocation.InterceptorContext$Invocation.proceed(InterceptorContext.java:437)
	at org.jboss.as.weld.ejb.Jsr299BindingsInterceptor.delegateInterception(Jsr299BindingsInterceptor.java:70)
	at org.jboss.as.weld.ejb.Jsr299BindingsInterceptor.doMethodInterception(Jsr299BindingsInterceptor.java:80)
	at org.jboss.as.weld.ejb.Jsr299BindingsInterceptor.processInvocation(Jsr299BindingsInterceptor.java:93)
	at org.jboss.as.ee.component.interceptors.UserInterceptorFactory$1.processInvocation(UserInterceptorFactory.java:63)
	at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)
	at org.jboss.invocation.InterceptorContext$Invocation.proceed(InterceptorContext.java:437)
	at com.betha.arrecadacao.core.jms.SqsAuthInterceptor.intercept(SqsAuthInterceptor.java:28)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.jboss.as.ee.component.ManagedReferenceLifecycleMethodInterceptor.processInvocation(ManagedReferenceLifecycleMethodInterceptor.java:89)
	at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)
	at org.jboss.as.ejb3.component.invocationmetrics.ExecutionTimeInterceptor.processInvocation(ExecutionTimeInterceptor.java:43)
	at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)
	at org.jboss.invocation.InterceptorContext$Invocation.proceed(InterceptorContext.java:437)
	at org.jboss.weld.ejb.AbstractEJBRequestScopeActivationInterceptor.aroundInvoke(AbstractEJBRequestScopeActivationInterceptor.java:73)
	at org.jboss.as.weld.ejb.EjbRequestScopeActivationInterceptor.processInvocation(EjbRequestScopeActivationInterceptor.java:83)
	at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)
	at org.jboss.as.ee.concurrent.ConcurrentContextInterceptor.processInvocation(ConcurrentContextInterceptor.java:45)
	at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)
	at org.jboss.invocation.InitialInterceptor.processInvocation(InitialInterceptor.java:21)
	at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)
	at org.jboss.invocation.ChainedInterceptor.processInvocation(ChainedInterceptor.java:61)
	at org.jboss.as.ee.component.interceptors.ComponentDispatcherInterceptor.processInvocation(ComponentDispatcherInterceptor.java:52)
	at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)
	at org.jboss.as.ejb3.component.pool.PooledInstanceInterceptor.processInvocation(PooledInstanceInterceptor.java:51)
	at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)
	at org.jboss.as.ejb3.tx.CMTTxInterceptor.invokeInCallerTx(CMTTxInterceptor.java:254)
	... 58 more
Caused by: java.lang.NoClassDefFoundError: co/elastic/apm/api/ElasticApm
	at com.betha.arrecadacao.calculostributarios.Apm.applyLabelsCurrentTransaction(Apm.java:17)
	at com.betha.arrecadacao.calculostributarios.business.homologacao.HomologacaoBusiness.homologar(HomologacaoBusiness.java:134)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.jboss.as.ee.component.ManagedReferenceMethodInterceptor.processInvocation(ManagedReferenceMethodInterceptor.java:52)
	at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)
	at org.jboss.invocation.InterceptorContext$Invocation.proceed(InterceptorContext.java:437)
	at org.jboss.as.weld.ejb.Jsr299BindingsInterceptor.doMethodInterception(Jsr299BindingsInterceptor.java:82)
	at org.jboss.as.weld.ejb.Jsr299BindingsInterceptor.processInvocation(Jsr299BindingsInterceptor.java:93)
	at org.jboss.as.ee.component.interceptors.UserInterceptorFactory$1.processInvocation(UserInterceptorFactory.java:63)
	at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)
	at org.jboss.as.ejb3.component.invocationmetrics.ExecutionTimeInterceptor.processInvocation(ExecutionTimeInterceptor.java:43)
	at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)
	at org.jboss.as.jpa.interceptor.SBInvocationInterceptor.processInvocation(SBInvocationInterceptor.java:47)
	at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)
	at org.jboss.invocation.InterceptorContext$Invocation.proceed(InterceptorContext.java:437)
	at org.jboss.weld.ejb.AbstractEJBRequestScopeActivationInterceptor.aroundInvoke(AbstractEJBRequestScopeActivationInterceptor.java:64)
	at org.jboss.as.weld.ejb.EjbRequestScopeActivationInterceptor.processInvocation(EjbRequestScopeActivationInterceptor.java:83)
	at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)
	at org.jboss.as.ee.concurrent.ConcurrentContextInterceptor.processInvocation(ConcurrentContextInterceptor.java:45)
	at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)
	at org.jboss.invocation.InitialInterceptor.processInvocation(InitialInterceptor.java:21)
	at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)
	at org.jboss.invocation.ChainedInterceptor.processInvocation(ChainedInterceptor.java:61)
	at org.jboss.as.ee.component.interceptors.ComponentDispatcherInterceptor.processInvocation(ComponentDispatcherInterceptor.java:52)
	at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)
	at org.jboss.as.ejb3.component.interceptors.NonPooledEJBComponentInstanceAssociatingInterceptor.processInvocation(NonPooledEJBComponentInstanceAssociatingInterceptor.java:59)
	at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)
	at org.jboss.as.ejb3.tx.CMTTxInterceptor.invokeInNoTx(CMTTxInterceptor.java:263)
	... 128 more

When this error happens, we're unable to consume SQS messages.

Are we doing something wrong using this approach? Can you help to understand and fix it?

Thank you.

Hi, the problem is the scope you use for the dependency:

You should remove the <scope>compile</scope> from the declaration, because the dependency needs to be on your runtime classpath. That should solve the issue.

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.