cancel
Showing results for 
Search instead for 
Did you mean: 

Problem with tutorial

thk
Champ on-the-rise
Champ on-the-rise
Hi

I tried to follow this tutorial:
http://docs.alfresco.com/community/tasks/dev-extensions-content-models-tutorials-add-custom-property...
(Have installed Alfresco 5.0 on Windows 8.1)
But I cannot login into Alfresco after restart.
In the logs I got errors like e.g.:
Caused by: java.io.FileNotFoundException: JAR entry alfresco/extension/custom-model-context.xml not found in C:\Alfresco\tomcat\shared\lib\MyCompanyContentModel.jar

But there is an alfresco/extension/custom-model-context.xml
My jar-file is under C:\Alfresco\tomcat\shared\lib\
And in the jar-file I have under \alfresco\extension\ the files custom-model-context.xml and customModel.xml
Attached the log file and screenshot.

Thanks for help
8 REPLIES 8

thk
Champ on-the-rise
Champ on-the-rise
nobody who can help me?

rjohnson
Star Contributor
Star Contributor
Cant see you layout BUT, your model should be in /config/alfresco/extension

thk
Champ on-the-rise
Champ on-the-rise
Yes maybe its a problem with the jar file, I put all manually into \Alfresco\tomcat\shared\classes\alfresco\extension and can at least now log into Alfresco. But if I run the web script like in the tutorial, I got:    org.alfresco.service.namespace.NamespaceException - Namespace prefix my is not mapped to a namespace URI

Actually all I wanted to do is add three text fields (similar to the "Description"-field as additional properties of a folder or document). Maybe there is some easier way.

rjohnson
Star Contributor
Star Contributor
That exception means that you have a XXX: in your model that isn't mapped to a URI at the top or your context is wrong. This is usually a typo.

Post your XML

thk
Champ on-the-rise
Champ on-the-rise
Thanks for helping me Bob! Attached all my files I created or changed so far.

I still get:
500 Description:   An error inside the HTTP server which prevented it from fulfilling the request.

Message:   04210003 Wrapped Exception (with status template): 04210082 Failed to execute script 'classpath*:alfresco/extension/templates/webscripts/modeltest.get.js': Namespace prefix my is not mapped to a namespace URI
   
Exception:   org.alfresco.service.namespace.NamespaceException - Namespace prefix my is not mapped to a namespace URI

I also have the problem that if I try to change the document type of a document under Document Actions to the new type "Whitepaper", I always get the message "unable to change document type".

thk
Champ on-the-rise
Champ on-the-rise
I found the error (but got another one instead) The preinstalled custom-model-context.xml is of type sample not xml. I fixed this.
But if I run the web script now I get:

500 Description:   An error inside the HTTP server which prevented it from fulfilling the request.

Message:   Server error (04210091). Details can be found in the server logs.

attached my alfresco.log
   
Exception:   java.lang.RuntimeException - Server error (04210091). Details can be found in the server logs.

By the way, I created a new rule that for all incoming or newly created files in a folder the doc type should be changed? But the rule works only if I upload a new document and not when I create an new document (using "Create") in this folder.

Actually I also needs to add custom properties to folders, is this also possible and how?

rjohnson
Star Contributor
Star Contributor
There are a few errors in your log.

From the top:-

You need to set up your outbound email currently it is set to smtp.example.com which is obviously wrong. To do this, go to alfresco-global.properties in tomcat/shared/classes Something like

# Outbound SMTP properties
# use these properties to configure the out-bound SMTP server.
mail.host=your.mail.server
mail.port=25
# if it needs login uncomment
# mail.username=uname
# mail.password=pwd
mail.encoding=UTF-8
mail.from.default=yourdefault@yourserver.com
mail.protocol=smtp
# Additional Java Mail properties for SMTP protocol
# if it needs login make this true
mail.smtp.auth=false
mail.smtp.debug=false
mail.smtp.timeout=30000
mail.smtp.starttls.enable=false
# Additional Java Mail properties for SMTPS protocol
mail.smtps.auth=false
mail.smtps.starttls.enable=false

That is not your primary problem. Having fixed your namespace problem you are simply trying to create a document with the same name as another document that already exists in the folder you are trying to create your document in.

The Java errors are long and dump the error at every level they can. You have looked at the last entry which is the lowest level, you should start at the beginning of the error and read down. The start of your last error (and you look like you have had a few goes) is actually

15:02:55,507 ERROR [org.alfresco.repo.web.scripts.RepositoryContainer] [http-apr-8080-exec-6] Server error (04210091)
org.springframework.extensions.webscripts.WebScriptException: 04210008 Wrapped Exception (with status template): 04210090 Failed to execute script 'classpath*:alfresco/extension/templates/webscripts/modeltest.get.js': Duplicate child name not allowed: {documentName}

Clearly defining your problem as trying to create a document with the same name as another document in the same folder.

You code

var contentType = "my:whitepaper";
var documentName = url.templateArgs.documentName;

var document = companyhome.createNode(documentName, contentType);

Will create a document when you call this webscript with the document name from the usr, but your error above is showing you are not substituting the document name you want for the parameter.


thk
Champ on-the-rise
Champ on-the-rise
thanks Bob, I understand now