cancel
Showing results for 
Search instead for 
Did you mean: 

Web Studio - Failed to load script

sbarcena
Champ in-the-making
Champ in-the-making
Hello to all,

It is not possible to create a new web site because there is not loaded the list that should appear under the text " Based on the following: ".
In the console of the tomcat the following thing appears:

[web.scripts.AbstractRuntime] Caught exception & redirecting
to status template: Failed to load script '/web-studio/api/prebuilt/list.get.js
(in classpath store file:C:/Alfresco/tomcat/webapps/studio/WEB-INF/classes/alfr
esco/webscripts)': TypeError: Cannot read property "results" from null (file:C:/
Alfresco/tomcat/webapps/studio/WEB-INF/classes/alfresco/webscripts/web-studio/ap
i/prebuilt/list.get.js#47)


I have Internet gone out across proxy.

I have removed the commentary of the block:

<config evaluator="string-compare" condition="Server">
      <server>
         <!– Enable and adjust the following settings to allow for external access URLs to the
              WebScript Framework - to return an externally accessable address for absolute url generation.
         <scheme>http</scheme>
         <hostname>localhost</hostname>
         <port>8080</port>
         <path>alfresco</path>
         –>
      </server>
   </config>


of the following files:

alfresco/tomcat/webapps/alfresco/webscript-framework-config.xml
alfresco/tomcat/webapps/share/webscript-framework-config.xml
alfresco/tomcat/webapps/studio/webscript-framework-config.xml


but that isn't work.

Must I add in these files an endpoint relative to the alfresco-network that is formed in the file web - framework-config-application.xml?

Any idea?

PD: excuse me for my english  :cry:
16 REPLIES 16

clynham
Champ in-the-making
Champ in-the-making
Same problem here.  I've added these to my JAVA_OPTS in Alfresco.bat. I'm using the Full Setup of 3.2 which came with Java 1.6

-Dhttps.proxyHost=domain.com
-Dhttps.proxyPort=8080
-Dhttps.proxyUser=user.name
-Dhttps.proxyPassword=password

alastairduncan
Champ in-the-making
Champ in-the-making
I have had the same experience after setting up the JAVA_OPTS. There is a further property which can be set which is: -Dhttp.proxySet=true but this still does not help. The error message on the server implies that the generation of an exception is causing a null pointer exeption, if I'm reading it correctly, when the problem occurs so the nature of the problem is hidden from the user and so diagnosis is going to be difficult. This is the stack trace:

SEVERE: Servlet.service() for servlet apiServlet threw exception
java.lang.NullPointerException
   at org.alfresco.web.scripts.ProcessorModelHelper.populateModel(ProcessorModelHelper.java:124)
   at org.alfresco.web.scripts.ProcessorModelHelper.populateTemplateModel(ProcessorModelHelper.java:310)
   at org.alfresco.web.scripts.LocalWebScriptRuntimeContainer.getTemplateParameters(LocalWebScriptRuntimeContainer.java:118)
   at org.alfresco.web.scripts.AbstractWebScript.createTemplateParameters(AbstractWebScript.java:408)
   at org.alfresco.web.scripts.AbstractWebScript$1.getStatusModel(AbstractWebScript.java:621)
   at org.alfresco.web.scripts.WebScriptException.getStatusModel(WebScriptException.java:158)
   at org.alfresco.web.scripts.AbstractRuntime.executeScript(AbstractRuntime.java:171)
   at org.alfresco.web.scripts.servlet.WebScriptServlet.service(WebScriptServlet.java:122)
   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.tuckey.web.filters.urlrewrite.UrlRewriteFilter.doFilter(UrlRewriteFilter.java:391)
   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.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
   at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
   at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
   at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
   at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
   at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:286)
   at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:845)
   at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
   at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
   at java.lang.Thread.run(Thread.java:619)

alastairduncan
Champ in-the-making
Champ in-the-making
Just wanted to add that I'm using jdk 1.6.0_13 and the cert bundle is in place and has the Starfield cert.

