v4. Share doesn't work properly with custom content types

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-08-2012 03:59 AM
I have a custom model that worked fine in Alfresco 3.4. I've configured both Explorer and Share so that I could create content of my own custom types, modify it etc.
Now I have Alfresco 4.0.d server and it's necessary do the same with it. I've read a lots of docs, wiki, forums and http://ecmarchitect.com/archives/2012/01/09/1509 and done all the things described there. Now, Alfresco Explorer works perfectly (so I can make a conlcusion that my model is fine), but I have troubles with share. "Create content" menu shows all my types (share-documentlibrary-config.xml is configured appropriately). Plus, appearing (when I click on some type) form shows all my custom properties and assocs. But, when i click on "create" the message is displaing:
The item cannot be found. Either it has been removed or it has never existed.Next, when I'm trying to get into the folder where I just tried to create content item, there are red strip on the top with message:
No items.At the same time I can see created item in alfresco Explorer. Here is the log:
ERROR [extensions.webscripts.AbstractRuntime] [http-8080-4] Exception from executeScript - redirecting to status template error: 01080003 Wrapped Exception (with status template): 01080010 Failed to execute script 'classpath*:alfresco/templates/webscripts/org/alfresco/slingshot/documentlibrary-v2/doclist.get.js': null org.springframework.extensions.webscripts.WebScriptException: 01080003 Wrapped Exception (with status template): 01080010 Failed to execute script 'classpath*:alfresco/templates/webscripts/org/alfresco/slingshot/documentlibrary-v2/doclist.get.js': null at org.springframework.extensions.webscripts.AbstractWebScript.createStatusException(AbstractWebScript.java:970) at org.springframework.extensions.webscripts.DeclarativeWebScript.execute(DeclarativeWebScript.java:171) at org.alfresco.repo.web.scripts.RepositoryContainer$2.execute(RepositoryContainer.java:393) at org.alfresco.repo.transaction.RetryingTransactionHelper.doInTransaction(RetryingTransactionHelper.java:388) at org.alfresco.repo.web.scripts.RepositoryContainer.transactionedExecute(RepositoryContainer.java:462) at org.alfresco.repo.web.scripts.RepositoryContainer.transactionedExecuteAs(RepositoryContainer.java:500) at org.alfresco.repo.web.scripts.RepositoryContainer.executeScript(RepositoryContainer.java:316) at org.springframework.extensions.webscripts.AbstractRuntime.executeScript(AbstractRuntime.java:372) at org.springframework.extensions.webscripts.AbstractRuntime.executeScript(AbstractRuntime.java:209) at org.springframework.extensions.webscripts.servlet.WebScriptServlet.service(WebScriptServlet.java:118) 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.alfresco.web.app.servlet.GlobalLocalizationFilter.doFilter(GlobalLocalizationFilter.java:58) 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.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:470) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127) 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:298) at org.apache.coyote.http11.Http11AprProcessor.process(Http11AprProcessor.java:861) at org.apache.coyote.http11.Http11AprProtocol$Http11ConnectionHandler.process(Http11AprProtocol.java:579) at org.apache.tomcat.util.net.AprEndpoint$Worker.run(AprEndpoint.java:1584) at java.lang.Thread.run(Thread.java:662)Caused by: org.alfresco.scripts.ScriptException: 01080010 Failed to execute script 'classpath*:alfresco/templates/webscripts/org/alfresco/slingshot/documentlibrary-v2/doclist.get.js': null at org.alfresco.repo.jscript.RhinoScriptProcessor.execute(RhinoScriptProcessor.java:195) at org.alfresco.repo.processor.ScriptServiceImpl.execute(ScriptServiceImpl.java:212) at org.alfresco.repo.processor.ScriptServiceImpl.executeScript(ScriptServiceImpl.java:174) at org.alfresco.repo.web.scripts.RepositoryScriptProcessor.executeScript(RepositoryScriptProcessor.java:102) at org.springframework.extensions.webscripts.AbstractWebScript.executeScript(AbstractWebScript.java:1193) at org.springframework.extensions.webscripts.DeclarativeWebScript.execute(DeclarativeWebScript.java:86) … 25 moreCaused by: java.lang.NullPointerException at org.alfresco.repo.jscript.ScriptNode.createThumbnail(ScriptNode.java:2736) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.mozilla.javascript.MemberBox.invoke(MemberBox.java:155) at org.mozilla.javascript.NativeJavaMethod.call(NativeJavaMethod.java:243) at org.mozilla.javascript.optimizer.OptRuntime.call2(OptRuntime.java:76) at org.mozilla.javascript.gen.c8._c15(file:/C:/Alfresco/tomcat/webapps/alfresco/WEB-INF/classes/alfresco/templates/webscripts/org/alfresco/slingshot/documentlibrary-v2/doclist.get.js:1001) at org.mozilla.javascript.gen.c8.call(file:/C:/Alfresco/tomcat/webapps/alfresco/WEB-INF/classes/alfresco/templates/webscripts/org/alfresco/slingshot/documentlibrary-v2/doclist.get.js) at org.mozilla.javascript.optimizer.OptRuntime.callName0(OptRuntime.java:108) at org.mozilla.javascript.gen.c8._c0(file:/C:/Alfresco/tomcat/webapps/alfresco/WEB-INF/classes/alfresco/templates/webscripts/org/alfresco/slingshot/documentlibrary-v2/doclist.get.js:1074) at org.mozilla.javascript.gen.c8.call(file:/C:/Alfresco/tomcat/webapps/alfresco/WEB-INF/classes/alfresco/templates/webscripts/org/alfresco/slingshot/documentlibrary-v2/doclist.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.c8.call(file:/C:/Alfresco/tomcat/webapps/alfresco/WEB-INF/classes/alfresco/templates/webscripts/org/alfresco/slingshot/documentlibrary-v2/doclist.get.js) at org.mozilla.javascript.gen.c8.exec(file:/C:/Alfresco/tomcat/webapps/alfresco/WEB-INF/classes/alfresco/templates/webscripts/org/alfresco/slingshot/documentlibrary-v2/doclist.get.js) at org.alfresco.repo.jscript.RhinoScriptProcessor.executeScriptImpl(RhinoScriptProcessor.java:483) at org.alfresco.repo.jscript.RhinoScriptProcessor.execute(RhinoScriptProcessor.java:191) … 30 more
My types are added to share-documentlibrary-config.xml as they are in share-config-custom.xml. Am I need to do something else? I can provide all configs on demand. I dont need localization or i18n at this time. Any help will be appreciated. Thanks.
- Labels:
-
Archive
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-06-2012 07:02 PM
Regarding your problem, though, I wonder if it is permissions related? The stack trace makes me think there is a problem when the thumbnail is being created. I have seen reports of people have a problem where thumbnails get created by one user and then when someone else logs in, they don't have access to the thumbnail node.
If you log in as admin, create a brand new test site, a new folder, and a new instance of cm:content, do you have this problem?
Jeff

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-22-2012 01:56 AM
Next, about permissions. They are not related. I am allways logged in as admin.
Let me describe the situation as I see it. I've made some more researches, read your article "Grasping Thumbnails in Alfresco 3" and made a conclusion: The reason is my custom types have no property cm:content. That's why when I create a node of my type, thumbnail Service cant create a proper thumbnail of it. Maybe it is so because created node doesn't have any content and service cant get it's mime type. (I can often see that my nodes have failedThumbnail aspect or don't have any aspects alike at all). Then, when rendering scripts are called node.createThumbnail throws Null Reference exception by the same reason.
Am I right? If it's so, how can i solve this problem? Should i add a cm:content property to all my types? My conceptual model will suffer from it.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-22-2012 10:13 AM
Jeff

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-22-2012 11:28 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-23-2012 09:17 AM
Make sure you've done a hard cache clear in your browser. You don't want to inadvertently be using old client-side JavaScript libraries.
If that doesn't clear it up, I think you need to turn on the Rhino debugger by editing $TOMCAT_HOME/webapps/alfresco/WEB-INF/classes/log4j.properties and setting:
log4j.logger.org.alfresco.repo.web.scripts.AlfrescoRhinoScriptDebugger=on
Then, set a breakpoint in doclist.get.js and see if you can tell exactly what is null.
Jeff

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-26-2012 06:51 AM
[img]http://i44.tinypic.com/r8ftap.png[/img]
and here is node of my type :
[img]http://i39.tinypic.com/izaid2.png[/img]
As you can see the first one has property cm:content and the other one doesn't, despite it inherits cm:content type. What does it mean? Is this fault of Node Browser?
Next, about debugging. I can't say what exactly is null, because it seems as exception is generated inside createThumbnail. When I'm reaching invocation of this function:
[img]http://i41.tinypic.com/35n3upe.png[/img]
and trying to step into, exception is thrown:
[img]http://i42.tinypic.com/2jbmnlt.png[/img]
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-26-2012 02:23 PM
As for debugging, you should set up a remote debugger, like Eclipse, so that you can step into Alfresco's Java source. The createThumbnail method, like every other Alfresco object in JavaScript, ultimately calls Java code.
Jeff

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-28-2012 12:31 AM
Another one question. After surfing this forum and doing a lots of work, i've finally set up eclipse for remote debugging. As I understand now, to debug Java code createThumbnail invokes, I have to download alfresco sources. Am I Right?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-28-2012 10:08 AM
Jeff
