Bug? [SOLVED] B4J 2.80 Beta Error Inline Java

Discussion in 'B4J Bugs & Wishlist' started by rwblinn, Feb 3, 2015.

  1. rwblinn

    rwblinn Well-Known Member Licensed User

    Hi

    SOLVED = See below

    when executing following code (JavaObject lib is included)

    Code:
    Sub Process_Globals
        
    Private fx As JFX
        
    Private MainForm As Form
        
    Private nativeMe As JavaObject
    End Sub

    Sub AppStart (Form1 As Form, Args() As String)
        MainForm = Form1
        
    'MainForm.RootPane.LoadLayout("Layout1") 'Load the layout file.
        MainForm.Show
        
    ' DO NOT USE as for B4A
        ' nativeMe.InitializeContext
        ' USE
        nativeMe = Me
        nativeMe.RunMethod(
    "Test"Null)
    End Sub

    #If JAVA
    public static void Test() {
        System.out.println("Moin Moin");
    }
    #End If
    receive error

    Code:
    Program started.
    main._appstart (java line: 
    53)
    java.lang.NoSuchFieldException: sharedProcessBA
        at java.lang.Class.getDeclaredField(Class.java:
    2062)
        at anywheresoftware.b4j.object.JavaObject.InitializeContext(
    JavaObject.java:55)
        at b4j.example.main._appstart(main.java:
    53)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:
    62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:
    43)
        at java.lang.reflect.Method.invoke(Method.java:
    483)
        at anywheresoftware.b4a.BA.raiseEvent2(BA.java:
    93)
        at anywheresoftware.b4a.BA.raiseEvent(BA.java:
    84)
        at b4j.example.main.start(main.java:
    36)
        at com.sun.javafx.application.LauncherImpl.lambda$launchApplication1$
    153(LauncherImpl.java:821)
        at com.sun.javafx.application.LauncherImpl$$Lambda$
    51/4360305.run(Unknown Source)
        at com.sun.javafx.application.PlatformImpl.lambda$runAndWait$
    166(PlatformImpl.java:323)
        at com.sun.javafx.application.PlatformImpl$$Lambda$
    45/7100574.run(Unknown Source)
        at com.sun.javafx.application.PlatformImpl.lambda$
    null$164(PlatformImpl.java:292)
        at com.sun.javafx.application.PlatformImpl$$Lambda$
    47/10819947.run(Unknown Source)
        at java.security.AccessController.doPrivileged(Native Method)
        at com.sun.javafx.application.PlatformImpl.lambda$runLater$
    165(PlatformImpl.java:291)
        at com.sun.javafx.application.PlatformImpl$$Lambda$
    46/7135120.run(Unknown Source)
        at com.sun.glass.ui.InvokeLaterDispatcher$
    Future.run(InvokeLaterDispatcher.java:95)
        at com.sun.glass.ui.win.WinApplication._runLoop(Native Method)
        at com.sun.glass.ui.win.WinApplication.lambda$
    null$141(WinApplication.java:102)
        at com.sun.glass.ui.win.WinApplication$$Lambda$
    37/24247422.run(Unknown Source)
        at java.lang.Thread.run(
    Thread.java:745)
     
    Last edited: Feb 3, 2015
    somed3v3loper likes this.
  2. mprimus

    mprimus Member Licensed User

    Hi,
    I get java.lang.RuntimeException: Object should first be initialized (JavaObject). running UI-helloworld with C:\Program Files (x86)\Java\jdk1.8.0_112\bin\javac.exe

    thx for help

    Mario

    #####
    Waiting for debugger to connect...
    Program started.
    Error occurred on line: 24 (Main)
    java.lang.RuntimeException: Object should first be initialized (JavaObject).
    at anywheresoftware.b4a.AbsObjectWrapper.getObject(AbsObjectWrapper.java:32)
    at anywheresoftware.b4j.object.JavaObject.getCurrentClass(JavaObject.java:258)
    at anywheresoftware.b4j.object.JavaObject.RunMethod(JavaObject.java:118)
    at b4j.example.main._appstart(main.java:72)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at anywheresoftware.b4a.shell.Shell.runMethod(Shell.java:612)
    at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:226)
    at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:159)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at anywheresoftware.b4a.BA.raiseEvent2(BA.java:93)
    at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:90)
    at anywheresoftware.b4a.BA.raiseEvent(BA.java:84)
    at b4j.example.main.start(main.java:42)
    at com.sun.javafx.application.LauncherImpl.lambda$launchApplication1$162(LauncherImpl.java:863)
    at com.sun.javafx.application.PlatformImpl.lambda$runAndWait$175(PlatformImpl.java:326)
    at com.sun.javafx.application.PlatformImpl.lambda$null$173(PlatformImpl.java:295)
    at java.security.AccessController.doPrivileged(Native Method)
    at com.sun.javafx.application.PlatformImpl.lambda$runLater$174(PlatformImpl.java:294)
    at com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:95)
    at com.sun.glass.ui.win.WinApplication._runLoop(Native Method)
    at com.sun.glass.ui.win.WinApplication.lambda$null$148(WinApplication.java:191)
    at java.lang.Thread.run(Thread.java:745)
    ####
     
  3. Erel

    Erel Administrator Staff Member Licensed User

    It has nothing to do with this thread. Please start a new one in the questions forum.
     
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice