java.lang.ClassCastException: com.atlassian.crowd.dao.directory.ImmutableDirectory cannot be cast to com.atlassian.crowd.model.directory.DirectoryImpl

Atlassian JIRA | Diego Berrueta | 3 years ago
  1. 0

    When using file-based directory configuration, any backup (manual or scheduled) fails and produces the following stacktrace: {noformat} java.lang.ClassCastException: com.atlassian.crowd.dao.directory.ImmutableDirectory cannot be cast to com.atlassian.crowd.model.directory.DirectoryImpl #011at com.atlassian.crowd.migration.DirectoryMapper.exportXml(DirectoryMapper.java:51) #011at com.atlassian.crowd.migration.XmlMigrator.exportXml(XmlMigrator.java:36) #011at com.atlassian.crowd.migration.XmlMigrationManagerImpl.exportXml(XmlMigrationManagerImpl.java:106) #011at com.atlassian.crowd.manager.backup.DefaultBackupManager.backup(DefaultBackupManager.java:73) #011at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) #011at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) #011at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) #011at java.lang.reflect.Method.invoke(Method.java:601) #011at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:317) #011at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:183) #011at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150) #011at org.springframework.transaction.interceptor.TransactionInterceptor$1.proceedWithInvocation(TransactionInterceptor.java:96) #011at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:260) #011at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:94) #011at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172) #011at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204) #011at $Proxy48.backup(Unknown Source) #011at com.atlassian.crowd.manager.backup.BackupJob.executeInternal(BackupJob.java:30) #011at org.springframework.scheduling.quartz.QuartzJobBean.execute(QuartzJobBean.java:113) #011at org.quartz.core.JobRunShell.run(JobRunShell.java:203) #011at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:520) {noformat} h2. Workaround Disable scheduled backups and abstain from doing manual backups when using the file-based directory configuration.

    Atlassian JIRA | 3 years ago | Diego Berrueta Munoz
    java.lang.ClassCastException: com.atlassian.crowd.dao.directory.ImmutableDirectory cannot be cast to com.atlassian.crowd.model.directory.DirectoryImpl
  2. 0

    When using file-based directory configuration, any backup (manual or scheduled) fails and produces the following stacktrace: {noformat} java.lang.ClassCastException: com.atlassian.crowd.dao.directory.ImmutableDirectory cannot be cast to com.atlassian.crowd.model.directory.DirectoryImpl #011at com.atlassian.crowd.migration.DirectoryMapper.exportXml(DirectoryMapper.java:51) #011at com.atlassian.crowd.migration.XmlMigrator.exportXml(XmlMigrator.java:36) #011at com.atlassian.crowd.migration.XmlMigrationManagerImpl.exportXml(XmlMigrationManagerImpl.java:106) #011at com.atlassian.crowd.manager.backup.DefaultBackupManager.backup(DefaultBackupManager.java:73) #011at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) #011at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) #011at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) #011at java.lang.reflect.Method.invoke(Method.java:601) #011at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:317) #011at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:183) #011at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150) #011at org.springframework.transaction.interceptor.TransactionInterceptor$1.proceedWithInvocation(TransactionInterceptor.java:96) #011at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:260) #011at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:94) #011at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172) #011at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204) #011at $Proxy48.backup(Unknown Source) #011at com.atlassian.crowd.manager.backup.BackupJob.executeInternal(BackupJob.java:30) #011at org.springframework.scheduling.quartz.QuartzJobBean.execute(QuartzJobBean.java:113) #011at org.quartz.core.JobRunShell.run(JobRunShell.java:203) #011at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:520) {noformat} h2. Workaround Disable scheduled backups and abstain from doing manual backups when using the file-based directory configuration.

    Atlassian JIRA | 3 years ago | Diego Berrueta
    java.lang.ClassCastException: com.atlassian.crowd.dao.directory.ImmutableDirectory cannot be cast to com.atlassian.crowd.model.directory.DirectoryImpl
  3. 0

    Trying to do backup or restore when recovery mode is enabled will fail, with a 500 server error: Restore: {code} Caused by: java.lang.RuntimeException: com.atlassian.crowd.exception.DirectoryNotFoundException: Directory <-2> does not exist at com.atlassian.crowd.console.action.admin.Backup.getSynchronisingDirectoryNames(Backup.java:208) at com.atlassian.crowd.console.action.admin.Backup.doImportValidation(Backup.java:77) at com.atlassian.crowd.console.action.admin.Backup.doImport(Backup.java:129) ... 156 more Caused by: com.atlassian.crowd.exception.DirectoryNotFoundException: Directory <-2> does not exist at com.atlassian.crowd.dao.directory.DirectoryDAOHibernate.findById(DirectoryDAOHibernate.java:61) at com.atlassian.crowd.dao.directory.DirectoryDAOHibernate.findById(DirectoryDAOHibernate.java:26) at com.atlassian.crowd.manager.directory.DirectorySynchroniserHelperImpl.findDirectoryById(DirectorySynchroniserHelperImpl.java:85) at com.atlassian.crowd.manager.directory.DirectorySynchroniserHelperImpl.isSynchronising(DirectorySynchroniserHelperImpl.java:70) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:497) {code} Backup: {code} java.lang.ClassCastException: com.atlassian.crowd.manager.recovery.RecoveryModeDirectory cannot be cast to com.atlassian.crowd.model.directory.DirectoryImpl at com.atlassian.crowd.migration.DirectoryMapper.exportXml(DirectoryMapper.java:52) at com.atlassian.crowd.migration.XmlMigrator.exportXml(XmlMigrator.java:33) at com.atlassian.crowd.migration.XmlMigrationManagerImpl.exportXml(XmlMigrationManagerImpl.java:104) at com.atlassian.crowd.manager.backup.DefaultBackupManager.backup(DefaultBackupManager.java:73) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:497) at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:317) at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:183) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150) at org.springframework.transaction.interceptor.TransactionInterceptor$1.proceedWithInvocation(TransactionInterceptor.java:96) at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:260) at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:94) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172) at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204) at com.sun.proxy.$Proxy63.backup(Unknown Source) at com.atlassian.crowd.console.action.admin.Backup.doExport(Backup.java:105) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:497) at ognl.OgnlRuntime.invokeMethod(OgnlRuntime.java:891) at ognl.OgnlRuntime.callAppropriateMethod(OgnlRuntime.java:1293) {code}

    Atlassian JIRA | 7 months ago | Lukasz Pater
    java.lang.ClassCastException: com.atlassian.crowd.manager.recovery.RecoveryModeDirectory cannot be cast to com.atlassian.crowd.model.directory.DirectoryImpl
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    Memcached Java客户端2.6.1发布 - 编程语言 - ITeye资讯

    iteye.com | 1 year ago
    java.lang.ClassCastException: cannot be cast to
  6. 0

    Scala 2.11.5 and Squeryl?

    Google Groups | 2 years ago | Clint Gilbert
    java.lang.ClassCastException: scala.None$ cannot be cast to

    Not finding the right solution?
    Take a tour to get the most out of Samebug.

    Tired of useless tips?

    Automated exception search integrated into your IDE

    Root Cause Analysis

    1. java.lang.ClassCastException

      com.atlassian.crowd.dao.directory.ImmutableDirectory cannot be cast to com.atlassian.crowd.model.directory.DirectoryImpl

      at com.atlassian.crowd.migration.DirectoryMapper.exportXml()
    2. com.atlassian.crowd
      DefaultBackupManager.backup
      1. com.atlassian.crowd.migration.DirectoryMapper.exportXml(DirectoryMapper.java:51)
      2. com.atlassian.crowd.migration.XmlMigrator.exportXml(XmlMigrator.java:36)
      3. com.atlassian.crowd.migration.XmlMigrationManagerImpl.exportXml(XmlMigrationManagerImpl.java:106)
      4. com.atlassian.crowd.manager.backup.DefaultBackupManager.backup(DefaultBackupManager.java:73)
      4 frames
    3. Java RT
      Method.invoke
      1. sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      2. sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
      3. sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      4. java.lang.reflect.Method.invoke(Method.java:601)
      4 frames
    4. Spring AOP
      ReflectiveMethodInvocation.proceed
      1. org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:317)
      2. org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:183)
      3. org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150)
      3 frames
    5. Spring Tx
      TransactionInterceptor.invoke
      1. org.springframework.transaction.interceptor.TransactionInterceptor$1.proceedWithInvocation(TransactionInterceptor.java:96)
      2. org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:260)
      3. org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:94)
      3 frames
    6. Spring AOP
      JdkDynamicAopProxy.invoke
      1. org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
      2. org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
      2 frames
    7. Unknown
      $Proxy48.backup
      1. $Proxy48.backup(Unknown Source)
      1 frame
    8. com.atlassian.crowd
      BackupJob.executeInternal
      1. com.atlassian.crowd.manager.backup.BackupJob.executeInternal(BackupJob.java:30)
      1 frame
    9. Spring Context Support
      QuartzJobBean.execute
      1. org.springframework.scheduling.quartz.QuartzJobBean.execute(QuartzJobBean.java:113)
      1 frame
    10. quartz
      SimpleThreadPool$WorkerThread.run
      1. org.quartz.core.JobRunShell.run(JobRunShell.java:203)
      2. org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:520)
      2 frames