cancel
Showing results for 
Search instead for 
Did you mean: 

Error 'InvalidTypeException' when starting Alfresco/Tomcat

kbonnet
Champ in-the-making
Champ in-the-making
Hi all,

I have run into a problem when i start Tomcat/Alfresco. My configuration is Alfresco 2.9B, Tomcat 5.5, Java JDK 1.5, MySQL 5. I have been playing with the dynamic content models in within Alfresco for the past days. Although my custom model was inactive when i restarted Tomcat, my guess is that i can't start up due to an error in the model.

I get the following error in catalina.out:


13:52:57,813 User:System ERROR [web.context.ContextLoader] Context initialization failed
org.alfresco.service.cmr.dictionary.InvalidTypeException
        at org.alfresco.repo.dictionary.DictionaryComponent.isSubClass(DictionaryComponent.java:202)
        at org.alfresco.repo.search.DocumentNavigator.isSubtypeOf(DocumentNavigator.java:560)
        at org.alfresco.repo.search.NodeServiceXPath$SubTypeOf.evaluate(NodeServiceXPath.java:275)
        at org.alfresco.repo.search.NodeServiceXPath$SubTypeOf.call(NodeServiceXPath.java:238)
        at org.jaxen.expr.DefaultFunctionCallExpr.evaluate(DefaultFunctionCallExpr.java:186)
        at org.jaxen.expr.DefaultPredicate.evaluate(DefaultPredicate.java:105)
        at org.jaxen.expr.PredicateSet.applyPredicate(PredicateSet.java:176)
        at org.jaxen.expr.PredicateSet.evaluatePredicates(PredicateSet.java:151)
        at org.jaxen.expr.DefaultNameStep.evaluate(DefaultNameStep.java:222)
        at org.jaxen.expr.DefaultLocationPath.evaluate(DefaultLocationPath.java:154)
        at org.jaxen.expr.DefaultAbsoluteLocationPath.evaluate(DefaultAbsoluteLocationPath.java:121)
        at org.jaxen.expr.DefaultXPathExpr.asList(DefaultXPathExpr.java:112)
        at org.jaxen.BaseXPath.selectNodesForContext(BaseXPath.java:688)
        at org.jaxen.BaseXPath.selectNodes(BaseXPath.java:227)
        at org.alfresco.repo.search.NodeServiceXPath.selectNodes(NodeServiceXPath.java:195)
        at org.alfresco.repo.search.impl.NodeSearcher.selectNodes(NodeSearcher.java:138)
        at org.alfresco.repo.search.impl.lucene.ADMLuceneSearcherImpl.selectNodes(ADMLuceneSearcherImpl.java:572)
        at org.alfresco.repo.search.SearcherComponent.selectNodes(SearcherComponent.java:108)
        at org.alfresco.repo.search.AbstractSearcherComponent.selectNodes(AbstractSearcherComponent.java:77)
        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:585)
        at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:281)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:187)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:154)
        at net.sf.acegisecurity.intercept.method.aopalliance.MethodSecurityInterceptor.invoke(MethodSecurityInterceptor.java:80)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:176)
        at org.alfresco.repo.security.permissions.impl.ExceptionTranslatorMethodInterceptor.invoke(ExceptionTranslatorMethodInterceptor.java:49)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:176)
        at org.alfresco.repo.audit.AuditComponentImpl.auditImpl(AuditComponentImpl.java:264)
        at org.alfresco.repo.audit.AuditComponentImpl.audit(AuditComponentImpl.java:194)
        at org.alfresco.repo.audit.AuditMethodInterceptor.invoke(AuditMethodInterceptor.java:69)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:176)
        at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:107)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:176)
        at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:210)
        at $Proxy16.selectNodes(Unknown Source)
        at org.alfresco.repo.dictionary.DictionaryRepositoryBootstrap.initDictionary(DictionaryRepositoryBootstrap.java:257)
        at org.alfresco.repo.dictionary.DictionaryRepositoryBootstrap$1.execute(DictionaryRepositoryBootstrap.java:221)
        at org.alfresco.repo.transaction.RetryingTransactionHelper.doInTransaction(RetryingTransactionHelper.java:236)
        at org.alfresco.repo.transaction.RetryingTransactionHelper.doInTransaction(RetryingTransactionHelper.java:166)
        at org.alfresco.repo.dictionary.DictionaryRepositoryBootstrap.init(DictionaryRepositoryBootstrap.java:217)
        at org.alfresco.repo.dictionary.DictionaryRepositoryBootstrap$2.doWork(DictionaryRepositoryBootstrap.java:428)
        at org.alfresco.repo.security.authentication.AuthenticationUtil.runAs(AuthenticationUtil.java:299)
        at org.alfresco.repo.dictionary.DictionaryRepositoryBootstrap.onBootstrap(DictionaryRepositoryBootstrap.java:424)
        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:241)
        at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:349)
        at org.springframework.web.context.support.AbstractRefreshableWebApplicationContext.refresh(AbstractRefreshableWebApplicationContext.java:156)
        at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:246)
        at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:184)
        at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:49)
        at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3763)
        at org.apache.catalina.core.StandardContext.start(StandardContext.java:4211)
        at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:759)
        at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:739)
        at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:524)
        at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:809)
        at org.apache.catalina.startup.HostConfig.deployWARs(HostConfig.java:698)
        at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:472)
        at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1122)
        at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:310)
        at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
        at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1021)
        at org.apache.catalina.core.StandardHost.start(StandardHost.java:718)
        at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1013)
        at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:442)
        at org.apache.catalina.core.StandardService.start(StandardService.java:450)
        at org.apache.catalina.core.StandardServer.start(StandardServer.java:709)
        at org.apache.catalina.startup.Catalina.start(Catalina.java:551)
        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:585)
        at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:294)
        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:585)
        at org.apache.commons.daemon.support.DaemonLoader.start(DaemonLoader.java:177)


Following this there a more errors in the log, but this is the one causing all of it i think.

Can anyone help? What does "org.alfresco.service.cmr.dictionary.InvalidTypeException" mean?

I have been Googling. I dont find a lot, but what i find is the java code with the following comment avout InvalidTypeException:


/**
22  * Thrown when an operation cannot be performed because a type is not recognised
23  * by the data dictionary
24  *
25  * @author Derek Hulley
26  */

(http://kickjava.com/src/org/alfresco/service/cmr/dictionary/InvalidTypeException.java.htm)

This made me think that it has to do with the content model in the data dictionary space within Alfresco. But if this is true, how do i solve the problem when Alfresco won't start. Any way to ignore the content models within the Alfresco repository?

Thanks for any help!

Kind regards,

Koen Bonnet
5 REPLIES 5

kbonnet
Champ in-the-making
Champ in-the-making
I think i have proven for myself that my problem is coming from something in my repository. I have created a clean database and a clean datastore on the filesystem ($dir.root). After that, my tomcat/alfresco started (with the original configuration) OK.

Is there a way to disable the dynamic content models in the data dictionary space?

Thanks,
Koen

kbonnet
Champ in-the-making
Champ in-the-making
I have been playing around more to understand this problem. I created copies of my alfresco database and contentstore and tested with those. What i did is deleted the dynamic models in the database. This made that i can start my Alfresco/Tomcat again. Ofcourse my database has lost its integrity now, so this is not the way to go, but at least i have proven this problem has to do with my custom models.

I would still like a way to disable the custom models in the repository while starting up. Would setting the "isActive" property to 0 be an option? Maybe in the database?

Has anyone experience with this?

Koen

janv
Employee
Employee
Thanks for raising this issue (http://issues.alfresco.com/browse/AR-2179). As you've diagnosed, this issue may occur if you create custom content in the Models space that in turn references dynamic (custom) models loaded from that space. I will look to provide a fix for this startup issue in a future build. For the time being, I would also recommend that you only create custom XML models in the Models space, even though the UI does not enforce it.

Regards,
Jan

kbonnet
Champ in-the-making
Champ in-the-making
Thanks for your feedback, Jan.

Was my way to get rid of the space i created in the models space the right way to go? I am running back on my production database again, but i would like to be sure that i didnt leave an non-integer database.

Thanks,
Koen

janv
Employee
Employee
I would not recommend direct manipulation of the DB. The issue has been fixed on HEAD. I have also added workaround notes to AR-2179.

Thanks,
Jan