... 2013-04-12 12:09:24,821: INFO rid=31 'server' mpk3 - Request handled. 2013-04-12 12:09:24,852: INFO rid=32 'server' mpk - Request handled. 2013-04-12 12:09:25,055: INFO rid=33 'server' mpk2 - Request handled. -> Here we see that there are 3 localmapservice already loaded 2013-04-12 12:09:29,305: INFO rid=34 'server' AdminWebService - POST admin/createService -> Here I just select a 4th shapefile java.lang.NullPointerException at com.esri.map.Layer.setUrl(Unknown Source) at com.esri.map.DynamicLayer.setUrl(Unknown Source) at com.esri.map.DynamicLayer.<init>(Unknown Source) at com.esri.map.ArcGISDynamicMapServiceLayer.<init>(Unknown Source) at com.esri.client.samples.datasources.LocalShapefileApp.addShapefile(LocalShapefileApp.java:103) at com.esri.client.samples.datasources.LocalShapefileApp.access$3(LocalShapefileApp.java:73) at com.esri.client.samples.datasources.LocalShapefileApp$3.actionPerformed(LocalShapefileApp.java:247) at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:2018) at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2341) at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:402) at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:259) at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:252) at java.awt.Component.processMouseEvent(Component.java:6505) at javax.swing.JComponent.processMouseEvent(JComponent.java:3321) at java.awt.Component.processEvent(Component.java:6270) at java.awt.Container.processEvent(Container.java:2229) at java.awt.Component.dispatchEventImpl(Component.java:4861) at java.awt.Container.dispatchEventImpl(Container.java:2287) at java.awt.Component.dispatchEvent(Component.java:4687) at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4832) at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4492) at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4422) at java.awt.Container.dispatchEventImpl(Container.java:2273) at java.awt.Window.dispatchEventImpl(Window.java:2719) at java.awt.Component.dispatchEvent(Component.java:4687) at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:723) at java.awt.EventQueue.access$200(EventQueue.java:103) at java.awt.EventQueue$3.run(EventQueue.java:682) at java.awt.EventQueue$3.run(EventQueue.java:680) at java.security.AccessController.doPrivileged(Native Method) at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76) at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:87) at java.awt.EventQueue$4.run(EventQueue.java:696) at java.awt.EventQueue$4.run(EventQueue.java:694) at java.security.AccessController.doPrivileged(Native Method) at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76) at java.awt.EventQueue.dispatchEvent(EventQueue.java:693) at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:244) at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:163) at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:151) at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:147) at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:139) at java.awt.EventDispatchThread.run(EventDispatchThread.java:97) 2013-04-12 12:09:35,071: INFO rid= '' WebServer - Lost connection on port 50000 Stopping server -> I've closed the application from here 2013-04-12 12:09:37,790: INFO rid= '' WebServer - Lost connection on port 50000 2013-04-12 12:09:37,790: INFO rid=35 'server' AdminWebService - POST admin/shutdown?f=json 2013-04-12 12:09:37,790: INFO rid= 'server' ServerMain - Shutting down 2013-04-12 12:09:37,790: INFO rid= 'server' ServerMain - Terminating web services 2013-04-12 12:09:37,790: INFO rid= 'server' AdminWebService - Terminating service blankMap.mpk 2013-04-12 12:09:37,790: INFO rid= 'server' mpk_host - Terminate 2013-04-12 12:09:37,790: INFO rid= 'server' AdminWebService - Terminating service blankMap.mpk2 2013-04-12 12:09:37,790: INFO rid= 'server' mpk2_host - Terminate 2013-04-12 12:09:37,790: INFO rid= 'server' AdminWebService - Terminating service blankMap.mpk3 2013-04-12 12:09:37,790: INFO rid= 'server' mpk3_host - Terminate 2013-04-12 12:09:37,790: INFO rid= 'server' ServerMain - Waiting for 3 worker processes to exit. Timeout=10s. 2013-04-12 12:09:37,899: INFO rid= '' WebServer - Lost connection on port 50000 2013-04-12 12:09:37,899: INFO rid= 'server' ServerMain - Worker processes exited. 2013-04-12 12:09:37,899: INFO rid= 'server' ServerMain - Deleting data directory C:/Windows/Temp/arcgisruntime_6452 2013-04-12 12:09:37,899: INFO rid= 'server' ServerMain - 10 filesystem object(s) removed. 2013-04-12 12:09:37,899: INFO rid= 'server' ServerMain - Server process exiting. Local server exited, code: 0
// set up a local dynamic layer final ArcGISDynamicMapServiceLayer localDynamicLayer = new ArcGISDynamicMapServiceLayer( localMapService.getUrlMapService());
Solved! Go to Solution.
I think the problem here appears to be around using the same MPK file multiple times. I modified the sample code so that is used a dedicated MPK file for each instance of the local server and I was able to add around 12 shapefiles without issue.
The other potiential option is to add multiple shape files to a single instance of a local server.
The other potential option is to add multiple shape files to a single instance of a local server.
So I'm definitly interested in your second idea :
- could you provide a sample code for this ? (multiple shp to a single instance of "local map service" ?)
- but will I still be able to manage layer order the same way ? (user can change layer order at any time in my app)
-> if exemple I have 1 TPK, 1 GraphicsLayer and 2 Shapefiles added to same MPK instance, could I manage order like 0-TPK 1-SHP n°1 2-GraphicsLayer 3-SHP n°2 ?