cancel
Showing results for 
Search instead for 
Did you mean: 

metadata exception in forms service

idwright
Star Collaborator
Star Collaborator

Hi,

When I select Create [something] (Folder, Plain Text ...) in a folder (Document Library or My Files) I'm seeing an exception in the logs

e.g. for a folder

2016-10-14 10:24:50,342  ERROR [extensions.webscripts.AbstractRuntime] [http-bio-8080-exec-13] Exception from executeScript - redirecting to status template error: 09140001 Wrapped Exception (with status template): 09140012 Failed to execute script 'classpath*:alfresco/templates/webscripts/org/alfresco/repository/metadata/metadata.get.js': 09140011 Invalid node ref - does not contain forward slash: cm:folder

org.springframework.extensions.webscripts.WebScriptException: 09140001 Wrapped Exception (with status template): 09140012 Failed to execute script 'classpath*:alfresco/templates/webscripts/org/alfresco/repository/metadata/metadata.get.js': 09140011 Invalid node ref - does not contain forward slash: cm:folder

    at org.springframework.extensions.webscripts.AbstractWebScript.createStatusException(AbstractWebScript.java:1138)

    at org.springframework.extensions.webscripts.DeclarativeWebScript.execute(DeclarativeWebScript.java:171)

The exception is thrown from the call:

http://localhost:8080/alfresco/wcs/api/metadata?nodeRef=cm:folder

which itself is called from:

http://localhost:8080/share/service/components/form?itemKind=type&itemId=cm:folder&destination=works...

I have a custom content model and various other customizations.

I've tried commenting out the metadata-templates and DocLibCustom in my share-config-custom.xml but that doesn't seem to make any difference - my next step will be removing everything and adding things back in one at time to see when the error starts but that will be painful...

The good news is that everything still seems to work but I don't want my logs full of errors.

Anybody got any ideas what might be going on?

(5.1.g Community)

1 ACCEPTED ANSWER

idwright
Star Collaborator
Star Collaborator

OK - it's my fault...

I'll give a little explanation in case it's helpful to someone

In site-data/extensions I'm changing things for a certain type on the folder details page

<extension>

    <modules>

        <module>

            <id>My Folder Details Page</id>

            <version>1.0</version>

            <evaluator type="my.type.component.evaluator">

                <params>

                    <nodetype>{http://alfresco.my.org/model/custom/1.0}myFolder</nodetype>

                </params>

            </evaluator>

because you can't use evaluator.doclib.metadata.nodeType I've written a class that extends ExtensionModuleEvaluator and the mistake is connected to that.

There's a whole load of other bits behind it but that's the main reason.

View answer in original post

3 REPLIES 3

kaynezhang
World-Class Innovator
World-Class Innovator

In alfresco a node is referenced by NodeRef which combine s store protocol,store identifier and node it ,it looks like  workspace://SpacesStore/faaf73a0-ff4a-4f75-a5a3-21c9e00d4f26.

It seems  a wrong parameter(cm:folder)was passed as NodeRef to metadata webscript

Thanks for the response.

I think that much is reasonably obvious - the question is why is http://localhost:8080/share/service/components/form​ calling api/metadata with a content type instead of a nodeRef?

idwright
Star Collaborator
Star Collaborator

OK - it's my fault...

I'll give a little explanation in case it's helpful to someone

In site-data/extensions I'm changing things for a certain type on the folder details page

<extension>

    <modules>

        <module>

            <id>My Folder Details Page</id>

            <version>1.0</version>

            <evaluator type="my.type.component.evaluator">

                <params>

                    <nodetype>{http://alfresco.my.org/model/custom/1.0}myFolder</nodetype>

                </params>

            </evaluator>

because you can't use evaluator.doclib.metadata.nodeType I've written a class that extends ExtensionModuleEvaluator and the mistake is connected to that.

There's a whole load of other bits behind it but that's the main reason.