Uploaded image for project: 'Wicket'
  1. Wicket
  2. WICKET-1130

Injection of Bound Instance Fails with Exception

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Won't Fix
    • 1.3.0-beta4
    • None
    • wicket-guice
    • None

    Description

      If I try to inject an explicitly bound instance into a component, injection fails with an exception in the creation of the CGLIB proxy:

      java.lang.IllegalArgumentException: Superclass has no null constructors but no arguments were given

      Stupidly, I forgot to save the whole stack trace and the code is now gone from my codebase (since I needed it to work). To repeat:

      @Override
      public void configure() {
      bind(EntityManager.class).toInstance(manager);
      }

      Seems wicket-guice is assuming that it needs to create a new instance of everything that's injected, and since EntityManager doesn't have a no-args constructor, such an action fails. Just an assumption anyway...

      Attachments

        Activity

          People

            ivaynberg Igor Vaynberg
            djspiewak Daniel Spiewak
            Votes:
            2 Vote for this issue
            Watchers:
            10 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: