structurizr / lite

Structurizr Lite
https://docs.structurizr.com/lite
MIT License
226 stars 26 forks source link

Issues with kts scripts #67

Closed FlorentinV-Decathlon closed 11 months ago

FlorentinV-Decathlon commented 1 year ago

Description

Hello, I am facing the following error while browsing the site : java.lang.RuntimeException: Could not load a scripting engine for extension "kts".

Maybe you have an idea?

The issue seems to be similar to this one : https://github.com/structurizr/lite/issues/33

Steps to reproduce

I haven't found a way to systematically reproduce the bug, but these steps produced an error for me :

  1. Navigate to documentation
  2. Navigate to Diagrams
  3. Repeat the operations several times

Screenshot

image

Code sample

workspace {

    model {
        user = person "User"
        softwareSystem = softwareSystem "Software System" {
            test_container = container "Test Container" {
                description "test_container"
                tags "test"
                technology "TEST TECHNOLOGY"
            }
        }

        user -> softwareSystem "Uses"
    }

    # https://github.com/structurizr/dsl/blob/master/docs/language-reference.md#scripts
    !script scripts/copy_containers_tech_as_tags.kts

    views {
        systemContext softwareSystem "Diagram1" {
            include *
            autoLayout
        }
        container softwareSystem "Diagram2" {
            include *
            autoLayout
        }
    }

}

Configuration

Structurizr versions

Device

Severity

Minor

Priority

Low

Resolution

I have no budget, please fix this for free

More information

Content of scripts/copy_containers_tech_as_tags.kts :

import com.structurizr.model.*

// For each container, append defined Technology as new Tag
// in order to help styling (styles are based on tags)
workspace.model.softwareSystems.forEach { ss: SoftwareSystem ->
    ss.containers.forEach { co: Container ->
        val tech: String? = co.technology?.trim()
        if (!tech.isNullOrEmpty()) {
            co.addTags(tech)
        }
    }
}
simonbrowndotje commented 1 year ago

It works for me. Are you using the pre-built Docker image, building your own, or using the .war file?

Screenshot 2023-06-21 at 10 30 05
FlorentinV-Decathlon commented 1 year ago

I use the image published on Dockerhub structurizr/lite:last

Here is the signature I got with the command docker inspect structurizr/lite:latest --format ‘{{.Id}}’ : ‘sha256:2ba22e2783450899c936cf28abc21ba1485210a04c0d0f4a96426dd82450b400’

simonbrowndotje commented 11 months ago

Closing this issue ... feel free to reopen if you find a way to reproduce it.