Hi,
I have been following
http://cwiki.apache.org/WICKET/facebook-integration.html and version tomcat
5.5.25. and ran NullPointerException.

TH Lim wrote:
> 
> Hi,
> I have been following the tip in the Wiki,
> http://cwiki.apache.org/WICKET/facebook-integration.html and ran into
> NullPointerException. The Login class is  exactly the class mentioned in
> the Wiki.
> 
> SEVERE: Can't instantiate page using constructor public reno.Login()
> org.apache.wicket.WicketRuntimeException: Can't instantiate page using
> constructor public reno.Login()
>       at
> org.apache.wicket.session.DefaultPageFactory.newPage(DefaultPageFactory.java:168)
>       at
> org.apache.wicket.session.DefaultPageFactory.newPage(DefaultPageFactory.java:58)
>       at
> org.apache.wicket.session.DefaultPageFactory.newPage(DefaultPageFactory.java:92)
>       at
> org.apache.wicket.request.target.component.BookmarkablePageRequestTarget.newPage(BookmarkablePageRequestTarget.java:268)
>       at
> org.apache.wicket.request.target.component.BookmarkablePageRequestTarget.getPage(BookmarkablePageRequestTarget.java:283)
>       at
> org.apache.wicket.request.target.component.BookmarkablePageRequestTarget.processEvents(BookmarkablePageRequestTarget.java:210)
>       at
> org.apache.wicket.request.AbstractRequestCycleProcessor.processEvents(AbstractRequestCycleProcessor.java:91)
>       at
> org.apache.wicket.RequestCycle.processEventsAndRespond(RequestCycle.java:1166)
>       at org.apache.wicket.RequestCycle.step(RequestCycle.java:1243)
>       at org.apache.wicket.RequestCycle.steps(RequestCycle.java:1331)
>       at org.apache.wicket.RequestCycle.request(RequestCycle.java:493)
>       at
> org.apache.wicket.protocol.http.WicketFilter.doGet(WicketFilter.java:363)
>       at
> org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java:194)
>       at
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215)
>       at
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
>       at
> org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
>       at
> org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:174)
>       at
> org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
>       at
> org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)
>       at
> org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:108)
>       at
> org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:151)
>       at
> org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:874)
>       at
> org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:665)
>       at
> org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:528)
>       at
> org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:81)
>       at
> org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:689)
>       at java.lang.Thread.run(Unknown Source)
> 
> java.lang.NullPointerException
>     at org.thlim.sample.wicket.Login.<init>(Login.java:23)
>     at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native
> Method)
>     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)
>     ......
> 
> I traced the code and found that the application didn't redirect as
> stipulated here,
> 
>    private void forceLogin(Page page)
>    {
>        page.getRequestCycle().setRequestTarget(new
> RedirectRequestTarget("http://www.facebook.com/login.php?api_key="; +
> _apiKey + "&v=1.0"));
>    }
> 
> I presume the line of code will redirect the browser to
> "http://www.facebook.com/login.php?api_key=xxxx&v=1.0"; when I logon to the
> URL http://apps.facebook.com/xxx/. It didn't and it went straight to the
> Login and caused the NPE. I realized that ExceptionErrorPage page was
> created after it failed to be redirected to
> "http://www.facebook.com/login.php?api_key=xxxx&v=1.0"; the 1st time.
> 
> If I logon manually e.g. point my browser to
> http://www.facebook.com/login.php?api_key=xxxx&v=1.0, my Facebook app will
> work fine. What did I do wrong?
> 
> Thanks
> 
> /lim/
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Facebook-Wicket-Integration-tp16558748p17096971.html
Sent from the Wicket - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to