decla
Champ in-the-making
Champ in-the-making
Hello,
we have exactly the same issue. Even if we set proxy information (for http and https), loading the templates gives an error.
08:15:36,216  ERROR [web.scripts.AbstractRuntime] Exception from executeScript - redirecting to status template error: 00120003 Failed to load script '/web-studio/api/prebuilt/list.get.js (in classpath store file:C:/Alfresco/tomcat/webapps/studio/WEB-INF/classes/alfresco/webscripts)': 00120002 TypeError: Cannot read property "results" from null (file:C:/Alfresco/tomcat/webapps/studio/WEB-INF/classes/alfresco/webscripts/web-studio/api/prebuilt/list.get.js#47)
org.alfresco.web.scripts.WebScriptException: 00120003 Failed to load script '/web-studio/api/prebuilt/list.get.js (in classpath store file:C:/Alfresco/tomcat/webapps/studio/WEB-INF/classes/alfresco/webscripts)': 00120002 TypeError: Cannot read property "results" from null (file:C:/Alfresco/tomcat/webapps/studio/WEB-INF/classes/alfresco/webscripts/web-studio/api/prebuilt/list.get.js#47)
   at org.alfresco.web.scripts.PresentationScriptProcessor.executeScript(PresentationScriptProcessor.java:193)
   at org.alfresco.web.scripts.AbstractWebScript.executeScript(AbstractWebScript.java:819)
   at org.alfresco.web.scripts.DeclarativeJSONWebScript.execute(DeclarativeJSONWebScript.java:103)
   at org.alfresco.web.scripts.PresentationContainer.executeScript(PresentationContainer.java:60)
   at org.alfresco.web.scripts.LocalWebScriptRuntimeContainer.executeScript(LocalWebScriptRuntimeContainer.java:192)
   at org.alfresco.web.scripts.AbstractRuntime.executeScript(AbstractRuntime.java:295)
   at org.alfresco.web.scripts.AbstractRuntime.executeScript(AbstractRuntime.java:172)
   at org.alfresco.web.scripts.servlet.WebScriptServlet.service(WebScriptServlet.java:122)
   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.tuckey.web.filters.urlrewrite.UrlRewriteFilter.doFilter(UrlRewriteFilter.java:391)
   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.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
   at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
   at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
   at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
   at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
   at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:286)
   at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:845)
   at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
   at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
   at java.lang.Thread.run(Unknown Source)
