Unable to run Examples given by Ballerina Integrator Tutorials

190 Views Asked by At

I am new to Ballerina and Ballerina Integrator While running the sample given by Ballerina Integrator tutorials getting an Error. Please help me to sort out the issues.

For the reference here i shared the screenshot and log file Error Screenshot.

java.lang.NoSuchMethodError: org.ballerinalang.jvm.types.BRecordType.<init>(Ljava/lang/String;Lorg/ballerinalang/jvm/types/BPackage;IZI)V
    at ballerina.lang_annotations.___init.$createTypeInstances(lang.annotations)
    at ballerina.lang_annotations.___init.$createTypes(lang.annotations)
    at ballerina.lang_annotations.___init.$currentModuleInit(lang.annotations)
    at ballerina.lang_annotations.___init.ballerina_lang_annotations__init_(lang.annotations:65535)
    at 13473.upload_to_ftp.___init.$moduleInit(upload_to_ftp:65535)
    at 13473.upload_to_ftp.___init.$lambda$$moduleInit$(upload_to_ftp)
    at org.ballerinalang.jvm.scheduling.SchedulerItem.execute(Scheduler.java:486)
    at org.ballerinalang.jvm.scheduling.Scheduler.run(Scheduler.java:237)
    at org.ballerinalang.jvm.scheduling.Scheduler.runSafely(Scheduler.java:207)
    at java.lang.Thread.run(Unknown Source)

[2019-11-21 12:17:32,502] SEVERE {b7a.log.crash} - org.ballerinalang.jvm.types.BRecordType.<init>(Ljava/lang/String;Lorg/ballerinalang/jvm/types/BPackage;IZI)V 
java.lang.NoSuchMethodError: org.ballerinalang.jvm.types.BRecordType.<init>(Ljava/lang/String;Lorg/ballerinalang/jvm/types/BPackage;IZI)V
    at ballerina.lang_annotations.___init.$createTypeInstances(lang.annotations)
    at ballerina.lang_annotations.___init.$createTypes(lang.annotations)
    at ballerina.lang_annotations.___init.$currentModuleInit(lang.annotations)
    at ballerina.lang_annotations.___init.ballerina_lang_annotations__init_(lang.annotations:65535)
    at 13473.upload_to_ftp.___init.$moduleInit(upload_to_ftp:65535)
    at 13473.upload_to_ftp.___init.$lambda$$moduleInit$(upload_to_ftp)
    at org.ballerinalang.jvm.scheduling.SchedulerItem.execute(Scheduler.java:486)
    at org.ballerinalang.jvm.scheduling.Scheduler.run(Scheduler.java:237)
    at org.ballerinalang.jvm.scheduling.Scheduler.runSafely(Scheduler.java:207)
    at java.lang.Thread.run(Unknown Source)```
3

There are 3 best solutions below

0
On BEST ANSWER

Mismatch of the version is problem here. Just install Ballerina Integrator alone which is packed with Ballerina 1.0.2 so no need to install Ballerina again or separately.

Locally installed "Ballerina Integrator with Ballerina" is lower version, In VSCode "Ballerina Integrator with Ballerina" is latest one. Mismatched version is the main problem which i was faced.

I have removed BI and Ballerina plugin from VSCode just tried the samples from random location which is used to refer locally installed BI with Ballerina,now its working fine

1
On

To try out the Ballerina Integrator samples, please make sure that you have installed the Ballerina Integrator installer and using it to run your samples. You can download the latest Ballerina Integrator from here.

To check if you are executing Ballerina Integrator, execute which ballerina command and verify that it is similar to <EI_HOME>/ballerina-integrator/bin/ballerina.

4
On

You can downgrade and upgrade Ballerina versions using the ballerina dist command. ballerina dist pull <distribution> will fetch a given distribution and set it as the active version.