Scene Builder with ArcGIS API

2410
8
Jump to solution
06-01-2021 12:49 AM
VanyaIvanov
Occasional Contributor

I want to create an interface using Scene Builder. Can i use Scene Builder with ArcGIS Java API? I added ArcGis java API libraries to Scene Builder but i haven't any arcgis elements(except AttributionControl) in the left bar of the Scene Builder with custom elements.

VanyaIvanov_0-1622533689562.png

 

 

 

 
0 Kudos
1 Solution

Accepted Solutions
ColinAnderson1
Esri Contributor

Sorry, slight correction - jnilibs needs to go where the JAR report says it is looking for it. In your case this is C:\Users\osipa\AppData\Local\SceneBuilder.

 

Colin

 

View solution in original post

8 Replies
ColinAnderson1
Esri Contributor

Hi, 

I think you can get it to work by doing some manual modification of the SceneBuilder library files. If you go to the SceneBuilder library location (e.g. AppData\Roaming\Scene Builder\Library) and add or modify filter.txt to contain the following

com.esri.arcgisruntime.internal.mapping.view.AttributionControl
com.esri.arcgisruntime.mapping.view.Callout
com.esri.arcgisruntime.internal.mapping.view.CalloutDefaultView

and then start SceneBuilder you will hopefully see MapView and SceneView as custom controls.

Colin

VanyaIvanov
Occasional Contributor

Thank you. I've added this lines into filter.txt but nothing changes. I still have only AttributionControl

0 Kudos
ColinAnderson1
Esri Contributor

I placed filter.txt (with the lines from above) and arcgis-java-100.11.0.jar into SceneBuilder's library location and I could see MapView and SceneView as custom controls. Maybe try deleting SceneBuilder's library and starting again. I think if you have the filter correct then you should not see AttributionControl in the custom controls.

ColinAnderson1_0-1622728569344.png

I will see if I can find someone else to verify that this works just in case I have missed something. You could also check what SceneBuilder says in the JAR report e.g.

ColinAnderson1_1-1622728686212.png

From that same menu you can also confirm the library location.

Colin

VanyaIvanov
Occasional Contributor

Thank you.

After reinstallation of the Scene Builder, adding of the arcgis-java-100.11.0.jar to the Library folder and adding of this lines into filter.txt i dont see AttributionControl but neither i see MapView or SceneView.

VanyaIvanov_0-1622799328627.png

 

 

 My jar Report:

Exception for: com/esri/arcgisruntime/internal/mapping/view/CalloutDefaultView.class
javafx.fxml.LoadException:
unknown path:2

at javafx.fxml/javafx.fxml.FXMLLoader.constructLoadException(Unknown Source)
at javafx.fxml/javafx.fxml.FXMLLoader$InstanceDeclarationElement.constructValue(Unknown Source)
at javafx.fxml/javafx.fxml.FXMLLoader$ValueElement.processStartElement(Unknown Source)
at javafx.fxml/javafx.fxml.FXMLLoader.processStartElement(Unknown Source)
at javafx.fxml/javafx.fxml.FXMLLoader.loadImpl(Unknown Source)
at javafx.fxml/javafx.fxml.FXMLLoader.load(Unknown Source)
at com.oracle.javafx.scenebuilder.kit.library.util.ExplorerBase.instantiateWithFXMLLoader(ExplorerBase.java:56)
at com.oracle.javafx.scenebuilder.kit.library.util.ExplorerBase.exploreEntry(ExplorerBase.java:111)
at com.oracle.javafx.scenebuilder.kit.library.util.JarExplorer.exploreEntry(JarExplorer.java:83)
at com.oracle.javafx.scenebuilder.kit.library.util.JarExplorer.explore(JarExplorer.java:65)
at com.oracle.javafx.scenebuilder.kit.library.user.LibraryFolderWatcher.exploreAndUpdateLibrary(LibraryFolderWatcher.java:367)
at com.oracle.javafx.scenebuilder.kit.library.user.LibraryFolderWatcher.runDiscovery(LibraryFolderWatcher.java:155)
at com.oracle.javafx.scenebuilder.kit.library.user.LibraryFolderWatcher.run(LibraryFolderWatcher.java:100)
at java.base/java.lang.Thread.run(Unknown Source)
Caused by: java.lang.InstantiationException: com.esri.arcgisruntime.internal.mapping.view.CalloutDefaultView
at java.base/java.lang.Class.newInstance(Unknown Source)
... 13 more
Caused by: java.lang.NoSuchMethodException: com.esri.arcgisruntime.internal.mapping.view.CalloutDefaultView.<init>()
at java.base/java.lang.Class.getConstructor0(Unknown Source)
... 14 more


Exception for: com/esri/arcgisruntime/mapping/view/MapView.class
java.io.IOException: java.lang.ExceptionInInitializerError
at com.oracle.javafx.scenebuilder.kit.library.util.ExplorerBase.instantiateWithFXMLLoader(ExplorerBase.java:60)
at com.oracle.javafx.scenebuilder.kit.library.util.ExplorerBase.exploreEntry(ExplorerBase.java:111)
at com.oracle.javafx.scenebuilder.kit.library.util.JarExplorer.exploreEntry(JarExplorer.java:83)
at com.oracle.javafx.scenebuilder.kit.library.util.JarExplorer.explore(JarExplorer.java:65)
at com.oracle.javafx.scenebuilder.kit.library.user.LibraryFolderWatcher.exploreAndUpdateLibrary(LibraryFolderWatcher.java:367)
at com.oracle.javafx.scenebuilder.kit.library.user.LibraryFolderWatcher.runDiscovery(LibraryFolderWatcher.java:155)
at com.oracle.javafx.scenebuilder.kit.library.user.LibraryFolderWatcher.run(LibraryFolderWatcher.java:100)
at java.base/java.lang.Thread.run(Unknown Source)
Caused by: java.lang.ExceptionInInitializerError
at com.esri.arcgisruntime.mapping.view.MapView.create(MapView.java:93)
at com.esri.arcgisruntime.mapping.view.MapView.<init>(MapView.java:87)
at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
at java.base/java.lang.reflect.Constructor.newInstanceWithCaller(Unknown Source)
at java.base/java.lang.reflect.ReflectAccess.newInstance(Unknown Source)
at java.base/jdk.internal.reflect.ReflectionFactory.newInstance(Unknown Source)
at java.base/java.lang.Class.newInstance(Unknown Source)
at javafx.fxml/javafx.fxml.FXMLLoader$InstanceDeclarationElement.constructValue(Unknown Source)
at javafx.fxml/javafx.fxml.FXMLLoader$ValueElement.processStartElement(Unknown Source)
at javafx.fxml/javafx.fxml.FXMLLoader.processStartElement(Unknown Source)
at javafx.fxml/javafx.fxml.FXMLLoader.loadImpl(Unknown Source)
at javafx.fxml/javafx.fxml.FXMLLoader.load(Unknown Source)
at com.oracle.javafx.scenebuilder.kit.library.util.ExplorerBase.instantiateWithFXMLLoader(ExplorerBase.java:56)
... 7 more
Caused by: java.lang.RuntimeException: Could not find runtime in any of:
- A directory specified by calling ArcGISRuntimeEnvironment.setInstallDirectory()
- The current directory C:\Users\osipa\AppData\Local\SceneBuilder
- A location specified by the environment variable ARCGISRUNTIMESDKJAVA_100_11_0
- Within the ".arcgis" directory in the user's home path C:\Users\osipa\.arcgis
at com.esri.arcgisruntime.ArcGISRuntimeEnvironment.lambda$getInstallDirectory$0(ArcGISRuntimeEnvironment.java:262)
at java.base/java.util.Optional.orElseThrow(Unknown Source)
at com.esri.arcgisruntime.ArcGISRuntimeEnvironment.getInstallDirectory(ArcGISRuntimeEnvironment.java:258)
at com.esri.arcgisruntime.ArcGISRuntimeEnvironment.loadNativeLibraries(ArcGISRuntimeEnvironment.java:693)
at com.esri.arcgisruntime.ArcGISRuntimeEnvironment.initialize(ArcGISRuntimeEnvironment.java:198)
at com.esri.arcgisruntime.internal.jni.CoreGeoView.<clinit>(CoreGeoView.java:52)
... 22 more


Exception for: com/esri/arcgisruntime/mapping/view/Callout.class
javafx.fxml.LoadException:
unknown path:2

at javafx.fxml/javafx.fxml.FXMLLoader.constructLoadException(Unknown Source)
at javafx.fxml/javafx.fxml.FXMLLoader$InstanceDeclarationElement.constructValue(Unknown Source)
at javafx.fxml/javafx.fxml.FXMLLoader$ValueElement.processStartElement(Unknown Source)
at javafx.fxml/javafx.fxml.FXMLLoader.processStartElement(Unknown Source)
at javafx.fxml/javafx.fxml.FXMLLoader.loadImpl(Unknown Source)
at javafx.fxml/javafx.fxml.FXMLLoader.load(Unknown Source)
at com.oracle.javafx.scenebuilder.kit.library.util.ExplorerBase.instantiateWithFXMLLoader(ExplorerBase.java:56)
at com.oracle.javafx.scenebuilder.kit.library.util.ExplorerBase.exploreEntry(ExplorerBase.java:111)
at com.oracle.javafx.scenebuilder.kit.library.util.JarExplorer.exploreEntry(JarExplorer.java:83)
at com.oracle.javafx.scenebuilder.kit.library.util.JarExplorer.explore(JarExplorer.java:65)
at com.oracle.javafx.scenebuilder.kit.library.user.LibraryFolderWatcher.exploreAndUpdateLibrary(LibraryFolderWatcher.java:367)
at com.oracle.javafx.scenebuilder.kit.library.user.LibraryFolderWatcher.runDiscovery(LibraryFolderWatcher.java:155)
at com.oracle.javafx.scenebuilder.kit.library.user.LibraryFolderWatcher.run(LibraryFolderWatcher.java:100)
at java.base/java.lang.Thread.run(Unknown Source)
Caused by: java.lang.InstantiationException: com.esri.arcgisruntime.mapping.view.Callout
at java.base/java.lang.Class.newInstance(Unknown Source)
... 13 more
Caused by: java.lang.NoSuchMethodException: com.esri.arcgisruntime.mapping.view.Callout.<init>()
at java.base/java.lang.Class.getConstructor0(Unknown Source)
... 14 more


Exception for: com/esri/arcgisruntime/mapping/view/SceneView.class
java.io.IOException: java.lang.NoClassDefFoundError: Could not initialize class com.esri.arcgisruntime.internal.jni.CoreGeoView
at com.oracle.javafx.scenebuilder.kit.library.util.ExplorerBase.instantiateWithFXMLLoader(ExplorerBase.java:60)
at com.oracle.javafx.scenebuilder.kit.library.util.ExplorerBase.exploreEntry(ExplorerBase.java:111)
at com.oracle.javafx.scenebuilder.kit.library.util.JarExplorer.exploreEntry(JarExplorer.java:83)
at com.oracle.javafx.scenebuilder.kit.library.util.JarExplorer.explore(JarExplorer.java:65)
at com.oracle.javafx.scenebuilder.kit.library.user.LibraryFolderWatcher.exploreAndUpdateLibrary(LibraryFolderWatcher.java:367)
at com.oracle.javafx.scenebuilder.kit.library.user.LibraryFolderWatcher.runDiscovery(LibraryFolderWatcher.java:155)
at com.oracle.javafx.scenebuilder.kit.library.user.LibraryFolderWatcher.run(LibraryFolderWatcher.java:100)
at java.base/java.lang.Thread.run(Unknown Source)
Caused by: java.lang.NoClassDefFoundError: Could not initialize class com.esri.arcgisruntime.internal.jni.CoreGeoView
at com.esri.arcgisruntime.mapping.view.SceneView.create(SceneView.java:74)
at com.esri.arcgisruntime.mapping.view.SceneView.<init>(SceneView.java:68)
at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
at java.base/java.lang.reflect.Constructor.newInstanceWithCaller(Unknown Source)
at java.base/java.lang.reflect.ReflectAccess.newInstance(Unknown Source)
at java.base/jdk.internal.reflect.ReflectionFactory.newInstance(Unknown Source)
at java.base/java.lang.Class.newInstance(Unknown Source)
at javafx.fxml/javafx.fxml.FXMLLoader$InstanceDeclarationElement.constructValue(Unknown Source)
at javafx.fxml/javafx.fxml.FXMLLoader$ValueElement.processStartElement(Unknown Source)
at javafx.fxml/javafx.fxml.FXMLLoader.processStartElement(Unknown Source)
at javafx.fxml/javafx.fxml.FXMLLoader.loadImpl(Unknown Source)
at javafx.fxml/javafx.fxml.FXMLLoader.load(Unknown Source)
at com.oracle.javafx.scenebuilder.kit.library.util.ExplorerBase.instantiateWithFXMLLoader(ExplorerBase.java:56)
... 7 more


Exception for: com/esri/arcgisruntime/internal/mapping/view/CalloutDefaultView.class
javafx.fxml.LoadException:
unknown path:2

at javafx.fxml/javafx.fxml.FXMLLoader.constructLoadException(Unknown Source)
at javafx.fxml/javafx.fxml.FXMLLoader$InstanceDeclarationElement.constructValue(Unknown Source)
at javafx.fxml/javafx.fxml.FXMLLoader$ValueElement.processStartElement(Unknown Source)
at javafx.fxml/javafx.fxml.FXMLLoader.processStartElement(Unknown Source)
at javafx.fxml/javafx.fxml.FXMLLoader.loadImpl(Unknown Source)
at javafx.fxml/javafx.fxml.FXMLLoader.load(Unknown Source)
at com.oracle.javafx.scenebuilder.kit.library.util.ExplorerBase.instantiateWithFXMLLoader(ExplorerBase.java:56)
at com.oracle.javafx.scenebuilder.kit.library.util.ExplorerBase.exploreEntry(ExplorerBase.java:111)
at com.oracle.javafx.scenebuilder.kit.library.util.JarExplorer.exploreEntry(JarExplorer.java:83)
at com.oracle.javafx.scenebuilder.kit.library.util.JarExplorer.explore(JarExplorer.java:65)
at com.oracle.javafx.scenebuilder.kit.library.user.LibraryFolderWatcher.exploreAndUpdateLibrary(LibraryFolderWatcher.java:367)
at com.oracle.javafx.scenebuilder.kit.library.user.LibraryFolderWatcher.runDiscovery(LibraryFolderWatcher.java:155)
at com.oracle.javafx.scenebuilder.kit.library.user.LibraryFolderWatcher.run(LibraryFolderWatcher.java:100)
at java.base/java.lang.Thread.run(Unknown Source)
Caused by: java.lang.InstantiationException: com.esri.arcgisruntime.internal.mapping.view.CalloutDefaultView
at java.base/java.lang.Class.newInstance(Unknown Source)
... 13 more
Caused by: java.lang.NoSuchMethodException: com.esri.arcgisruntime.internal.mapping.view.CalloutDefaultView.<init>()
at java.base/java.lang.Class.getConstructor0(Unknown Source)
... 14 more


Exception for: com/esri/arcgisruntime/mapping/view/MapView.class
java.io.IOException: java.lang.NoClassDefFoundError: Could not initialize class com.esri.arcgisruntime.internal.jni.CoreMapView
at com.oracle.javafx.scenebuilder.kit.library.util.ExplorerBase.instantiateWithFXMLLoader(ExplorerBase.java:60)
at com.oracle.javafx.scenebuilder.kit.library.util.ExplorerBase.exploreEntry(ExplorerBase.java:111)
at com.oracle.javafx.scenebuilder.kit.library.util.JarExplorer.exploreEntry(JarExplorer.java:83)
at com.oracle.javafx.scenebuilder.kit.library.util.JarExplorer.explore(JarExplorer.java:65)
at com.oracle.javafx.scenebuilder.kit.library.user.LibraryFolderWatcher.exploreAndUpdateLibrary(LibraryFolderWatcher.java:367)
at com.oracle.javafx.scenebuilder.kit.library.user.LibraryFolderWatcher.runDiscovery(LibraryFolderWatcher.java:155)
at com.oracle.javafx.scenebuilder.kit.library.user.LibraryFolderWatcher.run(LibraryFolderWatcher.java:100)
at java.base/java.lang.Thread.run(Unknown Source)
Caused by: java.lang.NoClassDefFoundError: Could not initialize class com.esri.arcgisruntime.internal.jni.CoreMapView
at com.esri.arcgisruntime.mapping.view.MapView.create(MapView.java:93)
at com.esri.arcgisruntime.mapping.view.MapView.<init>(MapView.java:87)
at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
at java.base/java.lang.reflect.Constructor.newInstanceWithCaller(Unknown Source)
at java.base/java.lang.reflect.ReflectAccess.newInstance(Unknown Source)
at java.base/jdk.internal.reflect.ReflectionFactory.newInstance(Unknown Source)
at java.base/java.lang.Class.newInstance(Unknown Source)
at javafx.fxml/javafx.fxml.FXMLLoader$InstanceDeclarationElement.constructValue(Unknown Source)
at javafx.fxml/javafx.fxml.FXMLLoader$ValueElement.processStartElement(Unknown Source)
at javafx.fxml/javafx.fxml.FXMLLoader.processStartElement(Unknown Source)
at javafx.fxml/javafx.fxml.FXMLLoader.loadImpl(Unknown Source)
at javafx.fxml/javafx.fxml.FXMLLoader.load(Unknown Source)
at com.oracle.javafx.scenebuilder.kit.library.util.ExplorerBase.instantiateWithFXMLLoader(ExplorerBase.java:56)
... 7 more


Exception for: com/esri/arcgisruntime/mapping/view/Callout.class
javafx.fxml.LoadException:
unknown path:2

at javafx.fxml/javafx.fxml.FXMLLoader.constructLoadException(Unknown Source)
at javafx.fxml/javafx.fxml.FXMLLoader$InstanceDeclarationElement.constructValue(Unknown Source)
at javafx.fxml/javafx.fxml.FXMLLoader$ValueElement.processStartElement(Unknown Source)
at javafx.fxml/javafx.fxml.FXMLLoader.processStartElement(Unknown Source)
at javafx.fxml/javafx.fxml.FXMLLoader.loadImpl(Unknown Source)
at javafx.fxml/javafx.fxml.FXMLLoader.load(Unknown Source)
at com.oracle.javafx.scenebuilder.kit.library.util.ExplorerBase.instantiateWithFXMLLoader(ExplorerBase.java:56)
at com.oracle.javafx.scenebuilder.kit.library.util.ExplorerBase.exploreEntry(ExplorerBase.java:111)
at com.oracle.javafx.scenebuilder.kit.library.util.JarExplorer.exploreEntry(JarExplorer.java:83)
at com.oracle.javafx.scenebuilder.kit.library.util.JarExplorer.explore(JarExplorer.java:65)
at com.oracle.javafx.scenebuilder.kit.library.user.LibraryFolderWatcher.exploreAndUpdateLibrary(LibraryFolderWatcher.java:367)
at com.oracle.javafx.scenebuilder.kit.library.user.LibraryFolderWatcher.runDiscovery(LibraryFolderWatcher.java:155)
at com.oracle.javafx.scenebuilder.kit.library.user.LibraryFolderWatcher.run(LibraryFolderWatcher.java:100)
at java.base/java.lang.Thread.run(Unknown Source)
Caused by: java.lang.InstantiationException: com.esri.arcgisruntime.mapping.view.Callout
at java.base/java.lang.Class.newInstance(Unknown Source)
... 13 more
Caused by: java.lang.NoSuchMethodException: com.esri.arcgisruntime.mapping.view.Callout.<init>()
at java.base/java.lang.Class.getConstructor0(Unknown Source)
... 14 more


Exception for: com/esri/arcgisruntime/mapping/view/SceneView.class
java.io.IOException: java.lang.NoClassDefFoundError: Could not initialize class com.esri.arcgisruntime.internal.jni.CoreSceneView
at com.oracle.javafx.scenebuilder.kit.library.util.ExplorerBase.instantiateWithFXMLLoader(ExplorerBase.java:60)
at com.oracle.javafx.scenebuilder.kit.library.util.ExplorerBase.exploreEntry(ExplorerBase.java:111)
at com.oracle.javafx.scenebuilder.kit.library.util.JarExplorer.exploreEntry(JarExplorer.java:83)
at com.oracle.javafx.scenebuilder.kit.library.util.JarExplorer.explore(JarExplorer.java:65)
at com.oracle.javafx.scenebuilder.kit.library.user.LibraryFolderWatcher.exploreAndUpdateLibrary(LibraryFolderWatcher.java:367)
at com.oracle.javafx.scenebuilder.kit.library.user.LibraryFolderWatcher.runDiscovery(LibraryFolderWatcher.java:155)
at com.oracle.javafx.scenebuilder.kit.library.user.LibraryFolderWatcher.run(LibraryFolderWatcher.java:100)
at java.base/java.lang.Thread.run(Unknown Source)
Caused by: java.lang.NoClassDefFoundError: Could not initialize class com.esri.arcgisruntime.internal.jni.CoreSceneView
at com.esri.arcgisruntime.mapping.view.SceneView.create(SceneView.java:74)
at com.esri.arcgisruntime.mapping.view.SceneView.<init>(SceneView.java:68)
at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
at java.base/java.lang.reflect.Constructor.newInstanceWithCaller(Unknown Source)
at java.base/java.lang.reflect.ReflectAccess.newInstance(Unknown Source)
at java.base/jdk.internal.reflect.ReflectionFactory.newInstance(Unknown Source)
at java.base/java.lang.Class.newInstance(Unknown Source)
at javafx.fxml/javafx.fxml.FXMLLoader$InstanceDeclarationElement.constructValue(Unknown Source)
at javafx.fxml/javafx.fxml.FXMLLoader$ValueElement.processStartElement(Unknown Source)
at javafx.fxml/javafx.fxml.FXMLLoader.processStartElement(Unknown Source)
at javafx.fxml/javafx.fxml.FXMLLoader.loadImpl(Unknown Source)
at javafx.fxml/javafx.fxml.FXMLLoader.load(Unknown Source)
at com.oracle.javafx.scenebuilder.kit.library.util.ExplorerBase.instantiateWithFXMLLoader(ExplorerBase.java:56)
... 7 more

0 Kudos
ColinAnderson1
Esri Contributor

Hi, 

The error output indicates that the native libs for runtime cannot be found when SceneBuilder tries to construct the controls. One way to fix that would be to copy the jniLIbs folder into SceneBuilder's library folder.

Colin

VanyaIvanov
Occasional Contributor

I did it but nothing changed, Jar Report is the same.

VanyaIvanov_0-1623058456168.png

 

0 Kudos
ColinAnderson1
Esri Contributor

Sorry, slight correction - jnilibs needs to go where the JAR report says it is looking for it. In your case this is C:\Users\osipa\AppData\Local\SceneBuilder.

 

Colin

 

VanyaIvanov
Occasional Contributor

Thank you. It works!

0 Kudos