error:
The code inside my controller is.
Caused by: org.springframework.beans.factory.BeanNotOfRequiredTypeException: Bean named '****' is expected to be of type '****' but was actually of type 'com.sun.proxy.$Proxy**'
The solution to the problem.The code inside my controller is.
@Autowired private UserServiceImpl userServiceImpl;
The solution is to change the userserviceimpl implementation class to the userservice interface, and that’s it.
After solving the problem, the code is as follows:
@Autowired private UserService userServiceImpl;
The specific reason is that the interface should be used to receive the proxy object, so as to obtain the proxy object.
Read More:
- [Solved] Connection error with cocoapods. Proxy CONNECT aborted
- Git Push Error: Proxy CONNECT aborted [How to Solve]
- NBU The vnet proxy encounrtened an error [How to Solve]
- if a proxy or similar is necessary `net.git-fetch-with-cli`, Rust Complete `Couldn‘t resolve host name (Coul
- Libtorch Error: Expected object of type Variable but found type CUDALongType for argument #2 ‘index’
- [vite] http proxy error: Error: self signed certificate in certificate chain vite
- [Solved] appium Original error: Could not proxy command to the remote server. Original error: socket hang up
- There was an unexpected error (type=Method Not Allowed, status=405). Request
- Swagger-ui.html Open Error: There was an unexpected error (type=Not Found, status=404)
- Springboot Error: There was an unexpected error (type = internal server error, status = 500)
- [Solved] FileUploadException: the request was rejected because no multipart boundary was found
- [Solved] Mac Runjmeter WARNING: package sun.awt.X11 not in java.desktop
- Tencent cloud container easyexcel export excel error NoClassDefFoundError: could not initialize class sun.awt.x11fontmanager
- [Solved] Error while extracting response for type [] and content type []…
- [Solved] The method getContextPath() from the type HttpServletRequest refers to the missing type String
- maven Error: Element ‘dependency’ cannot have character [children], because the type’s content type is
- [Go] Solve the empty interface interface{} cannot use (type []string) as type []interface {}
- [Exception] javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path validation failed: java.security.cert.CertPathValidatorException: validity check failed
- How to Solve Error: Element ‘dependency’ cannot have character [children], because the type’s content type is element-
- [Solved] TypeError: super(type, obj): obj must be an instance or subtype of type