Wicket
  1. Wicket
  2. WICKET-4872

IllegalArgumentException on ReloadingWicketFilter and inheritance markup

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.5.9, 6.3.0
    • Fix Version/s: 6.4.0, 1.5.10
    • Component/s: wicket
    • Labels:
      None

      Description

      simple inheritance markup and ReloadingWicketFilter set like below, throw from org.apache.wicket.markup.MarkupFactory#getContainerClass(MarkupContainer, Class<?>)

      ReloadingClassLoader.includePattern("wicket.inheritance.sample.*");

      Is this way wrong ?

      caused stacktrace is
      Caused by: java.lang.IllegalArgumentException: Parameter clazz must be an instance of wicket.inheritance.sample.ChildPage1, but is a wicket.inheritance.sample.HomePage
      at org.apache.wicket.markup.MarkupFactory.getContainerClass(MarkupFactory.java:378)
      at org.apache.wicket.markup.MarkupFactory.getMarkup(MarkupFactory.java:228)
      at org.apache.wicket.markup.loader.InheritedMarkupMarkupLoader.getBaseMarkup(InheritedMarkupMarkupLoader.java:96)
      at org.apache.wicket.markup.loader.InheritedMarkupMarkupLoader.loadMarkup(InheritedMarkupMarkupLoader.java:66)
      at org.apache.wicket.markup.loader.DefaultMarkupLoader.loadMarkup(DefaultMarkupLoader.java:51)
      at org.apache.wicket.markup.MarkupFactory.loadMarkup(MarkupFactory.java:430)

        Activity

        jun ozeki created issue -
        Hide
        jun ozeki added a comment -

        modify simple project from maven quick start.

        Show
        jun ozeki added a comment - modify simple project from maven quick start.
        jun ozeki made changes -
        Field Original Value New Value
        Attachment eclipse-project.zip [ 12554456 ]
        Hide
        Sven Meier added a comment -

        Problem is that in WicketFilter#init() the application is created before the contextClassLoader is set, thus HomePage.class isn't loaded via the custom classLoader.
        Later MarkupResourceStream#getMarkupClass() resolves classes via WicketObjects, which uses the custom classLoader via contextClassLoader set in WicketFilter#processRequest().

        Show
        Sven Meier added a comment - Problem is that in WicketFilter#init() the application is created before the contextClassLoader is set, thus HomePage.class isn't loaded via the custom classLoader. Later MarkupResourceStream#getMarkupClass() resolves classes via WicketObjects, which uses the custom classLoader via contextClassLoader set in WicketFilter#processRequest().
        Hide
        Sven Meier added a comment -

        After fixing the thread's contextClassLoader I stumbled into further problems, e.g. the application's name can't be set again.
        It seems we have to properly destroy the old application to make sure everything is reloaded.

        Which version of Wicket did this work for you?

        Show
        Sven Meier added a comment - After fixing the thread's contextClassLoader I stumbled into further problems, e.g. the application's name can't be set again. It seems we have to properly destroy the old application to make sure everything is reloaded. Which version of Wicket did this work for you?
        Hide
        Sven Meier added a comment -

        The contextClassLoader is now set before creating application and the application is properly destroyed before initializing the new on

        Show
        Sven Meier added a comment - The contextClassLoader is now set before creating application and the application is properly destroyed before initializing the new on
        Sven Meier made changes -
        Status Open [ 1 ] Resolved [ 5 ]
        Assignee Sven Meier [ svenmeier ]
        Fix Version/s 6.4.0 [ 12323450 ]
        Fix Version/s 1.5.10 [ 12323510 ]
        Resolution Fixed [ 1 ]
        Hide
        jun ozeki added a comment -

        thanks svenmeier.
        i confirmed branch on master and 1.5.x. it cleared this problem completely !

        i looking for next release.

        Show
        jun ozeki added a comment - thanks svenmeier. i confirmed branch on master and 1.5.x. it cleared this problem completely ! i looking for next release.
        jun ozeki made changes -
        Status Resolved [ 5 ] Closed [ 6 ]
        Transition Time In Source Status Execution Times Last Executer Last Execution Date
        Open Open Resolved Resolved
        16h 30m 1 Sven Meier 21/Nov/12 22:48
        Resolved Resolved Closed Closed
        10h 17m 1 jun ozeki 22/Nov/12 09:06

          People

          • Assignee:
            Sven Meier
            Reporter:
            jun ozeki
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development