jenkinsci / extension-filter-plugin

https://plugins.jenkins.io/extension-filter/
MIT License
2 stars 7 forks source link

ConfigurableExtensionFilter Guice proxy issue #54

Closed jonesbusy closed 6 months ago

jonesbusy commented 7 months ago

Jenkins and plugins versions report

Each time instance is restarted exception is raised that some filter cannot be proxy by Guice

ExtensionFilter, annotation=@com.google.inject.name.Named("org.jenkinsci.plugins.ConfigurableExtensionFilter.EXTENSION_FILTER")]; skipping this component 
com.google.inject.ProvisionException: Unable to provision, see the following errors:

1) [Guice/CanNotProxyClass]: Tried proxying jenkins.ExtensionFilter to support a circular dependency, but it is not an interface.

Learn more:
  https://github.com/google/guice/wiki/CAN_NOT_PROXY_CLASS

1 error
        at com.google.inject.internal.InternalProvisionException.toProvisionException(InternalProvisionException.java:251)
        at com.google.inject.internal.ProviderToInternalFactoryAdapter.get(ProviderToInternalFactoryAdapter.java:43)
        at com.google.inject.internal.SingletonScope$1.get(SingletonScope.java:169)

What Operating System are you using (both controller, and any agents involved in the problem)?

All

Reproduction steps

1) Install the plugin 2) Restart the instance

Expected Results

No issue with Guice

Actual Results

1) [Guice/CanNotProxyClass]: Tried proxying jenkins.ExtensionFilter to support a circular dependency, but it is not an interface.

Anything else?

I think the class must be modernize to avoid anonymous classed and use static inner class instead

@Extension
@Symbol("configurableExtensionFilter")
public static final class DescriptorImpl extends Descriptor<ConfigurableExtensionFilter> {

}

Are you interested in contributing a fix?

No response

sridamul commented 6 months ago

Hey @jonesbusy I tried to resolve this issue by modernizing the class as you suggested, but still the error persists. Also tried implementing interface as mentioned in the log.

[Guice/CanNotProxyClass]: Tried proxying jenkins.ExtensionFilter to support a circular dependency, but it is not an interface.

Do you have any idea? (Or I will try to figure out in my free time)

jonesbusy commented 6 months ago

Do I didn't explored this. Perhaps there is some Guice config to perform. I don't know enough the framework