We've been using ArcGIS this year for a school project, and seem to have hit a snag while trying to publish our map to ArcGIS Server. I'll try to be as detailed as possible.
Basically, what we're doing is making a routing web application using google maps as the front end/geocoding and using Network Analyst to create a network map to specify special routes (trying to combine roads with bike trails, giving preference to bike trails/low traffic count roads and so on.)
I've also seen some documentation saying we need to have it point to /arcgis/service/Test/MapServer/NAServer (since that's the URL given by the Network Analysis function when specifying when publishing the service).
The problem we're running into is after pointing to our server, our application doesn't route anything.
From the logs, there's information such as:
"The Layer:'TRAILS_SO_Merge' in Map:'Layers' is invalid. The database was not found. " or "The Layer:'TRAILS_SO_Merge_ND' in Map:'Layers' is invalid. "
Which makes it look like something's wrong with our .mxd file. It's simply a file with the network dataset imported into it.
Trying to troubleshoot the problem some more, I've tried using a sample route that comes with arcgis server, SanFrancisco-SimpleRoute.mxd. Again, publishing this service and pointing our web application to this service causes the application to not route.
However, pointing our web app to a routing system that ESRI has as an example:
and using the California sample dataset that is included, a sample route is produced.
However, when trying to add a service that uses our own .mxd file, we continue to get the error
"The Layer:'TRAILS_SO_Merge' in Map:'Layers' is invalid. The database was not found. " or "The Layer:'TRAILS_SO_Merge_ND' in Map:'Layers' is invalid. " and The Layer: Route in Map:'Layers' is invalid
so it appears to be something on our end when we create the .mxd.
Is there a guide somewhere the explains how to set up a .mxd in ArcMap before publishing it on a server? I've looked in a few places, but haven't found anything promising yet. The "database was not found error" and the cryptic "Layer is invalid" have be wondering if I need to copy the .dbf file over to the server, or if there is a way to verify layers are valid somewhere?
My current process to creating an .mxd currently involves: New Map, import data, import the ND dataset, choose to bring in the other files it's associated with (junctions and the .shp that the ND was created from), add a route layer using the "New Route" button on the Network Analysis toolbar, save the file as a .mxd and upload to the server.
Trying to see what the difference between the California sample and our sample was, I downloaded the .mxd of the California map. Every layer had a ! by it, indicating the data wasn't there. I looked around, and found a "networkanalyst" folder, downloaded that, and pointed the map to that, and I had a full looking map.
Saving that .mxd and uploading/publishing as a service caused the same "database not found/layer is invalid" error, so obviously I need more than the .mxd. I tried uploading the "networkanalyst" folder as well, yet still ran into the same errors.
Saving the .mxd into that same networkanalyst folder (and pointing the layers to same folder) and uploading that, and publishing it as a service however, seemed to cause things to work out ok.
I'm thinking something's the matter with working with ArcMap on Windows, and uploading the data to a Linux server.
However, trying this exact step with our data gives the same old "database not found/layer is invalid" problem as before. I'm going to try to make a new map tonight to see if it's our data or something else.
It looks like your server cannot get access to/find the network dataset when starting the configuration.
Please try the following steps: 1. open the mxd in ArcMap and set the paths to be relative (File > Document Properties, then select the "Store relative pathnames to datasources" checkbox). 2. save the document in the parent folder of your network dataset's folder. 3. copy the parent folder which now contains the mxd, and the network dataset to your Linux server. 4. publish the document and try hitting the service
If it still doesn't work, check directory permissions - ArcGISSOC account which runs SOC processes should have access to both mxd and network dataset.
One more option: try using the MxdEditor tool which is located <arcgis_home>/java/tools/ - it should allow you to fix the broken data path issues.