【轉載】ArcGIS Server常見問題

摘自ESRI公司網站。
-------------------------------------------
內容摘要
本指導描述瞭如何配置Windows XP SP2防火牆,使得ArcGIS Server能正常工作。爲了完成下面
的過程,必須安裝Windows XP Service Pack 2,下面的步驟需要爲ArcGIS Server配置Windows
防火牆。
過程描述
當升級的Windows XP SP2,將安裝Windows防火牆。其缺省的設置使得Windows阻止所有從ArcGIS

Server的連接。解決這個問題,需要在Windows防火牆設置中打開80端口,135端口,ArcSOM.exe

和ArcSOC.exe。

1、啓動Windows防火牆。開始 > 設置 > 控制面板 > Windows防火牆。缺省情況下,防火牆是啓

用的,這是推薦的設置。

2、點擊“例外”選項卡。
3、點擊“添加端口”。
4、添加下面的信息:
名稱:Web Port(http)
端口號:80
類型:TCP
點擊“確定”。
5、添加135端口,點擊“添加端口”。
6、添加下面的信息:
名稱:DCOM(ArcGIS Server)
端口號:135
類型:TCP
點擊“確定”。
7、點擊“添加程序”將ArcSOM.exe添加到例外。
8、點擊“瀏覽”,並瀏覽到:
<ArcGIS Install Directory>/bin/ArcSOM.exe,例如
C:/Program Files/ArcGIS/bin/ArcSOM.exe
點擊“確定”。
9、點擊“添加程序”將ArcSOC.exe添加到例外。
10、點擊“瀏覽”,並瀏覽到:
<ArcGIS Install Directory>/bin/ArcSOC.exe,例如
C:/Program Files/ArcGIS/bin/ArcSOC.exe
點擊“確定”。
11、這些端口和程序入口現在將顯示在程序和服務列表中。確保其之前的Check框被選中。
12、關閉Windows防火牆。

-------------------------------------------

內容摘要
我們使用ArcGIS Server .net ADF來開發應用程序的時候,使用Map WebControl的話,一般都是通過設置控件的屬性來設定Host以及MapServerObject。那如何在程序運行過程中來動態的改變這些屬性,以使得地圖的內容發生相應的變化。下面是c#的代碼:
過程描述
'Map1是地圖控件
Map1.Host = "ServerName";
Map1.ServerObject = "ServerObjectName";
WebMap webMap = Map1.CreateWebMap();
IMapServer mapServer = webMap.MapServer;
IMapServerObjects mapServerObjects = mapServer as IMapServerObjects;
mapServerObjects.RefreshServerObjects();
webMap.Refresh ();

--------------------------------------------

內容摘要
提供的指導描述瞭如何創建一個簡單的ArcGIS Server ASP.NET網頁。爲了診斷,儘可能使用最小的應用,這樣有助於測試ArcGIS Server和.NET 應用開發框架(ADF)是否配置適當且工作正常。
過程描述
在運行這個例子前,在網絡服務器上必須安裝好.NET ADF,ArcGIS Server已經安裝並正常運行,達到所有的系統要求。
1.創建一個ASP.NET應用目錄。可以按照下面步驟創建:
A. 在您的目錄<drive>:/inetpub/wwwroot下創建一個目錄。
B. 使用IIS管理器查看新建的目錄的屬性。
C. 在目錄標籤上,單擊創建按鈕,創建一個ASP.NET應用。
2.把下面的代碼複製到文本編輯器中,存爲*.aspx文件。然後對它做如下編輯:
A. 把esri:map標籤中的Host屬性改爲運行着ArcGIS Server SOM(Server Object Manager)的機器。
B. 把ServerObject改爲一個運行着的MapServer服務器對象。記住服務器對象的名稱區分大小寫。'World'和'world'不一樣。
<%@ Register TagPrefix="esri" Namespace="ESRI.ArcGIS.Server.WebControls"
Assembly="ESRI.ArcGIS.Server.WebControls, Version=9.0.0.2, Culture=neutral, PublicKeyToken=8fc3cc631e44ad86" %>

<html>
<head>
</head>
<body>
<form id="WebForm" method="post" runat="server">
<esri:map id="TheMap" UseMIMEData="True" Width="400px" Height="400px"
style="LEFT: 200px; POSITION: relative; TOP: 30px" runat="server"
BorderStyle="Solid" BorderColor="200,170,35" BorderWidth="10px"
ServerObject="PoliticalEarthquakes" Host="tao" AutoFirstDraw="True">
</esri:map>
</form>
</body>
</html>
3.在ASP.NET應用目錄下創建一個web.config文件。下面顯示了一個web.config文件的例子。
使用ArcGIS Server機器上的agsusers組中的帳戶配置這個文件。
把用戶名和密碼用明文寫在web.config文件中,可能不是存儲這個信息的安全方法。微軟提供了加密機制。這個例子只是用來診斷的。
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<system.web>
<!-- Session state must be enabled for the map control -->
<sessionState mode="InProc" />
<identity impersonate="true" userName="SomeDomain/SomeAcct" password="SomePassword" />
</system.web>
</configuration>
4.在瀏覽器中輸入http://servername/virtualdirectory/myapp.aspx 來測試這個應用程序。
如果ArcGIS Server已經安裝,.NET ADF工作正常,那麼將顯示一幅地圖。
5.完成測試後,刪除目錄中的文件,- 特別是包含明文密碼的web.config文件。


------------------------------------------

內容摘要
雖然說ArcGIS Server的開發技術當中最重要的技術是ArcOBjects。但是和在C/S模式下使用的ArcObjects還是會有一些差別,一個很重要的區別就是不能使用New方法來創建ArcObjects。
過程描述
1 web應用調用的是遠程的Ao組件,這些Ao對象都運行在服務器ArcSoc.exe進程中,由服務器上下文(server context)統一來創建(IServerContext::CreateObject),並服務器上下文來統一的管理和操作,比如Ao對象之間的交互,釋放等。
2 ArcGIS Server是一個可分佈式部署的軟件,GIS Server和Web應用可以部署在不同的機子上,而web應用的機子上只需要安裝ADF運行包,只有ArcObjects的代理,不安裝ArcObjects本身,因此web 應用沒有能力來創建本地的ArcObjects對象,這也是不能使用New方式來創建ArcObjects的原因。

-------------------------------------------

內容摘要
使用ArcGIS Server開發的web應用程序,有時候會需要把分析結果以graphics的方式臨時添加到地圖上,但是graphics會遮蓋住下面的標註。設透明也無效。
過程描述
解決辦法:
打開ArcMap,把Serverobject中用到的地圖文檔(*.mxd)打開,
打開Labeling工具條,點擊label weight ranking工具,
在彈出的label weight ranking對話框上,把<default>的feature weight設爲none,
停止並啓動Serverobject。


--------------------------------------------

內容摘要
在設計階段,使用Impersonation控件的屬性頁面設置用戶、密碼、域或機器的Identity屬性的時候出錯。
過程描述
出錯原因是微軟的.Net框架認證在操作系統上沒有必要的權限。
處理方法:
1、打開控制面板
2、打開管理工具頁面
3、本地打開安全設置
4、打開本地策略
5、選擇用戶權利指派
6、選擇“以操作系統方式操作”
7、添加“agsadmin”和“agsusers”兩個組
8、確認本地策略設置複選框處於選定狀態
9、確定退出界面
10、重新啓動計算機

--------------------------------------

內容摘要
下面的文章講的是怎麼樣更新一個使用ESRI.net web controls和ArcGIS Server 9.0寫的web應用,使得它能支持Arcgis Server 9.1版本。
這裏講的是ArcGIS Server 9.0的應用指的是在安裝了全部Service Packs的基礎上的。
過程描述
使用下面的過程在9.1中來修改已有的9.0的web應用。
這些步驟對於僅僅把ArcGIS Server 9.0的應用運行在安裝了9.1的機器上時候是不必要的。
1 在Microsoft Visual Studio .NET中打開web應用。
2 在HTML 視圖中,用下面的語句替換已有的 @Register 語句。
<%@ Register TagPrefix="esri" Namespace="ESRI.ArcGIS.Server.WebControls" Assembly="ESRI.ArcGIS.Server.WebControls, Version=9.1.0.722, Culture=neutral, PublicKeyToken=8fc3cc631e44ad86" %>
注意:"Version="屬性值必須和上面語句中的一樣。
3 重新編譯並保存應用。

------------------------------------
內容摘要
很多線劃圖數據進ArcSDE庫中都會有些對象轉換不進去。這些對象有很大一部分是由於數據本身有自相交的情況。如果這些線劃圖數據只是用來做底圖,而不需要做對象分析。則可以採用數據簡單化操作後再轉換入ArcSDE中。具體操作如下例子:
過程描述
Private Sub SimplifyPolyLine(pPolyline As esriGeometry.Polyline)
'通過QI取得線對象的拓撲操作接口
Dim pTopologicalOperator As esriGeometry.ITopologicalOperator
Set pTopologicalOperator = pPolyline
'執行簡單化操作
pTopologicalOperator.Simplify
'簡單化操作完了的數據可以轉換入ArcSDE中了
'下面代碼用來展示簡單化後的線數據的每個部分
Dim pGeometryCollection As esriGeometry.IGeometryCollection
Set pGeometryCollection = pPolyline

