Spring Application context has not been set

I'm trying to install Confluence on a Mac OS Server. Other answers in this forum state that insufficient permissions of the data folder cause this problem, however both the installation and the data folder are writable (right click > get info > sharing & permissions > everything is "read & write" here). 

Am I mistaking the reason for this error (see full description below), or did I just mess up the permissions somehow? 

 

HTTP Status 500 - java.lang.IllegalStateException: Spring Application context has not been set
 
Type Exception report
message java.lang.IllegalStateException: Spring Application context has not been set
description The server encountered an internal error that prevented it from fulfilling this request.
exception
com.atlassian.util.concurrent.LazyReference$InitializationException: java.lang.IllegalStateException: Spring Application context has not been set
	com.atlassian.util.concurrent.LazyReference.getInterruptibly(LazyReference.java:149)
	com.atlassian.util.concurrent.LazyReference.get(LazyReference.java:112)
	com.atlassian.confluence.plugin.servlet.filter.ServletFilterModuleContainerFilter.getServletModuleManager(ServletFilterModuleContainerFilter.java:23)
	com.atlassian.plugin.servlet.filter.ServletFilterModuleContainerFilter.doFilter(ServletFilterModuleContainerFilter.java:68)
	com.atlassian.plugin.servlet.filter.ServletFilterModuleContainerFilter.doFilter(ServletFilterModuleContainerFilter.java:63)
	com.atlassian.confluence.web.filter.validateparam.RequestParamValidationFilter.doFilter(RequestParamValidationFilter.java:58)
	com.atlassian.core.filters.AbstractHttpFilter.doFilter(AbstractHttpFilter.java:31)
	com.atlassian.confluence.web.filter.TranslationModeFilter.doFilter(TranslationModeFilter.java:44)
	com.atlassian.core.filters.AbstractHttpFilter.doFilter(AbstractHttpFilter.java:31)
	com.atlassian.confluence.plugin.servlet.filter.ActionContextCleanUp.doFilter(ActionContextCleanUp.java:73)
	com.atlassian.confluence.web.filter.LanguageExtractionFilter.doFilter(LanguageExtractionFilter.java:53)
	com.atlassian.core.filters.AbstractHttpFilter.doFilter(AbstractHttpFilter.java:31)
	com.atlassian.confluence.util.RequestCacheThreadLocalFilter.doFilter(RequestCacheThreadLocalFilter.java:32)
	com.atlassian.confluence.web.filter.ResponseOutputStreamFilter.doFilter(ResponseOutputStreamFilter.java:25)
	com.atlassian.core.filters.AbstractHttpFilter.doFilter(AbstractHttpFilter.java:31)
	com.atlassian.core.filters.encoding.AbstractEncodingFilter.doFilter(AbstractEncodingFilter.java:41)
	com.atlassian.core.filters.AbstractHttpFilter.doFilter(AbstractHttpFilter.java:31)
	com.atlassian.core.filters.HeaderSanitisingFilter.doFilter(HeaderSanitisingFilter.java:44)
	com.atlassian.confluence.servlet.FourOhFourErrorLoggingFilter.doFilter(FourOhFourErrorLoggingFilter.java:71)
	com.atlassian.confluence.web.filter.DebugFilter.doFilter(DebugFilter.java:50)
	com.atlassian.core.filters.AbstractHttpFilter.doFilter(AbstractHttpFilter.java:31)

root cause
java.lang.IllegalStateException: Spring Application context has not been set
	com.atlassian.spring.container.SpringContainerContext.getComponent(SpringContainerContext.java:48)
	com.atlassian.spring.container.ContainerManager.getComponent(ContainerManager.java:33)
	com.atlassian.confluence.util.LazyComponentReference$Accessor.get(LazyComponentReference.java:46)
	com.atlassian.util.concurrent.Lazy$Strong.create(Lazy.java:85)
	com.atlassian.util.concurrent.LazyReference$Sync.run(LazyReference.java:321)
	com.atlassian.util.concurrent.LazyReference.getInterruptibly(LazyReference.java:143)
	com.atlassian.util.concurrent.LazyReference.get(LazyReference.java:112)
	com.atlassian.confluence.plugin.servlet.filter.ServletFilterModuleContainerFilter.getServletModuleManager(ServletFilterModuleContainerFilter.java:23)
	com.atlassian.plugin.servlet.filter.ServletFilterModuleContainerFilter.doFilter(ServletFilterModuleContainerFilter.java:68)
	com.atlassian.plugin.servlet.filter.ServletFilterModuleContainerFilter.doFilter(ServletFilterModuleContainerFilter.java:63)
	com.atlassian.confluence.web.filter.validateparam.RequestParamValidationFilter.doFilter(RequestParamValidationFilter.java:58)
	com.atlassian.core.filters.AbstractHttpFilter.doFilter(AbstractHttpFilter.java:31)
	com.atlassian.confluence.web.filter.TranslationModeFilter.doFilter(TranslationModeFilter.java:44)
	com.atlassian.core.filters.AbstractHttpFilter.doFilter(AbstractHttpFilter.java:31)
	com.atlassian.confluence.plugin.servlet.filter.ActionContextCleanUp.doFilter(ActionContextCleanUp.java:73)
	com.atlassian.confluence.web.filter.LanguageExtractionFilter.doFilter(LanguageExtractionFilter.java:53)
	com.atlassian.core.filters.AbstractHttpFilter.doFilter(AbstractHttpFilter.java:31)
	com.atlassian.confluence.util.RequestCacheThreadLocalFilter.doFilter(RequestCacheThreadLocalFilter.java:32)
	com.atlassian.confluence.web.filter.ResponseOutputStreamFilter.doFilter(ResponseOutputStreamFilter.java:25)
	com.atlassian.core.filters.AbstractHttpFilter.doFilter(AbstractHttpFilter.java:31)
	com.atlassian.core.filters.encoding.AbstractEncodingFilter.doFilter(AbstractEncodingFilter.java:41)
	com.atlassian.core.filters.AbstractHttpFilter.doFilter(AbstractHttpFilter.java:31)
	com.atlassian.core.filters.HeaderSanitisingFilter.doFilter(HeaderSanitisingFilter.java:44)
	com.atlassian.confluence.servlet.FourOhFourErrorLoggingFilter.doFilter(FourOhFourErrorLoggingFilter.java:71)
	com.atlassian.confluence.web.filter.DebugFilter.doFilter(DebugFilter.java:50)
	com.atlassian.core.filters.AbstractHttpFilter.doFilter(AbstractHttpFilter.java:31)

note The full stack trace of the root cause is available in the Apache Tomcat/7.0.52 logs.

15 answers

Hey Chris,

May I ask you, how did you install Confluence? Did you make sure that it was the administrator that run the installer? This error is pretty likely to be a permission issue. Make sure you apply the same privileges to the sub-folders as well of your home-directory and install-folder.

As a side note Mac OS isn't a supported platform for Confluence as you can see here: https://confluence.atlassian.com/display/DOC/Supported+Platforms

Cheers,
WZ

Thanks William for your help. Looks like I lack knowledge here: I installed it with my user, but believe it is an admin. Do you mean I should have installed it with the root user? As all the subfolders of the mentioned directories have the maximum privileges I assume my mistake is related to that admin-thing. Jep thanks for pointing that out. I installed Jira on a Mac Server too - worked without any troubles. Now that it's not best practice though.

I just realized: I didn't use the installer but installed from the .zip file due to the unsupported Mac Server. Don't know if that makes any difference now though.

This was my issue and installing as admin fixed it - thanks William!

1 vote

Hey Christian,

Installing with the root user is not recommended, but if the user you've created to run Confluence somehow lack of permissions, trying to install as a root might be a good shot to try.

May I ask which database are you trying to use?

Finally, may I also ask whether you're correctly setting the home directory to this application?

 

Please, check this documentation and make sure you're following every step to get it manually installed.

 

Best regards,

Eduardo Mallmann

I had the same problem, it was looking for the odjc driver once that was added back into the folder...everything worked as it should. Hope that helps,

 

Michelle

Man, you got my hopes up! The file was missing from the lib folder but sadly replacing it didn't fix the error :(

Thanks a lot Eduardo & William, 

I checked like a million times, but apparently I forgot to set a slash in front of the path in the confluence-init.properties. Thanks a lot for your help, I really appreciate it.

That's awesome, Chris! Thanks for sharing your fix :) Happy holidays!

