upgrading bitbucket server from 7 to 8
Asked by ??????? ??????:

upgrading bitbucket server from 7 to 8

catching error after start

2023-04-23 20:25:57,015 ERROR \[spring-startup\] c.a.j.s.w.s.JohnsonDispatcherServlet SpringMVC dispatcher \[springMvc\] could not be started  
org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'fileServerServlet' defined in URL \[jar:file:/opt/atlassian/bitbucket/8.9.0/app/WEB-INF/lib/bitbucket-platform-8.9.0.jar!/com/atlassian/stash/internal/plugin/FileServerServlet.class\]: Unsatisfied dependency expressed through constructor parameter 0; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'pluginResourceDownload' defined in class path resource \[stash-context.xml\]: Cannot resolve reference to bean 'contentTypeResolver' while setting constructor argument; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'contentTypeResolver' defined in URL \[jar:file:/opt/atlassian/bitbucket/8.9.0/app/WEB-INF/lib/bitbucket-platform-8.9.0.jar!/com/atlassian/stash/internal/plugin/SimpleContentTypeResolver.class\]: Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate \[com.atlassian.stash.internal.plugin.SimpleContentTypeResolver\]: Constructor threw exception; nested exception is java.lang.NoClassDefFoundError: com/sun/activation/registries/LogSupport  
at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:800)  
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:920)  
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:583)  
at javax.servlet.GenericServlet.init(GenericServlet.java:158)  
at java.base/java.lang.Thread.run(Unknown Source)  
... 18 frames trimmed  
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'pluginResourceDownload' defined in class path resource \[stash-context.xml\]: Cannot resolve reference to bean 'contentTypeResolver' while setting constructor argument; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'contentTypeResolver' defined in URL \[jar:file:/opt/atlassian/bitbucket/8.9.0/app/WEB-INF/lib/bitbucket-platform-8.9.0.jar!/com/atlassian/stash/internal/plugin/SimpleContentTypeResolver.class\]: Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate \[com.atlassian.stash.internal.plugin.SimpleContentTypeResolver\]: Constructor threw exception; nested exception is java.lang.NoClassDefFoundError: com/sun/activation/registries/LogSupport  
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:342)  
... 5 common frames omitted  
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'contentTypeResolver' defined in URL \[jar:file:/opt/atlassian/bitbucket/8.9.0/app/WEB-INF/lib/bitbucket-platform-8.9.0.jar!/com/atlassian/stash/internal/plugin/SimpleContentTypeResolver.class\]: Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate \[com.atlassian.stash.internal.plugin.SimpleContentTypeResolver\]: Constructor threw exception; nested exception is java.lang.NoClassDefFoundError: com/sun/activation/registries/LogSupport  
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateBean(AbstractAutowireCapableBeanFactory.java:1334)  
... 5 common frames omitted  
Caused by: org.springframework.beans.BeanInstantiationException: Failed to instantiate \[com.atlassian.stash.internal.plugin.SimpleContentTypeResolver\]: Constructor threw exception; nested exception is java.lang.NoClassDefFoundError: com/sun/activation/registries/LogSupport  
at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:224)  
... 5 common frames omitted  
Caused by: java.lang.NoClassDefFoundError: com/sun/activation/registries/LogSupport  
at javax.activation.MimetypesFileTypeMap.\<init\>(MimetypesFileTypeMap.java:130)  
at javax.activation.MimetypesFileTypeMap.\<init\>(MimetypesFileTypeMap.java:301)  
at com.atlassian.stash.internal.plugin.SimpleContentTypeResolver.\<init\>(SimpleContentTypeResolver.java:25)  
at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)  
at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)  
at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)  
at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:211)  
... 5 common frames omitted  
Caused by: java.lang.ClassNotFoundException: com.sun.activation.registries.LogSupport  
at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(Unknown Source)  
at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(Unknown Source)  
... 12 common frames omitted


Answers:
author: Nick Murray
body: Any update on this? another thread suggested using Java 1.8, this fixed the problem, but now 1.8 is deprecated as on 8.17.0, and is therefore not a long term solution.


author: ??????? ??????
body: helps write to start-bitbucket.sh

export ATLASSIAN_DIR="/opt/atlassian/bitbucket/app/WEB-INF/lib/WEB-INF/lib"

comments: author: Gonchik Tsymzhitov
body: did not help to me ? :(


author: Baskar Annamalai
body: Hi [@??????? ??????](/t5/user/viewprofilepage/user-id/4356946) ,

Seems like `javax.activation-api-1.x.x.jar` doesn't have the package that previous Bitbucket versions had. You might want to consider upgrading to a different Bitbucket version or updating the javax.mail to the latest manually - take into consideration of CVE as well.

Best regards,  
Baskar Annamalai  
ServiceRocket

comments: author: Gonchik Tsymzhitov
body: Hi [@Baskar Annamalai](/t5/user/viewprofilepage/user-id/5187836) ,

added no luck


Tags: bitbucket-server

server