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

微服务@Dict注解显示commonApi异常NoSuchBeanDefinitionException #4192

Closed
ChenZJ0104 opened this issue Nov 5, 2022 · 4 comments
Closed

Comments

@ChenZJ0104
Copy link

版本号:3.4.0
前端版本:vue3
问题描述:

微服务项目在jeecg-demo-cloud-start服务中的实体类属性上添加@dict(dicCode="xxx"),在查询相关字段时,报异常:
Snipaste_2022-11-05_23-07-43

截图&代码:

实体类代码:
@Excel(name = "状态", width = 15)
@ApiModelProperty(value = "状态")
@dict(dicCode = "refunds")
private String state;

异常日志:
2022-11-05 22:54:21.322 ERROR 8524 --- [nio-7002-exec-1] o.j.c.e.JeecgBootExceptionHandler : No qualifying bean of type 'org.jeecg.common.api.CommonAPI' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {@org.springframework.context.annotation.Lazy(value=true), @org.springframework.beans.factory.annotation.Autowired(required=true)}

org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'org.jeecg.common.api.CommonAPI' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {@org.springframework.context.annotation.Lazy(value=true), @org.springframework.beans.factory.annotation.Autowired(required=true)}
at org.springframework.beans.factory.support.DefaultListableBeanFactory.raiseNoMatchingBeanFound(DefaultListableBeanFactory.java:1799) ~[spring-beans-5.3.18.jar:5.3.18]
at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1355) ~[spring-beans-5.3.18.jar:5.3.18]
at org.springframework.context.annotation.ContextAnnotationAutowireCandidateResolver$1.getTarget(ContextAnnotationAutowireCandidateResolver.java:95) ~[spring-context-5.3.18.jar:5.3.18]
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:195) ~[spring-aop-5.3.18.jar:5.3.18]
at com.sun.proxy.$Proxy117.translateManyDict(Unknown Source) ~[na:na]
at org.jeecg.common.aspect.DictAspect.translateAllDict(DictAspect.java:312) ~[classes/:na]
at org.jeecg.common.aspect.DictAspect.parseDictText(DictAspect.java:166) ~[classes/:na]
at org.jeecg.common.aspect.DictAspect.doAround(DictAspect.java:68) ~[classes/:na]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_101]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_101]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_101]
at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_101]
at org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethodWithGivenArgs(AbstractAspectJAdvice.java:634) ~[spring-aop-5.3.18.jar:5.3.18]
......

友情提示(为了提高issue处理效率):

  • 未按格式要求发帖,会被直接删掉;
  • 描述过于简单或模糊,导致无法处理的,会被直接删掉;
  • 请自己初判问题描述是否清楚,是否方便我们调查处理;
  • 针对问题请说明是Online在线功能(需说明用的主题模板),还是生成的代码功能;
@zhangdaiscott
Copy link
Member

你得引入下 jeecg-system-cloud-api

@ChenZJ0104
Copy link
Author

image
您好,我引入了 jeecg-system-cloud-api,也重新编译了,但还是报这个异常

@zhangdaiscott
Copy link
Member

不应该,你下载最新的代码测试下,这个问题修改改过

@zhangdaiscott zhangdaiscott reopened this Nov 7, 2022
@ChenZJ0104
Copy link
Author

您好,使用了3.4.3-GA版本,可以正常翻译了;非常感谢!!

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