Hi

I have been troubled with a problem that is very strange. Finally I solved
it, but I am unsure whether I am doing something wrong.

I have a custom session implementation MySesission extends WebSession.

On my first page I have a popuplink opening a normal popup-page. In that
popuppage I classcast the (MySession)getSession(), but here the fun begins.

If I open the popup like this

public void onClick() {
"getRequestCycle().setResponsePage(new ChooseProductPage());"     // it
works like a charm
}

but if I  do it like this
public void onClick() {
getRequestCycle().setResponsePage(ChooseProductPage.class);
}

I get a classcastexception in the line with the (MySession)getSession()

Is this something I should make a jira of or am I missing something :-)

As far as I can tell from the stack trace it seems to me that there might be
a classloading problem.
Btw I am running wicket 1.2.6, java 1.5  and OSX

/Flemming

=======================
java.lang.ClassCastException: com.na.client.web.MySession
   at com.na.client.web.fs.ChooseProductPage.init(ChooseProductPage.java
:44)
   at com.na.client.web.fs.ChooseProductPage.<init>(ChooseProductPage.java
:29)
   at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
   at sun.reflect.NativeConstructorAccessorImpl.newInstance(
NativeConstructorAccessorImpl.java:39)
   at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(
DelegatingConstructorAccessorImpl.java:27)
   at java.lang.reflect.Constructor.newInstance(Constructor.java:494)
   at java.lang.Class.newInstance0(Class.java:350)
   at java.lang.Class.newInstance(Class.java:303)
   at wicket.session.DefaultPageFactory.newPage(DefaultPageFactory.java:58)
   at wicket.request.target.component.BookmarkablePageRequestTarget.newPage
(BookmarkablePageRequestTarget.java:267)
   at wicket.request.target.component.BookmarkablePageRequestTarget.getPage
(BookmarkablePageRequestTarget.java:286)
   at
wicket.request.target.component.BookmarkablePageRequestTarget.processEvents(
BookmarkablePageRequestTarget.java:205)
   at wicket.request.compound.DefaultEventProcessorStrategy.processEvents(
DefaultEventProcessorStrategy.java:65)
   at
wicket.request.compound.AbstractCompoundRequestCycleProcessor.processEvents(
AbstractCompoundRequestCycleProcessor.java:57)
   at wicket.RequestCycle.doProcessEventsAndRespond(RequestCycle.java:896)
   at wicket.RequestCycle.processEventsAndRespond(RequestCycle.java:929)
   at wicket.RequestCycle.step(RequestCycle.java:1010)
   at wicket.RequestCycle.steps(RequestCycle.java:1084)
   at wicket.RequestCycle.request(RequestCycle.java:454)
   at wicket.protocol.http.WicketServlet.doGet(WicketServlet.java:219)

=======================
-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user

Reply via email to