AnsweredAssumed Answered

Creation of new content model fails

Question asked by lemmy on Apr 8, 2011
Latest reply on Apr 19, 2011 by mrogers
Hi,

I've created new content model for booking request. I've stored it in file <tomcat>\shared\classes\alfresco\extension\exampleModel.xml


<?xml version="1.0" encoding="UTF-8"?>

<!– Definition of new Model –>

<!– The important part here is the name - Note: the use of the b: namespace
     which is defined further on in the document –>
<model name="b:bookingmodel" xmlns="http://www.alfresco.org/model/dictionary/1.0">

   <!– Optional meta-data about the model –>  
   <description>Booking Request model</description>
   <author>Lemmy</author>
   <version>1.0</version>

   <!– Imports are required to allow references to definitions in other models –>  
   <imports>
        <!– Import Alfresco Dictionary Definitions –>
      <import uri="http://www.alfresco.org/model/dictionary/1.0" prefix="d"/>
      <!– Import Alfresco Content Domain Model Definitions –>
      <import uri="http://www.alfresco.org/model/content/1.0" prefix="cm"/>
   </imports>

   <!– Introduction of new namespaces defined by this model –>
   <!– NOTE: The following namespace my.new.model should be changed to reflect your own namespace –>
   <namespaces>
      <namespace uri="booking.mysite.model" prefix="b"/>
   </namespaces>
  
   <types>
      <!– Definition of new Content Type: Booking Request –>
      <type name="b:BookingRequest">
         <title>Booking Request</title>
         <parent>cm:content</parent>
         <properties>
            <property name="b:holidayHomeName">
               <type>d:text</type>
            </property>
            <property name="b:name">
               <type>d:text</type>
            </property>   
            <property name="b:firstName">
               <type>d:text</type>
            </property>
            <property name="b:street">
               <type>d:text</type>
            </property>
            <property name="b:zip">
               <type>d:text</type>
            </property>
            <property name="b:city">
               <type>d:text</type>
            </property>
            <property name="b:mobile">
               <type>d:text</type>
            </property>
            <property name="b:email">
               <type>d:text</type>
            </property>
            <property name="b:startDate">
               <type>d:text</type>
            </property>
            <property name="b:endDate">
               <type>d:text</type>
            </property>
            <property name="b:comment">
               <type>d:text</type>
            </property>                        
         </properties>
      </type>
    </types>
</model>

TestModel states a valid model. Entering data on the corresponding form an hitting send-button runs into an exception:

21:03:25,649  ERROR [extensions.webscripts.AbstractRuntime] Exception from executeScript - redirecting to status template error: 03080001 Invalid typeId b:BookingRequest
org.springframework.extensions.webscripts.WebScriptException: 03080001 Invalid typeId b:BookingRequest
   at org.alfresco.repo.cmis.rest.CMISScript.queryType(CMISScript.java:532)
   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:597)
   at org.mozilla.javascript.MemberBox.invoke(MemberBox.java:155)
   at org.mozilla.javascript.NativeJavaMethod.call(NativeJavaMethod.java:243)
   at org.mozilla.javascript.optimizer.OptRuntime.call1(OptRuntime.java:66)
   at org.mozilla.javascript.gen.c5._c0(file:/C:/Alfresco34dsource/tomcat/webapps/alfresco/WEB-INF/classes/alfresco/templates/webscripts/org/alfresco/cmis/type.get.js:5)
   at org.mozilla.javascript.gen.c5.call(file:/C:/Alfresco34dsource/tomcat/webapps/alfresco/WEB-INF/classes/alfresco/templates/webscripts/org/alfresco/cmis/type.get.js)
   at org.mozilla.javascript.ContextFactory.doTopCall(ContextFactory.java:393)
   at org.mozilla.javascript.ScriptRuntime.doTopCall(ScriptRuntime.java:2834)
   at org.mozilla.javascript.gen.c5.call(file:/C:/Alfresco34dsource/tomcat/webapps/alfresco/WEB-INF/classes/alfresco/templates/webscripts/org/alfresco/cmis/type.get.js)
   at org.mozilla.javascript.gen.c5.exec(file:/C:/Alfresco34dsource/tomcat/webapps/alfresco/WEB-INF/classes/alfresco/templates/webscripts/org/alfresco/cmis/type.get.js)
   at org.alfresco.repo.jscript.RhinoScriptProcessor.executeScriptImpl(RhinoScriptProcessor.java:472)
   at org.alfresco.repo.jscript.RhinoScriptProcessor.execute(RhinoScriptProcessor.java:190)
   at org.alfresco.repo.processor.ScriptServiceImpl.executeScript(ScriptServiceImpl.java:282)
   at org.alfresco.repo.web.scripts.RepositoryScriptProcessor.executeScript(RepositoryScriptProcessor.java:102)
   at org.springframework.extensions.webscripts.AbstractWebScript.executeScript(AbstractWebScript.java:981)
   at org.springframework.extensions.webscripts.DeclarativeWebScript.execute(DeclarativeWebScript.java:86)
   at org.alfresco.repo.web.scripts.RepositoryContainer$2.execute(RepositoryContainer.java:377)
   at org.alfresco.repo.transaction.RetryingTransactionHelper.doInTransaction(RetryingTransactionHelper.java:381)
   at org.alfresco.repo.web.scripts.RepositoryContainer.transactionedExecute(RepositoryContainer.java:436)
   at org.alfresco.repo.web.scripts.RepositoryContainer.transactionedExecuteAs(RepositoryContainer.java:466)
   at org.alfresco.repo.web.scripts.RepositoryContainer.executeScript(RepositoryContainer.java:304)
   at org.springframework.extensions.webscripts.AbstractRuntime.executeScript(AbstractRuntime.java:333)
   at org.springframework.extensions.webscripts.AbstractRuntime.executeScript(AbstractRuntime.java:189)
   at org.springframework.extensions.webscripts.servlet.WebScriptServlet.service(WebScriptServlet.java:118)
   at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
   at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
   at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
   at org.alfresco.web.app.servlet.GlobalLocalizationFilter.doFilter(GlobalLocalizationFilter.java:58)
   at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
   at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
   at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
   at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
   at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
   at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
   at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
   at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)
   at org.apache.coyote.http11.Http11AprProcessor.process(Http11AprProcessor.java:859)
   at org.apache.coyote.http11.Http11AprProtocol$Http11ConnectionHandler.process(Http11AprProtocol.java:579)
   at org.apache.tomcat.util.net.AprEndpoint$Worker.run(AprEndpoint.java:1555)
   at java.lang.Thread.run(Thread.java:662)
Caused by: org.alfresco.cmis.CMISInvalidArgumentException: Invalid typeId b:BookingRequest
   at org.alfresco.cmis.mapping.CMISServicesImpl.getTypeDefinition(CMISServicesImpl.java:800)
   at org.alfresco.repo.cmis.rest.CMISScript.queryType(CMISScript.java:528)
   … 43 more
ERROR: org.springframework.extensions.webscripts.AbstractRuntime - Exception from executeScript - redirecting to status template error: 03080001 Failed to execute script 'org.springframework.extensions.webscripts.ResourceStore$WebApplicationStoreScriptContent@114545': 03080000 Bad Request
org.springframework.extensions.webscripts.WebScriptException: 03080001 Failed to execute script 'org.springframework.extensions.webscripts.ResourceStore$WebApplicationStoreScriptContent@114545': 03080000 Bad Request
   at org.springframework.extensions.webscripts.processor.JSScriptProcessor.executeScript(JSScriptProcessor.java:200)
   at org.springframework.extensions.webscripts.AbstractWebScript.executeScript(AbstractWebScript.java:981)
   at org.springframework.extensions.webscripts.DeclarativeWebScript.execute(DeclarativeWebScript.java:86)
   at org.springframework.extensions.webscripts.PresentationContainer.executeScript(PresentationContainer.java:69)
   at org.springframework.extensions.webscripts.LocalWebScriptRuntimeContainer.executeScript(LocalWebScriptRuntimeContainer.java:231)
   at org.springframework.extensions.webscripts.AbstractRuntime.executeScript(AbstractRuntime.java:333)
   at org.springframework.extensions.webscripts.AbstractRuntime.executeScript(AbstractRuntime.java:189)
   at org.springframework.extensions.webscripts.WebScriptProcessor.executeBody(WebScriptProcessor.java:284)
   at org.springframework.extensions.surf.render.AbstractProcessor.execute(AbstractProcessor.java:57)
   at org.springframework.extensions.surf.render.RenderService.processComponent(RenderService.java:264)
   at org.springframework.extensions.surf.render.RenderService.renderComponent(RenderService.java:581)
   at org.springframework.extensions.surf.render.RenderService.renderComponent(RenderService.java:630)
   at org.springframework.extensions.surf.render.RenderService.renderChromeInclude(RenderService.java:879)
   at org.springframework.extensions.webscripts.ChromeIncludeFreeMarkerDirective.execute(ChromeIncludeFreeMarkerDirective.java:71)
   at freemarker.core.Environment.visit(Environment.java:263)
   at freemarker.core.UnifiedCall.accept(UnifiedCall.java:126)
   at freemarker.core.Environment.visit(Environment.java:210)
   at freemarker.core.Environment.process(Environment.java:190)
   at org.springframework.extensions.webscripts.processor.FTLTemplateProcessor.process(FTLTemplateProcessor.java:171)
   at org.springframework.extensions.webscripts.WebTemplateProcessor.executeBody(WebTemplateProcessor.java:345)
   at org.springframework.extensions.surf.render.AbstractProcessor.execute(AbstractProcessor.java:57)
   at org.springframework.extensions.surf.render.RenderService.processRenderable(RenderService.java:186)
   at org.springframework.extensions.surf.render.bean.ChromeRenderer.body(ChromeRenderer.java:89)
   at org.springframework.extensions.surf.render.AbstractRenderer.render(AbstractRenderer.java:75)
   at org.springframework.extensions.surf.render.bean.ChromeRenderer.render(ChromeRenderer.java:80)
   at org.springframework.extensions.surf.render.bean.ComponentRenderer.body(ComponentRenderer.java:89)
   at org.springframework.extensions.surf.render.AbstractRenderer.render(AbstractRenderer.java:75)
   at org.springframework.extensions.surf.render.RenderService.renderComponent(RenderService.java:600)
   at org.springframework.extensions.surf.render.RenderService.renderRegionComponents(RenderService.java:539)
   at org.springframework.extensions.surf.render.bean.RegionRenderer.body(RegionRenderer.java:98)
   at org.springframework.extensions.surf.render.AbstractRenderer.render(AbstractRenderer.java:75)
   at org.springframework.extensions.surf.render.RenderService.renderRegion(RenderService.java:492)
   at org.springframework.extensions.webscripts.RegionFreemarkerTagDirective.execute(RegionFreemarkerTagDirective.java:75)
   at freemarker.core.Environment.visit(Environment.java:263)
   at freemarker.core.UnifiedCall.accept(UnifiedCall.java:126)
   at freemarker.core.Environment.visit(Environment.java:210)
   at freemarker.core.MixedContent.accept(MixedContent.java:92)
   at freemarker.core.Environment.visit(Environment.java:210)
   at freemarker.core.Environment.visit(Environment.java:395)
   at freemarker.core.BodyInstruction.accept(BodyInstruction.java:93)
   at freemarker.core.Environment.visit(Environment.java:210)
   at freemarker.core.MixedContent.accept(MixedContent.java:92)
   at freemarker.core.Environment.visit(Environment.java:210)
   at freemarker.core.Macro$Context.runMacro(Macro.java:172)
   at freemarker.core.Environment.visit(Environment.java:603)
   at freemarker.core.UnifiedCall.accept(UnifiedCall.java:106)
   at freemarker.core.Environment.visit(Environment.java:210)
   at freemarker.core.MixedContent.accept(MixedContent.java:92)
   at freemarker.core.Environment.visit(Environment.java:210)
   at freemarker.core.Environment.process(Environment.java:190)
   at org.springframework.extensions.webscripts.processor.FTLTemplateProcessor.process(FTLTemplateProcessor.java:171)
   at org.springframework.extensions.webscripts.WebTemplateProcessor.executeBody(WebTemplateProcessor.java:345)
   at org.springframework.extensions.surf.render.AbstractProcessor.execute(AbstractProcessor.java:57)
   at org.springframework.extensions.surf.render.RenderService.processTemplate(RenderService.java:378)
   at org.springframework.extensions.surf.render.bean.TemplateInstanceRenderer.body(TemplateInstanceRenderer.java:123)
   at org.springframework.extensions.surf.render.AbstractRenderer.render(AbstractRenderer.java:75)
   at org.springframework.extensions.surf.render.bean.PageRenderer.body(PageRenderer.java:85)
   at org.springframework.extensions.surf.render.AbstractRenderer.render(AbstractRenderer.java:75)
   at org.springframework.extensions.surf.render.RenderService.renderPage(RenderService.java:408)
   at org.springframework.extensions.surf.mvc.PageView.dispatchPage(PageView.java:388)
   at org.springframework.extensions.surf.mvc.PageView.renderView(PageView.java:329)
   at org.springframework.extensions.surf.mvc.AbstractWebFrameworkView.renderMergedOutputModel(AbstractWebFrameworkView.java:285)
   at org.springframework.web.servlet.view.AbstractView.render(AbstractView.java:250)
   at org.springframework.web.servlet.DispatcherServlet.render(DispatcherServlet.java:1060)
   at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:798)
   at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:716)
   at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:647)
   at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:563)
   at javax.servlet.http.HttpServlet.service(HttpServlet.java:637)
   at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
   at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
   at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
   at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:646)
   at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:436)
   at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:374)
   at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:302)
   at org.tuckey.web.filters.urlrewrite.NormalRewrittenUrl.doRewrite(NormalRewrittenUrl.java:213)
   at org.tuckey.web.filters.urlrewrite.RuleChain.handleRewrite(RuleChain.java:171)
   at org.tuckey.web.filters.urlrewrite.RuleChain.doRules(RuleChain.java:145)
   at org.tuckey.web.filters.urlrewrite.UrlRewriter.processRequest(UrlRewriter.java:92)
   at org.tuckey.web.filters.urlrewrite.UrlRewriteFilter.doFilter(UrlRewriteFilter.java:381)
   at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
   at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
   at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
   at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
   at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
   at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
   at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
   at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)
   at org.apache.coyote.http11.Http11AprProcessor.process(Http11AprProcessor.java:859)
   at org.apache.coyote.http11.Http11AprProtocol$Http11ConnectionHandler.process(Http11AprProtocol.java:579)
   at org.apache.tomcat.util.net.AprEndpoint$Worker.run(AprEndpoint.java:1555)
   at java.lang.Thread.run(Thread.java:662)
Caused by: org.springframework.extensions.webscripts.WebScriptException: 03080000 Bad Request
   at org.springframework.extensions.webscripts.processor.JSScriptProcessor.executeScriptImpl(JSScriptProcessor.java:324)
   at org.springframework.extensions.webscripts.processor.JSScriptProcessor.executeScript(JSScriptProcessor.java:192)
   … 92 more
Caused by: org.apache.chemistry.opencmis.commons.exceptions.CmisInvalidArgumentException: Bad Request
   at org.apache.chemistry.opencmis.client.bindings.spi.atompub.AbstractAtomPubService.convertStatusCode(AbstractAtomPubService.java:401)
   at org.apache.chemistry.opencmis.client.bindings.spi.atompub.AbstractAtomPubService.read(AbstractAtomPubService.java:483)
   at org.apache.chemistry.opencmis.client.bindings.spi.atompub.AbstractAtomPubService.getTypeDefinitionInternal(AbstractAtomPubService.java:739)
   at org.apache.chemistry.opencmis.client.bindings.spi.atompub.RepositoryServiceImpl.getTypeDefinition(RepositoryServiceImpl.java:104)
   at org.apache.chemistry.opencmis.client.bindings.impl.RepositoryServiceImpl.getTypeDefinition(RepositoryServiceImpl.java:137)
   at org.apache.chemistry.opencmis.client.runtime.PersistentSessionImpl.getTypeDefinition(PersistentSessionImpl.java:558)
   at org.apache.chemistry.opencmis.client.runtime.repository.PersistentObjectFactoryImpl.convertProperties(PersistentObjectFactoryImpl.java:392)
   at org.apache.chemistry.opencmis.client.runtime.PersistentSessionImpl.createDocument(PersistentSessionImpl.java:729)
   at de.landhausanders.wcm.client.impl.BookingServiceImpl.postBookingRequest(BookingServiceImpl.java:132)
   at de.landhausanders.wcm.client.impl.BookingServiceImpl.postBookingRequest(BookingServiceImpl.java:149)
   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:597)
   at org.mozilla.javascript.MemberBox.invoke(MemberBox.java:155)
   at org.mozilla.javascript.NativeJavaMethod.call(NativeJavaMethod.java:243)
   at org.mozilla.javascript.optimizer.OptRuntime.callN(OptRuntime.java:86)
   at org.mozilla.javascript.gen.c5._c0(/WEB-INF/webscripts/booking/form.post.js:132)
   at org.mozilla.javascript.gen.c5.call(/WEB-INF/webscripts/booking/form.post.js)
   at org.mozilla.javascript.ContextFactory.doTopCall(ContextFactory.java:393)
   at org.mozilla.javascript.ScriptRuntime.doTopCall(ScriptRuntime.java:2834)
   at org.mozilla.javascript.gen.c5.call(/WEB-INF/webscripts/booking/form.post.js)
   at org.mozilla.javascript.gen.c5.exec(/WEB-INF/webscripts/booking/form.post.js)
   at org.springframework.extensions.webscripts.processor.JSScriptProcessor.executeScriptImpl(JSScriptProcessor.java:318)
   … 93 more

There are no related errors during server startup. Any help appreciated.

Thanks,
Stefan

Outcomes