title: Springboot @Transactional - How to make spring call super when it creates service proxy?
body: <p>I have intermediate skills in Springboot and can develop simple to medium complex applications but this one is throwing me off a little bit.</p>
  <p>I have a @Service that extends Guava's AbstractIdleService and a @Controller that has instance of the service autowired.</p>
  <p>In the service, I have a method, say performTransaction() that is annotated with @Transactional (ofcourse to let Spring take care of transactions) and it does create a proxy of the service class. But when I debug the application I can see that the proxy that is injected in the controller contains all super class (AbstractIdleService) class fields as null meaning super() is not called when the proxy of my service was created. Because of this the application is failing to initialize when calling the super class's (AbstractIdleService) startAsync method. I am not really sure how to make this work.</p>
  <p>I have added some code below for illustration.
  This is my service class:</p>
  <pre><code>import com.google.common.util.concurrent.AbstractIdleService;
  import org.springframework.transaction.annotation.Transactional;
  
  @Service
  public class MyService extends AbstractIdleService {
    @Transactional
    public void performTransaction() {
    }
  }
  </code></pre>
  <p>This is the controller that uses the above service:</p>
  <pre><code>@Controller
  public void MyController {
      private MyService service;
      private EurekaRegistration eurekaRegistration;
      
      @Autowired
      public MyController(MyService service, EurekaRegistration eurekaRegistration) {
          this.service = service;     // This is where the proxy contains all AbstractIdleService fields null
          this.eurekaRegistration = eurekaRegistration;
      }
  
      @EventListener({ ApplicationPreparedEvent.class })
          public void handleApplicationPreparedEvent() {
          this.service.startAsync();  // This line throws NPE, as delegate in the parent is null
          this.service.awaitRunning();
      }
  }
  </code></pre>
  <p>I must use AbstractIdleService as that is the organizational convention and I need to invoke some startup code in the startAsync method. But invoking startAsync method on the service is causing a NullPointerException as it uses a parent field that is null because the proxy initialization never called super.</p>