AnsweredAssumed Answered

setting mandatory aspect property throws exception

Question asked by smiconrad on Nov 4, 2006
Latest reply on Nov 7, 2006 by davidc
I'm seeing some strange behavior when creating a new aspect:


<aspect name="xx:aspectname">
  <title>Aspect Title</title>
  <properties>
      <property name="xx:weirdprop">
          <title>Why aren't you working man</title>
          <type>d:text</type>
          <index enabled="true">
              <atomic>true</atomic>
              <stored>true</stored>
              <tokenised>true</tokenised>
          </index>
          <mandatory>true</mandatory>
          <constraints>
              <constraint ref="xx:myConstraint" />
          </constraints>
      </property
  </properties>
</aspect>

Check out where the mandatory element is defined. This throws an exception. Moving the mandatory element above the index element works. The exception follows:

…     at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:442)
        at org.apache.catalina.core.StandardService.start(StandardService.java:450)
        at org.apache.catalina.core.StandardServer.start(StandardServer.java:680)
        at org.apache.catalina.startup.Catalina.start(Catalina.java:536)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:585)
        at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:275)
        at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)
Caused by: org.alfresco.service.cmr.dictionary.DictionaryException: Failed to parse model
        at org.alfresco.repo.dictionary.M2Model.createModel(M2Model.java:91)
        at org.alfresco.repo.dictionary.DictionaryBootstrap.bootstrap(DictionaryBootstrap.java:98)
        … 39 more
Caused by: org.jibx.runtime.JiBXException: Expected "{http://www.alfresco.org/model/dictionary/1.0}property" end tag, fo
und "{http://www.alfresco.org/model/dictionary/1.0}mandatory" end tag (line 199, col 33)
        at org.jibx.runtime.impl.UnmarshallingContext.throwEndTagNameError(UnmarshallingContext.java:302)
        at org.jibx.runtime.impl.UnmarshallingContext.parsePastEndTag(UnmarshallingContext.java:808)
        at org.alfresco.repo.dictionary.JiBX_repository_source_java_org_alfresco_repo_dictionary_m2bindingM2Property_acc
ess.unmarshal()
        at org.alfresco.repo.dictionary.JiBX_MungeAdapter.JiBX_repository_source_java_org_alfresco_repo_dictionary_m2bin
ding_unmarshal_1_10()
        at org.alfresco.repo.dictionary.M2Class.JiBX_repository_source_java_org_alfresco_repo_dictionary_m2binding_unmar
shal_1_0(M2Class.java)
        at org.alfresco.repo.dictionary.M2Aspect.JiBX_repository_source_java_org_alfresco_repo_dictionary_m2binding_unma
rshal_2_0(M2Aspect.java)
        at org.alfresco.repo.dictionary.JiBX_repository_source_java_org_alfresco_repo_dictionary_m2bindingM2Aspect_acces
s.unmarshal()
        at org.alfresco.repo.dictionary.JiBX_MungeAdapter.JiBX_repository_source_java_org_alfresco_repo_dictionary_m2bin
ding_unmarshal_1_5()
        at org.alfresco.repo.dictionary.M2Model.JiBX_repository_source_java_org_alfresco_repo_dictionary_m2binding_unmar
shal_1_0(M2Model.java)
        at org.alfresco.repo.dictionary.JiBX_repository_source_java_org_alfresco_repo_dictionary_m2bindingM2Model_access
.unmarshal()
        at org.jibx.runtime.impl.UnmarshallingContext.unmarshalElement(UnmarshallingContext.java:2515)
        at org.jibx.runtime.impl.UnmarshallingContext.unmarshalDocument(UnmarshallingContext.java:2675)
        at org.alfresco.repo.dictionary.M2Model.createModel(M2Model.java:86)
        … 40 more


Any idea why?

Thanks.
conrad

Outcomes