smalaryk

Can't create Server Object Manager

Discussion created by smalaryk on Aug 14, 2012
Latest reply on Aug 16, 2012 by smalaryk
Hi all,
I have a good working SOE on ArcgisServer 10 SP 4. I would like to add some modyfication to my SOE and I need to recive ServerContext by Server Object Manager.

When I try to create ServerObjectManager i recive Error: General Access Denied Error. Here is my code:

                IServerContext serverContext = null;
                String ARCGIS_SERVER = properties.getProperty("ARCGIS_SERVER");
  String ARCGIS_SERVER_DOMAIN = properties.getProperty("ARCGIS_SERVER_DOMAIN");
  String ARCGIS_SERVER_USER = properties.getProperty("ARCGIS_SERVER_USER");
  String ARCGIS_SERVER_PASSWORD = properties.getProperty("ARCGIS_SERVER_PASSWORD");
  String ARCGIS_SERVER_MSD_DOCUMENT = properties.getProperty("ARCGIS_SERVER_MSD_DOCUMENT");
  String ARCGIS_SERVER_MSD_DOCUMENT_TYPE = properties.getProperty("ARCGIS_SERVER_MSD_DOCUMENT_TYPE");
  ServerConnection connection;
  ServerInitializer si = new ServerInitializer();
  si.initializeServer(ARCGIS_SERVER_DOMAIN, ARCGIS_SERVER_USER, ARCGIS_SERVER_PASSWORD);
  connection = new ServerConnection();
  connection.connect(ARCGIS_SERVER);
  IServerObjectManager som = connection.getServerObjectManager();// this line generate error

                //I need IServerObjectManager object to create ServerContext.
                serverContext = som.createServerContext(ARCGIS_SERVER_MSD_DOCUMENT, ARCGIS_SERVER_MSD_DOCUMENT_TYPE);

Additional information: When we used this pice of code on server Tomcat web application (not as SOE in ArcgisServer) everything works fine.

I would be grateful for your help

Sebastian

Outcomes