Dim i As Long
For i = 0 To pGeometryCollection.GeometryCount - 1
Dim TempPolyline As esriGeometry.IGeometryCollection
Dim TempPath As esriGeometry.IPath

Set TempPolyline = New esriGeometry.Polyline
Set TempPath = pGeometryCollection.Geometry(i)

TempPolyline.AddGeometry TempPath
MapControl1.FlashShape TempPolyline

Set TempPath = Nothing
Set TempPolyline = Nothing
Next i

End Sub

備註:點、線、面都可以執行簡單化操作。可以根據不同的業務需求來使用這些功能。

------------------------------------

內容摘要
實現多個實體的聯合,通過這種聯合可以與其他幾何實體進行空間關係判斷,請看如下實例
過程描述
''''''''''''''''''''''''''''''''''''''''''''''''
dim I as interger
Dim SelectFeatureLineArr is Iarray
Set SelectFeatureLineArr = new Array
‘加入實體到array中,之後
Dim pTmpGeom As IGeometry
Dim pGeom As IGeometry
Dim pOutputGeometry As IGeometry
Dim pTopoOperator As ItopologicalOperator
Dim lFeature As iFeature
For i = 0 To SelectFeatureLineArr.Count - 1
Set lFeature = SelectFeatureLineArr.Element(i)
Set pGeom = lFeature.ShapeCopy
If i = 0 Then ' if its the first feature
Set pTmpGeom = pGeom
Set pOutputGeometry = pTmpGeom
Else ' merge the geometry of the features
Set pTopoOperator = pTmpGeom
Set pOutputGeometry = pTopoOperator.Union(pGeom)
Set pTmpGeom = pOutputGeometry
End If
Next i

------------------------------------------------------------------------------------------------------------------

內容摘要
提供了判斷幾何學之間空間關係的成員、方法。 其對如下產品有效:
ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.
過程描述
描述

判斷兩個空間實體之間在幾何上是否有關聯並返回 bool變量,對於一些關聯的存在判斷有限制(要求輸入相同的尺寸)。 大部份的預先定義表示關係的操作員是互斥的。當使用時,關聯操作是用來決定兩個幾何空間實體之間存在的特定的關係。
Description
Contains 包含指出是否這幾何實體包含另一個幾何實體
Crosses 交叉指出兩個實體是否交叉.
Disjoint 脫節指出兩個實體在幾何上是不是沒有共同的點.,來判斷它們之間是否是橫斷關係
Equals 相等指出兩個實體是否相同並定義了相同的點
Overlaps 輸入的實體是否 重疊
Relation 兩實體之間是否有定義關聯存在.
Touches 相觸與,指出兩實體之間是否有相觸與的關係.
Within 判斷一個實體是否被另一個實體所包含
使用VB實例
Dim pRelOp As IrelationalOperator
Dim oneFeature As iFeature
Dim twoFeature As iFeature
Set pRelOp = oneFeature.ShapeCopy
If pRelOp.Touches(twoFeature.Shape) Then
End if

-----------------------------------------------------------------------------------------------------------------

