cancel
Showing results for 
Search instead for 
Did you mean: 

Export: NullPointerException: Permission related?

ironman77
Champ in-the-making
Champ in-the-making
I' trying to export the content of company home with the exporter utility and these switches:


./export.sh -user admin -pwd admin -verbose -zip -overwrite -s workspace://SpacesStore -path /app:company_home -d /home/alfresco/Alfresco/export BazInhalt

the export fails when a folder is reached which contains test documents which are instances of my own datamodel:

Exporting node workspace://SpacesStore/55373e87-e8b5-11db-bfb3-5f2543a9eb85
The following error has occurred:
null
java.lang.NullPointerException
        at org.alfresco.repo.security.permissions.impl.model.PermissionModel.getExposedPermissionsImpl(PermissionModel.java:452)
        at org.alfresco.repo.security.permissions.impl.model.PermissionModel.getAllPermissions(PermissionModel.java:432)
        at org.alfresco.repo.security.permissions.impl.PermissionServiceImpl.hasPermission(PermissionServiceImpl.java:419)
        at org.alfresco.repo.security.permissions.impl.PermissionServiceImpl.hasPermission(PermissionServiceImpl.java:632)
        at org.alfresco.repo.security.permissions.impl.acegi.ACLEntryAfterInvocationProvider.decide(ACLEntryAfterInvocationProvider.java:577)
        at org.alfresco.repo.security.permissions.impl.acegi.ACLEntryAfterInvocationProvider.decide(ACLEntryAfterInvocationProvider.java:224)
        at net.sf.acegisecurity.afterinvocation.AfterInvocationProviderManager.decide(AfterInvocationProviderManager.java:107)
        at net.sf.acegisecurity.intercept.AbstractSecurityInterceptor.afterInvocation(AbstractSecurityInterceptor.java:329)
        at net.sf.acegisecurity.intercept.method.aopalliance.MethodSecurityInterceptor.invoke(MethodSecurityInterceptor.java:82)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:170)
        at org.alfresco.repo.security.permissions.impl.ExceptionTranslatorMethodInterceptor.invoke(ExceptionTranslatorMethodInterceptor.java:49)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:170)
        at org.alfresco.repo.audit.AuditComponentImpl.audit(AuditComponentImpl.java:204)
        at org.alfresco.repo.audit.AuditMethodInterceptor.invoke(AuditMethodInterceptor.java:69)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:170)
        at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:96)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:170)
        at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:176)
        at $Proxy12.getChildAssocs(Unknown Source)
        at org.alfresco.repo.exporter.ExporterComponent$DefaultCrawler.walkNode(ExporterComponent.java:449)
        at org.alfresco.repo.exporter.ExporterComponent$DefaultCrawler.export(ExporterComponent.java:288)
        at org.alfresco.repo.exporter.ExporterComponent.exportView(ExporterComponent.java:205)
        at org.alfresco.repo.exporter.ExporterComponent.exportView(ExporterComponent.java:190)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
        at java.lang.reflect.Method.invoke(Unknown Source)
        at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:335)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocati
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:
        at org.springframework.aop.support.DelegatingIntroductionInterceptor.invoke(DelegatingIntroductionInterc
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:
        at org.alfresco.repo.audit.AuditComponentImpl.auditImpl(AuditComponentImpl.java:219)
        at org.alfresco.repo.audit.AuditComponentImpl.audit(AuditComponentImpl.java:165)
        at org.alfresco.repo.audit.AuditMethodInterceptor.invoke(AuditMethodInterceptor.java:69)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:
        at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:
        at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynami
        at $Proxy51.exportView(Unknown Source)
        at org.alfresco.tools.Export.execute(Export.java:246)
        at org.alfresco.tools.Tool.start(Tool.java:216)
        at org.alfresco.tools.Export.main(Export.java:65)

Although i used the verbose switch, the error message isn't very descriptive. It could be something related to the permission, but shouldn't the admin user have all permissions? Is there any chance to pinpoint the document which causes the error?
6 REPLIES 6

derek
Star Contributor
Star Contributor
Hi,

Could you give details of the system, please.

Regards

ironman77
Champ in-the-making
Champ in-the-making
I was using Alfresco Community 2.0. I recently upgraded to Alfresco Community 2.1. The same java.lang.NullPointerException occurs.

andy
Champ on-the-rise
Champ on-the-rise
Hi

This should not happen and I will protect this call.

This affects you as you have an object in your repository that does not have a definition for its type in the data dictionary.

Check any extentions and changes to the data model.

Andy

ironman77
Champ in-the-making
Champ in-the-making
The issue is difficult to track down. I created a simple test case:

1. I create a new empty folder ("space"). This empty folder could be exported w/o any problems … surprise Smiley Very Happy

2. I create a new document which is a instance of my own docmodel that is currently registered in alfresco using the  WEB-CLIENT(!)

3. The export resulted in the exact same error (Nullpointer / permission)!

This leads to some questions/assumptions:
1. The Web-Client creates invalid document instances (i doubt that)?
2. The export tool does't know about my docmodel?

Does the export command has to started from a special folder or with special settings if there is a different docmodel?

This is the code which i use to start the exporter:

export ALFRESC0="/home/alfresco/Alfresco"
export JAVA_HOME="/home/service/java"
export TOMCAT_HOME="/home/alfresco/Alfresco/tomcat"
export PATH=${PATH}:${TOMCAT_HOME};
export IMPORT_LIB=./webapps/alfresco/WEB-INF/lib
export IMPORT_COMMON=./common/lib
export JAVA_CLASSPATH=./webapps/alfresco/WEB-INF/lib
export IMPORT_CLASSES=./webapps/alfresco/WEB-INF/classes
cd $TOMCAT_HOME

for i in $TOMCAT_HOME/$IMPORT_LIB/*.jar ;
do export JAVA_CLASSPATH=${JAVA_CLASSPATH}:$i ;
done

for i in $TOMCAT_HOME/$IMPORT_COMMON/mysql*.jar ;
do export JAVA_CLASSPATH=${JAVA_CLASSPATH}:$i ;
done
export JAVA_CLASSPATH=${JAVA_CLASSPATH}:${IMPORT_CLASSES} ;
$JAVA_HOME/bin/java -cp $JAVA_CLASSPATH org.alfresco.tools.Export  "$@"

I start the exporter command from the alfresco top level directory, the same level with alf_data and tomcat.

ironman77
Champ in-the-making
Champ in-the-making
After checking the different spring initialization files, i noticed, that the following classpath entry was missing:


export SHARED_CLASSPATH=${TOMCAT_HOME}/shared/classes

setting the classpath as follows solves my problem:


export JAVA_CLASSPATH=${JAVA_CLASSPATH}:${IMPORT_CLASSES}:${SHARED_CLASSPATH} ;

So the problem was, that my model which is within the shared folder wasn't known by the alfresco exporter.

Anyway, the whole process of exporting documents with alfresco community is poorly documented. The error thrown by the exporter tool is  confusing and misleading - this should be corrected!

derek
Star Contributor
Star Contributor
Feel free to contribute a patch.