Page 1 of 2

Integration with Spring Social

Posted: Wed May 15, 2013 4:13 am
by ANITHA
Hi

I'm trying to integrate broadleaf demosite with spring social. i followed steps as per
http://www.broadleafcommerce.com/post/w ... ing-social

i am getting the following error
[artifact:mvn] [ERROR] 14:27:04 ContextLoader - Context initialization failed
[artifact:mvn] org.springframework.context.ApplicationContextException: I/O error parsing bean definition source for Root WebApplicationContext; nested exception is java.io.FileNotFoundException: Could not open ServletContext resource [/WEB-INF/applicationContext-social.xml]

How to resolve this . i've added applicationContext-social.xml to site
error.zip
(26.77 KiB) Downloaded 328 times

Re: Integration with Spring Social

Posted: Wed May 15, 2013 7:52 am
by jfridye
In web.xml (in both the 'site' and 'combined' projects), there is a patchConfigLocation parameter, to which you need to add an entry for any applicationContext-*.xml for Spring to pick up the bean definitions.

Here is an example:

Code: Select all

   <context-param>
      <param-name>patchConfigLocation</param-name>
      <param-value>
            classpath:/bl-open-admin-contentClient-applicationContext.xml
            classpath:/bl-cms-contentClient-applicationContext.xml
            classpath:/bl-oms-applicationContext.xml
            classpath:/bl-inventory-applicationContext.xml
            classpath:/bl-braintree-applicationContext.xml
            classpath:/bl-credit-account-applicationContext.xml
            classpath:/applicationContext.xml
            classpath:/applicationContext-workflow.xml
            classpath:/applicationContext-email.xml
            /WEB-INF/applicationContext-datasource.xml
            /WEB-INF/applicationContext-security.xml
            /WEB-INF/applicationContext-filter.xml
            /WEB-INF/applicationContext-social.xml
            /WEB-INF/applicationContext.xml
        </param-value>
   </context-param>

Re: Integration with Spring Social

Posted: Thu May 16, 2013 1:48 am
by ANITHA
hi
i did the change. but once jetty started. if i access login . i'm getting the following error
Problem accessing /register. Reason:
Problem accessing /login . reason
org.springframework.web.method.support.InvocableHandlerMethod.<init>(Lorg/springframework/web/method/HandlerMethod;)V
Caused by:

java.lang.NoSuchMethodError: org.springframework.web.method.support.InvocableHandlerMethod.<init>(Lorg/springframework/web/method/HandlerMethod;)V
at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.<init>(ServletInvocableHandlerMethod.java:69)
at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.createRequestMappingMethod(RequestMappingHandlerAdapter.java:627)
at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:597)
at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:565)
at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:80)
at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:923)
at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:852)
at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:882)
at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:778)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:735)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:848)
at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:643)
at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1331)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:330)
at org.broadleafcommerce.cms.web.URLHandlerFilter.doFilterInternal(URLHandlerFilter.java:74)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
at org.springframework.security.web.FilterChainProxy.doFilterInternal(FilterChainProxy.java:192)
at org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:166)
at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:346)
at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:259)
at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1302)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:330)
at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:118)
at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:84)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
at org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:113)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
at org.broadleafcommerce.profile.web.core.security.SessionFixationProtectionFilter.doFilter(SessionFixationProtectionFilter.java:90)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
at org.springframework.security.web.authentication.AnonymousAuthenticationFilter.doFilter(AnonymousAuthenticationFilter.java:113)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
at org.broadleafcommerce.core.web.order.security.CartStateFilter.doFilter(CartStateFilter.java:105)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
at org.broadleafcommerce.profile.web.core.security.CustomerStateFilter.doFilter(CustomerStateFilter.java:147)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
at org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter.doFilter(SecurityContextHolderAwareRequestFilter.java:54)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
at org.springframework.security.web.savedrequest.RequestCacheAwareFilter.doFilter(RequestCacheAwareFilter.java:45)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
at org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter.doFilter(AbstractAuthenticationProcessingFilter.java:183)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
at org.broadleafcommerce.common.security.handler.CsrfFilter.doFilter(CsrfFilter.java:83)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
at org.springframework.security.web.authentication.logout.LogoutFilter.doFilter(LogoutFilter.java:105)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
at org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:87)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
at org.springframework.security.web.access.channel.ChannelProcessingFilter.doFilter(ChannelProcessingFilter.java:144)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
at org.springframework.security.web.FilterChainProxy.doFilterInternal(FilterChainProxy.java:192)
at org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:166)
at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:346)
at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:259)
at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1302)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:330)
at org.broadleafcommerce.common.web.BroadleafRequestFilter.doFilterInternal(BroadleafRequestFilter.java:152)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
at org.springframework.orm.jpa.support.OpenEntityManagerInViewFilter.doFilterInternal(OpenEntityManagerInViewFilter.java:147)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
at org.springframework.security.web.FilterChainProxy.doFilterInternal(FilterChainProxy.java:192)
at org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:160)
at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:346)
at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:259)
at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1302)
at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:448)
at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:131)
at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:524)
at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:231)
at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1067)
at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:377)
at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:192)
at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1001)
at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:129)
at org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:250)
at org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:149)
at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:111)
at org.eclipse.jetty.server.Server.handle(Server.java:360)
at org.eclipse.jetty.server.AbstractHttpConnection.handleRequest(AbstractHttpConnection.java:454)
at org.eclipse.jetty.server.AbstractHttpConnection.headerComplete(AbstractHttpConnection.java:890)
at org.eclipse.jetty.server.AbstractHttpConnection$RequestHandler.headerComplete(AbstractHttpConnection.java:944)
at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:630)
at org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:230)
at org.eclipse.jetty.server.AsyncHttpConnection.handle(AsyncHttpConnection.java:77)
at org.eclipse.jetty.io.nio.SslConnection.handle(SslConnection.java:191)
at org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle(SelectChannelEndPoint.java:622)
at org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run(SelectChannelEndPoint.java:46)
at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:603)
at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:538)
at java.lang.Thread.run(Thread.java:662)
Powered by Jetty://




Doc2.zip
(22 Bytes) Downloaded 300 times

Re: Integration with Spring Social

Posted: Wed May 22, 2013 5:26 am
by amywatson
Hi all,
I am also getting the same problem when running this. So if anyone has suitable solution, then please update it here.

Re: Integration with Spring Social

Posted: Wed May 22, 2013 7:50 am
by jfridye
@ANITHA and @amywatson: This sounds like a jar incompatibility issue. Spring Social has a dependency on the Spring Framework (I think 3.1), which conflicts with the version of the Spring Framework on which Broadleaf has a dependency (I think 3.2, as of now). You can prevent Spring Social from including this dependency by amending the spring-social-web entry in the pom.xml in your site project:

Code: Select all

        <dependency>
            <groupId>org.springframework.social</groupId>
            <artifactId>spring-social-web</artifactId>
            <exclusions>
                <exclusion>
                    <artifactId>spring-web</artifactId>
                    <groupId>org.springframework</groupId>
                </exclusion>
            </exclusions>
        </dependency>


Hope this helps!

Re: Integration with Spring Social

Posted: Thu May 23, 2013 3:47 am
by ANITHA
once i tried integrating my application with yammer. after successful login. i'm not able to redirect back to the heatclinic home page or the application.
Can you tell me wat change i need to do. ??
I have changed RegisterController extends BroadleafSocialRegisterController. Wat else do i need to redirect back to application after successful login at yammer!

Re: Integration with Spring Social

Posted: Thu May 23, 2013 9:07 am
by jfridye
This is likely not an issue in Broadleaf. It may pertain to either configuring the correct 'redirect_uri' in Yammer or passing the correct 'redirect_uri' parameter to Yammer.

Please refer to Yammer's documentation https://developer.yammer.com/authentication/#a-oauth2. The 'Server-Side Flow' or the 'Client-Side Flow' sections may be particularly helpful for you.

Re: Integration with Spring Social

Posted: Fri May 31, 2013 7:17 am
by ANITHA
Hi all

this link did not help me.!! try to explain in your words.

https://developer.yammer.com/authentication/#a-oauth2

once i login via sign in with Yammer, its redirecting me to yammers page. but i'm not redirected back to application url : localhost:8080 .

How should i proceed in this perspect?

Re: Integration with Spring Social

Posted: Fri May 31, 2013 7:23 am
by ANITHA
Should i register the broadleaf application?


only then i can proceed with authentication.is it?

Re: Integration with Spring Social

Posted: Fri May 31, 2013 4:04 pm
by elbertbautista
Yes, you should register your application with Yammer in order to connect with it.
See the following documentation on Yammer's site:
https://developer.yammer.com/introducti ... egisterapp

5. Expected Redirect/Redirect URI: Where Yammer will redirect to after the authentication flow is complete.

- For static urls, use the full url, without the leading `www`. For example, https://user.dynamics.com

- For dynamic url subdomains such as https://<instancename>.dynamics.com, use only the domain name i.e. https://dynamics.com

Save changes to finish registering your app.