Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: Cannot generate the package or template using bal health tool in Ballerina 2201.11.0 #43866

Open
Isuranga-2001 opened this issue Mar 4, 2025 · 0 comments
Labels
Area/Shell Issues related to Ballerina Shell CLI tool Team/CompilerFETools Semantic API, Formatter, Shell Type/Bug

Comments

@Isuranga-2001
Copy link

Description

I tried to generate the package for the sample in the ballerina health documentation.

Command that used:
bal health fhir -m package -o ig-carinbb/gen --org-name healthcare_samples --package-name carinbb_package ig-carinbb/definitions/

Directory: <path>\healthcare-samples-main\working-with-health-tool\package-generation

Error message:

ballerina: Oh no, something really went wrong. Bad. Sad.

We appreciate it if you can report the code that broke Ballerina in
https://github.com/ballerina-platform/ballerina-lang/issues with the
log you get below and your sample code.

We thank you for helping make us better.

[2025-03-04 16:36:21,996] SEVERE {b7a.log.crash} - loader constraint violation: when resolving method 'void io.swagger.v3.parser.core.models.SwaggerParseResult.setOpenAPI(io.swagger.v3.oas.models.OpenAPI)' the class loader io.ballerina.cli.launcher.CustomToolClassLoader @59e505b2 of the current class, io/swagger/v3/parser/util/OpenAPIDeserializer, and the class loader 'app' for the method's defining class, io/swagger/v3/parser/core/models/SwaggerParseResult, have different Class objects for the type io/swagger/v3/oas/models/OpenAPI used in the signature (io.swagger.v3.parser.util.OpenAPIDeserializer is in unnamed module of loader io.ballerina.cli.launcher.CustomToolClassLoader @59e505b2, parent loader 'app'; io.swagger.v3.parser.core.models.SwaggerParseResult is in unnamed module of loader 'app') 
java.lang.LinkageError: loader constraint violation: when resolving method 'void io.swagger.v3.parser.core.models.SwaggerParseResult.setOpenAPI(io.swagger.v3.oas.models.OpenAPI)' the class loader io.ballerina.cli.launcher.CustomToolClassLoader @59e505b2 of the current class, io/swagger/v3/parser/util/OpenAPIDeserializer, and the class loader 'app' for the method's defining class, io/swagger/v3/parser/core/models/SwaggerParseResult, have different Class objects for the type io/swagger/v3/oas/models/OpenAPI used in the signature (io.swagger.v3.parser.util.OpenAPIDeserializer is in unnamed module of loader io.ballerina.cli.launcher.CustomToolClassLoader @59e505b2, parent loader 'app'; io.swagger.v3.parser.core.models.SwaggerParseResult is in unnamed module of loader 'app')
        at io.swagger.v3.parser.util.OpenAPIDeserializer.deserialize(OpenAPIDeserializer.java:150)
        at io.swagger.v3.parser.OpenAPIV3Parser.parseJsonNode(OpenAPIV3Parser.java:134)
        at io.swagger.v3.parser.OpenAPIV3Parser.readContents(OpenAPIV3Parser.java:152)
        at io.swagger.v3.parser.OpenAPIV3Parser.readContents(OpenAPIV3Parser.java:99)
        at io.swagger.v3.parser.OpenAPIV3Parser.readContents(OpenAPIV3Parser.java:140)
        at org.wso2.healthcare.codegen.tool.framework.fhir.core.oas.OASGenerator.populateFhirOASBaseStructure(OASGenerator.java:99)
        at org.wso2.healthcare.codegen.tool.framework.fhir.core.oas.OASGenerator.<init>(OASGenerator.java:76)
        at org.wso2.healthcare.codegen.tool.framework.fhir.core.oas.OASGenerator.<clinit>(OASGenerator.java:70)
        at org.wso2.healthcare.codegen.tool.framework.fhir.core.FHIRSpecParser.parseIG(FHIRSpecParser.java:199)
        at io.ballerina.health.cmd.handler.Handler.initializeLib(Handler.java:62)
        at io.ballerina.health.cmd.handler.FhirPackageGenHandler.init(FhirPackageGenHandler.java:66)
        at io.ballerina.health.cmd.handler.HandlerFactory.createHandler(HandlerFactory.java:48)
        at io.ballerina.health.cmd.fhir.FhirSubCmd.engageSubCommand(FhirSubCmd.java:226)
        at io.ballerina.health.cmd.fhir.FhirSubCmd.execute(FhirSubCmd.java:172)
        at java.base/java.util.Optional.ifPresent(Optional.java:178)
        at io.ballerina.cli.launcher.Main.main(Main.java:63)

But package generation is successful on 2201.10.4 distribution.

Steps to Reproduce

No response

Affected Version(s)

Ballerina 2201.11.0

OS, DB, other environment details and versions

Windows

Related area

-> Shell

Related issue(s) (optional)

No response

Suggested label(s) (optional)

No response

Suggested assignee(s) (optional)

No response

@ballerina-bot ballerina-bot added Team/CompilerFETools Semantic API, Formatter, Shell Area/Shell Issues related to Ballerina Shell CLI tool labels Mar 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area/Shell Issues related to Ballerina Shell CLI tool Team/CompilerFETools Semantic API, Formatter, Shell Type/Bug
Projects
None yet
Development

No branches or pull requests

2 participants