Announcement Announcement Module
Collapse
No announcement yet.
Error while accessing facebook using spring-social Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Error while accessing facebook using spring-social

    Hi,

    I am getting an error when i include
    <facebook:init /> in my jsp page :

    Code:
    <%@ taglib prefix='c' uri='http://java.sun.com/jsp/jstl/core'%>
    <%@ taglib prefix="sec" uri="http://www.springframework.org/security/tags"%>
    <%@ taglib uri="http://www.springframework.org/spring-social/facebook/tags" prefix="facebook" %>
    
    <body>
    <form id="fb_signin" action="<c:url value="/connect/facebook" />" method="post">
    	<div class="formInfo">
    	</div>
    	<div id="fb-root"></div>	
    	<p><fb:login-button perms="email,publish_stream,offline_access" onlogin="$('#fb_signin').submit();" v="2" length="long">Connect to Facebook</fb:login-button></p>
    </form>
    
    <facebook:init />
    </body>
    
    SEVERE: Servlet.service() for servlet jsp threw exception
    org.apache.jasper.JasperException: /META-INF/tags/Init.tag(6,1) No tag "eval" defined in tag library imported with prefix "s"
    	at org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:40)
    	at org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:407)
    	at org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:198)
    	at org.apache.jasper.compiler.Parser.parseCustomTag(Parser.java:1231)
    	at org.apache.jasper.compiler.Parser.parseElements(Parser.java:1467)
    	at org.apache.jasper.compiler.Parser.parseBody(Parser.java:1675)
    	at org.apache.jasper.compiler.Parser.parseOptionalBody(Parser.java:1022)
    	at org.apache.jasper.compiler.Parser.parseCustomTag(Parser.java:1290)
    	at org.apache.jasper.compiler.Parser.parseElements(Parser.java:1467)
    	at org.apache.jasper.compiler.Parser.parse(Parser.java:138)
    	at org.apache.jasper.compiler.ParserController.doParse(ParserController.java:216)
    	at org.apache.jasper.compiler.ParserController.parse(ParserController.java:103)
    	at org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:154)
    	at org.apache.jasper.compiler.Compiler.compile(Compiler.java:315)
    	at org.apache.jasper.compiler.Compiler.compile(Compiler.java:295)
    	at org.apache.jasper.compiler.Compiler.compile(Compiler.java:282)
    	at org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:586)
    	at org.apache.jasper.servlet.JspServletWrapper.loadTagFile(JspServletWrapper.java:215)
    	at org.apache.jasper.compiler.TagFileProcessor.loadTagFile(TagFileProcessor.java:576)
    	at org.apache.jasper.compiler.TagFileProcessor.access$000(TagFileProcessor.java:50)
    	at org.apache.jasper.compiler.TagFileProcessor$TagFileLoaderVisitor.visit(TagFileProcessor.java:636)
    	at org.apache.jasper.compiler.Node$CustomTag.accept(Node.java:1512)
    	at org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2343)
    	at org.apache.jasper.compiler.Node$Visitor.visitBody(Node.java:2393)
    	at org.apache.jasper.compiler.Node$Visitor.visit(Node.java:2399)
    	at org.apache.jasper.compiler.Node$Root.accept(Node.java:489)
    	at org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2343)
    	at org.apache.jasper.compiler.TagFileProcessor.loadTagFiles(TagFileProcessor.java:654)
    	at org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:178)
    	at org.apache.jasper.compiler.Compiler.compile(Compiler.java:315)
    	at org.apache.jasper.compiler.Compiler.compile(Compiler.java:295)
    	at org.apache.jasper.compiler.Compiler.compile(Compiler.java:282)
    	at org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:586)
    	at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:317)
    	at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:342)
    	at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:267)
    	at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
    	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
    	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
    	at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:630)
    	at org.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicationDispatcher.java:535)
    	at org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDispatcher.java:472)
    	at org.apache.jasper.runtime.JspRuntimeLibrary.include(JspRuntimeLibrary.java:968)
    	at org.apache.jasper.runtime.PageContextImpl.doInclude(PageContextImpl.java:640)
    	at org.apache.jasper.runtime.PageContextImpl.include(PageContextImpl.java:634)
    	at org.apache.tiles.jsp.context.JspTilesRequestContext.include(JspTilesRequestContext.java:103)
    	at org.apache.tiles.jsp.context.JspTilesRequestContext.dispatch(JspTilesRequestContext.java:96)
    	at org.apache.tiles.renderer.impl.UntypedAttributeRenderer.write(UntypedAttributeRenderer.java:61)
    	at org.apache.tiles.renderer.impl.AbstractBaseAttributeRenderer.render(AbstractBaseAttributeRenderer.java:103)
    	at org.apache.tiles.impl.BasicTilesContainer.render(BasicTilesContainer.java:669)
    	at org.apache.tiles.impl.BasicTilesContainer.render(BasicTilesContainer.java:337)
    	at org.apache.tiles.jsp.taglib.InsertAttributeTag.render(InsertAttributeTag.java:234)
    	at org.apache.tiles.jsp.taglib.InsertAttributeTag.render(InsertAttributeTag.java:211)
    	at org.apache.tiles.jsp.taglib.RenderTag.doEndTag(RenderTag.java:220)
    	at org.apache.jsp.WEB_002dINF.pages.layout_jsp._jspx_meth_tiles_005finsertAttribute_005f1(layout_jsp.java:155)
    	at org.apache.jsp.WEB_002dINF.pages.layout_jsp._jspService(layout_jsp.java:97)
    	at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
    	at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
    	at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:374)
    	at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:342)
    	at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:267)
    	at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
    	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
    	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
    	at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:630)
    	at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:436)
    	at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:374)
    	at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:302)
    	at org.apache.tiles.servlet.context.ServletTilesRequestContext.forward(ServletTilesRequestContext.java:241)
    	at org.apache.tiles.servlet.context.ServletTilesRequestContext.dispatch(ServletTilesRequestContext.java:222)
    	at org.apache.tiles.renderer.impl.TemplateAttributeRenderer.write(TemplateAttributeRenderer.java:44)
    	at org.apache.tiles.renderer.impl.AbstractBaseAttributeRenderer.render(AbstractBaseAttributeRenderer.java:103)
    	at org.apache.tiles.impl.BasicTilesContainer.render(BasicTilesContainer.java:669)
    	at org.apache.tiles.impl.BasicTilesContainer.render(BasicTilesContainer.java:689)
    	at org.apache.tiles.impl.BasicTilesContainer.render(BasicTilesContainer.java:643)
    	at org.apache.tiles.impl.BasicTilesContainer.render(BasicTilesContainer.java:626)
    	at org.apache.tiles.impl.BasicTilesContainer.render(BasicTilesContainer.java:322)
    	at org.springframework.web.servlet.view.tiles2.TilesView.renderMergedOutputModel(TilesView.java:100)
    	at org.springframework.web.servlet.view.AbstractView.render(AbstractView.java:250)
    	at org.springframework.web.servlet.DispatcherServlet.render(DispatcherServlet.java:1060)
    	at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:798)
    	at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:716)
    	at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:647)
    	at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:552)
    	at javax.servlet.http.HttpServlet.service(HttpServlet.java:617)
    	at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
    	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
    	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
    	at com.arl.samay.filters.SessionValidation.doFilter(SessionValidation.java:69)
    	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
    	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
    	at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:630)
    	at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:436)
    	at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:374)
    Can anybody let me know if i am missing anything?

  • #2
    It looks like you're using the Facebook init tag from M1. That version of the tag was just a .tag file that uses Spring's JSP tag library to do some of its work. For that to work, you'll need the Spring MVC module in your classpath. (Maven group/artifact: org.springframework/spring-webmvc).

    Spring Social 1.0.0 M2 changed how that tag works, however. It no longer depends on Spring's JSP tag library and is now implemented as a Java class (not a .tag file). Moving up to the latest stuff should remedy your problem.

    Comment


    • #3
      Thanks habuma.

      I am right now using Spring Social 1.0.0 M2 and i don't get any such error. But in my controller class i get @FacebookCookieValue as null.

      Code:
      I have the following in my applicationContext.xml file.
      
      <bean class="org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping"/>
      
      <bean class="org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter">
         			<property name="customArgumentResolver" ref="facebookWebArgResolver"/>
      		</bean>
      		
      		<bean id="facebookWebArgResolver" class="org.springframework.social.facebook.web.FacebookWebArgumentResolver">
      			<constructor-arg name="appId" value="${facebook.appId}"/>
      			<constructor-arg name="appSecret" value="${facebook.appSecret}"/>
      		</bean>
      
      
      and the following method in my Controller class
      
      @RequestMapping(value="fb.htm", method=RequestMethod.POST) 
      	public String connectAccountToFacebook(@FacebookCookieValue String fbCookieVal) {
          	
          	String fbC = fbCookieVal;
      		return null;
      	}
      
      I get the value of fbCookieVal as null.
      
      Also in my JSP i have the following code :
      
      <%@ taglib uri="http://www.springframework.org/spring-social/facebook/tags" prefix="facebook" %>
      <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.3/jquery.min.js" type="text/javascript"></script>
      
      <%/* Connect to Facebook */ %> 
      
      <form id="fb_signin" action="fb.htm" method="post">
      	<div class="formInfo">
      	</div>
      	<div id="fb-root"></div>	
      	<p><fb:login-button onlogin="$('#fb_signin').submit();" v="2" length="long">Connect to Facebook</fb:login-button></p>
      </form>
      
      <facebook:init appId="${facebook.appId}" />
      Could you please let me know what i am missing?

      Comment

      Working...
      X