Hi.
We're testing deployment out for this product: Get started with JavaFX (BETA)—ArcGIS Runtime SDK for Java | ArcGIS for Developers
I know it's a beta soon to be replaced by Quartz...but...question:
When doing a maven : package, does this require some artifacts to be included in the build path that we must first create with ArcGIS Runtime Java Deployment Builder?
We can compile/run in Eclipse from JDT and the app w/a FXMap in it runs fine, we can compile and package up in maven w/no errors....however when we run a JavaFX app as a java -jar [myapp] with the same src, the FXMap is just a blank nothingness in the scene. Introspection on the scene graph at runtime after an mvn:package > deploy...the FXMap component is never spawned into the scene. Tricky - but effective!
Is this as designed and, if so, what is the deployment strategy? We'd like to push this into an uberjar with OneJar, FYI, for some testing.
Thanks in advance,
Eric
Solved! Go to Solution.
From what I understand, you did not use the Deployment Builder installed with your ArcGIS Runtime SDK for Java.
You should find your answer in these pages :
Build a Runtime deployment—ArcGIS Runtime SDK for Java | ArcGIS for Developers
Deploy your app—ArcGIS Runtime SDK for Java | ArcGIS for Developers
In our project, we have deploy the ArcGIS Deployment folder on our Nexus and manage with maven (using profil in our pom) to automatically attach this folder when performing our mvn release.
Jeremie
From what I understand, you did not use the Deployment Builder installed with your ArcGIS Runtime SDK for Java.
You should find your answer in these pages :
Build a Runtime deployment—ArcGIS Runtime SDK for Java | ArcGIS for Developers
Deploy your app—ArcGIS Runtime SDK for Java | ArcGIS for Developers
In our project, we have deploy the ArcGIS Deployment folder on our Nexus and manage with maven (using profil in our pom) to automatically attach this folder when performing our mvn release.
Jeremie
Thanks for the tips Jeremie.
We're still having issues getting the map to display. We effectively just get a blank area in our JavaFX VBox where the map is supposed to be showing, but only at runtime from a JAR, after we deploy. We registered the app, got a client ID and, from what I understand, since this is a thick-client JavaFX app using just the free basemap, there should be no OAuth necessary and we're running in BASIC license level only.
Here's what we do to create/pull up a map, and it works fine building/running from Eclipse, but not from a JAR:
ArcGISRuntime.setClientID(theClientIDString);
ArcGISRuntime.setInstallDirectory("C:ArcGISRuntime10.2.4/");
ArcGISRuntime.initialize();
LicenseLevel licenseLevel = ArcGISRuntime.License.getLicenseLevel();
//here, we show a msg on our GUI and it definitely is showing LICENSE LEVEL BASIC
//so to me, it seems as though we're authorized
loadStatusMessage("Successfully initialized ArcGIS with LicenseLevel=" + licenseLevel.toString());
//to load a map we:
FXMap map = new FXMap();
//just load it into a VBox container:
vBoxMap.getChildren().add(map);
//this next line is making me wonder - do we need ArcGIS Online Account Usage Credits?? (we don't have an ArcGIS Online Account, FYI) So a question would be: Do we need to do an OAuth for grabbing this basemap?
//Next we load our basemap
//according to docs I've read on ESRI, this should be a free basemap...
ArcGISTiledMapServiceLayer tiledLayer = new ArcGISTiledMapServiceLayer("http://services.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer");
map.getLayerList().add(tiledLayer);
//at this point running from Eclipse, no problema, map shows up fine
//from distro in a jar, we do show authorized and all that jazz, but the map area is completely void of a basemap or anything else..
Any idea what we're doing wrong?
Thanks in advance,
Eric
Howdy.
It appears that the issues we're having are a result of using OneJar. We've had a few other issues w/classpath mapping and my bad...
Thanks for your continued support and try to stay out of Dependency Hell
Eric
Hello,
As a follow-up to this post, here's a major issue we ran into: ArcGIS for Java will not run on Amazon Workspaces. We had plans to deploy our app there, too bad so sad. So ArcGIS for Java is dead in the Amazon cloud...unless Amazon can come up w/a driver that emulates either DirectX or OpenGL. Nothing we've done appears to work on their workspaces distro.
I'm wondering if Quartz fixes this but I kinda doubt it...?
Thanks, Eric
FINAL FOLLOWUP AND LESSONS LEARNED on Deployment of ArcGIS Map in JavaFX App or JAR (Beta, pre-quartz)
Howdy.
I thought I'd write a synopsis for any of those peeps out there pulling hair, here's some facts, it'd be good if Eric B can validate some of this:
1. If you're using the map w/license free basemap layers from arcgis.com and just doing simple object creation/placement in a graphics layer or other supported layers that don't require a local server....you don't need ArcGISRuntime10.2.4, nor to you need to initialize the map, all you need to do is set the client ID.
2. The map requires a hardware-based GPU that supports either DirectX or OpenGL. Will not run on most cloud-based desktop VMs like Amazon Desktop. (we are checking on the new "GP EC2" server variant that Amazon just came out with that supposedly has a server-based hardware GPU). Otherwise you'll need to setup your own cloud-based desktop VM w/VMWare's new GPU drivers.
3. For packaging a JAR, use maven Shade, don't use OneJar. To use shade, do a mvn:install:install w/all the ESRI jars into your local repo and update your pom dependencies w/those locations. You'll have a working, deployable jar at this point.
Other than the hardware-based GPU requirements for the map in JavaFX (not just JavaFX I think it's any map product in java), and a few bugs in the beta (expected) we are very happy w/the performance of the map - it screams. Way to go ESRI, looking forward to wash-rinse-repeat w/Quartz and adding the runtime and using Online Credits for various hosted tools from within our app suite.
Thanks, The Other Eric
Thanks Eric.
Wow. great job in sharing helpful info that others can use!
1. You always need the Runtime folder on the machine where your app can find it, no matter what. Even if you are just using the Basic license (client ID). Is this what you meant?
2. The machine your app runs on MUST have DirectX or OpenGL. No way around it (sadly, I may add, but that is where we are.).
3. You're ahead of me on this one. Great info, thanks. I will try to confirm your findings, but I wouldn't be totally surprised.
Yes, correct. Any map will need a graphics driver. JavaFX or Swing. And remember, a Quartz Map will only be JavaFX-based component. There will not be a Swing-based map.
Thanks for your feedback, Eric!
-Eric B
Why must the Runtime location be a folder? Why not a path? Looking at the source for ArcGISRuntimeEnvironment it actually does extra work to force you to use a directory rather than a Path. This actively subverts our ability to use the JAR Filesystem to host the dynamic libraries and resources requiring an unpack dance on the end-user machine which can be prevented or intercepted by the host operating system security controls. Access to arbitrary locations on the end-users local filesystem is not something that we even need for this so why the extra hoops?