Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

使用@NacosConfigListener报错 #252

Open
paladinGu opened this issue Mar 30, 2021 · 2 comments
Open

使用@NacosConfigListener报错 #252

paladinGu opened this issue Mar 30, 2021 · 2 comments

Comments

@paladinGu
Copy link

paladinGu commented Mar 30, 2021

使用@NacosConfigListener报错

java.util.concurrent.ExecutionException: java.lang.IllegalArgumentException: argument type mismatch
at java.util.concurrent.FutureTask.report(FutureTask.java:122)
at java.util.concurrent.FutureTask.get(FutureTask.java:206)
at com.alibaba.nacos.spring.context.event.config.TimeoutNacosConfigListener.receiveConfigInfo(TimeoutNacosConfigListener.java:79)
at com.alibaba.nacos.client.config.impl.CacheData$1.run(CacheData.java:210)
at com.alibaba.nacos.client.config.impl.CacheData.safeNotifyListener(CacheData.java:241)
at com.alibaba.nacos.client.config.impl.CacheData.checkListenerMd5(CacheData.java:181)
at com.alibaba.nacos.client.config.impl.ClientWorker$LongPollingRunnable.run(ClientWorker.java:629)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run$$$capture(FutureTask.java:266)
at java.util.concurrent.FutureTask.run(FutureTask.java)
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)

How to reproduce it

@NacosConfigListener(dataId = "a.properties")
public void onMsg(Properties config) {

environment

com.alibaba.nacos nacos-spring-context 1.0.1
@brotherlu-xcq
Copy link
Contributor

I will follow on this issue.

@brotherlu-xcq
Copy link
Contributor

brotherlu-xcq commented Apr 26, 2021

@paladinGu the config with properties type will be converted to Map, if you want to use Proeprties to receive the config which in properties type you may appoint your own converter like the example below.
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants