FraunhoferIOSB / FAAAST-Service

FA³ST - Fraunhofer Advanced Asset Administration Shell Tools (for Digital Twins)
Other
59 stars 12 forks source link

500 upon bad request #436

Closed arnoweiss closed 1 year ago

arnoweiss commented 1 year ago

Describe the bug The server produces an internal error when not finding a resource.

To Reproduce

  1. POST /shells with some valid AAS in the body including identification aasId
  2. GET /submodels/base64AasId/submodel

Expected behavior This is a bad request (4xx) since there is no submodel that is identifiable via the aasId.

Output


{
  "success" : false,
  "messages" : [ {
    "messageType" : "Exception",
    "text" : "class io.adminshell.aas.v3.model.impl.DefaultAssetAdministrationShell cannot be cast to class io.adminshell.aas.v3.model.Submodel (io.adminshell.aas.v3.model.impl.DefaultAssetAdministrationShell and io.adminshell.aas.v3.model.Submodel are in unnamed module of loader 'app')",
    "code" : "",
    "timestamp" : "2023-05-05T12:12:07.604+00:00"
  } ]
}
mjacoby commented 1 year ago

I was unable to reproduce the issue using the following steps

HTTP POST http://localhost:8080/shells


{
    "idShort": "ExampleAAS",
    "administration":
    {
        "version": "1",
        "revision": "0"
    },
    "identification":
    {
        "idType": "Iri",
        "id": "http://example.org/aas/1"
    },
    "assetInformation":
    {
        "assetKind": "Instance",
        "globalAssetId":
        {
            "keys": [
                {
                    "idType": "Iri",
                    "type": "Asset",
                    "value": "http://example.org/asset/1"
                }
            ]
        }
    },
    "submodels": [  ],
    "modelType":
    {
        "name": "AssetAdministrationShell"
    }
}

HTTP GET http://localhost:8080/submodels/aHR0cDovL2V4YW1wbGUub3JnL2Fhcy8x/submodel where aHR0cDovL2V4YW1wbGUub3JnL2Fhcy8x is the base64URLencoded value http://example.org/aas/1

--> returns HTTP 404 as expected

It tested this with version 0.5.0 and 0.6.0-SNAPSHOT.

Could you please provide detailed infomation on which version you are using and exact steps to reproduce the issue?

arnoweiss commented 1 year ago

Likely a versioning issue.

arnoweiss commented 1 year ago

This was solved by updating to 0.5.0