Wicket
  1. Wicket
  2. WICKET-5052

@SpringBean fails to invoke methods on bean with non-public methods

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 6.6.0, 1.5.10
    • Fix Version/s: 6.7.0, 1.5.11
    • Component/s: wicket-spring
    • Labels:
      None
    • Environment:
      Tomcat 6.0.35
      Java 1.6.0.37

      Description

      @SpringBean fails to inject properly classes with a composite interface.

      eg :

      interface Something1 {}

      interface Something2 {}

      edit-public-edit interface Something extends Something1, Something2 {}

      class TestBean implements Something {}

      public class TestPage extends WebPage

      { @SpringBrean private Something something; }

      Trying to inject a bean implementing the Something interface does not seems to fail at first, but when calling any method an IllegalAccessException is thrown, similar to this :
      java.lang.IllegalAccessException: Class org.apache.wicket.proxy.LazyInitProxyFactory$JdkHandler can not access a member of class

      {replaced}

      with modifiers "public abstract"

      I've attached different test cases reproducing the problem.

      As a side note, referencing directly the implementing class like this seems to work :

      public class TestPage extends WebPage

      { @SpringBrean private TestBean something; }

      But it kind of defeats the purpose of DI.

      edit The visibility of the main interface was incorrectly listed as package-private, it is public (otherwise you can't reference it).

      1. springbean-tests.tgz
        21 kB
        Antoine Dupuis

        Activity

        Martin Grigorov made changes -
        Summary @SpringBean fails to inject composite interfaces @SpringBean fails to invoke methods on bean with non-public methods
        Antoine Dupuis made changes -
        Description @SpringBean fails to inject properly classes with a composite interface.

        eg :

        interface Something1 {}

        interface Something2 {}

        {color:red}public{color} interface Something extends Something1, Something2 {}

        class TestBean implements Something {}

        public class TestPage extends WebPage {
        @SpringBrean
        private Something something;
        }

        Trying to inject a bean implementing the Something interface does not seems to fail at first, but when calling any method an IllegalAccessException is thrown, similar to this :
        java.lang.IllegalAccessException: Class org.apache.wicket.proxy.LazyInitProxyFactory$JdkHandler can not access a member of class {replaced} with modifiers "public abstract"

        I've attached different test cases reproducing the problem.

        As a side note, referencing directly the implementing class like this seems to work :

        public class TestPage extends WebPage {
        @SpringBrean
        private TestBean something;
        }

        But it kind of defeats the purpose of DI.


        {color:red}Edit1{color}: The visibility of the main interface was incorrectly listed as package-private, it is public (otherwise you can't reference it).
        @SpringBean fails to inject properly classes with a composite interface.

        eg :

        interface Something1 {}

        interface Something2 {}

        -edit-public-edit- interface Something extends Something1, Something2 {}

        class TestBean implements Something {}

        public class TestPage extends WebPage {
        @SpringBrean
        private Something something;
        }

        Trying to inject a bean implementing the Something interface does not seems to fail at first, but when calling any method an IllegalAccessException is thrown, similar to this :
        java.lang.IllegalAccessException: Class org.apache.wicket.proxy.LazyInitProxyFactory$JdkHandler can not access a member of class {replaced} with modifiers "public abstract"

        I've attached different test cases reproducing the problem.

        As a side note, referencing directly the implementing class like this seems to work :

        public class TestPage extends WebPage {
        @SpringBrean
        private TestBean something;
        }

        But it kind of defeats the purpose of DI.


        -edit- The visibility of the main interface was incorrectly listed as package-private, it is public (otherwise you can't reference it).
        Antoine Dupuis made changes -
        Description @SpringBean fails to inject properly classes with a composite interface.

        eg :

        interface Something1 {}

        interface Something2 {}

        interface Something extends Something1, Something2 {}

        class TestBean implements Something {}

        public class TestPage extends WebPage {
        @SpringBrean
        private Something something;
        }

        Trying to inject a bean implementing the Something interface does not seems to fail at first, but when calling any method an IllegalAccessException is thrown, similar to this :
        java.lang.IllegalAccessException: Class org.apache.wicket.proxy.LazyInitProxyFactory$JdkHandler can not access a member of class {replaced} with modifiers "public abstract"

        I've attached different test cases reproducing the problem.

        As a side note, referencing directly the implementing class like this seems to work :

        public class TestPage extends WebPage {
        @SpringBrean
        private TestBean something;
        }

        But it kind of defeats the purpose of DI.
        @SpringBean fails to inject properly classes with a composite interface.

        eg :

        interface Something1 {}

        interface Something2 {}

        {color:red}public{color} interface Something extends Something1, Something2 {}

        class TestBean implements Something {}

        public class TestPage extends WebPage {
        @SpringBrean
        private Something something;
        }

        Trying to inject a bean implementing the Something interface does not seems to fail at first, but when calling any method an IllegalAccessException is thrown, similar to this :
        java.lang.IllegalAccessException: Class org.apache.wicket.proxy.LazyInitProxyFactory$JdkHandler can not access a member of class {replaced} with modifiers "public abstract"

        I've attached different test cases reproducing the problem.

        As a side note, referencing directly the implementing class like this seems to work :

        public class TestPage extends WebPage {
        @SpringBrean
        private TestBean something;
        }

        But it kind of defeats the purpose of DI.


        {color:red}Edit1{color}: The visibility of the main interface was incorrectly listed as package-private, it is public (otherwise you can't reference it).
        Martin Grigorov made changes -
        Status Open [ 1 ] Resolved [ 5 ]
        Fix Version/s 6.7.0 [ 12323964 ]
        Fix Version/s 1.5.11 [ 12324069 ]
        Resolution Fixed [ 1 ]
        Martin Grigorov made changes -
        Assignee Martin Grigorov [ mgrigorov ]
        Antoine Dupuis made changes -
        Description @SpringBean fails to inject properly classes with a composite interface.

        eg :

        interface Something1 {}

        interface Something2 {}

        interface Something extends Something1, Something2 {}

        class TestBean implements Something {}

        public class TestPage extends WebPage {
        @SpringBrean
        private SomethingInterface something;
        }

        Trying to inject a bean implementing the Something interface does not seems to fail at first, but when calling any method an IllegalAccessException is thrown, similar to this :
        java.lang.IllegalAccessException: Class org.apache.wicket.proxy.LazyInitProxyFactory$JdkHandler can not access a member of class {replaced} with modifiers "public abstract"

        I've attached different test cases reproducing the problem.
        @SpringBean fails to inject properly classes with a composite interface.

        eg :

        interface Something1 {}

        interface Something2 {}

        interface Something extends Something1, Something2 {}

        class TestBean implements Something {}

        public class TestPage extends WebPage {
        @SpringBrean
        private Something something;
        }

        Trying to inject a bean implementing the Something interface does not seems to fail at first, but when calling any method an IllegalAccessException is thrown, similar to this :
        java.lang.IllegalAccessException: Class org.apache.wicket.proxy.LazyInitProxyFactory$JdkHandler can not access a member of class {replaced} with modifiers "public abstract"

        I've attached different test cases reproducing the problem.

        As a side note, referencing directly the implementing class like this seems to work :

        public class TestPage extends WebPage {
        @SpringBrean
        private TestBean something;
        }

        But it kind of defeats the purpose of DI.
        Antoine Dupuis made changes -
        Field Original Value New Value
        Attachment springbean-tests.tgz [ 12570475 ]
        Antoine Dupuis created issue -

          People

          • Assignee:
            Martin Grigorov
            Reporter:
            Antoine Dupuis
          • Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development