You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
The contextmapper cli crashes when asked to generate plantuml files for a contextmap which includes an import of another CML file. That other CML file contains the bounded contexts implementing the domains.
To Reproduce
Steps to reproduce the behavior:
As a simple test to isolate the problem I reproduced this issue using the CML "example" code shown on the ContextMapper website in https://contextmapper.org/docs/imports/. It uses two files, a ContextMap.cml and a BoundedContexts.cml file.
Run the command "cm generate -g plantuml -i ContextMap.cml -o src-gen"
Expected behavior
No crash and plantuml files for the aggregate and entities as well.
Screenshots / Exceptions
Context Mapper CLI v6.12.0
Exception in thread "main" java.lang.IllegalArgumentException: resolve against non-hierarchical or relative base
at org.eclipse.emf.common.util.URI$Hierarchical.resolve(URI.java:3548)
at org.eclipse.emf.common.util.URI.resolve(URI.java:5580)
at org.contextmapper.dsl.cml.CMLImportResolver.resolveImportedResources(CMLImportResolver.java:42)
at org.contextmapper.dsl.cml.CMLModelDomainAndSubdomainResolver.initAllDeclaredSubdomainsIncludingImportedOnes(CMLModelDomainAndSubdomainResolver.java:87)
at org.contextmapper.dsl.cml.CMLModelDomainAndSubdomainResolver.(CMLModelDomainAndSubdomainResolver.java:38)
at org.contextmapper.dsl.generator.PlantUMLGenerator.generateFromContextMappingModel(PlantUMLGenerator.java:61)
at org.contextmapper.dsl.generator.AbstractContextMappingModelGenerator.doGenerate(AbstractContextMappingModelGenerator.java:54)
at org.contextmapper.dsl.standalone.StandaloneContextMapper.callGenerator(StandaloneContextMapper.java:61)
at org.contextmapper.cli.commands.GenerateCommand.run(GenerateCommand.java:55)
at org.contextmapper.cli.ContextMapperCLI.run(ContextMapperCLI.java:59)
at org.contextmapper.cli.ContextMapperCLI.main(ContextMapperCLI.java:44)
IDE and Plugin (please complete the following information):
Context Mapper CLI v6.12.0
Visual studio Context Mapper v6.12.0
Additional context
The visual studio plugin does not crash, however it only produces one plantuml file for the contextmap and does not produce any plantuml output for the aggregate/entities. Hence, it seems to fail parsing the imported file.
The text was updated successfully, but these errors were encountered:
rerunner
changed the title
Contextmapper CLI crash when generating plantuml for contextmap with an imported bounded context file.
Contextmapper generator crash when generating plantuml for contextmap with an imported bounded context file.
Nov 28, 2024
The crash can be fixed with
line 55 in GenerateCommand CMLResource cmlResource = cmAPI.loadCML( URI.createFileURI( new File(inputPath).getAbsolutePath() ).toString() );
I have a branch prepared which
changes the global scope provider (reason for plantuml diagram showing only "null" as name)
changes the reference validation for domain objects in workbench context. Import files will validate now, if the context-map exists in the same project.
I started the branch for the last topic and discovered that this issue is connected. Problem is, my branch started on a merge of pull request #366 and touches not only this issue.
I'm currently enjoying holidays without computer besides my phone, I can try what @astmuc mentioned, but only in 2 weeks from now. Have a good change of the year!
Describe the bug
The contextmapper cli crashes when asked to generate plantuml files for a contextmap which includes an import of another CML file. That other CML file contains the bounded contexts implementing the domains.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
No crash and plantuml files for the aggregate and entities as well.
Screenshots / Exceptions
Context Mapper CLI v6.12.0
Exception in thread "main" java.lang.IllegalArgumentException: resolve against non-hierarchical or relative base
at org.eclipse.emf.common.util.URI$Hierarchical.resolve(URI.java:3548)
at org.eclipse.emf.common.util.URI.resolve(URI.java:5580)
at org.contextmapper.dsl.cml.CMLImportResolver.resolveImportedResources(CMLImportResolver.java:42)
at org.contextmapper.dsl.cml.CMLModelDomainAndSubdomainResolver.initAllDeclaredSubdomainsIncludingImportedOnes(CMLModelDomainAndSubdomainResolver.java:87)
at org.contextmapper.dsl.cml.CMLModelDomainAndSubdomainResolver.(CMLModelDomainAndSubdomainResolver.java:38)
at org.contextmapper.dsl.generator.PlantUMLGenerator.generateFromContextMappingModel(PlantUMLGenerator.java:61)
at org.contextmapper.dsl.generator.AbstractContextMappingModelGenerator.doGenerate(AbstractContextMappingModelGenerator.java:54)
at org.contextmapper.dsl.standalone.StandaloneContextMapper.callGenerator(StandaloneContextMapper.java:61)
at org.contextmapper.cli.commands.GenerateCommand.run(GenerateCommand.java:55)
at org.contextmapper.cli.ContextMapperCLI.run(ContextMapperCLI.java:59)
at org.contextmapper.cli.ContextMapperCLI.main(ContextMapperCLI.java:44)
Input files to reproduce
See attached.
BoundedContexts.cml.txt
ContextMap.cml.txt
IDE and Plugin (please complete the following information):
Additional context
The visual studio plugin does not crash, however it only produces one plantuml file for the contextmap and does not produce any plantuml output for the aggregate/entities. Hence, it seems to fail parsing the imported file.
The text was updated successfully, but these errors were encountered: