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

Wicket-cdi not working with Weld 2.0

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Duplicate
    • 6.7.0, 6.8.0
    • None
    • wicket-cdi
    • None
    • OSX 10.8, Glassfish 4.0, Java 7

    Description

      Wicket-cdi is violating the CDI spec by injecting every component. The spec is clear about this and non-static inner classes may not managed or injected.

      Weld error is: WELD-000070 Simple bean [EnhancedAnnotatedTypeImpl] class nl.frozn.liuk.web.wizard.component.employment.EmploymentPanel$1 cannot be a non-static inner class

      I made a workaround for ourself by using own INonContextualManager and check if the object that will be injected has no enclosing class.

      My workaround is.

      if (instance.getClass().getEnclosingClass() == null) {
      NonContextual.of(instance.getClass(), beanManager).inject(instance);
      }

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              mkara Marcus Kara
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: