简体   繁体   English

java.lang.AbstractMethodError 在尝试通过 rabbitMQ 实现 nexmo SDK 的入站呼叫时发生

[英]java.lang.AbstractMethodError occurs while trying to implement call inbound of nexmo SDK through rabbitMQ

I am trying to integrate call inbound feature using nexmo java SDK to my spring MVC project with help of rabbitMQ. I am trying to integrate call inbound feature using nexmo java SDK to my spring MVC project with help of rabbitMQ. But I keep on getting the exception below但我不断收到下面的异常

[WARN ] 2021-01-26 14:52:26.913 [org.springframework.amqp.rabbit.config.ListenerContainerFactoryBean#6-9]   ConditionalRejectingErrorHandler - Execution of Rabbit message listener failed.
org.springframework.amqp.rabbit.listener.exception.ListenerExecutionFailedException: Listener method 'listen' threw exception
        at org.springframework.amqp.rabbit.listener.adapter.MessageListenerAdapter.invokeListenerMethod(MessageListenerAdapter.java:371) ~[spring-rabbit-2.1.8.RELEASE.jar:2.1.8.RELEASE]
        at org.springframework.amqp.rabbit.listener.adapter.MessageListenerAdapter.onMessage(MessageListenerAdapter.java:292) ~[spring-rabbit-2.1.8.RELEASE.jar:2.1.8.RELEASE]
        at org.springframework.amqp.rabbit.listener.AbstractMessageListenerContainer.doInvokeListener(AbstractMessageListenerContainer.java:1542) ~[spring-rabbit-2.1.8.RELEASE.jar:2.1.8.RELEASE]
        at org.springframework.amqp.rabbit.listener.AbstractMessageListenerContainer.actualInvokeListener(AbstractMessageListenerContainer.java:1468) ~[spring-rabbit-2.1.8.RELEASE.jar:2.1.8.RELEASE]
        at org.springframework.amqp.rabbit.listener.AbstractMessageListenerContainer.invokeListener(AbstractMessageListenerContainer.java:1456) [spring-rabbit-2.1.8.RELEASE.jar:2.1.8.RELEASE]
        at org.springframework.amqp.rabbit.listener.AbstractMessageListenerContainer.doExecuteListener(AbstractMessageListenerContainer.java:1451) [spring-rabbit-2.1.8.RELEASE.jar:2.1.8.RELEASE]
        at org.springframework.amqp.rabbit.listener.AbstractMessageListenerContainer.executeListener(AbstractMessageListenerContainer.java:1400) [spring-rabbit-2.1.8.RELEASE.jar:2.1.8.RELEASE]
        at org.springframework.amqp.rabbit.listener.SimpleMessageListenerContainer.doReceiveAndExecute(SimpleMessageListenerContainer.java:870) [spring-rabbit-2.1.8.RELEASE.jar:2.1.8.RELEASE]
        at org.springframework.amqp.rabbit.listener.SimpleMessageListenerContainer.receiveAndExecute(SimpleMessageListenerContainer.java:854) [spring-rabbit-2.1.8.RELEASE.jar:2.1.8.RELEASE]
        at org.springframework.amqp.rabbit.listener.SimpleMessageListenerContainer.access$1600(SimpleMessageListenerContainer.java:78) [spring-rabbit-2.1.8.RELEASE.jar:2.1.8.RELEASE]
        at org.springframework.amqp.rabbit.listener.SimpleMessageListenerContainer$AsyncMessageProcessingConsumer.mainLoop(SimpleMessageListenerContainer.java:1137) [spring-rabbit-2.1.8.RELEASE.jar:2.1.8.RELEASE]
        at org.springframework.amqp.rabbit.listener.SimpleMessageListenerContainer$AsyncMessageProcessingConsumer.run(SimpleMessageListenerContainer.java:1043) [spring-rabbit-2.1.8.RELEASE.jar:2.1.8.RELEASE]
        at java.lang.Thread.run(Thread.java:748) [?:1.8.0_275]
Caused by: java.lang.AbstractMethodError: io.jsonwebtoken.impl.DefaultJwtBuilder.addClaims(Ljava/util/Map;)Lio/jsonwebtoken/JwtBuilder;
        at com.nexmo.jwt.JwtGenerator.generate(JwtGenerator.kt:44) ~[jwt-1.0.1.jar:?]
        at com.nexmo.jwt.Jwt.generate(Jwt.kt:44) ~[jwt-1.0.1.jar:?]
        at com.nexmo.jwt.Jwt.generate$default(Jwt.kt:43) ~[jwt-1.0.1.jar:?]
        at com.nexmo.jwt.Jwt.generate(Jwt.kt) ~[jwt-1.0.1.jar:?]
        at com.nexmo.client.auth.JWTAuthMethod.apply(JWTAuthMethod.java:49) ~[client-5.6.0.jar:5.6.0]
        at com.nexmo.client.AbstractMethod.applyAuth(AbstractMethod.java:133) ~[client-5.6.0.jar:5.6.0]
        at com.nexmo.client.AbstractMethod.execute(AbstractMethod.java:79) ~[client-5.6.0.jar:5.6.0]
        at com.nexmo.client.voice.CallsEndpoint.post(CallsEndpoint.java:62) ~[client-5.6.0.jar:5.6.0]
        at com.nexmo.client.voice.VoiceClient.createCall(VoiceClient.java:66) ~[client-5.6.0.jar:5.6.0]
        at com.senpiper.core.listener.VoiceCallListener.listen(VoiceCallListener.java:63) ~[classes/:?]
        at sun.reflect.GeneratedMethodAccessor104.invoke(Unknown Source) ~[?:?]
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_275]
        at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_275]
        at org.springframework.util.MethodInvoker.invoke(MethodInvoker.java:269) ~[spring-core-4.2.3.RELEASE.jar:4.2.3.RELEASE]
        at org.springframework.amqp.rabbit.listener.adapter.MessageListenerAdapter.invokeListenerMethod(MessageListenerAdapter.java:363) ~[spring-rabbit-2.1.8.RELEASE.jar:2.1.8.RELEASE]
        ... 12 more

RabbitMQ Listener class where call inbound logic is implemented. RabbitMQ 监听器 class 实现了调用入站逻辑。

@RabbitListener
public class VoiceCallListener {
    public void listen(VoiceCallPojo voiceCallPojo) {
        NexmoClient client = NexmoClient.builder()
                .apiKey(API_KEY)
                .applicationId(APPLICATION_ID)
                .privateKeyContents(PRIVATE_KEY).httpConfig(HttpConfig.defaultConfig())
                .signatureSecret(SECRET_KEY)
                .build();
        Ncco ncco = new Ncco(
         TalkAction.builder(voiceCallPojo.getMessage()).voiceName(VoiceName.ADITI).build()
        );
        CallEvent result = client.getVoiceClient().createCall(new Call(voiceCallPojo.getCallNumber(),FROM_NUMBER, ncco));
    }
}

POM dependencies POM 依赖项

<dependency>
      <groupId>com.nexmo</groupId>
      <artifactId>client</artifactId>
      <version>5.6.0</version>
    </dependency>
    <dependency>
      <groupId>io.jsonwebtoken</groupId>
      <artifactId>jjwt-impl</artifactId>
      <version>0.11.2</version>
      <scope>runtime</scope>
    </dependency>

This has nothing to do with spring-rabbit;这与spring-rabbit无关; it is an incompatibility between the two library versions you are using and will happen when called from any of your code.这是您正在使用的两个库版本之间的不兼容,并且会在从您的任何代码调用时发生。 See the javadocs for AbstractMethodError .请参阅AbstractMethodError的 javadocs。

/**
 * Thrown when an application tries to call an abstract method.
 * Normally, this error is caught by the compiler; this error can
 * only occur at run time if the definition of some class has
 * incompatibly changed since the currently executing method was last
 * compiled.
 *
 * @author  unascribed
 * @since   1.0
 */

You need to find out which versions are compatible.您需要找出兼容的版本。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 java.lang.AbstractMethodError:当我尝试使用 nexmo(vonage) API 发起出站语音呼叫时出现此异常 - java.lang.AbstractMethodError: I get this exception when I am trying to initiate an outbound voice call using nexmo(vonage) API 启动点燃时发生java.lang.abstractmethoderror - java.lang.abstractmethoderror while Starting an Ignite java.lang.AbstractMethodError - java.lang.AbstractMethodError 尝试在Play框架中使用Siena时出现java.lang.AbstractMethodError - java.lang.AbstractMethodError when trying to use Siena with the Play Framework 在ReportClientDocument.open()调用中获取错误java.lang.AbstractMethodError - Getting error java.lang.AbstractMethodError on ReportClientDocument.open() call 运行jersey项目时出现java.lang.AbstractMethodError - java.lang.AbstractMethodError while running jersey project java.lang.AbstractMethodError-使用ANT内置jar时 - java.lang.AbstractMethodError - while using ANT Built jar java.lang.AbstractMethodError: 在 Weblogic 中部署 RESTful 应用程序时的 uri - java.lang.AbstractMethodError: uri while deploying RESTful app in Weblogic 使用Jersey其余Web服务时出现java.lang.AbstractMethodError - java.lang.AbstractMethodError while using Jersey rest webservice Java异常java.lang.AbstractMethodError - Java Exception java.lang.AbstractMethodError
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM