Bug? NoSuchMethodError: AnchorPaneWrapper.LoadLayout in 3.50

jmon

Well-Known Member
Licensed User
Longtime User
Hi,

I get an error in 3.50, and I can't launch my app and work anymore because of it! :
Program started.
Aug 14, 2015 11:49:18 AM com.mchange.v2.log.MLog <clinit>
INFO: MLog clients using java 1.4+ standard logging.
Aug 14, 2015 11:49:18 AM com.mchange.v2.c3p0.C3P0Registry banner
INFO: Initializing c3p0-0.9.2.1 [built 20-March-2013 11:16:28 +0000; debug? true; trace: 10]
java.lang.RuntimeException: java.lang.NoSuchMethodError: anywheresoftware.b4j.objects.PaneWrapper$AnchorPaneWrapper.LoadLayout(Lanywheresoftware/b4a/BA;Ljava/lang/String;)V
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:114)
at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:82)
at anywheresoftware.b4a.BA.raiseEvent(BA.java:84)
at com.xxx.xxxx.main.start(main.java:36)
at com.sun.javafx.application.LauncherImpl.lambda$launchApplication1$159(LauncherImpl.java:863)
at com.sun.javafx.application.LauncherImpl$$Lambda$53/19337296.run(Unknown Source)
at com.sun.javafx.application.PlatformImpl.lambda$runAndWait$172(PlatformImpl.java:326)
at com.sun.javafx.application.PlatformImpl$$Lambda$45/19532686.run(Unknown Source)
at com.sun.javafx.application.PlatformImpl.lambda$null$170(PlatformImpl.java:295)
at com.sun.javafx.application.PlatformImpl$$Lambda$48/26522780.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at com.sun.javafx.application.PlatformImpl.lambda$runLater$171(PlatformImpl.java:294)
at com.sun.javafx.application.PlatformImpl$$Lambda$46/16393153.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$145(WinApplication.java:101)
at com.sun.glass.ui.win.WinApplication$$Lambda$36/22002071.run(Unknown Source)
at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.NoSuchMethodError: anywheresoftware.b4j.objects.PaneWrapper$AnchorPaneWrapper.LoadLayout(Lanywheresoftware/b4a/BA;Ljava/lang/String;)V
at b4j.example.jcustomwindow._initialize(jcustomwindow.java:736)
at com.xxx.xxxx.main._appstart(main.java:598)
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:497)
at anywheresoftware.b4a.shell.Shell.runMethod(Shell.java:563)
at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:224)
at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:156)
at sun.reflect.GeneratedMethodAccessor1.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:93)
... 17 more

This error is quite difficult to debug, since it doesn't point me exactly to where the error is and my project contains 100s of subs. What I know is that it says that the second error is from my jCustomWindow library, but when I run this library apart from my project it works properly.

I guess it is caused by the new / modified loadLayout feature in 3.50.

I use LoadLayout a lot in my app. My only guess is that it could be caused by subs like this:
B4X:
Private Sub CreatePage(TabParent As TabPane, Index As Int)
    Page.Initialize
    Page.Text = ""
    Dim ap As AnchorPane
    ap.Initialize("ap")
    ap.LoadLayout("ProjectsPage")
    Page.Content = ap
    TabParent.Tabs.InsertAt(Index, Page)
End Sub

This error didn't happen in previous versions... Where can I download the previous version? :(

Thank you for your help
Jmon.
 

jmon

Well-Known Member
Licensed User
Longtime User
The error was caused by this line when it was called as an external library:

B4X:
CustomWin.RootPane.LoadLayout("Main")

The code for this line is
B4X:
Private Sub Class_Globals
    Private apWindowContent As AnchorPane
End Sub
'....

'Returns the rootPane of the custom content area. You can load your layout there.
Public Sub getRootPane As AnchorPane
    Return apWindowContent
End Sub

so I just recompiled and it worked.
 
Top