Skip to content

JRS 10.0.0 Docker: cannot save JDBC Data Source, REST returns mandatory.parameter.error "resource body" missing #102

@ErClode

Description

@ErClode

Environment:

  • Repository: TIBCOSoftware/js-docker
  • JasperReports Server: 10.0.0 PRO
  • Docker deployment using jaspersoft-containers/Docker/jrs
  • Webapp image: jasperserver-webapp:10.0.0
  • Buildomatic image: jasperserver-buildomatic:10.0.0
  • PostgreSQL repository: postgres:12
  • Tomcat base image from .env: tomcat:10.1.43-jdk17-temurin
  • JDK base image from .env: eclipse-temurin:17-jdk-noble

Issue:
Saving a JDBC Data Source fails with HTTP 400.

The JDBC connection test works correctly from the UI, but when saving the Data Source, the request fails with:

{
"message": "The mandatory parameter "resource body" is missing.",
"errorCode": "mandatory.parameter.error",
"parameters": [
"resource body"
],
"properties": [
{
"key": "propertyPath",
"value": "resource body"
}
]
}

Reproduction:

  1. Deploy a clean JasperReports Server 10.0.0 Docker environment using js-docker.
  2. Use a clean PostgreSQL repository volume, no migration/import from older Jasper versions.
  3. Login as superuser/superuser.
  4. Create a new JDBC Data Source from the UI.
  5. Use the internal PostgreSQL repository database:
    • Driver: PostgreSQL (org.postgresql.Driver)
    • Host: repository
    • Port: 5432
    • Database: jasperserver
    • URL: jdbc:postgresql://repository:5432/jasperserver
    • Username: postgres
    • Password: postgres
  6. Click "Test Connection": connection succeeds.
  7. Click "Save": save fails with HTTP 400 and mandatory.parameter.error "resource body" missing.

REST reproduction:
Creating a folder via REST works:

PUT /jasperserver-pro/rest_v2/resources/public/Rest_Folder_Test
Content-Type: application/repository.folder+json

Result: HTTP 201

Creating a JDBC Data Source via REST fails:

PUT /jasperserver-pro/rest_v2/resources/public/PG_Repo_DS_Clean_Test?createFolders=false&overwrite=true
Content-Type: application/repository.jdbcDataSource+json
Accept: application/repository.jdbcDataSource+json

Body:
{
"label": "PG_Repo_DS_Clean_Test",
"uri": "/public/PG_Repo_DS_Clean_Test",
"driverClass": "org.postgresql.Driver",
"username": "postgres",
"password": "postgres",
"connectionUrl": "jdbc:postgresql://repository:5432/jasperserver",
"timezone": ""
}

Result:
HTTP 400

{
"message": "The mandatory parameter "resource body" is missing.",
"errorCode": "mandatory.parameter.error",
"parameters": [
"resource body"
],
"properties": [
{
"key": "propertyPath",
"value": "resource body"
}
]
}

Additional tests:

  • Same issue happens in a custom image and in a clean vanilla image.
  • Same issue happens with a clean repository, without importing content from JasperReports Server 7.
  • Same issue happens with SQL Server and PostgreSQL JDBC Data Sources.
  • GET of existing JDBC Data Sources works.
  • Test connection works.
  • PUT folder works.
  • PUT JDBC Data Source fails.
  • Using Content-Type: application/json saves a generic JSON file resource, not a JDBC Data Source, so it is not a valid workaround.

Expected behavior:
A JDBC Data Source should be saved as a repository jdbcDataSource resource.

Actual behavior:
Saving fails with HTTP 400 and "resource body" missing.

I also reproduced the issue from the clean UI:

  • Login: superuser/superuser
  • Create JDBC Data Source under /public
  • PostgreSQL driver: org.postgresql.Driver
  • Host: repository
  • Port: 5432
  • Database: jasperserver
  • Test Connection: successful
  • Save: fails with HTTP 400

Network response:

{
"message": "The mandatory parameter "resource body" is missing.",
"errorCode": "mandatory.parameter.error",
"parameters": [
"resource body"
],
"properties": [
{
"key": "propertyPath",
"value": "resource body"
}

Image Image

]
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions