Upgrade to Confluence 4.x failed with Null value assigned to a property of primitive type setter of com.atlassian.confluence.pages.Draft.pageVersion

Still need help?

The Atlassian Community is here for you.

Ask the community

Symptoms

  1. Upgrading to confluence 4.x results in a failure:

    2012-01-18 18:12:09,264 INFO [WikiToXhtmlMigration:thread-4] [xhtml.migration.tasks.ContentEntityMigrationTaskWrapper] logProgress WikiToXhtmlMigration:thread-4- Migrated 7000 of 24409 pages, this batch migrated 499/500 without error
    2012-01-18 18:12:11,757 INFO [WikiToXhtmlMigration:thread-3] [xhtml.migration.tasks.ContentEntityMigrationTaskWrapper] logProgress WikiToXhtmlMigration:thread-3- Migrated 7500 of 24409 pages, this batch migrated 499/500 without error
    2012-01-18 18:14:13,201 INFO [WikiToXhtmlMigration:thread-2] [xhtml.migration.tasks.ContentEntityMigrationTaskWrapper] logProgress WikiToXhtmlMigration:thread-2- Migrated 8000 of 24409 pages, this batch migrated 499/500 without error
    2012-01-18 18:14:44,850 INFO [WikiToXhtmlMigration:thread-1] [xhtml.migration.tasks.ContentEntityMigrationTaskWrapper] logProgress WikiToXhtmlMigration:thread-1- Migrated 8500 of 24409 pages, this batch migrated 497/500 without error
    2012-01-18 18:16:06,566 FATAL [main] [atlassian.config.lifecycle.LifecycleManager] panicAndShutdown Unable to start up Confluence. Fatal error during startup sequence: confluence.lifecycle.core:pluginframeworkdependentupgrades (Run all the upgrades that require the plugin framework to be available) - com.atlassian.confluence.content.render.xhtml.migration.exceptions.MigrationException: java.util.concurrent.ExecutionException: org.springframework.orm.hibernate.HibernateSystemException: Null value was assigned to a property of primitive type setter of com.atlassian.confluence.pages.Draft.pageVersion; nested exception is net.sf.hibernate.PropertyAccessException: Null value was assigned to a property of primitive type setter of com.atlassian.confluence.pages.Draft.pageVersion
    com.atlassian.confluence.content.render.xhtml.migration.exceptions.MigrationException: java.util.concurrent.ExecutionException: org.springframework.orm.hibernate.HibernateSystemException: Null value was assigned to a property of primitive type setter of com.atlassian.confluence.pages.Draft.pageVersion; nested exception is net.sf.hibernate.PropertyAccessException: Null value was assigned to a property of primitive type setter of com.atlassian.confluence.pages.Draft.pageVersion
        at com.atlassian.confluence.content.render.xhtml.migration.DefaultWikiToXhtmlSiteMigrator.migrateSite(DefaultWikiToXhtmlSiteMigrator.java:167)
        at com.atlassian.confluence.upgrade.upgradetask.WikiToXhtmlMigrationUpgradeTask.doDeferredUpgrade(WikiToXhtmlMigrationUpgradeTask.java:40)
        at com.atlassian.confluence.upgrade.PluginFrameworkDependentUpgrader.runDeferredUpgradeTasks(PluginFrameworkDependentUpgrader.java:56)
        at com.atlassian.confluence.upgrade.PluginFrameworkDependentUpgrader.startup(PluginFrameworkDependentUpgrader.java:25)
        at com.atlassian.config.lifecycle.DefaultLifecycleManager.startUp(DefaultLifecycleManager.java:40)
        at com.atlassian.config.lifecycle.LifecycleServletContextListener.contextInitialized(LifecycleServletContextListener.java:17)
        at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4205)
        at org.apache.catalina.core.StandardContext.start(StandardContext.java:4704)
        at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1053)
        at org.apache.catalina.core.StandardHost.start(StandardHost.java:840)
        at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1053)
        at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:463)
        at org.apache.catalina.core.StandardService.start(StandardService.java:525)
        at org.apache.catalina.core.StandardServer.start(StandardServer.java:754)
        at org.apache.catalina.startup.Catalina.start(Catalina.java:595)
        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:289)
        at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:414)
    Caused by: java.util.concurrent.ExecutionException: org.springframework.orm.hibernate.HibernateSystemException: 
    
    
    ; nested exception is net.sf.hibernate.PropertyAccessException: Null value was assigned to a property of primitive type setter of com.atlassian.confluence.pages.Draft.pageVersion
        at java.util.concurrent.FutureTask$Sync.innerGet(FutureTask.java:222)
        at java.util.concurrent.FutureTask.get(FutureTask.java:83)
        at com.atlassian.confluence.content.render.xhtml.migration.DefaultWikiToXhtmlSiteMigrator.migrateSite(DefaultWikiToXhtmlSiteMigrator.java:148)
        ... 20 more
    Caused by: org.springframework.orm.hibernate.HibernateSystemException: Null value was assigned to a property of primitive type setter of com.atlassian.confluence.pages.Draft.pageVersion; nested exception is net.sf.hibernate.PropertyAccessException: Null value was assigned to a property of primitive type setter of com.atlassian.confluence.pages.Draft.pageVersion
        at org.springframework.orm.hibernate.SessionFactoryUtils.convertHibernateAccessException(SessionFactoryUtils.java:597)
        at org.springframework.orm.hibernate.HibernateAccessor.convertHibernateAccessException(HibernateAccessor.java:353)
        at org.springframework.orm.hibernate.HibernateTemplate.execute(HibernateTemplate.java:375)
        at org.springframework.orm.hibernate.HibernateTemplate.executeFind(HibernateTemplate.java:341)
        at com.atlassian.hibernate.HibernateObjectDao.findNamedQueryStringParams(HibernateObjectDao.java:350)
        at com.atlassian.confluence.content.render.xhtml.migration.DefaultContentDao.getLatestOrderedWikiContentFromContentId(DefaultContentDao.java:48)
        at com.atlassian.confluence.content.render.xhtml.migration.ContentEntityObjectMigrationWorkSource.getBatch(ContentEntityObjectMigrationWorkSource.java:47)
        at com.atlassian.confluence.content.render.xhtml.migration.tasks.ContentEntityMigrationTaskWrapper.doInTransactionWithoutResult(ContentEntityMigrationTaskWrapper.java:80)
        at org.springframework.transaction.support.TransactionCallbackWithoutResult.doInTransaction(TransactionCallbackWithoutResult.java:33)
        at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:128)
        at com.atlassian.confluence.content.render.xhtml.migration.DefaultWikiToXhtmlSiteMigrator$TransactionWrappingMigratorRunnable.run(DefaultWikiToXhtmlSiteMigrator.java:217)
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
        at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
        at java.util.concurrent.FutureTask.run(FutureTask.java:138)
        at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
        at java.lang.Thread.run(Thread.java:662)
    Caused by: net.sf.hibernate.PropertyAccessException: Null value was assigned to a property of primitive type setter of com.atlassian.confluence.pages.Draft.pageVersion
        at net.sf.hibernate.property.BasicPropertyAccessor$BasicSetter.set(BasicPropertyAccessor.java:57)
        at net.sf.hibernate.persister.AbstractEntityPersister.setPropertyValues(AbstractEntityPersister.java:229)
        at net.sf.hibernate.impl.SessionImpl.initializeEntity(SessionImpl.java:2222)
        at net.sf.hibernate.loader.Loader.initializeEntitiesAndCollections(Loader.java:319)
        at net.sf.hibernate.loader.Loader.doQuery(Loader.java:309)
        at net.sf.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:138)
        at net.sf.hibernate.loader.Loader.doList(Loader.java:1063)
        at net.sf.hibernate.loader.Loader.list(Loader.java:1054)
        at net.sf.hibernate.hql.QueryTranslator.list(QueryTranslator.java:854)
        at net.sf.hibernate.impl.SessionImpl.find(SessionImpl.java:1552)
        at net.sf.hibernate.impl.QueryImpl.list(QueryImpl.java:49)
        at com.atlassian.hibernate.HibernateObjectDao$5.doInHibernate(HibernateObjectDao.java:383)
        at org.springframework.orm.hibernate.HibernateTemplate.execute(HibernateTemplate.java:370)
        ... 14 more
    Caused by: java.lang.IllegalArgumentException
        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 net.sf.hibernate.property.BasicPropertyAccessor$BasicSetter.set(BasicPropertyAccessor.java:38)
        ... 26 more
    2012-01-18 18:16:07,133 INFO [main] [com.atlassian.confluence.lifecycle] init Confluence is ready to serve
    
    

 

Cause

This is due to incorrect data in the database where the upgrade process is expecting a draft version for draft entries in the content table.

Resolution

  1. Revert the confluence instance back to previous working state.
  2. Run the following SQL commands
delete from bodycontent where contentid in (select contentid from content where draftpageid is null and contenttype = 'DRAFT');
delete from content where draftpageid is null and contenttype = 'DRAFT'

 

Rerun the Confluence 4.x upgrade.

 

Last modified on Feb 23, 2016

Was this helpful?

Yes
No
Provide feedback about this article
Powered by Confluence and Scroll Viewport.