內容摘要
圖層渲染是GIS應用之中十分常用的功能,所有基於ArcOjects組件的ArcGIS軟件產品(如: ArcGIS Desktop, ArcGIS Engine, ArcGIS Server), 還有ArcIMS和MapObjects(Windows Edition & Java Edition)都提供了各種實用的渲染方法,詳細列舉如下:
ArcOjects提供了SimpleRenderer, UniqueValueMapRenderer, ClassBreaksRenderer, DotDensityRenderer, ProportionalSymbolRenderer, ChartRenderer;
ArcIMS提供了SimpleRenderer, SimpleLabelRenderer, ValueMapRenderer, ValueMapLableRenderer, ScaleDependentRenderer, GroupRenderer;
MapObjects Windows Edition提供了ValueMapRenderer, ClassBreaksRenderer, DotDensityRenderer, LabelRenderer, EventRenderer, ZRenderer, GroupRenderer;
MapObjects JavaEdition提供了SimpleRenderer, ValueMapRenderer, LabelRenderer, ScaleDependentRenderer, GroupRenderer;
跟一般的渲染功能有所不同,在ArcIMS和MapObjects的兩個版本中都提供的GroupRender它本身並不利用任何圖層的屬性來對圖層進行渲染,而是通過借用其他Renderer的功能,把它們組合起來,實現對同一個圖層進行不同類型的渲染效果的同時展現,比如對一個包含了人口總數量,男性人口數量和女性人口數量的世界地圖圖層(面狀)先利用人口總數量屬性現實分類渲染的效果,同時利用男性人口數量和女性人口數量屬性用直棒圖選然展現出兩個數值比較的效果。
可惜的是ArcObjects中偏偏沒有實現這種渲染功能。不過基於COM技術的ArcObjects所具有的可擴展性爲我們自己去實現"GroupRenderer"提供了可能。
過程描述
ArcObjects中,圖層的渲染效果是通過實例化一個實現了某個渲染接口(ISimpleRenderer, IUniqueValueMapRenderer, IClassBreaksRenderer, IDotDensityRenderer, IProportionalSymbolRenderer, IChartRenderer之一)的CoClass類,然後作爲該渲染接口類型的變量賦給圖層(IGeoFeatureLayer)的Renderer屬性來實現的。這個Renderer屬性是IFeatureRenderer接口類型,IFeatureRenderer中定義了一個叫做Draw的方法,其實ArcObjects中各種各樣的渲染效果就是通過這個Draw方法畫出來的,因爲各個渲染效果CoClass都實現了IFeatureRenderer接口。所以要實現"GroupRenderer"效果,只要實現了IFeatureRenderer接口就可以了。以下提供VB和ArcGIS Server Java API的例程供大家參考:
[VB6: CustomGroupRenderer.cls]
Option Explicit

Implements IFeatureRenderer

Private m_Renderers As Collection

Private Sub Class_Initialize()
On Error GoTo ErrHand
Set m_Renderers = New Collection
GoTo EndProc
ErrHand:
MsgBox "Class Initialize" & Err.Description
EndProc:
Exit Sub
End Sub

Private Function IFeatureRenderer_CanRender(ByVal featClass As esriGeoDatabase.IFeatureClass, ByVal Display As esriDisplay.IDisplay) As Boolean
On Error GoTo ErrHand
If Not featClass.ShapeType = esriGeometryNull Then
IFeatureRenderer_CanRender = True
Else
IFeatureRenderer_CanRender = False
End If
GoTo EndProc
ErrHand:
MsgBox "CanRender" & Err.Description
EndProc:
Exit Function
End Function

Private Sub IFeatureRenderer_Draw(ByVal Cursor As esriGeoDatabase.IFeatureCursor, _
ByVal drawPhase As esriSystem.esriDrawPhase, _
ByVal Display As esriDisplay.IDisplay, _
ByVal trackCancel As esriSystem.ITrackCancel)
On Error GoTo ErrHand
Dim i As Integer
For i = 1 To m_Renderers.Count
Dim r As IFeatureRenderer
Set r = m_Renderers.Item(i)
If (TypeOf r Is ISimpleRenderer) And (drawPhase = esriDPGeography) Then
r.Draw Cursor, drawPhase, Display, trackCancel
ElseIf (TypeOf r Is IUniqueValueRenderer) And (drawPhase = esriDPGeography) Then
r.Draw Cursor, drawPhase, Display, trackCancel
ElseIf (TypeOf r Is IClassBreaksRenderer) And (drawPhase = esriDPGeography) Then
r.Draw Cursor, drawPhase, Display, trackCancel
ElseIf (TypeOf r Is IDotDensityRenderer) And (drawPhase = esriDPGeography) Then
r.Draw Cursor, drawPhase, Display, trackCancel
ElseIf (TypeOf r Is IProportionalSymbolRenderer) And (drawPhase = esriDPAnnotation) Then
r.Draw Cursor, drawPhase, Display, trackCancel
ElseIf (TypeOf r Is IChartRenderer) And (drawPhase = esriDPAnnotation) Then
r.Draw Cursor, drawPhase, Display, trackCancel
End If
Next i
GoTo EndProc
ErrHand:
MsgBox "Draw" & Err.Description
EndProc:
Exit Sub
End Sub

Private Sub IFeatureRenderer_PrepareFilter(ByVal pFeatClass As esriGeoDatabase.IFeatureClass, ByVal QueryFilter As esriGeoDatabase.IQueryFilter)
Dim i As Integer
For i = 1 To m_Renderers.Count
Dim r As IFeatureRenderer
Set r = m_Renderers.Item(i)
r.PrepareFilter pFeatClass, QueryFilter
Next i
End Sub

Private Property Set IFeatureRenderer_ExclusionSet(ByVal pIDSet As esriCarto.IFeatureIDSet)

End Property

