-
Notifications
You must be signed in to change notification settings - Fork 38.5k
@JmsListener annotated method need to be extracted to interface even if CGLIB used [SPR-16557] #21100
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
Comments
Juergen Hoeller commented Could you provide a few details on your setup there? |
Anton Filatov commented The simpliest class reproducing problem in my environment: import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.jms.annotation.JmsListener;
import org.springframework.stereotype.Component;
import javax.transaction.Transactional;
@Component
public class MessageProcessor {
private Logger log = LoggerFactory.getLogger(MessageProcessor.class);
@JmsListener(destination = "event_queue")
@Transactional
public void process(String event) {
log.info("Event received: " + event);
}
} In context.xml cglib-proxies are activated: <tx:annotation-driven proxy-target-class="true"/> Indeed, this does not matter - activated cglib-proxies or not... Exception in both cases the same, but in case of java interface-based proxies exception is correct. |
Anton Filatov commented You was right! More investigation showed that proxy-target-class somewhy is ignored and proxies actually are java interface-based. My real configuration contains ...
<aop:aspectj-autoproxy proxy-target-class="true"/>
...
<tx:annotation-driven proxy-target-class="true"/>
... And i was sure that cglib proxies used.
|
Juergen Hoeller commented Alright, I'll mark this issue as invalid for the time being. If there is anything we need to do at the |
Anton Filatov opened SPR-16557 and commented
Before bugfix #20744 it was impossible to use
@JmsListener
annotation with cglib-proxied classes at all.Now it works fine, but stil we need to extract annotated method into interface because processJmsListener try to search invocableMethod as follows
and this lead to
Message is discouraging :)
I suppose that
will fix this problem.
Affects: 4.3.14
Issue Links:
@Retryable
and@Scheduled
/@JmsListener
doesn't workThe text was updated successfully, but these errors were encountered: