Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

java.lang.ClassNotFoundException: com.sun.activation.registries.LogSupport

Андрей Каракуца
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
July 27, 2024

 

 

Hey Guys!
I also have such error and I've tried to setup Oracle JDK 8, 11 and OpenJDK 8, 11 and with all of them Bitbucket restarts all the time.


Here is log with original start:

2024-07-27 23:20:34 INFO:root:User is currently root. Will downgrade run user to bitbucket
2024-07-27 23:20:34 INFO:root:Running Bitbucket with command '/opt/atlassian/bitbucket/bin/exec-bitbucket-node.sh', arguments ['/opt/atlassian/bitbucket/bin/exec-bitbucket-node.sh']
2024-07-27 23:20:34 /opt/atlassian/bitbucket/bin/_exec-webapp.sh: line 64: \nStarting Bitbucket webapp at http://localhost:${bitbucket.http.port}${bitbucket.context}: bad substitution
2024-07-27 23:20:34 Starting Atlassian Bitbucket as the current user
2024-07-27 23:20:34 Starting Atlassian Bitbucket as the current user
2024-07-27 23:20:35 20:20:35.642 [main] INFO com.atlassian.security.serialfilter.DeserializationFilterConfigurator - Global serial filter set to JDK 11 DeserializationFilter
2024-07-27 23:20:37 2024-07-27 20:20:37,179 INFO [main] c.a.b.i.b.BitbucketServerApplication Starting BitbucketServerApplication v8.9.8 using Java 17.0.12 on bitbucket with PID 7 (/opt/atlassian/bitbucket/app/WEB-INF/classes started by bitbucket in /var/atlassian/application-data/bitbucket)
2024-07-27 23:20:37 2024-07-27 20:20:37,181 INFO [main] c.a.b.i.b.BitbucketServerApplication No active profile set, falling back to 1 default profile: "default"
2024-07-27 23:20:38 2024-07-27 20:20:38,318 INFO [main] c.a.b.i.boot.log.BuildInfoLogger Starting Bitbucket 8.9.8 (1ae6adb built on Mon Dec 11 03:12:09 UTC 2023)
2024-07-27 23:20:38 2024-07-27 20:20:38,318 INFO [main] c.a.b.i.boot.log.BuildInfoLogger JVM: Eclipse Adoptium OpenJDK 64-Bit Server VM 17.0.12+7
2024-07-27 23:20:39 2024-07-27 20:20:39,772 INFO [main] c.a.b.i.b.BitbucketServerApplication Started BitbucketServerApplication in 3.934 seconds (JVM running for 5.432)
2024-07-27 23:20:43 2024-07-27 20:20:43,068 INFO [spring-startup] c.a.s.internal.home.HomeLockAcquirer Successfully acquired lock on home directory /var/atlassian/application-data/bitbucket
2024-07-27 23:20:43 2024-07-27 20:20:43,079 WARN [spring-startup] c.a.s.internal.home.HomeValidator Downgrading Bitbucket from 9.0.0 to 8.9.8
2024-07-27 23:20:46 2024-07-27 20:20:46,740 INFO [spring-startup] c.a.s.internal.home.HomeLockAcquirer Successfully acquired lock on home directory /var/atlassian/application-data/bitbucket/shared
2024-07-27 23:20:48 2024-07-27 20:20:48,232 WARN [spring-startup] com.hazelcast.instance.Node [172.18.0.5]:5701 [bitbucket] [3.12.13] No join method is enabled! Starting standalone.
2024-07-27 23:21:04 2024-07-27 20:21:04,409 INFO [spring-startup] c.a.s.i.s.g.m.DefaultSidecarManager Sidecar started after 6024ms
2024-07-27 23:21:04 2024-07-27 20:21:04,903 WARN [spring-startup] o.s.w.c.s.XmlWebApplicationContext Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'contentTypeResolver' defined in URL [jar:file:/opt/atlassian/bitbucket/app/WEB-INF/lib/bitbucket-platform-8.9.8.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
2024-07-27 23:21:05 2024-07-27 20:21:05,729 INFO [spring-startup] c.a.s.i.s.g.m.DefaultSidecarManager Sidecar has stopped (Exit code: 0)
2024-07-27 23:21:05 2024-07-27 20:21:05,786 INFO [spring-startup] c.a.s.internal.home.HomeLockAcquirer Releasing lock on /var/atlassian/application-data/bitbucket/shared
2024-07-27 23:21:05 2024-07-27 20:21:05,797 INFO [spring-startup] c.a.s.internal.home.HomeLockAcquirer Releasing lock on /var/atlassian/application-data/bitbucket
2024-07-27 23:21:05 2024-07-27 20:21:05,801 ERROR [spring-startup] c.a.j.s.w.s.JohnsonDispatcherServlet SpringMVC dispatcher [springMvc] could not be started
2024-07-27 23:21:05 org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'contentTypeResolver' defined in URL [jar:file:/opt/atlassian/bitbucket/app/WEB-INF/lib/bitbucket-platform-8.9.8.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
2024-07-27 23:21:05 at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateBean(AbstractAutowireCapableBeanFactory.java:1334)
2024-07-27 23:21:05 at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:929)
2024-07-27 23:21:05 at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:591)
2024-07-27 23:21:05 at javax.servlet.GenericServlet.init(GenericServlet.java:143)
2024-07-27 23:21:05 at java.base/java.lang.Thread.run(Thread.java:840)
2024-07-27 23:21:05 ... 16 frames trimmed
2024-07-27 23:21:05 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
2024-07-27 23:21:05 at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:226)
2024-07-27 23:21:05 ... 5 common frames omitted
2024-07-27 23:21:05 Caused by: java.lang.NoClassDefFoundError: com/sun/activation/registries/LogSupport
2024-07-27 23:21:05 at javax.activation.MimetypesFileTypeMap.<init>(MimetypesFileTypeMap.java:130)
2024-07-27 23:21:05 at javax.activation.MimetypesFileTypeMap.<init>(MimetypesFileTypeMap.java:301)
2024-07-27 23:21:05 at com.atlassian.stash.internal.plugin.SimpleContentTypeResolver.<init>(SimpleContentTypeResolver.java:25)
2024-07-27 23:21:05 at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
2024-07-27 23:21:05 at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:77)
2024-07-27 23:21:05 at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
2024-07-27 23:21:05 at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:213)
2024-07-27 23:21:05 ... 5 common frames omitted
2024-07-27 23:21:05 Caused by: java.lang.ClassNotFoundException: com.sun.activation.registries.LogSupport
2024-07-27 23:21:05 at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:641)
2024-07-27 23:21:05 at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:188)
2024-07-27 23:21:05 ... 12 common frames omitted


 

 
Docker-compose part for this log:



bitbucket:
image: atlassian/bitbucket:8.9.8-ubuntu-jdk17
container_name: bitbucket
hostname: bitbucket
restart: always
environment:
BITBUCKET_HOME: /var/atlassian/application-data/bitbucket/
JDBC_DRIVER: org.postgresql.Driver
JDBC_URL: 'jdbc:postgresql://postgres-sql-infrastructure:5432/bitbucket'
JDBC_USER: 'jira'
JDBC_PASSWORD: 'DA.13jpj93%eBw_Q'
SEARCH_ENABLED: 'false'
# OPENSEARCH_URL: 'http://opensearch:9200'
#SERVER_SCHEME: 'https'
#SERVER_SECURE: 'true'
#SERVER_PROXY_PORT: '443'
#SERVER_PROXY_NAME: 'bitbucket.mysite.com'
JVM_MINIMUM_MEMORY: 512m
JVM_MAXIMUM_MEMORY: 2048m
volumes:
- bitbucket_data:/var/atlassian/application-data/bitbucket
networks:
- ${GLOBAL_NETWORK}
depends_on:
- postgres-sql-infrastructure
# - opensearch
ports:
- 7990:7990
- 7999:7999

 

To setup custom Java version I've used scripts generated with ChatGPT like this:
Dockerfile:

