Confluence Takes too Long to Start Due to Class Loading

Still need help?

The Atlassian Community is here for you.

Ask the community

Symptoms

Confluence startup is very slow; it may take up to 20 minutes to complete. This can be seen in the log, where there is a big time gap in the logging messages:


2010-05-16 12:38:46,537 INFO [main\] [com.atlassian.confluence.lifecycle\] contextInitialized Starting Confluence 2.10.1 (build #1517)
...
2010-05-16 12:39:17,292 INFO [main\] [beans.factory.xml.XmlBeanDefinitionReader\]
loadBeanDefinitions Loading XML bean definitions from class path resource [jmxContext.xml\]
2010-05-16 13:02:28,192 INFO [main\] [springframework.web.context.ContextLoader\]
initWebApplicationContext Root WebApplicationContext: initialization completed in 1391452 ms
...

In thread dumps, there is one thread in RUNNABLE state:


"main" prio=10 tid=0x09991400 nid=0x5163 runnable [0xb7fb0000..0xb7fb41f8\]
java.lang.Thread.State: RUNNABLE
at java.io.UnixFileSystem.getBooleanAttributes0(Native Method)
at java.io.UnixFileSystem.getBooleanAttributes(UnixFileSystem.java:228)
at java.io.File.exists(File.java:733)
at sun.misc.URLClassPath$FileLoader.getResource(URLClassPath.java:995)
at sun.misc.URLClassPath.getResource(URLClassPath.java:168)
at java.net.URLClassLoader$1.run(URLClassLoader.java:192)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
- locked <0x7d570838> (a sun.misc.Launcher$AppClassLoader)
...

Cause

As evidenced in the thread dump, the operating system is trying to load class files from the filesystem. The calls have not reached Confluence code yet.

These are the known reasons for this problem:

  1. The files are located on an NFS share which is currently inaccessible. See further suggestions.
  2. There is a '/net' directory under the root '/' directory in filesystem being referenced in the classpath. Confluence has some packages that look in 'net' directories. In this case, the '/net' directory is special as it seems to be a 'network' directory. Any file references within the '/net' directory incurs a timeout. Most likely, this directory is created by the automount.

Resolution

  1. Re-establish access to inaccessible NFS share
  2. Remove the '/net' directory from the automount directives

Last modified on Mar 30, 2016

Was this helpful?

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