Oh no, that was too quick :(. I restarted the computer, started JIRA and then tried to start Confluence - same error again. I can't get Confluence running again, but it appears that it's related to JIRA - is that possible? Tried to restart the computer again and then start Confluence directly, without JIRA, but doesn't work, which is really weird. But I wish you happy holidays too ;).

Hey Chris, That's pretty weird, indeed. But I don't think it's related to JIRA, though. May I ask if you have had the chance to try to start Confluence as a root user already? Also, which directory are you setting as home directory for Confluence and JIRA? Can you let me know the full path for both? Best regards, Eduardo Mallmann

0 vote

Hi Christian, 

Can you let us know with what user are you starting Confluence? 

Do not run Confluence as root, and ensure that the user running Confluence has full read and write access to the home folder. This can be set by running chmod -R with the appropriate permissions, to apply them recursively to each sub folder.

 

Also, can you check if do you have only one confluence.home variable configurede on confluenceinit.properties?

If do you have more than one, please remove that. 

 

Let us know if it works. 

 

Regards, 

Renato Rudnicki

Thanks again for your responses and efforts.

  • Tried is root user two days ago, same problem.
  • I believe my user has the full rights and the folders are both readable and writeable
  • I uploaded screenshots that show the rights of the users and the infos of the folders

These are my paths:

  • Installation: Users/name/Documents/Atlassian/confluence/confluence-5.6.5
  • Home: Users/name/Documents/Atlassian/confluence/data
  • (I had to move the folders in order to try to start them with the root user obviously)

confluenceinit.properties: 

  • confluence.home=/Users/ched/Documents/Atlassian/confluence/data
  • This is the the only line of code there (except for the comments)

Could it be that my JAVA_HOME is causing the trouble? It's apparently working with JIRA though:

Users/name/.bash_profile

export JAVA_HOME=`/library/java/JavaVirtualMachines/jdk1.7.0_71.jdk/contents/home/bin/java`

Hi Christian, It may be something related to java as you mentioned. I have a look on my Mac OS and my JAVA configuration is like that: ecrmac-34:~ rrudnicki$ echo $JAVA_HOME /Library/Java/JavaVirtualMachines/jdk1.7.0_25.jdk/Contents/Home ecrmac-34:~ rrudnicki$ ecrmac-34:~ rrudnicki$ ecrmac-34:~ rrudnicki$ java -version java version "1.7.0_25" Java(TM) SE Runtime Environment (build 1.7.0_25-b15) Java HotSpot(TM) 64-Bit Server VM (build 23.25-b01, mixed mode) ecrmac-34:~ rrudnicki$ ecrmac-34:~ rrudnicki$ ecrmac-34:~ rrudnicki$ cat .bash_profile |grep ^[^#] . "/Users/rrudnicki/.profile" export PATH="/opt/local/bin:/opt/local/sbin:$PATH” I could see your JAVA_HOME is pointing to /library/java/JavaVirtualMachines/jdk1.7.0_71.jdk/contents/home/bin/java while mine is pointing to /Library/Java/JavaVirtualMachines/jdk1.7.0_25.jdk/Contents/Home. The difference here is mine doesn't have the "/bin/java" and I believe this is causing the issue. So, could you please try set your JAVA_HOME like below and try to stop and start Confluence again? export JAVA_HOME='/library/java/JavaVirtualMachines/jdk1.7.0_71.jdk/contents/home/‘ Please let us know how it is going. Regards, Renato Rudnicki

It unfortunately didn't work :(. Neither did export JAVA_HOME=`/usr/libexec/java_home -v 1.7`.

For whatever reason it appears that the uploading of the screenshots mentioned above didn't work. I'm trying again now, could somebody please check if those permission settings are right?

 

admin1.png

confluence-5_6_5_Info.png

data_Info_and_ched_—_bash_—_80×24.png

Hi Michelle,

Thanks a lot for posting your solution, I really appreciate it. Could you tell me what exactly you did? I unfortunately have no clue what a odjc driver is, where I can get it from and to which folder I should add it.

Thank you!

Turned out In my case all confluence directories under both /var and /opt needed to be removed.  The uninstall does not appear to remove pertinent files under /var/ and this error will persist until they're removed.  I tried all other remedies, but a previous partially install must of somehow corrupted those files under /var. Thanks to 

Mark Sanderson

Thanks Jermon for your hint. Where do I find /var and /opt?

For future reference: /var is directly on the hard disc, it can be found by typing ls -l /var in the console. There is no /opt on my computer, according to this post on Stackexchange that's normal: http://apple.stackexchange.com/questions/119230/what-is-standard-for-os-x-filesystem-e-g-opt-vs-usr. Turned out that usr/local doesn't contain any confluence folder either, so I assume your solution doesn't solve my problem :(.

Hello I am working from the CLI as root user My steps were 1. Uninstall Confluence by first command entry of "CD /" 2. Command entry of "ls" to list contents, which is where I find OPT directory 3. CD into /opt/atlassian/confluence and command entry of "./uninstall" 4. Command entry of "CD /opt/atlassian/" then command entry of "rm -rf confluence/" - to remove everything 5. Command entry of "CD /var/www/vhosts/XXXXXX (enter your doman here)" I locate the atlassian folder within there and command entry of "rm -rf confluence/" 6. I reinstall from Confluence binaries and it works Hope this helps - I'm on a linux server btw

Hi What will be the equivalent in windows  if you have  to remove /VAR and  /opt

 

Thanks

I had the same issue. My solution is:

  • check all folders permission and make the same. 
  • Allow confluence os user to access both installation and home folder (complete path)
  • Allow confluence os user to access partial path. I mean: complete path is: /opt/atlassian/confluence..... Well os user have to access to: /opt - /opt/Atlassian - /opt/atlassian/confluence

After a lot of chmod 755 XXXX command, setup works.

 

Hope this help all

FABIO

Copy jira-javamelody-1.55.0.jar to /opt/confluence/confluence/WEB-INF/lib

And restart confluence the problems was fixed

Copy jira-javamelody-1.55.0.ja    from where     ?       Are we talking Windows or Linux? 

Where is  this file located  ? 

Suggest an answer

Log in or Sign up to answer
How to earn badges on the Atlassian Community

How to earn badges on the Atlassian Community

Badges are a great way to show off community activity, whether you’re a newbie or a Champion.

Learn more
Community showcase
Posted Jul 10, 2018 in Confluence

We want to see the templates you've created in Confluence!

Hi Community, Jessica here from the Confluence Product Marketing team!  July’s community challenge is all about sharing pictures  — and as an extension of our first post on what ...

546 views 20 11
Join discussion

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you