Private Property Get IFeatureRenderer_RenderPhase(ByVal drawPhase As esriSystem.esriDrawPhase) As Boolean
On Error GoTo ErrHand
IFeatureRenderer_RenderPhase = True
Exit Property
ErrHand:
MsgBox "Get RenderPhase" & Err.Description
End Property

Private Property Get IFeatureRenderer_SymbolByFeature(ByVal Feature As esriGeoDatabase.IFeature) As esriDisplay.ISymbol
On Error GoTo ErrHand
Dim pSym As ISymbol
Set pSym = m_LegendGroup.Class(0).Symbol
Set IFeatureRenderer_SymbolByFeature = pSym
GoTo EndProc
ErrHand:
MsgBox Err.Description
EndProc:
Set pSym = Nothing
Exit Property
End Property

Public Sub AddRenderer(ByVal renderer As esriCarto.IFeatureRenderer)
m_Renderers.Add renderer
End Sub
==========================================================================================================================================================

[ArcGIS Server Java API]

//IGroupRenderer.java

package com.esri.arcgis.samples.carto.renderers;


import com.linar.jintegra.AutomationException;
import java.io.IOException;
import java.io.Serializable;

public interface IGroupRenderer extends Serializable {
public static final int IID27AC33C1_506B_41F6_B2F0_D6F163CB7699 = 1;
public static final int xxDummy = 0;
public static final String IID = "27AC33C1-506B-41F6-B2F0-D6F163CB7699";

public void addRenderer(Object iRenderer) throws IOException, AutomationException;
}

//CustomGroupRenderer.java

package com.esri.arcgis.samples.carto.renderers;

import java.io.IOException;
import java.util.ArrayList;
import com.esri.arcgis.server.*;
import com.esri.arcgis.carto.*;
import com.esri.arcgis.display.*;
import com.esri.arcgis.geodatabase.*;
import com.esri.arcgis.system.*;
import com.esri.arcgis.geometry.esriGeometryType;
import com.esri.arcgis.system.esriDrawPhase;
import com.linar.jintegra.AutomationException;

public class CustomGroupRenderer implements IFeatureRenderer, IGroupRenderer {
private ILegendGroup pLegendGroup;
private IServerContext serverContext;
private ArrayList renderers = new ArrayList();

public CustomGroupRenderer(IServerContext sc) {
try {
serverContext = sc;
pLegendGroup = new ILegendGroupProxy(serverContext.createObject(LegendGroup.getClsid()));
ILegendClass pLegendClass = new ILegendClassProxy(sc.createObject(LegendClass.getClsid()));
pLegendGroup.addClass(pLegendClass);
pLegendGroup.setVisible(true);
pLegendGroup.setEditable(true);
} catch (AutomationException e) {
System.out.println("AutomationException " + e);
} catch (IOException e) {
System.out.println("IOException " + e);
}
}

public boolean canRender(IFeatureClass iFeatureClass, IDisplay iDisplay) throws
IOException, AutomationException {
if (iFeatureClass.getShapeType() == esriGeometryType.esriGeometryNull) {
return true;
} else {
return false;
}
}

public void prepareFilter(IFeatureClass iFeatureClass,
IQueryFilter iQueryFilter) throws IOException,
AutomationException {
if (renderers.size() > 0) {
for (int i = 0; i < renderers.size(); i++) {
IFeatureRenderer pFR = new IFeatureRendererProxy(renderers.get(i));
pFR.prepareFilter(iFeatureClass, iQueryFilter);
}
}
}

public void draw(IFeatureCursor iFeatureCursor, int drawPhase,
IDisplay iDisplay, ITrackCancel iTrackCancel) throws
IOException, AutomationException {
if (renderers.size() > 0) {
for (int i = 0; i < renderers.size(); i++) {
Object obj = renderers.get(i);
if (obj instanceof ISimpleRenderer && drawPhase == esriDrawPhase.esriDPGeography) {
IFeatureRenderer pFR = new IFeatureRendererProxy(obj);
pFR.draw(iFeatureCursor, drawPhase, iDisplay, iTrackCancel);
}
if (obj instanceof IUniqueValueRenderer && drawPhase == esriDrawPhase.esriDPGeography) {
IFeatureRenderer pFR = new IFeatureRendererProxy(obj);
pFR.draw(iFeatureCursor, drawPhase, iDisplay, iTrackCancel);
}
if (obj instanceof IClassBreaksRenderer && drawPhase == esriDrawPhase.esriDPGeography) {
IFeatureRenderer pFR = new IFeatureRendererProxy(obj);
pFR.draw(iFeatureCursor, drawPhase, iDisplay, iTrackCancel);
}
if (obj instanceof IDotDensityRenderer && drawPhase == esriDrawPhase.esriDPGeography) {
IFeatureRenderer pFR = new IFeatureRendererProxy(obj);
pFR.draw(iFeatureCursor, drawPhase, iDisplay, iTrackCancel);
}
if (obj instanceof IProportionalSymbolRenderer && drawPhase == esriDrawPhase.esriDPAnnotation) {
IFeatureRenderer pFR = new IFeatureRendererProxy(obj);
pFR.draw(iFeatureCursor, drawPhase, iDisplay, iTrackCancel);
}
if (obj instanceof IChartRenderer && drawPhase == esriDrawPhase.esriDPAnnotation) {
IFeatureRenderer pFR = new IFeatureRendererProxy(obj);
pFR.draw(iFeatureCursor, drawPhase, iDisplay, iTrackCancel);
}
}
}
}

public ISymbol getSymbolByFeature(IFeature iFeature) throws IOException,
AutomationException {
ISymbol pSym = pLegendGroup.esri_getClass(0).getSymbol();
return pSym;
}

public boolean isRenderPhase(int drawPhase) throws IOException,
AutomationException {
return true;
}

public void setExclusionSetByRef(IFeatureIDSet iFeatureIDSet) throws
IOException, AutomationException {

}

public void addRenderer(Object iRenderer) throws
IOException, AutomationException {
renderers.add(iRenderer);
}
}

如果想要在TOC控件上動態的展現出渲染的效果,還需實現ILegendInfo接口,這裏不做詳細說明。

 -------------------------------------------

錯誤描述
在ArcCatalog中,當成功的創建了server object之後,server object不能被預覽。ArcCatalog顯示下面的錯誤信息:
“你的選擇不能在當前視圖中顯示.”
導致原因
server屬性中被指定的輸出值和http位置可能不正確。
解決辦法
所有的創建的ArcGIS Server Objects需要被停止。
1 在ArcCatalog中,右擊已經添加的ArcGIS Server,並選擇Server屬性。
2 在目錄頁中,選中已經添加的輸出目錄並點擊編輯。
3 輸出目錄字段應該指向一個有效的目錄,比如 C:/ArcGIS/Output。
如果一個虛擬目錄已經被指定,確認它是有效的,並且看上去和下面的格式一樣,
http://<servername>/output
4 如果有錯請更改,然後重新創建server object來確認更改是否有效。

 -------------------------------------------

錯誤描述
當在Visual Studio.NET 2003上使用ArcGIS Server .NET 的ADF模板創建一個項目時,返回如下錯誤信息:
“在服務器<主機名>上的Web站點不可用(Web Site on server <host> is not available)”
導致原因
該模板包含了調用'http://localhost'這一URL的屬性。如果在IIS中禁用了本地主機的服務,則顯示該錯誤信息。禁用本地服務可能是因爲你的Web站點已經爲其指定了一個IP地址或者是因爲安全方面的考慮。
解決辦法
啓用對 http://localhost的訪問決定於您安裝的是哪種類型的操作系統,是服務器還是非服務器。
對於非服務器的操作系統:
1.點擊Internet信息服務控制檯,右鍵選擇默認站點的屬性,打開屬性對話框,並選擇網站標籤頁。

2.修改IP地址欄爲"(全部未分配)"。

3.重啓IIS。

在IE瀏覽器中瀏覽剛剛啓用的 http://localhost 服務,在Visual Studio .NET 2003 中用模板創建項目,現在應該是成功的了。
對於Windows Server操作系統:
1. 在Internet信息服務控制檯上創建一個新的Web站點。

2. 爲其分配IP地址:127.0.0.1。意味着只能在本地計算機上啓用該站點。

3. 瀏覽Web站點的根目錄,比如C:/Inetput/wwwroot 。

此時在Visual Studio .NET 2003 中用模板創建項目應該沒有問題。

-------------------------------------------

錯誤描述
當啓動一個服務對象時,出現下述錯誤信息:“在機器XXX上創建Server 環境(Context)失敗。拒絕訪問output文件夾。”
導致原因
ArcGIS Server Object Container的帳號必須擁有虛擬文件夾的寫權限。例如虛擬文件夾爲: c:/inetpub/wwwroot/temp
解決辦法
執行如下步驟:
右鍵點擊虛擬文件夾如: c:/inetpub/wwwroot/temp

1.選擇屬性->安全標籤頁.
2.添加帳號並賦予寫權限,使其可以讀寫圖片.
3.點擊OK,關閉屬性對話框.

-------------------------------------------
錯誤描述
使用下面的代碼,來進行使用字體中的符號進行點要素渲染的時候,會出現地圖消失的問題。
下面的代碼是用來生成需要在渲染過程中使用的點符號的,使用的是宋體中index爲21的字作爲符號。
private static ICharacterMarkerSymbol
GetMarkerSymbol(IServerContext pServerContext,PowerNet.GISCommon.SymbolClass pSymbolClass)
{

System.Drawing.Font drawFont = new
System.Drawing.Font("宋體", 21);
ICharacterMarkerSymbol charMarker=
pServerContext.CreateObject("esriDisplay.CharacterMarkerSymbol") as
ICharacterMarkerSymbol;
charMarker.Font = (stdole.IFontDisp)
OLE.GetIFontDispFromFont(drawFont);
charMarker.CharacterIndex = pSymbolClass.CharacterIndex;
IRgbColor pRGB = pServerContext.CreateObject("esriDisplay.RgbColor") as IRgbColor;
pRGB.Red=pSymbolClass.SymbolColorR;
pRGB.Green=pSymbolClass.SymbolColorG;
pRGB.Blue=pSymbolClass.SymbolColorB;
charMarker.Color = pRGB as IColor;
charMarker.Size = pSymbolClass.SymbolSize;
return charMarker;
}
導致原因
使用ArcGIS Engine進行開發時,對於點要素類,是可以使用指定字體中的符號作爲渲染的符號的,但是在arcgis server的應用中來實現這個過程,就稍微有點不同,導致的原因還是本地對象和遠程對象進行了混用?對於ao對象,可能大家都已經有這個概念,就是一般不在本地創建對象,但是對於其它的對象,比如.net中的對象,可能就沒有太注意了,所以才導致了這個問題的出現。
解決辦法
這個問題的解決辦法是這樣的,爲了避免在程序中使用下面這句代碼:
System.Drawing.Font drawFont = new
System.Drawing.Font(pSymbolClass.FontSymbolName, 21);
可以採用先在*.Style文件中把符號都配好,然後轉成*.ServerStyle文件,然後使用下面的代碼得到相應的符號:
private IMarkerSymbol createSymbol(IServerContext pServerContext,string index)
{
IStyleGallery pSGallery = pServerContext.CreateObject("esriDisplay.ServerStyleGallery") as IStyleGallery ;
IStyleGalleryStorage pSGStorage = pSGallery as IStyleGalleryStorage ;
pSGStorage.TargetFile = @"D:/xjw.ServerStyle";
pSGStorage.AddFile (@"D:/xjw.ServerStyle");
IEnumStyleGalleryItem pEnumGItem = pSGallery.get_Items("MarkerSymbols",@"D:/xjw.ServerStyle",index);
pEnumGItem.Reset ();
IStyleGalleryItem pSGItem = pEnumGItem.Next();
IMarkerSymbol pMSymbol = pSGItem.Item as IMarkerSymbol;
IRgbColor pRGB = pServerContext.CreateObject("esriDisplay.RgbColor") as IRgbColor;
pRGB.Red=255;
pRGB.Green =0;
pRGB.Blue=0;
pMSymbol.Color=pRGB;
pMSymbol.Size=18;
pEnumGItem=null;
pSGItem=null;
return pMSymbol;
}

-------------------------------------------
錯誤描述
這個錯誤可能發生在.net中的ArcGIS Primary Interop Assemblies(PIA)。在錯誤信息中的CLSID可能會變化:
"COM object with CLSID {XXXX} is either not valid or not registered"
導致原因
在ArcGIS安裝中選擇安裝.NET的支持,PIAs就會爲所有的ArcGIS庫而安裝上。
當在嘗試使用一個對象庫的PIA時,而這個對象庫根本就沒有安裝時,錯誤就會發生,因爲Com對象不能被初始化。
例如,3DAnalyst擴展模塊沒有被安裝,而嘗試使用ESRI.ArcGIS.Analyst3D命名空間中的對象,使用如下代碼:
ESRI.ArcGIS.Analyst3D.IAnimationTrack aTrack = new ESRI.ArcGIS.Analyst3D.AnimationTrackClass();
一個錯誤就會發生:
"Error number -2147221164: COM object with CLSID {4FEDC9CB-A7BE-11D5-B2A0-00508BCDDE28} is either not valid or not registered."
解決辦法
編程只能使用安裝了的對象庫。爲了開發使用一個特殊的庫,那就需要重新安裝ArcGIS產品,確保所需的擴展模塊都被安裝,以及所有的.NET的支持選項。額外的許可會被需要。
1 識別使用的對象,以及這些對象所屬的命名空間。
2 識別命名空間所屬的產品。例如,爲了使用ESRI.ArcGIS.Analyst3D命名空間中的對象,在開發幫助中瀏覽庫總體說明那一頁。會有註解說明這個命名空間是有ArcGIS Engine產品的3D擴展模塊,ArcGIS desktop 3D擴展模塊,以及ArcGIS Server的3D擴展模塊支持。
3 重新安裝產品,確保所需的擴展模塊得到安裝,且保證.Net支持選項被選中。

