structurizr / cli

A command line utility for Structurizr.
https://docs.structurizr.com/cli
Apache License 2.0
492 stars 75 forks source link

Exception in thread "main" BUG! exception in phase 'semantic analysis' in source unit 'Script1.groovy' Unsupported class file major version 64 #127

Closed psacchitella closed 1 year ago

psacchitella commented 1 year ago

Description

I updated to the on-prem instance version 3080. Now the !script throws the attached error when using this command. structurizr-cli push -url http://localhost:9393/api -id 2 -key 52310afd-b834-4d87-9dab-0f249c2869f2 -secret 5af59181-53bb-4fa5-8977-01720c5d01e8 -w workspace.dsl

This error does not occur when running the structurizr-lite image directly reading from the workspace.dsl file.

Steps to reproduce

  1. Use workspace.views.views.each { it.enableAutomaticLayout(com.structurizr.view.AutomaticLayout.RankDirection.TopBottom, 300, 300, 400, false) } in the views.dsl page.
  2. run structurizr-cli push -url http://localhost:9393/api -id 2 -key 52310afd-b834-4d87-9dab-0f249c2869f2 -secret 5af59181-53bb-4fa5-8977-01720c5d01e8 -w workspace.dsl
  3. see error message.

Screenshot

No response

Code sample

!script groovy {
Fails if this is uncommented ->>>   // workspace.views.views.findAll { it instanceof com.structurizr.view.ModelView }.each { it.enableAutomaticLayout(com.structurizr.view.AutomaticLayout.RankDirection.TopBottom, 400, 400, 600, false) }
Works fine -->>> topLayer = workspace.views.getViewWithKey("plutoTVComplete");

Works fine -->>>    println("Description - " + topLayer.getDescription());
Fails if this is uncommented ->>> workspace.views.views.each { it.enableAutomaticLayout(com.structurizr.view.AutomaticLayout.RankDirection.TopBottom, 300, 300, 400, false) }
        // println("Description - ");

    }

Configuration

Structurizr on-prem build 3080 or Structurizr on-prem build 3068 structurizr-cli 1.30.0

Severity

Critical

Priority

High

Resolution

I have no budget, please fix this for free

More information

No response

psacchitella commented 1 year ago

Sorry I put this in the wrong repo, I appreciate the support. I just noticed that the push command works fine is I choose the workspace.json file instead of the workspace.dsl file. This is still an issue for us as tracking changes in Github for the workspace.dsl file is difficult and requires manual merging each time. Cheers, Phil

simonbrowndotje commented 1 year ago

Googling Unsupported class file major version 64 should provide some hints ... it sounds like your CLI is using an incompatible version of the Java runtime.

psacchitella commented 1 year ago

Okay I will try changing the runtime and see where it goes. Thank you. It woks fine on the other commands and if there isn't a filtered view though. I will get back to you today.

psacchitella commented 1 year ago

So the issue is running the CLI tools on my mac. I am sure it is the Run time as you said. I was able to make it work using the CLI docker container.