Issues with Web Service

2008-03-29
2013-04-22
  • Jen Garrett
    Jen Garrett
    2008-03-29

    I apologize if this has been covered before. I am working with IIS 7 and Vista, trying to use AIMLBot 2.5, I have having the following error:

    Server Error in '/AIMLWebService' Application.
    --------------------------------------------------------------------------------

    Unable to find the specified file.
    Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

    Exception Details: System.IO.FileNotFoundException: Unable to find the specified file.

    Source Error:

    Line 11:         // Code that runs on application startup
    Line 12:         UserSession.Timeout = Convert.ToDouble(ConfigurationSettings.AppSettings["timeout"]);
    Line 13:         globalBot.loadSettings(System.IO.Path.Combine(Server.MapPath("AIMLWebService"), System.IO.Path.Combine("config", "Settings.xml")));
    Line 14:         globalBot.loadAIMLFromFiles();
    Line 15:     }

    Source File: c:\inetpub\wwwroot\AIMLWebService\Global.asax    Line: 13

    Stack Trace:

    [FileNotFoundException: Unable to find the specified file.]
       AIMLbot.Utils.SettingsDictionary.loadSettings(String pathToSettings) in C:\Documents and Settings\Nicholas\My Documents\Visual Studio 2005\Projects\Program#\Repos\trunk\AIMLbot\AIMLbot\Utils\SettingsDictionary.cs:108
       AIMLbot.Bot.loadSettings(String pathToSettings) in C:\Documents and Settings\Nicholas\My Documents\Visual Studio 2005\Projects\Program#\Repos\trunk\AIMLbot\AIMLbot\Bot.cs:391
       ASP.global_asax.Application_Start(Object sender, EventArgs e) in c:\inetpub\wwwroot\AIMLWebService\Global.asax:13

    [HttpException (0x80004005): Unable to find the specified file.]
       System.Web.HttpApplicationFactory.EnsureAppStartCalledForIntegratedMode(HttpContext context, HttpApplication app) +3384766
       System.Web.HttpApplication.RegisterEventSubscriptionsWithIIS(IntPtr appContext, HttpContext context, MethodInfo[] handlers) +125
       System.Web.HttpApplication.InitSpecial(HttpApplicationState state, MethodInfo[] handlers, IntPtr appContext, HttpContext context) +182
       System.Web.HttpApplicationFactory.GetSpecialApplicationInstance(IntPtr appContext, HttpContext context) +259
       System.Web.Hosting.PipelineRuntime.InitializeApplication(IntPtr appContext) +245

    [HttpException (0x80004005): Unable to find the specified file.]
       System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +3465427
       System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +69
       System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context) +675

    --------------------------------------------------------------------------------
    Version Information: Microsoft .NET Framework Version:2.0.50727.1433; ASP.NET Version:2.0.50727.1433

     
    • Jen Garrett
      Jen Garrett
      2008-03-29

      Now I am getting this:

      Server Error in '/AIMLWebService' Application.
      --------------------------------------------------------------------------------

      Compilation Error
      Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.

      Compiler Error Message: CS1009: Unrecognized escape sequence

      Source Error:

      Line 11:         // Code that runs on application startup
      Line 12:         UserSession.Timeout = Convert.ToDouble(ConfigurationSettings.AppSettings["timeout"]);
      Line 13:         globalBot.loadSettings("C:\inetpub\wwwroot\AIMLWebService\config\Settings.xml");
      Line 14:         globalBot.loadAIMLFromFiles();
      Line 15:     }

      Source File: c:\inetpub\wwwroot\AIMLWebService\Global.asax    Line: 13

      Show Detailed Compiler Output:

      c:\windows\system32\inetsrv> "C:\Windows\Microsoft.NET\Framework\v2.0.50727\csc.exe" /t:library /utf8output /R:"C:\Windows\assembly\GAC_MSIL\System.Drawing\2.0.0.0__b03f5f7f11d50a3a\System.Drawing.dll" /R:"C:\Windows\assembly\GAC_MSIL\System.WorkflowServices\3.5.0.0__31bf3856ad364e35\System.WorkflowServices.dll" /R:"C:\Windows\assembly\GAC_MSIL\System.Web.Services\2.0.0.0__b03f5f7f11d50a3a\System.Web.Services.dll" /R:"C:\Windows\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\aimlwebservice\41227fc7\43768486\App_Code.ezvlflvb.dll" /R:"C:\Windows\assembly\GAC_MSIL\System.Xml\2.0.0.0__b77a5c561934e089\System.Xml.dll" /R:"C:\Windows\assembly\GAC_32\System.Data\2.0.0.0__b77a5c561934e089\System.Data.dll" /R:"C:\Windows\assembly\GAC_MSIL\System\2.0.0.0__b77a5c561934e089\System.dll" /R:"C:\Windows\assembly\GAC_MSIL\System.Runtime.Serialization\3.0.0.0__b77a5c561934e089\System.Runtime.Serialization.dll" /R:"C:\Windows\assembly\GAC_32\System.EnterpriseServices\2.0.0.0__b03f5f7f11d50a3a\System.EnterpriseServices.dll" /R:"C:\Windows\assembly\GAC_MSIL\System.ServiceModel.Web\3.5.0.0__31bf3856ad364e35\System.ServiceModel.Web.dll" /R:"C:\Windows\assembly\GAC_32\System.Web\2.0.0.0__b03f5f7f11d50a3a\System.Web.dll" /R:"C:\Windows\Microsoft.NET\Framework\v2.0.50727\mscorlib.dll" /R:"C:\Windows\assembly\GAC_MSIL\System.Web.Mobile\2.0.0.0__b03f5f7f11d50a3a\System.Web.Mobile.dll" /R:"C:\Windows\assembly\GAC_MSIL\System.Configuration\2.0.0.0__b03f5f7f11d50a3a\System.Configuration.dll" /R:"C:\Windows\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\aimlwebservice\41227fc7\43768486\assembly\dl3\446b9c3a\009ca3d3_8a75c701\AIMLbot.DLL" /R:"C:\Windows\assembly\GAC_MSIL\System.IdentityModel\3.0.0.0__b77a5c561934e089\System.IdentityModel.dll" /R:"C:\Windows\assembly\GAC_MSIL\System.ServiceModel\3.0.0.0__b77a5c561934e089\System.ServiceModel.dll" /out:"C:\Windows\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\aimlwebservice\41227fc7\43768486\App_global.asax.5cli0anh.dll" /D:DEBUG /debug+ /optimize- /w:4 /nowarn:1659;1699;1701  "C:\Windows\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\aimlwebservice\41227fc7\43768486\App_global.asax.5cli0anh.0.cs" "C:\Windows\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\aimlwebservice\41227fc7\43768486\App_global.asax.5cli0anh.1.cs"

      Microsoft (R) Visual C# 2005 Compiler version 8.00.50727.1433
      for Microsoft (R) Windows (R) 2005 Framework version 2.0.50727
      Copyright (C) Microsoft Corporation 2001-2005. All rights reserved.

      c:\inetpub\wwwroot\AIMLWebService\Global.asax(13,36): error CS1009: Unrecognized escape sequence
      c:\inetpub\wwwroot\AIMLWebService\Global.asax(13,44): error CS1009: Unrecognized escape sequence
      c:\inetpub\wwwroot\AIMLWebService\Global.asax(13,52): error CS1009: Unrecognized escape sequence
      c:\inetpub\wwwroot\AIMLWebService\Global.asax(13,67): error CS1009: Unrecognized escape sequence
      c:\inetpub\wwwroot\AIMLWebService\Global.asax(13,74): error CS1009: Unrecognized escape sequence

      Show Complete Compilation Source:

      Line 1:    #pragma checksum "C:\inetpub\wwwroot\AIMLWebService\global.asax" "{406ea660-64cf-4c82-b6f0-42d48172a799}" "47ABDFE0A5DB9461B7FDF089A8EE63E4"
      Line 2:    //------------------------------------------------------------------------------
      Line 3:    // <auto-generated>
      Line 4:    //     This code was generated by a tool.
      Line 5:    //     Runtime Version:2.0.50727.1433
      Line 6:    //
      Line 7:    //     Changes to this file may cause incorrect behavior and will be lost if
      Line 8:    //     the code is regenerated.
      Line 9:    // </auto-generated>
      Line 10:   //------------------------------------------------------------------------------
      Line 11:  
      Line 12:   namespace ASP {
      Line 13:      
      Line 14:       #line 285 "C:\Windows\Microsoft.NET\Framework\v2.0.50727\Config\web.config"
      Line 15:       using System.Web.Profile;
      Line 16:      
      Line 17:       #line default
      Line 18:       #line hidden
      Line 19:      
      Line 20:       #line 280 "C:\Windows\Microsoft.NET\Framework\v2.0.50727\Config\web.config"
      Line 21:       using System.Text.RegularExpressions;
      Line 22:      
      Line 23:       #line default
      Line 24:       #line hidden
      Line 25:      
      Line 26:       #line 282 "C:\Windows\Microsoft.NET\Framework\v2.0.50727\Config\web.config"
      Line 27:       using System.Web.Caching;
      Line 28:      
      Line 29:       #line default
      Line 30:       #line hidden
      Line 31:      
      Line 32:       #line 278 "C:\Windows\Microsoft.NET\Framework\v2.0.50727\Config\web.config"
      Line 33:       using System.Configuration;
      Line 34:      
      Line 35:       #line default
      Line 36:       #line hidden
      Line 37:      
      Line 38:       #line 277 "C:\Windows\Microsoft.NET\Framework\v2.0.50727\Config\web.config"
      Line 39:       using System.Collections.Specialized;
      Line 40:      
      Line 41:       #line default
      Line 42:       #line hidden
      Line 43:      
      Line 44:       #line 289 "C:\Windows\Microsoft.NET\Framework\v2.0.50727\Config\web.config"
      Line 45:       using System.Web.UI.HtmlControls;
      Line 46:      
      Line 47:       #line default
      Line 48:       #line hidden
      Line 49:      
      Line 50:       #line 287 "C:\Windows\Microsoft.NET\Framework\v2.0.50727\Config\web.config"
      Line 51:       using System.Web.UI.WebControls;
      Line 52:      
      Line 53:       #line default
      Line 54:       #line hidden
      Line 55:      
      Line 56:       #line 276 "C:\Windows\Microsoft.NET\Framework\v2.0.50727\Config\web.config"
      Line 57:       using System.Collections;
      Line 58:      
      Line 59:       #line default
      Line 60:       #line hidden
      Line 61:      
      Line 62:       #line 286 "C:\Windows\Microsoft.NET\Framework\v2.0.50727\Config\web.config"
      Line 63:       using System.Web.UI;
      Line 64:      
      Line 65:       #line default
      Line 66:       #line hidden
      Line 67:      
      Line 68:       #line 288 "C:\Windows\Microsoft.NET\Framework\v2.0.50727\Config\web.config"
      Line 69:       using System.Web.UI.WebControls.WebParts;
      Line 70:      
      Line 71:       #line default
      Line 72:       #line hidden
      Line 73:      
      Line 74:       #line 275 "C:\Windows\Microsoft.NET\Framework\v2.0.50727\Config\web.config"
      Line 75:       using System;
      Line 76:      
      Line 77:       #line default
      Line 78:       #line hidden
      Line 79:      
      Line 80:       #line 284 "C:\Windows\Microsoft.NET\Framework\v2.0.50727\Config\web.config"
      Line 81:       using System.Web.Security;
      Line 82:      
      Line 83:       #line default
      Line 84:       #line hidden
      Line 85:      
      Line 86:       #line 281 "C:\Windows\Microsoft.NET\Framework\v2.0.50727\Config\web.config"
      Line 87:       using System.Web;
      Line 88:      
      Line 89:       #line default
      Line 90:       #line hidden
      Line 91:      
      Line 92:       #line 283 "C:\Windows\Microsoft.NET\Framework\v2.0.50727\Config\web.config"
      Line 93:       using System.Web.SessionState;
      Line 94:      
      Line 95:       #line default
      Line 96:       #line hidden
      Line 97:      
      Line 98:       #line 279 "C:\Windows\Microsoft.NET\Framework\v2.0.50727\Config\web.config"
      Line 99:       using System.Text;
      Line 100:     
      Line 101:      #line default
      Line 102:      #line hidden
      Line 103:     
      Line 104:     
      Line 105:      [System.Runtime.CompilerServices.CompilerGlobalScopeAttribute()]
      Line 106:      public class global_asax : global::System.Web.HttpApplication {
      Line 107:         
      Line 108:          private System.Collections.Hashtable cacheduserHash;
      Line 109:         
      Line 110:          private System.Collections.Hashtable cachedsessionHash;
      Line 111:         
      Line 112:          private AIMLbot.Bot cachedglobalBot;
      Line 113:         
      Line 114:          private static bool @__initialized;
      Line 115:         
      Line 116:         
      Line 117:          #line 7 "C:\inetpub\wwwroot\AIMLWebService\global.asax"
      Line 118:                        
      Line 119:     
      Line 120:      void Application_Start(object sender, EventArgs e)
      Line 121:      {
      Line 122:          // Code that runs on application startup
      Line 123:          UserSession.Timeout = Convert.ToDouble(ConfigurationSettings.AppSettings["timeout"]);
      Line 124:          globalBot.loadSettings("C:\inetpub\wwwroot\AIMLWebService\config\Settings.xml");
      Line 125:          globalBot.loadAIMLFromFiles();
      Line 126:      }
      Line 127:     
      Line 128:      void Application_End(object sender, EventArgs e)
      Line 129:      {
      Line 130:          //  Code that runs on application shutdown
      Line 131: 
      Line 132:      }
      Line 133:         
      Line 134:      void Application_Error(object sender, EventArgs e)
      Line 135:      {
      Line 136:          // Code that runs when an unhandled error occurs
      Line 137: 
      Line 138:      }
      Line 139: 
      Line 140:      void Session_Start(object sender, EventArgs e)
      Line 141:      {
      Line 142:          // Code that runs when a new session is started
      Line 143: 
      Line 144:      }
      Line 145: 
      Line 146:      void Session_End(object sender, EventArgs e)
      Line 147:      {
      Line 148:          // Code that runs when a session ends.
      Line 149:          // Note: The Session_End event is raised only when the sessionstate mode
      Line 150:          // is set to InProc in the Web.config file. If session mode is set to StateServer
      Line 151:          // or SQLServer, the event is not raised.
      Line 152: 
      Line 153:      }
      Line 154:        
      Line 155: 
      Line 156:          #line default
      Line 157:          #line hidden
      Line 158:         
      Line 159:         
      Line 160:          [System.Diagnostics.DebuggerNonUserCodeAttribute()]
      Line 161:          public global_asax() {
      Line 162:              if ((global::ASP.global_asax.@__initialized == false)) {
      Line 163:                  global::ASP.global_asax.@__initialized = true;
      Line 164:              }
      Line 165:          }
      Line 166:         
      Line 167:          protected System.Web.Profile.DefaultProfile Profile {
      Line 168:              get {
      Line 169:                  return ((System.Web.Profile.DefaultProfile)(this.Context.Profile));
      Line 170:              }
      Line 171:          }
      Line 172:         
      Line 173:          private System.Collections.Hashtable userHash {
      Line 174:              get {
      Line 175:                  if ((this.cacheduserHash == null)) {
      Line 176:                      this.cacheduserHash = ((System.Collections.Hashtable)(this.Application.StaticObjects.GetObject("userHash")));
      Line 177:                  }
      Line 178:                  return this.cacheduserHash;
      Line 179:              }
      Line 180:          }
      Line 181:         
      Line 182:          private System.Collections.Hashtable sessionHash {
      Line 183:              get {
      Line 184:                  if ((this.cachedsessionHash == null)) {
      Line 185:                      this.cachedsessionHash = ((System.Collections.Hashtable)(this.Application.StaticObjects.GetObject("sessionHash")));
      Line 186:                  }
      Line 187:                  return this.cachedsessionHash;
      Line 188:              }
      Line 189:          }
      Line 190:         
      Line 191:          private AIMLbot.Bot globalBot {
      Line 192:              get {
      Line 193:                  if ((this.cachedglobalBot == null)) {
      Line 194:                      this.cachedglobalBot = ((AIMLbot.Bot)(this.Application.StaticObjects.GetObject("globalBot")));
      Line 195:                  }
      Line 196:                  return this.cachedglobalBot;
      Line 197:              }
      Line 198:          }
      Line 199:      }
      Line 200:  }
      Line 201: 

      --------------------------------------------------------------------------------
      Version Information: Microsoft .NET Framework Version:2.0.50727.1433; ASP.NET Version:2.0.50727.1433

       
    • Jen,

      The string in line 13 should read:

      "C:\\inetpub\\wwwroot\\AIMLWebService\\config\\Settings.xml"

      Although I caution against hard coding a path like this.

      Bets wishes,

      Nicholas.