2

我正在尝试通过以下链接通过 JCR API 和 SpringFramework 访问 Alfresco 存储库:http ://wiki.alfresco.com/wiki/Introducing_the_Alfresco_Java_Content_Repository_API 。

IDE:日食伽利略

System.out.println("Initialising Repository...");
    ApplicationContext context = new ClassPathXmlApplicationContext("classpath:alfresc/application-context.xml");
    //ApplicationContext context = ApplicationContextHelper.getApplicationContext(); 

    Repository repository = (Repository)context.getBean("JCR.Repository");

             // display information about the repository
     System.out.println("Repository Description...");
             String  [] keys = repository.getDescriptorKeys();
             for (String   key : keys)
             {
                 String   value = repository.getDescriptor(key);
                 System.out.println(" " + key + " = " + value);
         }

并得到这个例外:

 Initialising Repository...
Exception in thread "main" org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'propertyValueCache' defined in class path resource [alfresco/cache-context.xml]: Initialization of bean failed; nested exception is org.springframework.beans.TypeMismatchException: Failed to convert property value of type 'java.lang.String' to required type 'boolean' for property 'disableSharedCache'; nested exception is java.lang.IllegalArgumentException: Invalid boolean value [${system.cache.disableImmutableSharedCaches}]
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:527)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)
    at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:291)
    at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
    at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:288)
    at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:190)
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:580)
    at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:895)
    at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:425)
    at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:139)
    at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:83)
    at com.tcs.alfresco.WikiExample.main(WikiExample.java:20)
Caused by: org.springframework.beans.TypeMismatchException: Failed to convert property value of type 'java.lang.String' to required type 'boolean' for property 'disableSharedCache'; nested exception is java.lang.IllegalArgumentException: Invalid boolean value [${system.cache.disableImmutableSharedCaches}]
    at org.springframework.beans.BeanWrapperImpl.convertIfNecessary(BeanWrapperImpl.java:467)
    at org.springframework.beans.BeanWrapperImpl.convertForProperty(BeanWrapperImpl.java:499)
    at org.springframework.beans.BeanWrapperImpl.convertForProperty(BeanWrapperImpl.java:493)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.convertForProperty(AbstractAutowireCapableBeanFactory.java:1371)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1330)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1086)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:517)
    ... 11 more
Caused by: java.lang.IllegalArgumentException: Invalid boolean value [${system.cache.disableImmutableSharedCaches}]
    at org.springframework.beans.propertyeditors.CustomBooleanEditor.setAsText(CustomBooleanEditor.java:124)
    at org.springframework.beans.TypeConverterDelegate.doConvertTextValue(TypeConverterDelegate.java:416)
    at org.springframework.beans.TypeConverterDelegate.doConvertValue(TypeConverterDelegate.java:388)
    at org.springframework.beans.TypeConverterDelegate.convertIfNecessary(TypeConverterDelegate.java:157)
    at org.springframework.beans.BeanWrapperImpl.convertIfNecessary(BeanWrapperImpl.java:447)
    ... 17 more

我也尝试过露天 SDK。但得到同样的错误。 http://wiki.alfresco.com/wiki/Alfresco_SDK_4.0

我的露天副本是正确的,因为我能够通过 CMIS 连接到存储库。请帮忙。

谢谢瑞诗

4

0 回答 0