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
import ballerina/io;
import ballerina/data.xmldata;
public function main() returns error? {
string xmlStr = string `
<Data>
<field2>
<str2>2</str2>
<str1>1</str1>
</field2>
</Data>
`;
record {|
record {
string str1;
} field2;
|} rec = check xmldata:parseString(xmlStr);
io:println(rec.field2.str1 is string);
}
This give below runtime error
Running executable
[2024-06-25 17:39:38,961] SEVERE {b7a.log.crash} - class java.lang.Long cannot be cast to class io.ballerina.runtime.api.values.BString (java.lang.Long is in module java.base of loader 'bootstrap'; io.ballerina.runtime.api.values.BString is in unnamed module of loader 'app')
java.lang.ClassCastException: class java.lang.Long cannot be cast to class io.ballerina.runtime.api.values.BString (java.lang.Long is in module java.base of loader 'bootstrap'; io.ballerina.runtime.api.values.BString is in unnamed module of loader 'app')
at io.ballerina.runtime.internal.values.MapValueImpl.getStringValue(MapValueImpl.java:156)
at prakanth.test_xmldata.0.main.main(main.bal:18)
at prakanth.test_xmldata.0.$_init.$moduleExecute(test_xmldata)
at prakanth.test_xmldata.0.$_init.$lambda$$moduleExecute$(test_xmldata)
at io.ballerina.runtime.internal.scheduling.SchedulerItem.execute(SchedulerItem.java:54)
at io.ballerina.runtime.internal.scheduling.Scheduler.run(Scheduler.java:320)
at io.ballerina.runtime.internal.scheduling.Scheduler.runSafely(Scheduler.java:287)
at java.base/java.lang.Thread.run(Thread.java:833)
Steps to reproduce:
Affected Versions:
OS, DB, other environment details and versions:
Related Issues (optional):
Suggested Labels (optional):
Suggested Assignees (optional):
The text was updated successfully, but these errors were encountered:
This issue is NOT closed with a proper Reason/ label. Make sure to add proper reason label before closing. Please add or leave a comment with the proper reason label now.
- Reason/EngineeringMistake - The issue occurred due to a mistake made in the past. - Reason/Regression - The issue has introduced a regression. - Reason/MultipleComponentInteraction - Issue occured due to interactions in multiple components. - Reason/Complex - Issue occurred due to complex scenario. - Reason/Invalid - Issue is invalid. - Reason/Other - None of the above cases.
Description:
This give below runtime error
Steps to reproduce:
Affected Versions:
OS, DB, other environment details and versions:
Related Issues (optional):
Suggested Labels (optional):
Suggested Assignees (optional):
The text was updated successfully, but these errors were encountered: