-
Mar 2nd, 2010, 01:14 PM
#1
Error on Spring Surf Tutorial Example
Hi,
I just wanted to point out two errors on the sample on the Spring Surf Developer Tools Tutorial.
On this page: http://www.springsurf.org/sites/1.0....ginning-step-8
the file newsfeed.get.js line 17 should be:
var re = /<[r|R][s|S]{2}/; // Is this really an RSS document?
and the file newsfeed.get.html.ftl line 4 should be:
<#if items?exists && (items?size > 0)>
Also the Rss Feed is not returning the expected rss format, it will work better with other Rss Feeds like the one from bbc, substituting in newsfeed.get.js line 2
var newsServiceUrl = "http://fxfeeds.mozilla.com/en-US/firefox/headlines.xml";
Regards,
Andres
-
Mar 23rd, 2010, 01:58 PM
#2
This error should have been fixed in M3.
Thanks!
Yong
-
Aug 23rd, 2010, 08:22 AM
#3
Hi..
I am following the same tutorial which you had posted here. Until the step 2.3.6, there is no issue...
As you reported, I corrected those three issues..
But still when I am trying with http://localhost:8080/surf/page/news/feed, I am getting error in the browser.
Environment details:
Os: Windows Xp
SST version: 2.3.2
roo version: 1.0.2
The error in browser is:
The Web Script /surf/page/news/feed has responded with a status of 500 - Internal Error.
500 Description: An error inside the HTTP server which prevented it from fulfilling the request.
Message: 07230002 Failed to load script 'org.springframework.extensions.webscripts.LocalFi leSystemStore$LocalFileSystemStoreScriptContent@54 570a': 07230001 TypeError: Cannot parse XML: Attribute name "x" associated with an element type "rss" must be followed by the ' = ' character. (C:\Program Files\Apache Software Foundation\Tomcat 6.0\webapps\surf\/WEB-INF/webscripts/news/newsfeed.get.js#33)
Exception: org.mozilla.javascript.EcmaError - TypeError: Cannot parse XML: Attribute name "x" associated with an element type "rss" must be followed by the ' = ' character. (C:\Program Files\Apache Software Foundation\Tomcat 6.0\webapps\surf\/WEB-INF/webscripts/news/newsfeed.get.js#33)
org.mozilla.javascript.ScriptRuntime.constructErro r(ScriptRuntime.java:3350)
org.mozilla.javascript.ScriptRuntime.constructErro r(ScriptRuntime.java:3340)
org.mozilla.javascript.ScriptRuntime.typeError(Scr iptRuntime.java:3356)
org.mozilla.javascript.xmlimpl.XMLLibImpl.parse(XM LLibImpl.java:411)
org.mozilla.javascript.xmlimpl.XMLLibImpl.ecmaToXm l(XMLLibImpl.java:433)
org.mozilla.javascript.xmlimpl.XMLObjectImpl.ecmaT oXml(XMLObjectImpl.java:779)
org.mozilla.javascript.xmlimpl.XML.jsConstructor(X ML.java:250)
org.mozilla.javascript.xmlimpl.XMLObjectImpl.execI dCall(XMLObjectImpl.java:570)
org.mozilla.javascript.IdFunctionObject.call(IdFun ctionObject.java:127)
org.mozilla.javascript.BaseFunction.construct(Base Function.java:313)
org.mozilla.javascript.ScriptRuntime.newObject(Scr iptRuntime.java:2132)
org.mozilla.javascript.gen.c1._c0(C:\Program Files\Apache Software Foundation\Tomcat 6.0\webapps\surf\/WEB-INF/webscripts/news/newsfeed.get.js:33)
org.mozilla.javascript.gen.c1.call(C:\Program Files\Apache Software Foundation\Tomcat 6.0\webapps\surf\/WEB-INF/webscripts/news/newsfeed.get.js)
org.mozilla.javascript.ContextFactory.doTopCall(Co ntextFactory.java:393)
org.mozilla.javascript.ScriptRuntime.doTopCall(Scr iptRuntime.java:2834)
org.mozilla.javascript.gen.c1.call(C:\Program Files\Apache Software Foundation\Tomcat 6.0\webapps\surf\/WEB-INF/webscripts/news/newsfeed.get.js)
org.mozilla.javascript.gen.c1.exec(C:\Program Files\Apache Software Foundation\Tomcat 6.0\webapps\surf\/WEB-INF/webscripts/news/newsfeed.get.js)
org.springframework.extensions.webscripts.processo r.JSScriptProcessor.executeScriptImpl(JSScriptProc essor.java:292)
org.springframework.extensions.webscripts.processo r.JSScriptProcessor.executeScript(JSScriptProcesso r.java:178)
org.springframework.extensions.webscripts.Abstract WebScript.executeScript(AbstractWebScript.java:878 )
org.springframework.extensions.webscripts.Declarat iveWebScript.execute(DeclarativeWebScript.java:84)
org.springframework.extensions.webscripts.Presenta tionContainer.executeScript(PresentationContainer. java:59)
org.springframework.extensions.webscripts.LocalWeb ScriptRuntimeContainer.executeScript(LocalWebScrip tRuntimeContainer.java:180)
org.springframework.extensions.webscripts.Abstract Runtime.executeScript(AbstractRuntime.java:307)
org.springframework.extensions.webscripts.Abstract Runtime.executeScript(AbstractRuntime.java:178)
org.springframework.extensions.webscripts.servlet. mvc.WebScriptView.renderMergedOutputModel(WebScrip tView.java:95)
org.springframework.web.servlet.view.AbstractView. render(AbstractView.java:250)
org.springframework.web.servlet.DispatcherServlet. render(DispatcherServlet.java:1060)
org.springframework.web.servlet.DispatcherServlet. doDispatch(DispatcherServlet.java:798)
org.springframework.web.servlet.DispatcherServlet. doService(DispatcherServlet.java:716)
org.springframework.web.servlet.FrameworkServlet.p rocessRequest(FrameworkServlet.java:647)
org.springframework.web.servlet.FrameworkServlet.d oGet(FrameworkServlet.java:552)
javax.servlet.http.HttpServlet.service(HttpServlet .java:617)
javax.servlet.http.HttpServlet.service(HttpServlet .java:717)
org.apache.catalina.core.ApplicationFilterChain.in ternalDoFilter(ApplicationFilterChain.java:290)
org.apache.catalina.core.ApplicationFilterChain.do Filter(ApplicationFilterChain.java:206)
org.apache.catalina.core.ApplicationDispatcher.inv oke(ApplicationDispatcher.java:630)
org.apache.catalina.core.ApplicationDispatcher.pro cessRequest(ApplicationDispatcher.java:436)
org.apache.catalina.core.ApplicationDispatcher.doF orward(ApplicationDispatcher.java:374)
org.apache.catalina.core.ApplicationDispatcher.for ward(ApplicationDispatcher.java:302)
org.tuckey.web.filters.urlrewrite.NormalRewrittenU rl.doRewrite(NormalRewrittenUrl.java:195)
org.tuckey.web.filters.urlrewrite.RuleChain.handle Rewrite(RuleChain.java:159)
org.tuckey.web.filters.urlrewrite.RuleChain.doRule s(RuleChain.java:141)
org.tuckey.web.filters.urlrewrite.UrlRewriter.proc essRequest(UrlRewriter.java:90)
org.tuckey.web.filters.urlrewrite.UrlRewriteFilter .doFilter(UrlRewriteFilter.java:417)
org.apache.catalina.core.ApplicationFilterChain.in ternalDoFilter(ApplicationFilterChain.java:235)
org.apache.catalina.core.ApplicationFilterChain.do Filter(ApplicationFilterChain.java:206)
org.apache.catalina.core.StandardWrapperValve.invo ke(StandardWrapperValve.java:233)
org.apache.catalina.core.StandardContextValve.invo ke(StandardContextValve.java:191)
org.apache.catalina.core.StandardHostValve.invoke( StandardHostValve.java:128)
org.apache.catalina.valves.ErrorReportValve.invoke (ErrorReportValve.java:102)
org.apache.catalina.core.StandardEngineValve.invok e(StandardEngineValve.java:109)
org.apache.catalina.connector.CoyoteAdapter.servic e(CoyoteAdapter.java:286)
org.apache.coyote.http11.Http11AprProcessor.proces s(Http11AprProcessor.java:857)
org.apache.coyote.http11.Http11AprProtocol$Http11C onnectionHandler.process(Http11AprProtocol.java:56 5)
org.apache.tomcat.util.net.AprEndpoint$Worker.run( AprEndpoint.java:1509)
java.lang.Thread.run(Unknown Source)
Exception: org.springframework.extensions.webscripts.WebScrip tException - 07230001 TypeError: Cannot parse XML: Attribute name "x" associated with an element type "rss" must be followed by the ' = ' character. (C:\Program Files\Apache Software Foundation\Tomcat 6.0\webapps\surf\/WEB-INF/webscripts/news/newsfeed.get.js#33)
org.springframework.extensions.webscripts.processo r.JSScriptProcessor.executeScriptImpl(JSScriptProc essor.java:302)
Exception: org.springframework.extensions.webscripts.WebScrip tException - 07230002 Failed to load script 'org.springframework.extensions.webscripts.LocalFi leSystemStore$LocalFileSystemStoreScriptContent@54 570a': 07230001 TypeError: Cannot parse XML: Attribute name "x" associated with an element type "rss" must be followed by the ' = ' character. (C:\Program Files\Apache Software Foundation\Tomcat 6.0\webapps\surf\/WEB-INF/webscripts/news/newsfeed.get.js#33)
org.springframework.extensions.webscripts.processo r.JSScriptProcessor.executeScript(JSScriptProcesso r.java:182)
Server: Alfresco <unknown> v<unknown> schema -1
Time: Aug 23, 2010 6:37:39 PM
Diagnostics: Inspect Web Script (webscripts/news/newsfeed.get)
Can anyone kindly suggest me whats the problem is???
Thanks in advance.....
Last edited by kamal_1; Aug 23rd, 2010 at 08:35 AM.
Regards,
Kamal
-
Aug 23rd, 2010, 08:36 AM
#4
Did you use the JS template here from its download link?
http://www.springsurf.org/sites/1.0....ewsfeed.get.js
Yong
-
Aug 23rd, 2010, 08:43 AM
#5
Thanks for your quick response...
even after having the js file which you have said, I am getting the same error..
Is there any issue with the html file.
I am having
<div class="dashlet">
<div class="title" > ${title}</div>
<div class="body scrollableList">
<#if items?exists && (items?size > 0)>
<#list items as item>
<div style="clear:both;"><a href="item.link">${item.title}</a></div>
<div style="clear:both;">${item.description}</div>
</#list>
</#if>
</div><#-- end of body -->
</div><#-- end of dashlet -->
But I think, this js is not retrieving the correct feeds...
Regards,
Kamal
-
Aug 23rd, 2010, 08:54 AM
#6
Hi,
I just created a clean Surf web app and added the newsfeed webscript from the download links. And then started jetty and open browser and test following link
http://localhost:8180/service/news/feed
It works as expected.
The error is from your JS template so it has nothing to do with the freemarker template.
Yong
-
Aug 24th, 2010, 12:31 AM
#7
Hi..
You are running the application in jetty server..
I am using tomcat to run the application. I can view my surf sample page in http://localhost:8080/community/
I am following http://www.springsurf.org/sites/1.0....beginning.html
As you said I had changed my js file and now I am getting some new error in browser. When I tried with jetty server, the same below error is displayed.
Exception
javax.servlet.ServletException: Could not resolve view with name 'news/feed' in servlet with name 'Spring Surf Dispatcher Servlet'
org.springframework.web.servlet.DispatcherServlet. render(DispatcherServlet.java:1042)
org.springframework.web.servlet.DispatcherServlet. doDispatch(DispatcherServlet.java:798)
org.springframework.web.servlet.DispatcherServlet. doService(DispatcherServlet.java:716)
org.springframework.web.servlet.FrameworkServlet.p rocessRequest(FrameworkServlet.java:647)
org.springframework.web.servlet.FrameworkServlet.d oGet(FrameworkServlet.java:552)
javax.servlet.http.HttpServlet.service(HttpServlet .java:617)
javax.servlet.http.HttpServlet.service(HttpServlet .java:717)
org.tuckey.web.filters.urlrewrite.NormalRewrittenU rl.doRewrite(NormalRewrittenUrl.java:195)
org.tuckey.web.filters.urlrewrite.RuleChain.handle Rewrite(RuleChain.java:159)
org.tuckey.web.filters.urlrewrite.RuleChain.doRule s(RuleChain.java:141)
org.tuckey.web.filters.urlrewrite.UrlRewriter.proc essRequest(UrlRewriter.java:90)
org.tuckey.web.filters.urlrewrite.UrlRewriteFilter .doFilter(UrlRewriteFilter.java:417)
Can you say whats the reason for this new error?
Last edited by kamal_1; Aug 24th, 2010 at 12:41 AM.
Regards,
Kamal
-
Aug 24th, 2010, 05:14 AM
#8
Hi,
It looks like you are using M2. Please use M3.
Yong
-
Aug 24th, 2010, 05:31 AM
#9
Hi..
Thanks...
When I am using 1.0.0.CI-SNAPSHOT, I am not getting the above error. Can I know what is the difference between these M2, M3 and 1.0.0.CI-SNAPSHOT addons..
Thanks...
Regards,
Kamal
-
Aug 24th, 2010, 05:49 AM
#10
From the link you posted, it seems like you are following M2 Tutorial.
You should follow following link
http://www.springsurf.org/sites/1.0....tml/index.html
I have tested Surf M3 on STS 2.3.2 and I tested it on Spring TC server (Tomcat). It seems to work fine.
The only extra thing I did is touching the urlrewirte.xml (Just added a space and saved it).
For now, please use M3.
Yong
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules