将自定义模型添加到Alfresco未按预期工作,日志中出现错误

将自定义模型添加到Alfresco未按预期工作,日志中出现错误,alfresco,Alfresco,因此,我多次尝试遵循alfresco示例,但似乎无法将自定义模型添加到我的alfresco实例中。在example-model-context.xml中,我尝试指定exampleModel.xml路径,如示例“alfresco/extension/exampleModel.xml”中所示,并将其作为我的机器上的完整路径“/home/james/jboss-4.2.2.GA/server/default/conf/alfresco/extension/exampleModel.xml”。我正竭尽全

因此,我多次尝试遵循alfresco示例,但似乎无法将自定义模型添加到我的alfresco实例中。在example-model-context.xml中,我尝试指定exampleModel.xml路径,如示例“alfresco/extension/exampleModel.xml”中所示,并将其作为我的机器上的完整路径“/home/james/jboss-4.2.2.GA/server/default/conf/alfresco/extension/exampleModel.xml”。我正竭尽全力想让它发挥作用,因为我几年前就这么做了。我基本上是将example-model-context.xml.sample和exampleModel.xml.sample复制到我的“/home/james/jboss-4.2.2.GA/server/default/conf/alfresco/extension”目录中,然后尝试重新启动alfresco。下面是我的日志,它表明它找不到exampleModel.xml,但我看不出为什么路径不正确

日志中有趣的部分:

cat alfresco.log | grep example
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'extension.dictionaryBootstrap' defined in file [/home/james/jboss-4.2.2.GA/server/default/conf/alfresco/extension/example-model-context.xml]: Invocation of init method failed; nested exception is org.alfresco.service.cmr.dictionary.DictionaryException: 06060000 Could not find bootstrap model /home/james/jboss-4.2.2.GA/server/default/conf/alfresco/extension/exampleModel.xml
Caused by: org.alfresco.service.cmr.dictionary.DictionaryException: 06060000 Could not find bootstrap model /home/james/jboss-4.2.2.GA/server/default/conf/alfresco/extension/exampleModel.xml
完整日志:

16:55:06,966 INFO  [org.alfresco.config.JndiPropertiesFactoryBean] Loading properties file from class path resource [alfresco/repository.properties]
16:55:06,968 INFO  [org.alfresco.config.JndiPropertiesFactoryBean] Loading properties file from class path resource [alfresco/domain/transaction.properties]
16:55:06,969 INFO  [org.alfresco.config.JndiPropertiesFactoryBean] Loading properties file from file [/home/james/jboss-4.2.2.GA/server/default/tmp/deploy/tmp4976126406029600389alfresco-exp.war/WEB-INF/classes/alfresco/module/test/alfresco-global.properties]
16:55:06,969 INFO  [org.alfresco.config.JndiPropertiesFactoryBean] Loading properties file from file [/home/james/jboss-4.2.2.GA/server/default/tmp/deploy/tmp4976126406029600389alfresco-exp.war/WEB-INF/classes/alfresco/module/tests/alfresco-global.properties]
16:55:06,969 INFO  [org.alfresco.config.JndiPropertiesFactoryBean] Loading properties file from URL [file:/home/james/jboss-4.2.2.GA/server/default/conf/alfresco-global.properties]
16:55:07,094 INFO  [org.alfresco.config.JndiPropertyPlaceholderConfigurer] Loading properties file from class path resource [alfresco/alfresco-shared.properties]
16:55:07,301 INFO  [org.alfresco.config.FixedPropertyPlaceholderConfigurer] Loading properties file from class path resource [alfresco/version.properties]
16:55:07,344 INFO  [org.alfresco.config.FixedPropertyPlaceholderConfigurer] Loading properties file from class path resource [alfresco/domain/cache-strategies.properties]
16:55:17,856 ERROR [org.springframework.web.context.ContextLoader] Context initialization failed
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'extension.dictionaryBootstrap' defined in file [/home/james/jboss-4.2.2.GA/server/default/conf/alfresco/extension/example-model-context.xml]: Invocation of init method failed; nested exception is org.alfresco.service.cmr.dictionary.DictionaryException: 06060000 Could not find bootstrap model /home/james/jboss-4.2.2.GA/server/default/conf/alfresco/extension/exampleModel.xml
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1401)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:512)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:450)
    at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:290)
    at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
    at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:287)
    at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:189)
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:557)
    at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:842)
    at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:416)
    at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:261)
    at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:192)
    at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:47)
    at org.alfresco.web.app.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:63)
    at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3856)
    at org.apache.catalina.core.StandardContext.start(StandardContext.java:4361)
    at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:790)
    at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:770)
    at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:553)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:616)
    at org.apache.tomcat.util.modeler.BaseModelMBean.invoke(BaseModelMBean.java:296)
    at org.jboss.mx.server.RawDynamicInvoker.invoke(RawDynamicInvoker.java:164)
    at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
    at org.apache.catalina.core.StandardContext.init(StandardContext.java:5312)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:616)
    at org.apache.tomcat.util.modeler.BaseModelMBean.invoke(BaseModelMBean.java:296)
    at org.jboss.mx.server.RawDynamicInvoker.invoke(RawDynamicInvoker.java:164)
    at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
    at org.jboss.web.tomcat.service.TomcatDeployer.performDeployInternal(TomcatDeployer.java:301)
    at org.jboss.web.tomcat.service.TomcatDeployer.performDeploy(TomcatDeployer.java:104)
    at org.jboss.web.AbstractWebDeployer.start(AbstractWebDeployer.java:375)
    at org.jboss.web.WebModule.startModule(WebModule.java:83)
    at org.jboss.web.WebModule.startService(WebModule.java:61)
    at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanSupport.java:289)
    at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSupport.java:245)
    at sun.reflect.GeneratedMethodAccessor3.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:616)
    at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
    at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
    at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
    at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
    at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
    at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:978)
    at $Proxy0.start(Unknown Source)
    at org.jboss.system.ServiceController.start(ServiceController.java:417)
    at sun.reflect.GeneratedMethodAccessor9.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:616)
    at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
    at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
    at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
    at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
    at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
    at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
    at $Proxy44.start(Unknown Source)
    at org.jboss.web.AbstractWebContainer.start(AbstractWebContainer.java:466)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:616)
    at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
    at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
    at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:133)
    at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
    at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:142)
    at org.jboss.mx.interceptor.DynamicInterceptor.invoke(DynamicInterceptor.java:97)
    at org.jboss.system.InterceptorServiceMBeanSupport.invokeNext(InterceptorServiceMBeanSupport.java:238)
    at org.jboss.wsf.container.jboss42.DeployerInterceptor.start(DeployerInterceptor.java:87)
    at org.jboss.deployment.SubDeployerInterceptorSupport$XMBeanInterceptor.start(SubDeployerInterceptorSupport.java:188)
    at org.jboss.deployment.SubDeployerInterceptor.invoke(SubDeployerInterceptor.java:95)
    at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
    at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
    at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
    at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
    at $Proxy45.start(Unknown Source)
    at org.jboss.deployment.MainDeployer.start(MainDeployer.java:1025)
    at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:819)
    at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:782)
    at sun.reflect.GeneratedMethodAccessor21.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:616)
    at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
    at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
    at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:133)
    at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
    at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:142)
    at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
    at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
    at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
    at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
    at $Proxy9.deploy(Unknown Source)
    at org.jboss.deployment.scanner.URLDeploymentScanner.deploy(URLDeploymentScanner.java:421)
    at org.jboss.deployment.scanner.URLDeploymentScanner.scan(URLDeploymentScanner.java:634)
    at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.doScan(AbstractDeploymentScanner.java:263)
    at org.jboss.deployment.scanner.AbstractDeploymentScanner.startService(AbstractDeploymentScanner.java:336)
    at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanSupport.java:289)
    at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSupport.java:245)
    at sun.reflect.GeneratedMethodAccessor3.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:616)
    at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
    at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
    at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
    at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
    at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
    at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:978)
    at $Proxy0.start(Unknown Source)
    at org.jboss.system.ServiceController.start(ServiceController.java:417)
    at sun.reflect.GeneratedMethodAccessor9.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:616)
    at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
    at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
    at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
    at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
    at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
    at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
    at $Proxy4.start(Unknown Source)
    at org.jboss.deployment.SARDeployer.start(SARDeployer.java:302)
    at org.jboss.deployment.MainDeployer.start(MainDeployer.java:1025)
    at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:819)
    at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:782)
    at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:766)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:616)
    at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
    at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
    at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:133)
    at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
    at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:142)
    at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
    at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
    at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
    at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
    at $Proxy5.deploy(Unknown Source)
    at org.jboss.system.server.ServerImpl.doStart(ServerImpl.java:482)
    at org.jboss.system.server.ServerImpl.start(ServerImpl.java:362)
    at org.jboss.Main.boot(Main.java:200)
    at org.jboss.Main$1.run(Main.java:508)
    at java.lang.Thread.run(Thread.java:636)
Caused by: org.alfresco.service.cmr.dictionary.DictionaryException: 06060000 Could not find bootstrap model /home/james/jboss-4.2.2.GA/server/default/conf/alfresco/extension/exampleModel.xml
    at org.alfresco.repo.dictionary.DictionaryBootstrap.onDictionaryInit(DictionaryBootstrap.java:143)
    at org.alfresco.repo.dictionary.DictionaryBootstrap.bootstrap(DictionaryBootstrap.java:105)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:616)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeCustomInitMethod(AbstractAutowireCapableBeanFactory.java:1529)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1468)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1398)
    ... 148 more
16:55:36,622 INFO  [org.springframework.extensions.webscripts.DeclarativeRegistry] Registered 264 Web Scripts (+0 failed), 274 URLs
16:55:36,623 INFO  [org.springframework.extensions.webscripts.DeclarativeRegistry] Registered 8 Package Description Documents (+0 failed) 
16:55:36,623 INFO  [org.springframework.extensions.webscripts.DeclarativeRegistry] Registered 0 Schema Description Documents (+0 failed) 
16:55:36,775 INFO  [org.springframework.extensions.webscripts.AbstractRuntimeContainer] Initialised Spring Surf Container Web Script Container (in 6646.76ms)
16:55:36,834 INFO  [org.springframework.extensions.webscripts.TemplateProcessorRegistry] Registered template processor freemarker for extension ftl
16:55:36,966 INFO  [org.springframework.extensions.webscripts.ScriptProcessorRegistry] Registered script processor javascript for extension js
16:55:37,207 INFO  [org.springframework.extensions.webscripts.TemplateProcessorRegistry] Registered template processor freemarker for extension ftl
16:55:37,219 INFO  [org.springframework.extensions.webscripts.ScriptProcessorRegistry] Registered script processor javascript for extension js
16:55:37,416 INFO  [org.springframework.extensions.webscripts.TemplateProcessorRegistry] Registered template processor freemarker for extension ftl
16:55:37,430 INFO  [org.springframework.extensions.webscripts.ScriptProcessorRegistry] Registered script processor javascript for extension js

通常alfresco/extension/exampleModel.xml就足够了。Alfresco不接受完整路径。它总是来自WEB-INF/classes目录。

我不完全确定是什么修复了它,但可能有几件事。这就是我所做的


我更改了引用exampleModel.xml的路径,输入时出错,当我认为这是我们上面讨论的内容时,可能是输入错误。所以我把它切换回上面提到的默认值。我还将行结尾字符从unix改为ms windows,因为我读到了alfresco更喜欢的地方。重新启动jboss,alfresco日志中没有错误。仍然没有在web UI中看到新模型。我发现有一个名为web-client-config-custom.xml.sample的文件。我从sample中更改了它的名称,并在其中取消了与exampleModel相关的部分的注释,然后重新启动了jboss。成功。

我也尝试过这条路,但运气不佳。我想我本可以发布该错误消息以避免混淆,但我也尝试过。好的,但你还是应该发布“that”错误日志,因为这样做是正确的。Alfresco不包括以.sample结尾的扩展文件,因为你发现在使用它之前需要将其重命名为.xml。是的,我知道很多:-)我不需要的是web-client-config-custom.xml文件,因为在我阅读的wikipage中没有提到它。我想这不是为了定义一个模型,而是为了能够在web UI中使用它。