Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Jersey 2.29 AbstractBinder.configure() called twice #4344

Closed
mr-aixigo opened this issue Dec 11, 2019 · 2 comments
Closed

Jersey 2.29 AbstractBinder.configure() called twice #4344

mr-aixigo opened this issue Dec 11, 2019 · 2 comments
Milestone

Comments

@mr-aixigo
Copy link

After upgrading von 2.28 to 2.29 I noticed that the configure() methods of all binders are called twice. This happens with org.glassfish.hk2.utilities.binding.AbstractBinder and can be solved by switching to org.glassfish.jersey.internal.inject.AbstractBinder.

Since this occured only in 2.29 I would like to know:

  • Is this a bug which will be fixed?
  • Should org.glassfish.hk2.utilities.binding.AbstractBinder be considered as deprecated? I could not find anything in the documentation that suggests I should stop using this class.
import org.glassfish.hk2.utilities.binding.AbstractBinder;       // bad
//import org.glassfish.jersey.internal.inject.AbstractBinder;    // good
import org.glassfish.jersey.server.ResourceConfig;

public class DemoConfig extends ResourceConfig
{
   public DemoConfig()
   {
      registerInstances( new DemoBinder() );
   }

   static class DemoBinder extends AbstractBinder
   {
      @Override
      protected void configure()
      {
         System.out.println( "configure()" );
      }
   }
}
@jansupol
Copy link
Contributor

Thanks, this will be fixed.
Duplicates #4256

@jansupol
Copy link
Contributor

As a workaround, you can use:

   public DemoConfig()
   {
      register(DemoBinder.class);
   }

@jansupol jansupol added this to the 2.30 milestone Dec 31, 2019
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants