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

spring boot (because it is a JDK dynamic proxy that implements) #666

Closed
An0nymous0 opened this issue Aug 31, 2017 · 4 comments
Closed

spring boot (because it is a JDK dynamic proxy that implements) #666

An0nymous0 opened this issue Aug 31, 2017 · 4 comments

Comments

@An0nymous0
Copy link

An0nymous0 commented Aug 31, 2017

1.gradle

compile group: 'net.bull.javamelody', name: 'javamelody-spring-boot-starter', version: '1.69.0'
application.yml
   aop:
       auto: true
       proxy-target-class: true
@Transactional 
xx method()

4.start spring boot
The bean 'xxxService' could not be injected as a 'com.xxx.service.xxxService' because it is a JDK dynamic proxy that implements:

Action:

Consider injecting the bean as one of its interfaces or forcing the use of CGLib-based proxies by setting proxyTargetClass=true on @EnableAsync and/or @EnableCaching.

@evernat
Copy link
Member

evernat commented Sep 2, 2017

a workaround is to add in your application.yml:

javamelody:
  advisor-auto-proxy-creator-enabled: false

and to add in your pom.xml (if you don't already have that dependency):

<dependency>
	<groupId>org.springframework.boot</groupId>
	<artifactId>spring-boot-starter-aop</artifactId>
</dependency>

see https://github.com/javamelody/javamelody/blob/master/javamelody-spring-boot-starter/src/main/java/net/bull/javamelody/JavaMelodyAutoConfiguration.java#L148

I think that I should add a note about advisor-auto-proxy-creator-enabled in the doc

@evernat
Copy link
Member

evernat commented Sep 6, 2017

doc updated at the end of the Integration chapter.
Thanks for the issue.

@evernat evernat closed this as completed Sep 6, 2017
@qiyunfei
Copy link

qiyunfei commented Sep 7, 2017

hi. the project use spring cloud feign api ,the controller mapping is not work when dependency javamelody-spring-boot-starter. because of javamelody auto proxy.
add

javamelody:
  advisor-auto-proxy-creator-enabled: false

it work .thx for the issue .

@sxdtzhaoxinguo
Copy link

sxdtzhaoxinguo commented Aug 10, 2018

add this configuration spring.aop.proxy-target-class=true in the application.properties file!

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

4 participants