-------------------------------------------
錯誤描述
當使用ArcGIS開發者控件開發應用程序、控件拖放於窗體上的時候,出現以下錯誤信息:

"該控件需要一個ESRI Designer 許可。請從工程中移除該控件。"
導致原因
出現這個信息是因爲ArcGIS Engine Developer Kit 這個產品未在機器上安裝並授權。

ArcGIS Desktop 安裝了以下控件:

-MapControl
-PageLayoutControl
-GlobeControl
-ReaderControl
-SceneControl
-TOCControl
-ToolbarControl

ArcGIS Desktop 許可僅允許使用MapControl 和 PageLayoutControl 進行開發或設計應用程序。

剩下的其它控件許可給ArcGIS Engine,並僅能在ArcGIS Engine Developer Kit 已安裝並授權時用於開發。
解決辦法
購買ArcGIS Engine Developer Kit 產品,並在機器上授權以下任意控件:

-GlobeControl
-ReaderControl
-SceneControl
-TOCControl
-ToolbarControl

有關如何使用這些控件的詳細信息,以及哪些控件需要對應哪些許可,請參考ArcGIS Developer Help。例如, 'TOCControl CoClass' 幫助主題提到,該控件只在有ArcGIS Engine 產品時纔可用。
-------------------------------------------

錯誤描述
安裝出錯1935
當安裝ArcGIS Server, ArcGIS Desktop, including ArcView, ArcEditor, ArcInfo; or ArcIMS, 都可能發生如下錯誤:

"Error 1935: An error occured during the installation of assembly component {303994BA-6487-47AE-AF1D-7AF6088EEBDB}. HRESULT: -2147024894."
之後點擊'OK' 安裝回滾退出.
導致原因
導致原因
這個錯誤發生在系統安裝(Microsoft XML Parser 4 )更新.這現同樣的錯誤信息將發生在試圖安裝(Microsoft XML Parser 4.0)的時候; 這也可能修改,但是經常會因爲其他產品的安裝而影響系統文件破壞。
解決辦法
步驟:
1. 儘可能停止一些後臺程序,例如adware 或 spyware. 有可能也停止Adwatch,在機器上刪除所有的 adware.;
2. 儘可能停止一些Windows服務,控制面板 >管理員工具 >服務;
3. 檢查Internet Explorer 6.0的安裝. 檢驗Microsoft service 安裝包和安裝更新;
4. 在安裝產品前請先安裝Microsoft XML 4.0 SP2,這有可能下載其相關聯的一部分;
5. 接着安裝ESRI軟件產品在第4步安裝成功;

-------------------------------------------
錯誤描述
在操作系統是Windows XP SP2、CPU爲 AMD Athlon 64系列或 Pentium 4 和 Celeron-D 的機器上安裝ArcGIS 9.0時,出現1904錯誤,系統無法註冊一些 dll 文件。
導致原因
在Windows XP SP2 中, DEP(數據執行保護)選項默認情況下是打開的, AMD和Intel新的CUP系列中包含這個選項。數據執行保護是一套硬件和軟件技術用於執行對內存的額外檢查,以保護電腦遭受惡意代碼的破壞。
解決辦法
方法一:移除Windows XP的SP2,然後安裝ArcGIS 9.0。

方法二:關閉DEP(數據執行保護),安裝ArcGIS 9.0,安裝完再激活數據執行保護。具體如下:
1. 以管理員權限登陸Windows XP。
2. 鼠標郵件點擊“我的電腦”,選擇“屬性”菜單
3. 點擊“高級”頁。
4. 選擇“啓動與恢復”下的“設置”按鈕。
5. 選擇默認操作系統,如下:
"Microsoft Windows XP Professional" /fastdetect /NoExecute=OptIn
6. 點擊“編輯” 按鈕打開boot.ini 文件,將其中的“”/NoExecute=OptIn”改爲“/NoExecute=AlwaysOff”。
7. 保存文件,重新啓動計算機。
8. 安裝ArcGIS,此時應該就不會出現1904錯誤了
9. 安裝完ArcGIS以後,將 boot.ini 文件設置改回來,以重新激活數據執行保護的安全選項。

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章