cancel
Showing results for 
Search instead for 
Did you mean: 

TestModel.java

markthompson23
Champ in-the-making
Champ in-the-making
I cannot get the TestModel.java app to validate the models.  I have made no changes to the existing code nor I have added new models.  Here is the output from the console:

Testing dictionary model definitions…
alfresco/model/dictionaryModel.xml
alfresco/model/systemModel.xml
alfresco/model/contentModel.xml
alfresco/model/applicationModel.xml
Found an invalid model…
Could not find bootstrap model alfresco/model/dictionaryModel.xml

The source is in the exact directory structure as it existed in the zip file.  I'm using 1.1.

I'm sure this is a simple thing to fix but I have not been able to get around it.  I'd appreciate any input.
6 REPLIES 6

drbaz
Champ in-the-making
Champ in-the-making
I get the same error …

davidc
Star Contributor
Star Contributor
The model files are searched for within the classpath.  Can you check that the config directory containing them is added to your classpath.  The four models listed are found in:

/projects/repository/config/alfresco/model

rbramley
Champ in-the-making
Champ in-the-making
The Alfresco data dictionary guide has a section on Testing the model definition.
http://www.alfresco.org/mediawiki/index.php/Data_Dictionary_Guide#Step_5:_Testing_the_Model_definiti...

You will need the following jar files on your classpath:

    * projects/repository/build/dist/repository.jar
    * projects/core/build/dist/core.jar
    * projects/3rd-party/lib/jibx/jibx-run.jar
    * projects/3rd-party/lib/xpp3.jar
    * projects/3rd-party/lib/commons/commons-logging.jar

and add . for good measure!

Then from within alfresco-src-1.1.0\projects\repository\config
run:

java -cp [as above] org.alfresco.repo.dictionary.TestModel alfresco/extension/customModel.xml

markthompson23
Champ in-the-making
Champ in-the-making
It is working now.

The following was already in the repository project's .classpath:

<classpathentry kind="src" path="config"/>

I added:

* projects/repository/build/dist/repository.jar
* projects/3rd-party/lib/jibx/jibx-run.jar
* projects/3rd-party/lib/xpp3.jar
* projects/3rd-party/lib/commons/commons-logging.jar
* projects/core/build/dist/core.jar

to the project's classpath and it is working now.  How did you know to add those jars RBramley?  They are not mentioned in the wiki link.

I'm still not sure why it couldn't find the files to begin with since the config directory was on the classpath. 

At any rate, thanks for the help.  I was a little embarassed to have to ask but now that I see what fixed it, I'm not sure I would have ever known to add those files.

rbramley
Champ in-the-making
Champ in-the-making
Glad I could help.

I found out the hard way by resolving ClassNotFoundException(s)! :wink:
So I ended up creating a validateModel batch file…

markthompson23
Champ in-the-making
Champ in-the-making
I ended up scrapping my Eclipse workspace and started from scratch re-importing the projects.  I decided to add each jar listed above one by one to see if there was one in particular that mattered.

After adding the core.jar, it worked (without any of the others).  As a matter of fact, I removed the core.jar also and it continues to work.

Not sure why but I thought I would pass it on.
Getting started

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.