ONLYOFFICE / ONLYOFFICE/docs-integration-sdk-java

Missing configuration file onlyoffice-docs-formats.json causes startup error

Open
#38 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Java
Stars
44
Forks
9
PR merge metrics
No merged PRs in 30d

Description

Description

When attempting to start the ONLYOFFICE DocumentServer, the application fails due to a missing configuration file: onlyoffice-docs-formats.json.

Steps to Reproduce
  1. Clone the latest version of the ONLYOFFICE/DocumentServer repository.
  2. Follow the setup instructions to build and start the application.
  3. Observe the startup error due to the missing onlyoffice-docs-formats.json file.
Expected Behavior

The application should start without any errors.

Actual Behavior

The application fails to start, and the following error message is displayed:

Environment
ONLYOFFICE DocumentServer version: 8.2
Operating System: docker
Java version: idea + jdk 11

Additional Context

The issue seems to be related to the following code section:

private static final String DOCS_FORMATS_JSON_PATH = "assets/document-formats/onlyoffice-docs-formats.json";
/** Defines a list containing data about supported formats. */
private static List<Format> formats;

static {
    init();
}

protected static void init() {
    ObjectMapper objectMapper = new ObjectMapper();

    InputStream inputStream =  Thread
            .currentThread()
            .getContextClassLoader()
            .getResourceAsStream(DOCS_FORMATS_JSON_PATH);

    if (inputStream == null) {
        inputStream = DefaultDocumentManager.class
                .getClassLoader()
                .getResourceAsStream(DOCS_FORMATS_JSON_PATH);
    }

    try {
        formats = objectMapper.configure(DeserializationFeature.READ_UNKNOWN_ENUM_VALUES_AS_NULL, true)
                .readValue(inputStream, new TypeReference<List<Format>>() { });
    } catch (IOException e) {
        throw new RuntimeException(e);
    }
}

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at DefaultDocumentManager.init() and the DOCS_FORMATS_JSON_PATH constant, then inspect how assets/document-formats/onlyoffice-docs-formats.json is expected to be packaged. Reproduce the documented Docker startup and verify that the missing-resource error is gone and the application starts successfully.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
backend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.