Skip to content

@ManagedResource not discovered if at least one method is @Transactional, and no exception thrown [SPR-14189] #18760

Open
@spring-projects-issues

Description

@spring-projects-issues

teo sarca opened SPR-14189 and commented

Consider following example

@Service
@ManagedResource(...)
public void MyService
{
  @ManagedOperation(....)
   public void myJmxMethod() { ... }

  @Transactional
  public void someOtherTransactionalMethod();
}

This managed resource will not be detected nor registered because in org.springframework.jmx.export.MBeanExporter.autodetect(AutodetectCallback), the call "beanFactory.getType(beanName)" returns "Proxy" class so "callback.include(beanClass, beanName)" will not detect it.

I find this issue critical because it's so easy to break a managed resource that was working just by annotating with @Transactional one of the methods, even if that method is not exposed.


Affects: 4.2.5

Issue Links:

Metadata

Metadata

Assignees

No one assigned

    Labels

    in: coreIssues in core modules (aop, beans, core, context, expression)type: enhancementA general enhancement

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions