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

CCE with Java interop #30949

Closed
rdhananjaya opened this issue Jun 2, 2021 · 1 comment · Fixed by #31288
Closed

CCE with Java interop #30949

rdhananjaya opened this issue Jun 2, 2021 · 1 comment · Fixed by #31288
Assignees
Labels
Points/3 Equivalent to three days effort Priority/Blocker Team/jBallerina All the issues related to BIR, JVM backend code generation and runtime Type/Bug

Comments

@rdhananjaya
Copy link
Member

Description:
https://stackoverflow.com/questions/67796448/issues-calling-java-from-ballerina

Steps to reproduce:

Affected Versions:

OS, DB, other environment details and versions:

Related Issues (optional):

Suggested Labels (optional):

Suggested Assignees (optional):

@rdhananjaya rdhananjaya added Type/Bug Priority/Blocker Team/jBallerina All the issues related to BIR, JVM backend code generation and runtime labels Jun 2, 2021
@gabilang
Copy link
Contributor

Code to reproduce the issue:

Java code:

package javalibs.app;

public class App {
    public static int status = 1;
    
    public static int[] intArray() throws Exception {
        int arr[] = {1,2,3};
        if (status == 1) {
            return arr;
        } else {
            throw new Exception("Invalid Status");
        }
            
    }
}

Ballerina code:

import ballerina/jballerina.java;
import ballerina/io;
 
public function main() {
   handle|error h = intArray();
   io:println(h);
}
 
function intArray() returns handle|error = @java:Method {
   'class: "javalibs.app.App"
} external;

returned error message:

error("java.lang.ClassCastException",message="class [I cannot be cast to class io.ballerina.runtime.api.values.BValue ([I is in module java.base of loader 'bootstrap'; io.ballerina.runtime.api.values.BValue is in unnamed module of loader 'app')")```

@warunalakshitha warunalakshitha added this to To do in Sprint 33 - JBallerina Runtime via automation Jun 17, 2021
@riyafa riyafa moved this from To do to In progress in Sprint 33 - JBallerina Runtime Jun 17, 2021
@riyafa riyafa added the Points/3 Equivalent to three days effort label Jun 17, 2021
@warunalakshitha warunalakshitha added this to To do in Bug Fixing via automation Jun 25, 2021
@warunalakshitha warunalakshitha moved this from To do to PR Sent in Bug Fixing Jun 25, 2021
@warunalakshitha warunalakshitha moved this from In progress to Blocked in Sprint 33 - JBallerina Runtime Jun 25, 2021
Bug Fixing automation moved this from PR Sent to Done Jun 29, 2021
Sprint 33 - JBallerina Runtime automation moved this from Blocked to Done Jun 29, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Points/3 Equivalent to three days effort Priority/Blocker Team/jBallerina All the issues related to BIR, JVM backend code generation and runtime Type/Bug
Projects
No open projects
Development

Successfully merging a pull request may close this issue.

3 participants