You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by "Mathieu Sacrispeyre (JIRA)" <ji...@apache.org> on 2007/04/10 10:12:32 UTC

[jira] Created: (WICKET-457) wicket-quickstart issue with wicket-spring : classCastException

wicket-quickstart issue with wicket-spring : classCastException
---------------------------------------------------------------

                 Key: WICKET-457
                 URL: https://issues.apache.org/jira/browse/WICKET-457
             Project: Wicket
          Issue Type: Bug
          Components: wicket-quickstart, wicket-spring
    Affects Versions: 1.2.5
            Reporter: Mathieu Sacrispeyre


There is a classloader issue when using wicket-spring with wicket-quickstart : a classCastException is raised when trying to do something like (MyWebApplication) getApplication() in a page.

In fact Jetty uses its own classloader and not the system one. The problem can be solved configuring Jetty to use the good classloader : the one used by the rest of the application (Spring...).

With Jetty 6 (wicket-quickstart currently uses Jetty 4.2) it can be done like this :

WebAppContext web = new WebAppContext();
web.setClassLoader(Start.class.getClassLoader());
...
server.addHandler(web);

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (WICKET-457) wicket-quickstart issue with wicket-spring : classCastException

Posted by "Jean-Baptiste Quenot (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/WICKET-457?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jean-Baptiste Quenot updated WICKET-457:
----------------------------------------

    Attachment: quickstart13.zip

Mavenified project with Wicket 1.3: issue *cannot* be reproduced

> wicket-quickstart issue with wicket-spring : classCastException
> ---------------------------------------------------------------
>
>                 Key: WICKET-457
>                 URL: https://issues.apache.org/jira/browse/WICKET-457
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket-quickstart, wicket-spring
>    Affects Versions: 1.2.5
>            Reporter: Mathieu Sacrispeyre
>         Assigned To: Jean-Baptiste Quenot
>         Attachments: IssueQuickstartSpring.zip, quickstart125.zip, quickstart13.zip
>
>
> There is a classloader issue when using wicket-spring with wicket-quickstart : a classCastException is raised when trying to do something like (MyWebApplication) getApplication() in a page.
> In fact Jetty uses its own classloader and not the system one. The problem can be solved configuring Jetty to use the good classloader : the one used by the rest of the application (Spring...).
> With Jetty 6 (wicket-quickstart currently uses Jetty 4.2) it can be done like this :
> WebAppContext web = new WebAppContext();
> web.setClassLoader(Start.class.getClassLoader());
> ...
> server.addHandler(web);

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (WICKET-457) wicket-quickstart issue with wicket-spring : classCastException

Posted by "Jean-Baptiste Quenot (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/WICKET-457?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jean-Baptiste Quenot updated WICKET-457:
----------------------------------------

    Attachment: quickstart125.zip

Mavenified project with Wicket 1.2.5: issue reproduced

> wicket-quickstart issue with wicket-spring : classCastException
> ---------------------------------------------------------------
>
>                 Key: WICKET-457
>                 URL: https://issues.apache.org/jira/browse/WICKET-457
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket-quickstart, wicket-spring
>    Affects Versions: 1.2.5
>            Reporter: Mathieu Sacrispeyre
>         Assigned To: Jean-Baptiste Quenot
>         Attachments: IssueQuickstartSpring.zip, quickstart125.zip
>
>
> There is a classloader issue when using wicket-spring with wicket-quickstart : a classCastException is raised when trying to do something like (MyWebApplication) getApplication() in a page.
> In fact Jetty uses its own classloader and not the system one. The problem can be solved configuring Jetty to use the good classloader : the one used by the rest of the application (Spring...).
> With Jetty 6 (wicket-quickstart currently uses Jetty 4.2) it can be done like this :
> WebAppContext web = new WebAppContext();
> web.setClassLoader(Start.class.getClassLoader());
> ...
> server.addHandler(web);

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (WICKET-457) wicket-quickstart issue with wicket-spring : classCastException

Posted by "Jean-Baptiste Quenot (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WICKET-457?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12487727 ] 

Jean-Baptiste Quenot commented on WICKET-457:
---------------------------------------------

Do you have a small demo application that would allow me to reproduce this problem?  Do you launch Jetty in Eclipse using src/main/java/wicket/quickstart/Start.java?

> wicket-quickstart issue with wicket-spring : classCastException
> ---------------------------------------------------------------
>
>                 Key: WICKET-457
>                 URL: https://issues.apache.org/jira/browse/WICKET-457
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket-quickstart, wicket-spring
>    Affects Versions: 1.2.5
>            Reporter: Mathieu Sacrispeyre
>         Assigned To: Jean-Baptiste Quenot
>
> There is a classloader issue when using wicket-spring with wicket-quickstart : a classCastException is raised when trying to do something like (MyWebApplication) getApplication() in a page.
> In fact Jetty uses its own classloader and not the system one. The problem can be solved configuring Jetty to use the good classloader : the one used by the rest of the application (Spring...).
> With Jetty 6 (wicket-quickstart currently uses Jetty 4.2) it can be done like this :
> WebAppContext web = new WebAppContext();
> web.setClassLoader(Start.class.getClassLoader());
> ...
> server.addHandler(web);

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (WICKET-457) wicket-quickstart issue with wicket-spring : classCastException

