我正在更新 javassist 库的版本,并注意到maven 存储库站点上的最新版本 ( 3.22.0-CR1 ) 具有红色背景,但通过快速搜索,我无法找出原因。
我尝试使用RabbitTemplate.convertAndSend发布消息时随机遇到NullPointerException
我尝试了spring-amqp:1.7.6和spring-amqp:1.7.8,这应该是我的依赖树的相关部分:
[INFO] | +- org.springframework.amqp:spring-rabbit:jar:1.7.4.RELEASE:compile
[INFO] | | +- com.rabbitmq:http-client:jar:1.1.1.RELEASE:compile
[INFO] | | \- com.rabbitmq:amqp-client:jar:4.0.3:compile
Run Code Online (Sandbox Code Playgroud)
这是异常的堆栈跟踪
org.springframework.amqp.UncategorizedAmqpException: java.lang.NullPointerException
at org.springframework.amqp.rabbit.support.RabbitExceptionTranslator.convertRabbitAccessException(RabbitExceptionTranslator.java:83)
at org.springframework.amqp.rabbit.connection.RabbitAccessor.convertRabbitAccessException(RabbitAccessor.java:113)
at org.springframework.amqp.rabbit.core.RabbitTemplate.doExecute(RabbitTemplate.java:1461)
at org.springframework.amqp.rabbit.core.RabbitTemplate.execute(RabbitTemplate.java:1411)
at org.springframework.amqp.rabbit.core.RabbitTemplate.send(RabbitTemplate.java:712)
at org.springframework.amqp.rabbit.core.RabbitTemplate.convertAndSend(RabbitTemplate.java:813)
at org.springframework.amqp.rabbit.core.RabbitTemplate.convertAndSend(RabbitTemplate.java:791)
at io.reactivex.internal.operators.completable.CompletableFromAction.subscribeActual(CompletableFromAction.java:34)
at io.reactivex.Completable.subscribe(Completable.java:1635)
at io.reactivex.internal.operators.completable.CompletableCache.subscribeActual(CompletableCache.java:59)
at io.reactivex.Completable.subscribe(Completable.java:1635)
at io.reactivex.internal.operators.completable.CompletableSubscribeOn$SubscribeOnObserver.run(CompletableSubscribeOn.java:64)
at io.reactivex.Scheduler$DisposeTask.run(Scheduler.java:452)
at io.reactivex.internal.schedulers.ScheduledRunnable.run(ScheduledRunnable.java:61)
at io.reactivex.internal.schedulers.ScheduledRunnable.call(ScheduledRunnable.java:52)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
Caused by: java.lang.NullPointerException: null
at sun.reflect.GeneratedMethodAccessor487.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.springframework.amqp.rabbit.connection.CachingConnectionFactory$CachedChannelInvocationHandler.invoke(CachingConnectionFactory.java:980)
at com.sun.proxy.$Proxy174.basicPublish(Unknown Source)
at org.springframework.amqp.rabbit.core.RabbitTemplate.doSend(RabbitTemplate.java:1532)
at …Run Code Online (Sandbox Code Playgroud) java nullpointerexception rabbitmq spring-amqp spring-rabbitmq
嗨,我正在尝试让这样的东西在 bash 中工作
$ http=xx sudo echo $http
xx
Run Code Online (Sandbox Code Playgroud)
但我不断收到空行,到目前为止唯一有效的是:
$ export http=xx
$ sudo -E echo $http
xx
Run Code Online (Sandbox Code Playgroud)
我想要实现的是能够为 sudo 命令内联变量
我也按照这里的建议尝试过这个
$ sudo http=xx echo $http
Run Code Online (Sandbox Code Playgroud)
但运气不好,我错过了什么吗?