2010-04-13 38 views
1

我正在學習Alfresco,特別是它的內容存儲庫Java API。Alfresco內容存儲庫API的副作用?

我想用SDK「First Foundation Client」中的例子進行培訓。

我把代碼,我設法處理它有點,但是當我重新啓動我的露天服務器我變得醜陋堆棧跟蹤像

ERROR [web.context.ContextLoader] Context initialization failed 
org.alfresco.error.AlfrescoRuntimeException: 03130001 Failed to initialise org.alfresco.enterprise.license.LicenseComponent 
    at org.alfresco.repo.descriptor.DescriptorServiceImpl.constructSpecialService(DescriptorServiceImpl.java:301) 
    at org.alfresco.repo.descriptor.DescriptorServiceImpl.access$100(DescriptorServiceImpl.java:51) 
    at org.alfresco.repo.descriptor.DescriptorServiceImpl$1$1.execute(DescriptorServiceImpl.java:181) 
    at org.alfresco.repo.descriptor.DescriptorServiceImpl$1$1.execute(DescriptorServiceImpl.java:179) 
    at org.alfresco.repo.transaction.RetryingTransactionHelper.doInTransaction(RetryingTransactionHelper.java:327) 
    at org.alfresco.repo.descriptor.DescriptorServiceImpl$1.doWork(DescriptorServiceImpl.java:175) 
    at org.alfresco.repo.security.authentication.AuthenticationUtil.runAs(AuthenticationUtil.java:514) 
    at org.alfresco.repo.descriptor.DescriptorServiceImpl.onBootstrap(DescriptorServiceImpl.java:168) 
    at org.alfresco.util.AbstractLifecycleBean.onApplicationEvent(AbstractLifecycleBean.java:62) 
    at org.springframework.context.event.SimpleApplicationEventMulticaster$1.run(SimpleApplicationEventMulticaster.java:77) 
    at org.springframework.core.task.SyncTaskExecutor.execute(SyncTaskExecutor.java:49) 
    at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:75) 
    at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:246) 
    at org.springframework.context.support.AbstractApplicationContext.finishRefresh(AbstractApplicationContext.java:617) 
    at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:355) 
    at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:246) 
    at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:189) 
    at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:49) 
    at org.alfresco.web.app.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:69) 
    at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3843) 
    at org.apache.catalina.core.StandardContext.start(StandardContext.java:4342) 
    at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:791) 
    at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:771) 
    at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:525) 
    at org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:627) 
    at org.apache.catalina.startup.HostConfig.deployDescriptors(HostConfig.java:553) 
    at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:488) 
    at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1149) 
    at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:311) 
    at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117) 
    at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1053) 
    at org.apache.catalina.core.StandardHost.start(StandardHost.java:719) 
    at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045) 
    at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443) 
    at org.apache.catalina.core.StandardService.start(StandardService.java:516) 
    at org.apache.catalina.core.StandardServer.start(StandardServer.java:710) 
    at org.apache.catalina.startup.Catalina.start(Catalina.java:578) 
    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.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288) 
    at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413) 
Caused by: java.lang.reflect.InvocationTargetException 
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) 
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39) 
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27) 
    at java.lang.reflect.Constructor.newInstance(Constructor.java:513) 
    at org.alfresco.repo.descriptor.DescriptorServiceImpl.constructSpecialService(DescriptorServiceImpl.java:286) 
    ... 42 more 
