Closed GoogleCodeExporter closed 8 years ago
Can you please show me your spring configuration file.
It is mandatory to use "socialauth" as a contoller mapping to work with
socialauth-spring as given below:-
<a href="socialauth.do?id=facebook"><img src="images/facebook_icon.png"
alt="Facebook" title="Facebook" border="0"></img></a>
But it seems you have changed it to "app"
Regards
Tarun
Original comment by tar...@brickred.com
on 9 Jul 2012 at 7:21
I have created app-social-context.xml and properties.xml file. Imported
properties.xml in app-social.xml and imported app-social.xml to
root-context.xml.
I have called root-context.xml file in web.xml
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>classpath:/META-INF/spring/root-context.xml</param-value>
</context-param>
I was unable to add
<servlet-mapping>
<servlet-name>socialauthdemo</servlet-name>
<url-pattern>*.do</url-pattern>
</servlet-mapping> in web.xml
I have added rule in urlrewrite.xml as i have it in my project
<rule>
<from>/socialauthdemo/socialAuthSuccessAction.do</from>
<to type="redirect">/$1</to>
</rule>
Still i am getting same error
Original comment by rose12...@gmail.com
on 9 Jul 2012 at 8:09
Attachments:
sociaAuthSuccessAction.do is not a valid path, so rule will not work.
Please check this path..
http://socialauth.in/socialauthdemo//app
why //app is appending. It should be
http://socialauth.in/socialauthdemo/socialauth
And Why you are using socialauth.in domain. It will not work too because you
should have application key.secret for this.
Use opensource.brickred.com instead of this because keys on a wiki are
registered for this domain.
You can run our Sample demo which is in SDK and then match your demo with this.
Regards
Tarun
Original comment by tar...@brickred.com
on 10 Jul 2012 at 8:29
Still i am getting the same error.
Please find the attached app-social-context.xml which is mapping to app
I have attached error log.
/app is appending from my app. If you copy the google link available in error
log and paste it on browser. It rediects the url to some google link where app
authentication is required.
But why is the lin not rediting to broswer from socialauth side. I smy
question. I understood that /app is been appending and i am rediecting it in
apache so no issue. But still i am getting error. Please help me.
Original comment by rose12...@gmail.com
on 11 Jul 2012 at 12:05
Attachments:
Hi Tarun,
I am getting nullpointer exception manager.getCurrentAuthProvider();
I am using socialauth-2.3.jar and socialauth-spring-2.0-beta2.jar
SEVERE: Servlet.service() for servlet appServlet threw exception
java.lang.NullPointerException
at com.nii.web.app.controller.SuccessController.setUpForm(SuccessController.java:79)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:616)
at org.springframework.web.method.support.InvocableHandlerMethod.invoke(InvocableHandlerMethod.java:213)
at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:126)
at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:96)
Original comment by rose12...@gmail.com
on 16 Jul 2012 at 7:21
Seems following line returns null manager in your code or you are not getting
manager like this.
SocialAuthManager manager = socialAuthTemplate.getSocialAuthManager();
If you are getting manager as above then socialAuthTemplate is not in a session
scope.
Can you please provide me your complete application in zip without lib folder
and apache mapping file if redirect issue is not resolved.
Regards
Tarun
Original comment by tar...@brickred.com
on 16 Jul 2012 at 3:41
Please re-open this, If you are still facing this issue or let me know if you
have made some changes to make it work which we should incorporated in our
application.
Regards
Tarun
Original comment by tar...@brickred.com
on 16 Aug 2012 at 4:42
Hi Tarun,
I am getting nullpointer exception manager.getCurrentAuthProvider();
please Reply me--
org.springframework.web.util.NestedServletException: Request processing failed;
nested exception is java.lang.NullPointerException
org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:656)
org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:549)
javax.servlet.http.HttpServlet.service(HttpServlet.java:621)
javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
org.displaytag.filter.ResponseOverrideFilter.doFilter(ResponseOverrideFilter.java:125)
net.bull.javamelody.MonitoringFilter.doFilter(MonitoringFilter.java:206)
net.bull.javamelody.MonitoringFilter.doFilter(MonitoringFilter.java:179)
root cause
java.lang.NullPointerException
com.c2b.controller.SocialController.getRedirectURL(SocialController.java:35)
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
java.lang.reflect.Method.invoke(Method.java:597)
org.springframework.web.bind.annotation.support.HandlerMethodInvoker.invokeHandlerMethod(HandlerMethodInvoker.java:176)
org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter.invokeHandlerMethod(AnnotationMethodHandlerAdapter.java:426)
org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter.handle(AnnotationMethodHandlerAdapter.java:414)
org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:790)
org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:719)
org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:644)
org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:549)
javax.servlet.http.HttpServlet.service(HttpServlet.java:621)
javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
org.displaytag.filter.ResponseOverrideFilter.doFilter(ResponseOverrideFilter.java:125)
net.bull.javamelody.MonitoringFilter.doFilter(MonitoringFilter.java:206)
net.bull.javamelody.MonitoringFilter.doFilter(MonitoringFilter.java:179)
Original comment by rsreddy....@gmail.com
on 31 Jul 2013 at 6:58
How you are creating manager object in your controller.
From the given exception, it seems manager object is null. So please verify
your code to make sure it is not null.
Original comment by tarun.na...@3pillarglobal.com
on 2 Aug 2013 at 10:21
Hello, I have same problem. I have socialauthdemo from examples
(socialauth-java-sdk-4.7), and when I try to register using Google+ or Facebook
I got this error:
HTTP Status 500 - Request processing failed; nested exception is
java.lang.NullPointerException
type Exception report
message Request processing failed; nested exception is
java.lang.NullPointerException
description The server encountered an internal error that prevented it from
fulfilling this request.
exception
org.springframework.web.util.NestedServletException: Request processing failed;
nested exception is java.lang.NullPointerException
org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:894)
org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:778)
javax.servlet.http.HttpServlet.service(HttpServlet.java:618)
javax.servlet.http.HttpServlet.service(HttpServlet.java:725)
org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:393)
com.opensymphony.sitemesh.webapp.SiteMeshFilter.obtainContent(SiteMeshFilter.java:129)
com.opensymphony.sitemesh.webapp.SiteMeshFilter.doFilter(SiteMeshFilter.java:77)
root cause
java.lang.NullPointerException
com.threepillar.labs.socialauthsample.controller.SuccessController.getRedirectURL(SuccessController.java:57)
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
java.lang.reflect.Method.invoke(Method.java:606)
org.springframework.web.method.support.InvocableHandlerMethod.invoke(InvocableHandlerMethod.java:213)
org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:126)
org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:96)
org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:617)
org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:578)
org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:80)
org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:923)
org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:852)
org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:882)
org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:778)
javax.servlet.http.HttpServlet.service(HttpServlet.java:618)
javax.servlet.http.HttpServlet.service(HttpServlet.java:725)
org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:393)
com.opensymphony.sitemesh.webapp.SiteMeshFilter.obtainContent(SiteMeshFilter.java:129)
com.opensymphony.sitemesh.webapp.SiteMeshFilter.doFilter(SiteMeshFilter.java:77)
note The full stack trace of the root cause is available in the Apache
Tomcat/8.0.9 logs.
Apache Tomcat/8.0.9
When I try to debug, I noticed socialAuthTemplate.getSocialAuthManager()
returns null.
//SuccessController.java
@RequestMapping(value = "/authSuccess")
public ModelAndView getRedirectURL(final HttpServletRequest request)
throws Exception {
SocialAuthManager manager = socialAuthTemplate.getSocialAuthManager(); // NULL
!!
Why is that so? How can I fix it? Shouldnt the SocialAuthManager be saved
automatically in this demo?
Original comment by JJtu...@gmail.com
on 7 Dec 2014 at 9:20
I just want to add Tomcat log
48130303 22:32:34,376 INFO
com.threepillar.labs.socialauthsample.controller.HomeController - Showing
registration page
MonitorFilter::WARNING: the monitor filter must be the first filter in the
chain.
48144100 22:32:48,173 DEBUG
org.brickred.socialauth.spring.controller.SocialAuthWebController - Getting
Authentication URL for :facebook
48144100 22:32:48,173 DEBUG org.brickred.socialauth.SocialAuthManager - Getting
Authentication URL for provider facebook, with success url :
http://devpc.com:8024/socialauthdemo/socialauth.do
48144100 22:32:48,173 INFO org.brickred.socialauth.provider.FacebookImpl -
Loading plugins
48144100 22:32:48,173 INFO org.brickred.socialauth.provider.FacebookImpl -
Loading plugin :: org.brickred.socialauth.plugin.facebook.AlbumsPluginImpl
48144100 22:32:48,173 INFO org.brickred.socialauth.provider.FacebookImpl -
Loading plugin :: org.brickred.socialauth.plugin.facebook.FeedPluginImpl
48144100 22:32:48,173 INFO org.brickred.socialauth.oauthstrategy.OAuth2 -
Determining URL for redirection
48144100 22:32:48,173 INFO org.brickred.socialauth.oauthstrategy.OAuth2 -
Redirection to following URL should happen :
https://graph.facebook.com/oauth/authorize?client_id=XXXXXXXXXXXXXXXX&response_t
ype=code&redirect_uri=http%3A%2F%2Fdevpc.com%3A8024%2Fsocialauthdemo%2Fsocialaut
h.do&scope=publish_actions,public_profile,email,user_birthday,user_location,user
_photos,user_friends,read_stream
48147921 22:32:51,994 DEBUG
org.brickred.socialauth.spring.controller.SocialAuthWebController - Unable to
connect provider because SocialAuthManager object is null.
Also, I have this in webapp/web-INF/socialauthdemo-servlet.xml
<bean id="socialAuthManager" class="org.brickred.socialauth.spring.bean.SpringSocialAuthManager" scope="session">
<aop:scoped-proxy/>
</bean>
<bean id="socialAuthTemplate" class="org.brickred.socialauth.spring.bean.SocialAuthTemplate" scope="session">
<aop:scoped-proxy/>
</bean>
So I guess socialAuthTemplate and SocialAuthManager should be in session scope
Original comment by JJtu...@gmail.com
on 7 Dec 2014 at 9:47
Original issue reported on code.google.com by
rose12...@gmail.com
on 7 Jul 2012 at 7:09