SpringMVC dispatcher springMvc could not be started due to AccessDeniedException on Windows.

Still need help?

The Atlassian Community is here for you.

Ask the community


Platform notice: Server and Data Center only. This article only applies to Atlassian products on the Server and Data Center platforms.

Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.

*Except Fisheye and Crucible

    

Summary

After upgrading Bitbucket or installing on Windows, Bitbucket is unable to startup.

Environment

  • Windows

Diagnosis

In the atlassian-bitbucket.log you may see something similar to the following:

2021-03-16 14:00:28,249 ERROR [spring-startup]  c.a.e.i.AsynchronousAbleEventDispatcher There was an exception thrown trying to dispatch event [com.atlassian.plugin.event.events.PluginFrameworkStartingEvent@75f7f1cc] from the invoker [SingleParameterMethodListenerInvoker{method=public void com.atlassian.plugin.osgi.container.felix.FelixOsgiContainerManager.onStart(com.atlassian.plugin.event.events.PluginFrameworkStartingEvent), listener=com.atlassian.plugin.osgi.container.felix.FelixOsgiContainerManager@7ad12091} (monitored)]
java.lang.RuntimeException: java.util.concurrent.ExecutionException: java.lang.ExceptionInInitializerError. Listener: com.atlassian.plugin.osgi.container.felix.FelixOsgiContainerManager event: com.atlassian.plugin.event.events.PluginFrameworkStartingEvent
	at com.atlassian.event.internal.SingleParameterMethodListenerInvoker.invoke(SingleParameterMethodListenerInvoker.java:57)
	at com.atlassian.diagnostics.internal.platform.event.EventSystemMonitor.invokeMonitored(EventSystemMonitor.java:109)
	at com.atlassian.diagnostics.internal.platform.event.MonitoredListenerInvoker.invoke(MonitoredListenerInvoker.java:38)
	at com.atlassian.event.internal.AsynchronousAbleEventDispatcher.lambda$null$0(AsynchronousAbleEventDispatcher.java:37)
	at com.atlassian.event.internal.AsynchronousAbleEventDispatcher.dispatch(AsynchronousAbleEventDispatcher.java:85)
	at com.atlassian.diagnostics.internal.platform.event.MonitoredEventDispatcher.dispatch(MonitoredEventDispatcher.java:36)
	at com.atlassian.event.internal.LockFreeEventPublisher$Publisher.dispatch(LockFreeEventPublisher.java:215)
	at com.atlassian.event.internal.LockFreeEventPublisher.publish(LockFreeEventPublisher.java:88)
	at com.atlassian.stash.internal.event.TransactionAwareEventPublisher.internalPublish(TransactionAwareEventPublisher.java:155)
	at com.atlassian.stash.internal.event.TransactionAwareEventPublisher.publish(TransactionAwareEventPublisher.java:99)
	at com.atlassian.plugin.event.impl.DefaultPluginEventManager.broadcast(DefaultPluginEventManager.java:92)
	at com.atlassian.plugin.manager.DefaultPluginManager.broadcastIgnoreError(DefaultPluginManager.java:1962)
	at com.atlassian.plugin.manager.DefaultPluginManager.lambda$earlyStartup$3(DefaultPluginManager.java:528)
	at com.atlassian.plugin.manager.PluginTransactionContext.wrap(PluginTransactionContext.java:63)
	at com.atlassian.plugin.manager.DefaultPluginManager.earlyStartup(DefaultPluginManager.java:522)
	at com.atlassian.stash.internal.plugin.StashPluginManager.lambda$earlyStartup$0(StashPluginManager.java:54)
	at com.atlassian.stash.internal.plugin.PluginUpgradeHelper.withUpgrade(PluginUpgradeHelper.java:89)
	at com.atlassian.stash.internal.plugin.StashPluginManager.earlyStartup(StashPluginManager.java:54)
	at com.atlassian.plugin.manager.DefaultPluginManager.lambda$init$2(DefaultPluginManager.java:514)
	at com.atlassian.plugin.manager.PluginTransactionContext.wrap(PluginTransactionContext.java:63)
	at com.atlassian.plugin.manager.DefaultPluginManager.init(DefaultPluginManager.java:513)
	at com.atlassian.stash.internal.plugin.SpringPluginSystemLifecycle.start(SpringPluginSystemLifecycle.java:35)
	at org.springframework.context.support.DefaultLifecycleProcessor.doStart(DefaultLifecycleProcessor.java:182)
	at org.springframework.context.support.DefaultLifecycleProcessor.access$200(DefaultLifecycleProcessor.java:53)
	at org.springframework.context.support.DefaultLifecycleProcessor$LifecycleGroup.start(DefaultLifecycleProcessor.java:360)
	at org.springframework.context.support.DefaultLifecycleProcessor.startBeans(DefaultLifecycleProcessor.java:158)
	at org.springframework.context.support.DefaultLifecycleProcessor.onRefresh(DefaultLifecycleProcessor.java:122)
	at org.springframework.context.support.AbstractApplicationContext.finishRefresh(AbstractApplicationContext.java:895)
	at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:554)
	at javax.servlet.GenericServlet.init(GenericServlet.java:158)
	at java.lang.Thread.run(Unknown Source)
	... 8 frames trimmed
Caused by: java.lang.RuntimeException: java.util.concurrent.ExecutionException: java.lang.ExceptionInInitializerError
	at io.github.lukehutch.fastclasspathscanner.FastClasspathScanner.getUniqueClasspathElementURLs(FastClasspathScanner.java:1840)
	at io.github.lukehutch.fastclasspathscanner.FastClasspathScanner.getUniqueClasspathElementURLs(FastClasspathScanner.java:1875)
	at com.atlassian.event.internal.SingleParameterMethodListenerInvoker.invoke(SingleParameterMethodListenerInvoker.java:42)
	... 31 common frames omitted
Caused by: java.util.concurrent.ExecutionException: java.lang.ExceptionInInitializerError
	at java.util.concurrent.FutureTask.report(Unknown Source)
	at java.util.concurrent.FutureTask.get(Unknown Source)
	at io.github.lukehutch.fastclasspathscanner.FastClasspathScanner$5.call(FastClasspathScanner.java:1782)
	at io.github.lukehutch.fastclasspathscanner.FastClasspathScanner$5.call(FastClasspathScanner.java:1779)
	at java.util.concurrent.FutureTask.run(Unknown Source)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
	... 2 common frames omitted
Caused by: java.lang.ExceptionInInitializerError: null
	at io.github.lukehutch.fastclasspathscanner.scanner.Scanner.call(Scanner.java:214)
	at io.github.lukehutch.fastclasspathscanner.scanner.Scanner.call(Scanner.java:56)
	... 4 common frames omitted
Caused by: java.lang.RuntimeException: Could not resolve current directory: C:\Atlassian\Bitbucket\7.11.1\app
	at io.github.lukehutch.fastclasspathscanner.utils.FileUtils.getCurrDirPathStr(FileUtils.java:56)
	at io.github.lukehutch.fastclasspathscanner.scanner.ClasspathFinder.<clinit>(ClasspathFinder.java:47)
	... 6 common frames omitted
Caused by: java.nio.file.AccessDeniedException: C:\Atlassian\Bitbucket\7.11.1\app
	at sun.nio.fs.WindowsException.translateToIOException(Unknown Source)
	at sun.nio.fs.WindowsException.rethrowAsIOException(Unknown Source)
	at sun.nio.fs.WindowsLinkSupport.getRealPath(Unknown Source)
	at sun.nio.fs.WindowsPath.toRealPath(Unknown Source)
	at sun.nio.fs.WindowsPath.toRealPath(Unknown Source)
	at io.github.lukehutch.fastclasspathscanner.utils.FileUtils.getCurrDirPathStr(FileUtils.java:52)
	... 7 common frames omitted


Cause

The user running Bitbucket (atlbitbucket by default) does not have the correct permissions to start the Bitbucket app. 

Solution

  1. Navigate to the Bitbucket installation directory (in the above stacktrace, that would be C:\Atlassian\Bitbucket\7.11.1).
  2. Right-click on the directory and click "Properties."
  3. Click on the "Security" tab.
  4. Click "Advanced" and then "Change Permission."
  5. Find the user that is running Bitbucket and ensure that user has "Full Control"
  6. Ensure all subdirectories share the same "Full Control" level of permissions.
  7. Restart Bitbucket.



Last modified on Jun 14, 2021

Was this helpful?

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