Caused by: java.lang.NullPointerException 
    at org.alfresco.repo.domain.NodePropertyValue.getValue(NodePropertyValue.java:986) 
    at org.alfresco.repo.node.db.hibernate.HibernateNodeDaoServiceImpl.makeSerializableValue(HibernateNodeDaoServiceImpl.java:5371) 
    at org.alfresco.repo.node.db.hibernate.HibernateNodeDaoServiceImpl.collapsePropertiesWithSameQNameAndListIndex(HibernateNodeDaoServiceImpl.java:5313) 
    at org.alfresco.repo.node.db.hibernate.HibernateNodeDaoServiceImpl.convertToPublicProperties(HibernateNodeDaoServiceImpl.java:5155) 
    at org.alfresco.repo.node.db.hibernate.HibernateNodeDaoServiceImpl.getNodeProperties(HibernateNodeDaoServiceImpl.java:1424) 
    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.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:304) 
    at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182) 
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149) 
    at org.alfresco.repo.transaction.TransactionalDaoInterceptor.invoke(TransactionalDaoInterceptor.java:68) 
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171) 
    at org.alfresco.repo.domain.hibernate.DirtySessionMethodInterceptor.invoke(DirtySessionMethodInterceptor.java:419) 
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171) 
    at org.alfresco.repo.transaction.SingleEntryTransactionResourceInterceptor.invokeInternal(SingleEntryTransactionResourceInterceptor.java:163) 
    at org.alfresco.repo.transaction.SingleEntryTransactionResourceInterceptor.invoke(SingleEntryTransactionResourceInterceptor.java:138) 
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171) 
    at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204) 
    at $Proxy9.getNodeProperties(Unknown Source) 
    at org.alfresco.repo.node.db.DbNodeServiceImpl.getPropertiesImpl(DbNodeServiceImpl.java:1292) 
    at org.alfresco.repo.node.db.DbNodeServiceImpl.getProperties(DbNodeServiceImpl.java:1283) 
    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.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:304) 
    at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182) 
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149) 
    at org.alfresco.repo.tenant.MultiTNodeServiceInterceptor.invoke(MultiTNodeServiceInterceptor.java:110) 
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171) 
    at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204) 
    at $Proxy11.getProperties(Unknown Source) 
    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.alfresco.repo.service.StoreRedirectorProxyFactory$RedirectorInvocationHandler.invoke(StoreRedirectorProxyFactory.java:221) 
    at $Proxy12.getProperties(Unknown Source) 
    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.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:304) 
    at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182) 
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149) 
    at org.alfresco.repo.node.MLPropertyInterceptor.invoke(MLPropertyInterceptor.java:179) 
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171) 
    at org.alfresco.repo.node.MLPropertyInterceptor.invoke(MLPropertyInterceptor.java:179) 
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171) 
    at org.alfresco.repo.node.NodeRefPropertyMethodInterceptor.invoke(NodeRefPropertyMethodInterceptor.java:218) 
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171) 
    at org.alfresco.repo.node.NodeRefPropertyMethodInterceptor.invoke(NodeRefPropertyMethodInterceptor.java:218) 
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171) 
    at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204) 
    at $Proxy11.getProperties(Unknown Source) 
    at org.alfresco.repo.descriptor.RepositoryDescriptorDAOImpl.getDescriptor(RepositoryDescriptorDAOImpl.java:178) 
    at org.alfresco.enterprise.license.LicenseComponent.<init>(LicenseComponent.java:99) 
    ... 47 more 

我精確,以至於當我離開露天我不明白這個問題並重新啓動它,只要我在服務器停止時不運行我的代碼。 !

這是一個已知的問題?谷歌是不是很健談(可能是我不能讓他談談)......

Ubuntu 9.10的業報考拉

工作,我有一個官方的JDK jdk1.6.0_14

露天3.2R企業服務器

EDIT reason='add'

露天社區-SDK-3.3的SDK

我跑其它測試(以及結果不漂亮): - 原始示例運行良好,但我崩潰的服務器 - 運行「達蓋爾調查「我刪除了所有的線找出失效是由

ApplicationContextHelper.getApplicationContext(); 

哪一個是API使用的骨幹暗示...

如果任何人有任何的想法...

+0

您可能會發現更容易使用CMIS連接到存儲庫來存儲和檢索你的文件。請參閱http://wiki.alfresco.com/wiki/CMIS瞭解CMIS是什麼以及如何開始。 – Gagravarr 2011-04-19 20:14:08

回答

0

加入你的代碼到底你做一個System.exit(0);

這是我從企業SDK示例獲得:

public static void main(String[] args) 
    { 
     // initialise app content 
     ApplicationContext ctx = ApplicationContextHelper.getApplicationContext(); 
     // get registry of services 
     final ServiceRegistry serviceRegistry = (ServiceRegistry) ctx.getBean(ServiceRegistry.SERVICE_REGISTRY); 

     // use TransactionWork to wrap service calls in a user transaction 
     TransactionService transactionService = serviceRegistry.getTransactionService(); 
     RetryingTransactionCallback<Object> exampleWork = new RetryingTransactionCallback<Object>() 
     { 
      public Object execute() throws Exception 
      { 
       doExample(serviceRegistry); 
       return null; 
      } 
     }; 
     transactionService.getRetryingTransactionHelper().doInTransaction(exampleWork); 
     System.exit(0); 
    }