# Use the official Atlassian Bitbucket Server image as a base
FROM atlassian/bitbucket:8.6.1

# Install necessary packages
RUN apt-get update && apt-get install -y wget tar

# Download and install Eclipse Temurin OpenJDK 11
RUN wget https://github.com/adoptium/temurin11-binaries/releases/download/jdk-11.0.18%2B10/OpenJDK11U-jdk_x64_linux_hotspot_11.0.18_10.tar.gz -O /tmp/OpenJDK11U-jdk_x64_linux.tar.gz && \
mkdir -p /usr/lib/jvm && \
tar -xzf /tmp/OpenJDK11U-jdk_x64_linux.tar.gz -C /usr/lib/jvm && \
rm /tmp/OpenJDK11U-jdk_x64_linux.tar.gz && \
mv /usr/lib/jvm/jdk-11* /usr/lib/jvm/temurin-java11

# Set JAVA_HOME to Temurin OpenJDK 11
ENV JAVA_HOME=/usr/lib/jvm/temurin-java11
ENV PATH=$JAVA_HOME/bin:$PATH

# Verify the Java installation
RUN java -version

# Copy the custom start script
COPY start-bitbucket-custom.sh /opt/atlassian/bitbucket/bin/start-bitbucket-custom.sh

# Make the custom start script executable
RUN chmod +x /opt/atlassian/bitbucket/bin/start-bitbucket-custom.sh

# Define the entry point script
ENTRYPOINT ["/opt/atlassian/bitbucket/bin/start-bitbucket-custom.sh"]


start-bitbucket-custom.sh:

#!/bin/bash

# Set JAVA_HOME to Temurin OpenJDK 11
export JAVA_HOME=/usr/lib/jvm/temurin-java11
export PATH=$JAVA_HOME/bin:$PATH

# Log the Java version being used
echo "Using Java version:"
java -version

# Start Bitbucket
exec /opt/atlassian/bitbucket/bin/start-bitbucket.sh "$@"


Log for such setup:


2024-07-27 22:56:45 Using Java version:
2024-07-27 22:56:46 Starting Atlassian Bitbucket as the current user
2024-07-27 22:56:49
2024-07-27 22:56:49 Starting the bundled search server
2024-07-27 22:56:49 Hint: Run start-bitbucket.sh --no-search to skip starting the bundled search server
2024-07-27 22:56:52 Bundled search server started successfully
2024-07-27 22:56:52
2024-07-27 22:56:46 openjdk version "11.0.18" 2023-01-17
2024-07-27 22:56:46 OpenJDK Runtime Environment Temurin-11.0.18+10 (build 11.0.18+10)
2024-07-27 22:56:46 OpenJDK 64-Bit Server VM Temurin-11.0.18+10 (build 11.0.18+10, mixed mode)
2024-07-27 22:56:52 Bitbucket is being run with a umask that contains potentially unsafe settings.
2024-07-27 22:56:52 The following issues were found with the mask "u=rwx,g=rx,o=rx" (0022):
2024-07-27 22:56:52 - Access is allowed to 'others'. It is recommended that 'others' be denied
2024-07-27 22:56:52 all access for security reasons.
2024-07-27 22:56:52 The recommended umask for Bitbucket is "u=,g=w,o=rwx" (0027) and can be
2024-07-27 22:56:52 configured in _start-webapp.sh
2024-07-27 22:56:52
2024-07-27 22:56:52 Starting Bitbucket webapp at http://localhost:7990
2024-07-27 22:56:52 The Bitbucket webapp has been started.
2024-07-27 22:56:52
2024-07-27 22:56:52 If you cannot access Bitbucket within 3 minutes, or encounter other issues, check the troubleshooting guide at:
2024-07-27 22:56:52 https://go.atlassian.com/bbs-troubleshooting-installations
2024-07-27 22:56:53 Using Java version:
2024-07-27 22:56:53 Starting Atlassian Bitbucket as the current user
2024-07-27 22:56:55
2024-07-27 22:56:55 Starting the bundled search server
2024-07-27 22:56:55 Hint: Run start-bitbucket.sh --no-search to skip starting the bundled search server
2024-07-27 22:56:58 Bundled search server started successfully
2024-07-27 22:56:58
2024-07-27 22:56:58 Bitbucket is being run with a umask that contains potentially unsafe settings.
2024-07-27 22:56:58 The following issues were found with the mask "u=rwx,g=rx,o=rx" (0022):
2024-07-27 22:56:58 - Access is allowed to 'others'. It is recommended that 'others' be denied
2024-07-27 22:56:58 all access for security reasons.
2024-07-27 22:56:58 The recommended umask for Bitbucket is "u=,g=w,o=rwx" (0027) and can be
2024-07-27 22:56:58 configured in _start-webapp.sh
2024-07-27 22:56:58
2024-07-27 22:56:58 Starting Bitbucket webapp at http://localhost:7990
2024-07-27 22:56:58 The Bitbucket webapp has been started.
2024-07-27 22:56:58
2024-07-27 22:56:58 If you cannot access Bitbucket within 3 minutes, or encounter other issues, check the troubleshooting guide at:
2024-07-27 22:56:58 https://go.atlassian.com/bbs-troubleshooting-installations
2024-07-27 22:56:59 Using Java version:
2024-07-27 22:56:59 Starting Atlassian Bitbucket as the current user
2024-07-27 22:57:01
2024-07-27 22:57:01 Starting the bundled search server
2024-07-27 22:57:01 Hint: Run start-bitbucket.sh --no-search to skip starting the bundled search server
2024-07-27 22:57:04 Bundled search server started successfully
2024-07-27 22:57:04
2024-07-27 22:57:04 Bitbucket is being run with a umask that contains potentially unsafe settings.
2024-07-27 22:57:04 The following issues were found with the mask "u=rwx,g=rx,o=rx" (0022):
2024-07-27 22:57:04 - Access is allowed to 'others'. It is recommended that 'others' be denied
2024-07-27 22:57:04 all access for security reasons.
2024-07-27 22:57:04 The recommended umask for Bitbucket is "u=,g=w,o=rwx" (0027) and can be
2024-07-27 22:57:04 configured in _start-webapp.sh
2024-07-27 22:57:04
2024-07-27 22:57:04 Starting Bitbucket webapp at http://localhost:7990
2024-07-27 22:57:04 The Bitbucket webapp has been started.
2024-07-27 22:57:04
2024-07-27 22:57:04 If you cannot access Bitbucket within 3 minutes, or encounter other issues, check the troubleshooting guide at:
2024-07-27 22:57:04 https://go.atlassian.com/bbs-troubleshooting-installations
2024-07-27 22:57:05 Using Java version:
2024-07-27 22:57:05 Starting Atlassian Bitbucket as the current user
2024-07-27 22:57:07
2024-07-27 22:57:07 Starting the bundled search server
2024-07-27 22:57:07 Hint: Run start-bitbucket.sh --no-search to skip starting the bundled search server
2024-07-27 22:57:10 Bundled search server started successfully
2024-07-27 22:57:10
2024-07-27 22:57:10 Bitbucket is being run with a umask that contains potentially unsafe settings.
2024-07-27 22:57:10 The following issues were found with the mask "u=rwx,g=rx,o=rx" (0022):
2024-07-27 22:57:10 - Access is allowed to 'others'. It is recommended that 'others' be denied
2024-07-27 22:57:10 all access for security reasons.
2024-07-27 22:57:10 The recommended umask for Bitbucket is "u=,g=w,o=rwx" (0027) and can be
2024-07-27 22:57:10 configured in _start-webapp.sh
2024-07-27 22:57:10
2024-07-27 22:57:10 Starting Bitbucket webapp at http://localhost:7990
2024-07-27 22:57:10 The Bitbucket webapp has been started.
2024-07-27 22:57:10
2024-07-27 22:57:10 If you cannot access Bitbucket within 3 minutes, or encounter other issues, check the troubleshooting guide at:
2024-07-27 22:57:10 https://go.atlassian.com/bbs-troubleshooting-installations

 

0 answers

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events