Usage of "com.atlassian.confluence.api.service" in Atlassian Scheduler runJob

I am also struggling to use SpaceService in my plugin.

I am unable to successfully inject it using Spring Java configuration of app components

Caused by: java.lang.ClassNotFoundException: org.springframework.cglib.proxy.Factory not found by com.atlassian.plugin.osgi.bridge [1]
	at org.apache.felix.framework.BundleWiringImpl.findClassOrResourceByDelegation(BundleWiringImpl.java:1639)
	at org.apache.felix.framework.BundleWiringImpl.access$200(BundleWiringImpl.java:80)
	at org.apache.felix.framework.BundleWiringImpl$BundleClassLoader.loadClass(BundleWiringImpl.java:2053)
	at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:522)

If anyone is successfully using Spring Java configuration and the SpaceService I’d like to know how they got that service injected into their classes.

The mechanism I’m using for all the other services (like the old SpaceManager, etc.) works fine.

UPDATE:
I am able to inject SpaceService using Spring Java configuration. In my configuration class:

@Bean
  public SpaceService spaceService() {
    return importOsgiService(SpaceService.class);
  }