cancel
Showing results for 
Search instead for 
Did you mean: 

Problem with TestModel

guiyan17
Champ in-the-making
Champ in-the-making
Hello everybody,

I've got a little problem when I try to use the TestModel class to test my custom model.

I used the following command :
java -cp ".;C:\Alfresco\tomcat\webapps\alfresco\WEB-INF\lib\commons-logging.jar;C:\Alfresco\tomcat\webapps\alfresco\WEB-INF\lib\core.jar;C:\Alfresco\tomcat\webapps\alfresco\WEB-INF\lib\repository.jar;C:\Alfresco\tomcat\webapps\alfresco\WEB-INF\lib\jibx-bind.jar;C:\Alfresco\tomcat\webapps\alfresco\WEB-INF\lib\jibx-run.jar;C:\Alfresco\tomcat\webapps\alfresco\WEB-INF\classes" org.alfresco.repo.dictionary.TestModel alfresco/extension/customModel.xml

But I receive the following error :
Exception in thread "main" java.lang.NoClassDefFoundError :  org.alfresco.repo.dictionary.TestModel

Is anybody know why it can't find my TestModel class?

Thank you very much.

Yannick
6 REPLIES 6

guiyan17
Champ in-the-making
Champ in-the-making
Well  finally find the solution… The problem was because I used the bad path to Alfresco (yes, stupid mistache  :roll:  )

Then one or two errors appears because of missed .jar, but I finnaly used the following command from /tomcat/shared/classes.

java -cp ".;C:\Program Files\Alfresco ECMS Community Network\tomcat\webapps\alfresco\WEB-INF\lib\*;C:\Program Files\Alfresco ECMS Community Network\tomcat\webapps\alfresco\WEB-INF\classes" org.alfresco.repo.dictionary.TestModel

I hope it will help!!

Yannick

stevegreenbaum
Champ in-the-making
Champ in-the-making
I am using v3.2 and the following code. but it returns the following message:

"07240000 Could not find bootstrap model alfresco/model/dictionaryModel.xml"

I tried using the quotes for the path like in the example above, but it didn't help.  Perhaps something changed with v3.2.  Any suggestions for getting this to work?  Does the CLASSPATH need to be set for this to work?

Thanks

CSmiley Embarassedjava -cp .;c:\alfresco\tomcat\webapps\alfresco\web-inf\*;c:\alfresco\tomcat\webapps\alfresco\web-inf\lib\*;c:alfresco\tomcat\webapps\alfresco\web-inf\classes\*  org.alfresco.repo.dictionary.TestModel alfresco/tomcat/shared/classes/alfresco/extension/newModel.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/tomcat/shared/classes/alfresco/extension/newModel.xml

Found an invalid model…
07240000 Could not find bootstrap model alfresco/model/dictionaryModel.xml

jerrycooper
Champ in-the-making
Champ in-the-making
I'm using Alfresco Community Edition 3.3 and I had problems to run org.alfresco.repo.dictionary.TestModel with out-of-the-box model exampleModel.xml.
Output was: 08230000 Could not find bootstrap model alfresco/extension/exampleModel.xml.

Problem was in paths, answer is on this forum: http://forums.alfresco.com/en/viewtopic.php?f=5&t=11043&start=0&hilit=org.alfresco.repo.dictionary.T....
So functional commands with standard instalation paths are:
in win:
java -cp ".;C:\Alfresco\tomcat\webapps\alfresco\WEB-INF\lib\*;C:\Alfresco\tomcat\webapps\alfresco\WEB-INF\classes;C:\Alfresco\tomcat\shared\classes" org.alfresco.repo.dictionary.TestModel alfresco/extension/exampleModel.xml
in Linux:
java -cp ".:/opt/Alfresco/tomcat/webapps/alfresco/WEB-INF/lib/*:/opt/Alfresco/tomcat/webapps/alfresco/WEB-INF/classes:/opt/Alfresco/tomcat/shared/classes" org.alfresco.repo.dictionary.TestModel alfresco/extension/exampleModel.xml

jara

sharifu
Confirmed Champ
Confirmed Champ
i am on linux just installed 4.0d and i get the following


[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.

any suggestions

alex_chew
Champ in-the-making
Champ in-the-making
Hi,

I also failed to verify my customized model with TestModel. I do hate the very long classpath argument. I came over by writing my own unit tests and I ran from Eclipse. It seems TestModel is not friendly to those users who don't have java programming background.

We can verify web scripts, both Alfresco ones and Share ones, by simply surfing to below URLs,
Alfresco web scripts:http://localhost:8390/alfresco/service/index
Share web scripts:http://localhost:8390/share/service/index

We do want to have another URL to list all registered models. It maybe something like http://localhost:8390/alfresco/model/index.
Is there have such kind of add-ons? That will be more helpful.

Regards,
Alex

sharifu
Confirmed Champ
Confirmed Champ
I get the following when i try to browse


The Web Script /share/page/index/family/admin-console has responded with a status of 500 - .

500 Description:   

Message:   04170000 Authorization 'NTLM' not supported.
   
Exception:   org.springframework.extensions.webscripts.WebScriptException - 04170000 Authorization 'NTLM' not supported.
   
   org.springframework.extensions.webscripts.BasicHttpAuthenticatorFactory$BasicHttpAuthenticator.authenticate(BasicHttpAuthenticatorFactory.java:146)
   org.springframework.extensions.webscripts.PresentationContainer.executeScript(PresentationContainer.java:67)
   org.springframework.extensions.webscripts.LocalWebScriptRuntimeContainer.executeScript(LocalWebScriptRuntimeContainer.java:231)
   org.springframework.extensions.webscripts.AbstractRuntime.executeScript(AbstractRuntime.java:333)
   org.springframework.extensions.webscripts.AbstractRuntime.executeScript(AbstractRuntime.java:189)
   org.springframework.extensions.webscripts.servlet.mvc.WebScriptView.renderMergedOutputModel(WebScriptView.java:99)
   org.springframework.web.servlet.view.AbstractView.render(AbstractView.java:250)
   org.springframework.web.servlet.DispatcherServlet.render(DispatcherServlet.java:1060)
   org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:798)
   org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:716)
   org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:647)
   org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:552)
   javax.servlet.http.HttpServlet.service(HttpServlet.java:617)
   javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
   org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
   org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
   org.alfresco.web.site.servlet.MTAuthenticationFilter.doFilter(MTAuthenticationFilter.java:74)
   org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
   org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
   org.alfresco.web.site.servlet.SSOAuthenticationFilter.processType3(SSOAuthenticationFilter.java:879)
   org.alfresco.web.site.servlet.SSOAuthenticationFilter.doFilter(SSOAuthenticationFilter.java:495)
   org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
   org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
   org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
   org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
   org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
   org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
   org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
   org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)
   org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:852)
   org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588)
   org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
   java.lang.Thread.run(Thread.java:619)
   
Server:   Spring WebScripts - v1.0.0 (Release Candidate 2 744) schema 1,000
Time:   17-May-2012 10:11:18
   
Diagnostics:   Inspect Web Script (org/springframework/extensions/webscripts/indexfamily.get)