unable to start confluence ERROR:[springframework.web.context.ContextLoader] initWebApplicationConte
Asked by SparkAdministrator:

hi,

i just migrated our confluence between servers. Followed the instructions but getting error when i open the confluence site.

starting with NULLPOINTEREXCEPTION . java version is correct and it is the recommended supported version.

version we are running: 5.6.1 (WINDOWS)

Java 1.7latest of 1.7) JDK

error log from atlassian.confluence.log

2017-07-08 10:05:55,931 INFO \[localhost-startStop-1\] \[com.atlassian.confluence.lifecycle\] contextInitialized Starting Confluence 5.6.1 \[build 5635 based on commit hash 60fd2eb45debbf4ede2b669f4c9b96b4ce40a937\]  
2017-07-08 10:05:57,900 WARN \[localhost-startStop-1\] \[atlassian.config.xml.AbstractDom4jXmlConfigurationPersister\] saveDocumentAtomically Unable to move E:\\Program Files\\ConfluenceHome\\confluence.cfg.xml3610131418487871784tmp to E:\\Program Files\\ConfluenceHome\\confluence.cfg.xml. Falling back to non-atomic overwrite.  
2017-07-08 10:05:57,931 INFO \[localhost-startStop-1\] \[springframework.web.context.ContextLoader\] initWebApplicationContext Root WebApplicationContext: initialization started  
2017-07-08 10:06:01,228 INFO \[localhost-startStop-1\] \[com.atlassian.confluence.lifecycle\] \<init\> Loading EhCache cache manager  
2017-07-08 10:06:04,134 INFO \[localhost-startStop-1\] \[com.atlassian.confluence.lifecycle\] shutdownCacheManager Shutting down EhCache cache manager  
2017-07-08 10:06:04,166 ERROR \[localhost-startStop-1\] \[springframework.web.context.ContextLoader\] initWebApplicationContext Context initialization failed  
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'cacheStatisticsManager' defined in class path resource \[services/cacheServiceContext.xml\]: Invocation of init method failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'ehCacheStatisticsManager' defined in URL \[jar:file:/C:/Program%20Files/Atlassian/Confluence/confluence/WEB-INF/lib/confluence-cache-ehcache-5.6.1.jar!/cacheProviderContext.xml\]: Cannot resolve reference to bean 'userI18NBeanFactory' while setting constructor argument; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'userI18NBeanFactory' defined in class path resource \[i18NContext.xml\]: Cannot resolve reference to bean 'localeManager' while setting bean property 'localeManager'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'localeManager' defined in class path resource \[i18NContext.xml\]: Cannot resolve reference to bean 'settingsManager' while setting bean property 'settingsManager'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'settingsManager' defined in class path resource \[applicationContext.xml\]: Cannot resolve reference to bean 'upgradeManager' while setting bean property 'upgradeManager'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'upgradeManager' defined in class path resource \[upgradeSubsystemContext.xml\]: Cannot resolve reference to bean 'convertToRelativeLinksUpgradeTask' while setting bean property 'upgradeTasks' with key \[1\]; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'convertToRelativeLinksUpgradeTask' defined in class path resource \[upgradeSubsystemContext.xml\]: Unsatisfied dependency expressed through constructor argument with index 3 of type \[int\]: Could not convert constructor argument value of type \[java.lang.String\] to required type \[int\]: Failed to convert value of type \[java.lang.String\] to required type \[int\]; nested exception is java.lang.NumberFormatException: For input string: ""  
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1338)  
at


Answers:
author: Nic Brough -Adaptavist-
body: Errors with files usually mean you have the permissions on them incorrect - the user running the service must have full read/write/execute/delete rights on the whole installation, home and temporary directories.   

I would also want to check that the version of Java it's using is definitely the one you think it is, and that it's the Sun/Oracle one, not OpenJDK or something else.

comments: author: SparkAdministrator
body: ![java_version.PNG](https://community.atlassian.com/t5/image/serverpage/image-id/2849i83208DC5874E850B/image-size/large?v=v2&px=999 "java_version.PNG")


author: SparkAdministrator
body: see the screenshot, that is the Java version from Oracle and no opensource java jdk .

i am using ms sql server 2012 r2.

just copied the mdb file to the new server, changed the confluence.cfg.xml with correct settings.

and then im getting this issue. Point is that i want to set up a staging first and point it to the copy of the prod database.

just following the steps here on the website.

any help is appreciated.


author: SparkAdministrator
body: the folders (install and home) have the sufficient access rights (full control)


author: Nic Brough -Adaptavist-
body: I don't think "just copying the mdb file" works, you need to do a proper backup and restore of the database.

Also, while I suspect you're using the right Java, the screenshot just tells me what the current default is. This is not necessarily the one in use for Confluence. Have a look at the logs as startup is attempted, it should echo it out.