Caused by: org.alfresco.web.scripts.WebScriptException: 00120002 TypeError: Cannot read property "results" from null (file:C:/Alfresco/tomcat/webapps/studio/WEB-INF/classes/alfresco/webscripts/web-studio/api/prebuilt/list.get.js#47)
   at org.alfresco.web.scripts.PresentationScriptProcessor.executeScriptImpl(PresentationScriptProcessor.java:324)
   at org.alfresco.web.scripts.PresentationScriptProcessor.executeScript(PresentationScriptProcessor.java:189)
   … 23 more
Caused by: org.mozilla.javascript.EcmaError: TypeError: Cannot read property "results" from null (file:C:/Alfresco/tomcat/webapps/studio/WEB-INF/classes/alfresco/webscripts/web-studio/api/prebuilt/list.get.js#47)
   at org.mozilla.javascript.ScriptRuntime.constructError(ScriptRuntime.java:3350)
   at org.mozilla.javascript.ScriptRuntime.constructError(ScriptRuntime.java:3340)
   at org.mozilla.javascript.ScriptRuntime.typeError(ScriptRuntime.java:3356)
   at org.mozilla.javascript.ScriptRuntime.typeError2(ScriptRuntime.java:3375)
   at org.mozilla.javascript.ScriptRuntime.undefReadError(ScriptRuntime.java:3388)
   at org.mozilla.javascript.ScriptRuntime.getObjectProp(ScriptRuntime.java:1362)
   at org.mozilla.javascript.gen.c2._c4(file:C:/Alfresco/tomcat/webapps/studio/WEB-INF/classes/alfresco/webscripts/web-studio/api/prebuilt/list.get.js:47)
   at org.mozilla.javascript.gen.c2.call(file:C:/Alfresco/tomcat/webapps/studio/WEB-INF/classes/alfresco/webscripts/web-studio/api/prebuilt/list.get.js)
   at org.mozilla.javascript.optimizer.OptRuntime.callName(OptRuntime.java:97)
   at org.mozilla.javascript.gen.c2._c2(file:C:/Alfresco/tomcat/webapps/studio/WEB-INF/classes/alfresco/webscripts/web-studio/api/prebuilt/list.get.js:19)
   at org.mozilla.javascript.gen.c2.call(file:C:/Alfresco/tomcat/webapps/studio/WEB-INF/classes/alfresco/webscripts/web-studio/api/prebuilt/list.get.js)
   at org.mozilla.javascript.optimizer.OptRuntime.callName0(OptRuntime.java:108)
   at org.mozilla.javascript.gen.c2._c0(file:C:/Alfresco/tomcat/webapps/studio/WEB-INF/classes/alfresco/webscripts/web-studio/api/prebuilt/list.get.js:57)
   at org.mozilla.javascript.gen.c2.call(file:C:/Alfresco/tomcat/webapps/studio/WEB-INF/classes/alfresco/webscripts/web-studio/api/prebuilt/list.get.js)
   at org.mozilla.javascript.ContextFactory.doTopCall(ContextFactory.java:393)
   at org.mozilla.javascript.ScriptRuntime.doTopCall(ScriptRuntime.java:2834)
   at org.mozilla.javascript.gen.c2.call(file:C:/Alfresco/tomcat/webapps/studio/WEB-INF/classes/alfresco/webscripts/web-studio/api/prebuilt/list.get.js)
   at org.mozilla.javascript.gen.c2.exec(file:C:/Alfresco/tomcat/webapps/studio/WEB-INF/classes/alfresco/webscripts/web-studio/api/prebuilt/list.get.js)
   at org.alfresco.web.scripts.PresentationScriptProcessor.executeScriptImpl(PresentationScriptProcessor.java:314)
   … 24 more

Accessing https://network.alfresco.com/service/webstudio/sites works…

How can this issue be resolved?

Thanks,
Claudio

ezio
Champ in-the-making
Champ in-the-making
Smiley Very Happy Hi,

:idea: I've temporarily solved by modifying the file "prebuilt.js" in the directory "<TOMCAT_HOME> \ webapps \ studio \ WEB-INF \ classes \ alfresco \ webscripts \ web-studio \ api \ prebuilt" as follows:



function getRemoteSites(endpointId, uri)
{
   // var connector = remote.connect(endpointId);
   
   // var feed = connector.get(uri));
   // model.feed = feed;
   
   // var obj = eval('(' + feed + ')');
   
   // var sites = { };
   
   // for(var key in obj.results)
   // {
   //   if(key != null && key != "none")
   //   {
   //      var site = obj.results[key];
   //      sites[key] = site;
   //   }
   // }

var sites = { "quickstart": { "title": "Web Studio Quick Start", "description": "Web Studio Quick Start", "previewImageUrl": "https://network.alfresco.com/extranet/proxy/alfresco-noauth/api/path/content/workspace/SpacesStore/C...", "archiveUrl": "https://network.alfresco.com/extranet/proxy/alfresco-noauth/api/path/content/workspace/SpacesStore/C..." } , "powertoys": { "title": "Power Toys - Sample", "description": "Power Toys - Sample", "previewImageUrl": "https://network.alfresco.com/extranet/proxy/alfresco-noauth/api/path/content/workspace/SpacesStore/C...", "archiveUrl": "https://network.alfresco.com/extranet/proxy/alfresco-noauth/api/path/content/workspace/SpacesStore/C..." } , "greenenergy": { "title": "Green Energy - Sample ", "description": "Green Energy - Sample", "previewImageUrl": "https://network.alfresco.com/extranet/proxy/alfresco-noauth/api/path/content/workspace/SpacesStore/C...", "archiveUrl": "https://network.alfresco.com/extranet/proxy/alfresco-noauth/api/path/content/workspace/SpacesStore/C..." } }


   return sites;
}

pp20218
Champ in-the-making
Champ in-the-making
Hi All,

I have also the same problem. I am getting the same JS error.
I changed the two xml files with .sample extn but didn't work. I saw a document located at (https://issues.alfresco.com/jira/sr/jira.issueviews:searchrequest-fullcontent/temp/SearchRequest.ht....  and commented out          
<ref bean="webframework.remotestore.webscripts" />    under
<bean id="webframework.searchpath" class="org.alfresco.web.scripts.SearchPath">.

Now I can see  the drop down with existing websites. But when I select one and click finish I am getting the below things.

This is an unconfigured page.
           Home
It does not have a presentation template.
Associate a Presentation Template


But when I click on Associate a Presentation Template   nothing is happening.

NOTE:  When I am using 3.2r it is not working at all.
But in 3labs stable version i can able to login and see some features.But i am not finding the file  custom-web-framework-application-context.xml

Any reply welcome.

Thanks

pp20218
Champ in-the-making
Champ in-the-making
Same list.get.js I mean