11-17-2011 04:33 PM
11-20-2011 09:09 AM
java -cp "`find . -name \*.jar | tr "\n" ":"`:../../../../shared/classes/:../classes" org.alfresco.repo.dictionary.TestModel "alfresco/extension/models/yourCustomContentModelFile.xml"
Notice that you have to set the classpath resource of your custom model. 05-11-2012 10:17 AM
[root@alfrescotest bin]# pwd
/opt/alfresco-4.0.d/java/jre/bin
[root@alfrescotest bin]# ./java -cp "`find . -name \*.jar | tr "\n" ":"`:../../../../shared/classes/:../classes" org.alfresco.repo.dictionary.TestModel "alfresco/extension/models/SpectrumModel.xml"
Exception in thread "main" java.lang.NoClassDefFoundError: org/alfresco/repo/dictionary/TestModel
Caused by: java.lang.ClassNotFoundException: org.alfresco.repo.dictionary.TestModel
at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
Could not find the main class: org.alfresco.repo.dictionary.TestModel. Program will exit.
[root@alfrescotest bin]# ./java -cp ".;/opt/alfresco-4.0.d/tomcat/webapps/alfresco/WEB-INF/lib/*;/opt/alfresco-4.0.d/tomcat/webapps/alfresco/WEB-INF/classes/" org.alfresco.repo.dictionary.TestModel alfresco/extension/exampleModel.xml
Exception in thread "main" java.lang.NoClassDefFoundError: org/alfresco/repo/dictionary/TestModel
Caused by: java.lang.ClassNotFoundException: org.alfresco.repo.dictionary.TestModel
at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
Could not find the main class: org.alfresco.repo.dictionary.TestModel. Program will exit.
[root@alfrescotest bin]#
05-11-2012 10:26 AM
[root@alfrescotest lib]# pwd
/opt/alfresco-4.0.d/tomcat/webapps/alfresco/WEB-INF/lib
[root@alfrescotest lib]#
[root@alfrescotest lib]#
[root@alfrescotest lib]#
[root@alfrescotest lib]# ../../../../../java/jre/bin/java -cp "`find . -name \*.jar | tr "\n" ":"`:../../../../shared/classes/:../classes" org.alfresco.repo.dictionary.TestModel "alfresco/extension/models/SpectrumModel.xml"
Testing dictionary model definitions…
alfresco/model/dictionaryModel.xml
alfresco/model/systemModel.xml
org/alfresco/repo/security/authentication/userModel.xml
alfresco/model/contentModel.xml
alfresco/model/wcmModel.xml
alfresco/model/applicationModel.xml
alfresco/model/bpmModel.xml
alfresco/model/wcmAppModel.xml
alfresco/extension/models/SpectrumModel.xml
Found an invalid model…
04110000 Could not find bootstrap model alfresco/extension/models/SpectrumModel.xml
Tags
Find what you came for
We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.