Posted by "Jean-Baptiste Quenot (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WICKET-457?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12488101 ] 

Jean-Baptiste Quenot commented on WICKET-457:
---------------------------------------------

NOTE: the issue with wicket 1.2.5 *only* happens when setting output folder to src/main/webapp/WEB-INF/classes, it does not happen when using target/classes.

> wicket-quickstart issue with wicket-spring : classCastException
> ---------------------------------------------------------------
>
>                 Key: WICKET-457
>                 URL: https://issues.apache.org/jira/browse/WICKET-457
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket-quickstart, wicket-spring
>    Affects Versions: 1.2.5
>            Reporter: Mathieu Sacrispeyre
>         Assigned To: Jean-Baptiste Quenot
>         Attachments: IssueQuickstartSpring.zip, quickstart125.zip, quickstart13.zip
>
>
> There is a classloader issue when using wicket-spring with wicket-quickstart : a classCastException is raised when trying to do something like (MyWebApplication) getApplication() in a page.
> In fact Jetty uses its own classloader and not the system one. The problem can be solved configuring Jetty to use the good classloader : the one used by the rest of the application (Spring...).
> With Jetty 6 (wicket-quickstart currently uses Jetty 4.2) it can be done like this :
> WebAppContext web = new WebAppContext();
> web.setClassLoader(Start.class.getClassLoader());
> ...
> server.addHandler(web);

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Assigned: (WICKET-457) wicket-quickstart issue with wicket-spring : classCastException

Posted by "Jean-Baptiste Quenot (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/WICKET-457?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jean-Baptiste Quenot reassigned WICKET-457:
-------------------------------------------

    Assignee: Jean-Baptiste Quenot

> wicket-quickstart issue with wicket-spring : classCastException
> ---------------------------------------------------------------
>
>                 Key: WICKET-457
>                 URL: https://issues.apache.org/jira/browse/WICKET-457
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket-quickstart, wicket-spring
>    Affects Versions: 1.2.5
>            Reporter: Mathieu Sacrispeyre
>         Assigned To: Jean-Baptiste Quenot
>
> There is a classloader issue when using wicket-spring with wicket-quickstart : a classCastException is raised when trying to do something like (MyWebApplication) getApplication() in a page.
> In fact Jetty uses its own classloader and not the system one. The problem can be solved configuring Jetty to use the good classloader : the one used by the rest of the application (Spring...).
> With Jetty 6 (wicket-quickstart currently uses Jetty 4.2) it can be done like this :
> WebAppContext web = new WebAppContext();
> web.setClassLoader(Start.class.getClassLoader());
> ...
> server.addHandler(web);

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Resolved: (WICKET-457) wicket-quickstart issue with wicket-spring : classCastException

Posted by "Jean-Baptiste Quenot (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/WICKET-457?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jean-Baptiste Quenot resolved WICKET-457.
-----------------------------------------

    Resolution: Won't Fix

I could reproduce the problem with the attached quickstart125.zip so there may be an issue with Wicket-Spring in version 1.2.5.  But I cannot reproduce with Wicket 1.3.0, so I will mark this issue as WONTFIX because the 1.2.x versions are in maintenance mode and are not likely to receive non-critical bugfixes.  If you have a workaround for this, use it until you update to Wicket 1.3, soon to be released.

Thanks for your contribution!

> wicket-quickstart issue with wicket-spring : classCastException
> ---------------------------------------------------------------
>
>                 Key: WICKET-457
>                 URL: https://issues.apache.org/jira/browse/WICKET-457
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket-quickstart, wicket-spring
>    Affects Versions: 1.2.5
>            Reporter: Mathieu Sacrispeyre
>         Assigned To: Jean-Baptiste Quenot
>         Attachments: IssueQuickstartSpring.zip, quickstart125.zip, quickstart13.zip
>
>
> There is a classloader issue when using wicket-spring with wicket-quickstart : a classCastException is raised when trying to do something like (MyWebApplication) getApplication() in a page.
> In fact Jetty uses its own classloader and not the system one. The problem can be solved configuring Jetty to use the good classloader : the one used by the rest of the application (Spring...).
> With Jetty 6 (wicket-quickstart currently uses Jetty 4.2) it can be done like this :
> WebAppContext web = new WebAppContext();
> web.setClassLoader(Start.class.getClassLoader());
> ...
> server.addHandler(web);

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.