Hi, After you suggested showing what was in the Home class, I decided to strip all the code out of there and see if it worked. It did, so I then added code back in bit by bit until I got it working. Thanks Andrew
igor.vaynberg wrote: > > can we see fragment of this code: > > at uk.co.rageconsulting.thepencilroom.web.page.Home.<init>(Home.java:47) > > -igor > > On 4/10/07, Andrew Moore <[EMAIL PROTECTED]> wrote: >> >> >> Hi, >> Yes, sign in session is just a copy from the example project extending >> WebSession. >> Cheers >> Andrew >> >> >> >> Andrew Moore wrote: >> > >> > I've been using wicket 1.2.5 for a while with a sign in page based upon >> > the wicket-examples signin (with cookies) example. >> > >> > I've now moved to 1.3 as I didn't want to cache some markup pages. >> > >> > I'm using the latest wicket file from here >> > >> http://wicketstuff.org/maven/repository/org/apache/wicket/wicket/1.3.0-incubating-SNAPSHOT/ >> > (dates 10th April) >> > >> > and i've changed most classes without problem to work with 1.3. The >> > problem I'm having is with the SignInSession and getting a >> > ClassCastException when trying to get the SignInSession in the init >> > method: >> > >> > code from the init method below >> > getSecuritySettings().setAuthorizationStrategy(new >> > IAuthorizationStrategy() >> > { >> > public boolean isActionAuthorized(Component >> component, Action action) >> > { >> > return true; >> > } >> > >> > public boolean isInstantiationAuthorized(Class >> componentClass) >> > { >> > if ( >> AuthenticatedWebPage.class.isAssignableFrom(componentClass)) >> > { >> > // Is user signed in? >> > if >> (((SignInSession)Session.get()).isSignedIn()) >> > { >> > // okay to proceed >> > return true; >> > } >> > // Force sign in >> > throw new >> RestartResponseAtInterceptPageException(SignIn.class); >> > } >> > return true; >> > } >> > }); >> > >> > The line above is highlighted that causes the error. >> > >> > I've implemented, taking in the new parameter >> > public Session newSession(Request request, Response response) >> > { >> > return new SignInSession(ThePencilRoomApplication.this, >> request); >> > } >> > >> > >> > Sign in session is just a copy from the example project extending >> > WebSession. >> > >> > But I always seem to get the error below: >> > WicketMessage: Can't instantiate page using constructor public >> > uk.co.rageconsulting.thepencilroom.web.page.Home(wicket.PageParameters) >> > and argument >> > >> > Root cause: >> > >> > java.lang.ClassCastException: wicket.protocol.http.WebSession >> > at >> uk.co.rageconsulting.thepencilroom.web.page.Home.<init>(Home.java:47) >> > at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native >> Method) >> > at java.lang.reflect.Constructor.newInstance(Constructor.java:494) >> > at wicket.session.DefaultPageFactory.newPage(DefaultPageFactory.java >> :153) >> > at >> wicket.session.DefaultPageFactory.newPage(DefaultPageFactory.java:65) >> > at >> > wicket.request.target.component.BookmarkablePageRequestTarget.newPage( >> BookmarkablePageRequestTarget.java:256) >> > at >> > wicket.request.target.component.BookmarkablePageRequestTarget.getPage( >> BookmarkablePageRequestTarget.java:275) >> > at >> > >> wicket.request.target.component.BookmarkablePageRequestTarget.processEvents >> (BookmarkablePageRequestTarget.java:204) >> > at >> > wicket.request.AbstractRequestCycleProcessor.processEvents( >> AbstractRequestCycleProcessor.java:89) >> > at wicket.RequestCycle.processEventsAndRespond(RequestCycle.java:962) >> > at wicket.RequestCycle.step(RequestCycle.java:1035) >> > at wicket.RequestCycle.steps(RequestCycle.java:1114) >> > at wicket.RequestCycle.request(RequestCycle.java:474) >> > at wicket.protocol.http.WicketFilter.doGet(WicketFilter.java:248) >> > at wicket.protocol.http.WicketServlet.doGet(WicketServlet.java:126) >> > at javax.servlet.http.HttpServlet.service(HttpServlet.java:689) >> > at javax.servlet.http.HttpServlet.service(HttpServlet.java:802) >> > at >> > org.apache.catalina.core.ApplicationFilterChain.internalDoFilter( >> ApplicationFilterChain.java:252) >> > at >> > org.apache.catalina.core.ApplicationFilterChain.doFilter( >> ApplicationFilterChain.java:173) >> > at >> > >> org.springframework.orm.hibernate3.support.OpenSessionInViewFilter.doFilterInternal >> (OpenSessionInViewFilter.java:174) >> > at >> > org.springframework.web.filter.OncePerRequestFilter.doFilter( >> OncePerRequestFilter.java:76) >> > at >> > org.apache.catalina.core.ApplicationFilterChain.internalDoFilter( >> ApplicationFilterChain.java:202) >> > at >> > org.apache.catalina.core.ApplicationFilterChain.doFilter( >> ApplicationFilterChain.java:173) >> > at >> > org.apache.catalina.core.StandardWrapperValve.invoke( >> StandardWrapperValve.java:213) >> > at >> > org.apache.catalina.core.StandardContextValve.invoke( >> StandardContextValve.java:178) >> > at >> > >> org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java >> :126) >> > at >> > >> org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java >> :105) >> > at >> > org.apache.catalina.core.StandardEngineValve.invoke( >> StandardEngineValve.java:107) >> > at >> > org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java >> :148) >> > at >> > org.apache.coyote.http11.Http11Processor.process(Http11Processor.java >> :869) >> > at >> > >> org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection >> (Http11BaseProtocol.java:664) >> > at >> > org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket( >> PoolTcpEndpoint.java:527) >> > at >> > org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt( >> LeaderFollowerWorkerThread.java:80) >> > at >> > org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run( >> ThreadPool.java:684) >> > at java.lang.Thread.run(Thread.java:595) >> > >> > Complete stack: >> > >> > wicket.WicketRuntimeException: Can't instantiate page using constructor >> > public >> > uk.co.rageconsulting.thepencilroom.web.page.Home(wicket.PageParameters) >> > and argument >> > at wicket.session.DefaultPageFactory.newPage(DefaultPageFactory.java >> :174) >> > at >> wicket.session.DefaultPageFactory.newPage(DefaultPageFactory.java:65) >> > at >> > wicket.request.target.component.BookmarkablePageRequestTarget.newPage( >> BookmarkablePageRequestTarget.java:256) >> > at >> > wicket.request.target.component.BookmarkablePageRequestTarget.getPage( >> BookmarkablePageRequestTarget.java:275) >> > at >> > >> wicket.request.target.component.BookmarkablePageRequestTarget.processEvents >> (BookmarkablePageRequestTarget.java:204) >> > at >> > wicket.request.AbstractRequestCycleProcessor.processEvents( >> AbstractRequestCycleProcessor.java:89) >> > at wicket.RequestCycle.processEventsAndRespond(RequestCycle.java:962) >> > at wicket.RequestCycle.step(RequestCycle.java:1035) >> > at wicket.RequestCycle.steps(RequestCycle.java:1114) >> > at wicket.RequestCycle.request(RequestCycle.java:474) >> > at wicket.protocol.http.WicketFilter.doGet(WicketFilter.java:248) >> > at wicket.protocol.http.WicketServlet.doGet(WicketServlet.java:126) >> > >> > >> > java.lang.reflect.InvocationTargetException >> > at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native >> Method) >> > at >> > sun.reflect.NativeConstructorAccessorImpl.newInstance( >> NativeConstructorAccessorImpl.java:39) >> > at java.lang.reflect.Constructor.newInstance(Constructor.java:494) >> > at wicket.session.DefaultPageFactory.newPage(DefaultPageFactory.java >> :153) >> > at >> wicket.session.DefaultPageFactory.newPage(DefaultPageFactory.java:65) >> > at >> > wicket.request.target.component.BookmarkablePageRequestTarget.newPage( >> BookmarkablePageRequestTarget.java:256) >> > at >> > wicket.request.target.component.BookmarkablePageRequestTarget.getPage( >> BookmarkablePageRequestTarget.java:275) >> > at >> > >> wicket.request.target.component.BookmarkablePageRequestTarget.processEvents >> (BookmarkablePageRequestTarget.java:204) >> > at >> > wicket.request.AbstractRequestCycleProcessor.processEvents( >> AbstractRequestCycleProcessor.java:89) >> > at wicket.RequestCycle.processEventsAndRespond(RequestCycle.java:962) >> > at wicket.RequestCycle.step(RequestCycle.java:1035) >> > at wicket.RequestCycle.steps(RequestCycle.java:1114) >> > at wicket.RequestCycle.request(RequestCycle.java:474) >> > at wicket.protocol.http.WicketFilter.doGet(WicketFilter.java:248) >> > at wicket.protocol.http.WicketServlet.doGet(WicketServlet.java:126) >> > >> > >> > ..and I'm out of ideas as to what might be causing it. >> > Anybody any ideas? >> > Cheers >> > Andrew >> > >> > >> >> -- >> View this message in context: >> http://www.nabble.com/ClassCastException-when-using-SignInSession-tf3553677.html#a9922424 >> Sent from the Wicket - User mailing list archive at Nabble.com. >> >> >> ------------------------------------------------------------------------- >> Take Surveys. Earn Cash. Influence the Future of IT >> Join SourceForge.net's Techsay panel and you'll get the chance to share >> your >> opinions on IT & business topics through brief surveys-and earn cash >> http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV >> _______________________________________________ >> Wicket-user mailing list >> [EMAIL PROTECTED] >> https://lists.sourceforge.net/lists/listinfo/wicket-user >> > > ------------------------------------------------------------------------- > Take Surveys. Earn Cash. Influence the Future of IT > Join SourceForge.net's Techsay panel and you'll get the chance to share > your > opinions on IT & business topics through brief surveys-and earn cash > http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV > _______________________________________________ > Wicket-user mailing list > [EMAIL PROTECTED] > https://lists.sourceforge.net/lists/listinfo/wicket-user > > -- View this message in context: http://www.nabble.com/ClassCastException-when-using-SignInSession-tf3553677.html#a9954029 Sent from the Wicket - User mailing list archive at Nabble.com. ------------------------------------------------------------------------- Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys-and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV _______________________________________________ Wicket-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/wicket-user
