irigsoft Posted September 23, 2020 Share Posted September 23, 2020 Hi, I try to deploy my application on IIS. When is Use it like StandAlone Application its OK, no errors shown on start session When I Start IIS on port 80 my ISAPI, this hapen on browser "Fatal Error: InituniGUIServerModule: Access violation at address 00404F20 in module 'eMenu.dll'. Read of address 00000000" on Log file: eMenu.dll: 00001124: 21:06:15 []:>--------------------------------------------------------------< eMenu.dll: 00001124: 21:06:15 []:Starting Server. Module Handle: 0000000000400000 eMenu.dll: 00001124: 21:06:15 []:EAccessViolation : Access violation at address 00404F20 in module 'eMenu.dll'. Read of address 00000000 : Addr: $00404F20 eMenu.dll: 00001124: 21:06:15 [TUniServerModule]:Server Shutdown Completed. eMenu.dll: 00001124: 21:06:15 [InitUniGUIServerModule]:Access violation at address 00404F20 in module 'eMenu.dll'. Read of address 00000000 on Second try to load IIS site I get this: "Fatal Error: UniGUIServerModule is not inited!" How to analize this error? Quote Link to comment Share on other sites More sharing options...
Administrators Farshad Mohajeri Posted September 23, 2020 Administrators Share Posted September 23, 2020 Hi, Do you have any sort of components placed on your server module? Quote Link to comment Share on other sites More sharing options...
irigsoft Posted September 23, 2020 Author Share Posted September 23, 2020 11 minutes ago, Farshad Mohajeri said: Hi, Do you have any sort of components placed on your server module? By Design, no. but on Project I use: uses msvcrtMM, {$IFDEF UNIGUI_ISAPI} uniGUIISAPI, {$ENDIF} SysUtils, Forms, ServerModule in 'ServerModule.pas' {UniServerModule: TUniGUIServerModule}, MainModule in 'MainModule.pas' {UniMainModule: TUniGUIMainModule}, ............................... {$R *.res} {$IFDEF UNIGUI_ISAPI} exports GetExtensionVersion, HttpExtensionProc, TerminateExtension; {$ENDIF} begin ................ On ServerModule ------------on BeforInit: AllowWebMonitor := False; GetLocaleFormatSettings(GetUserDefaultLCID, MySettings); MySettings.DateSeparator := '.'; MySettings.TimeSeparator := ':'; MySettings.DecimalSeparator := '.'; MySettings.LongTimeFormat := 'HH:mm:ss'; MySettings.ShortDateFormat := 'dd.MM.yyyy'; MySettings.ShortTimeFormat := 'HH:mm'; Application.UpdateFormatSettings := False; SectionsList := TStringList.Create; SistemSettingsList := TStringList.Create; AllowedCommands := TStringList.Create; If FileExists (ExtractFilePath(StartPath) + 'Settings\DisabledCommands.cfg') then AllowedCommands.LoadFromFile (ExtractFilePath(StartPath) + 'Settings\DisabledCommands.cfg'); AllowedCommands.SaveToFile (ExtractFilePath(StartPath) + 'Settings\DisabledCommands.cfg'); AllowedCommands.Clear; AllowedCommands.Free; If FileExists (ExtractFilePath(StartPath) + 'Settings\BlockedIPList.cfg') then BlockedIPList.LoadFromFile (ExtractFilePath(StartPath) + 'Settings\BlockedIPList.cfg'); HTMLCommandsLog := TStringList.Create; if not DirectoryExists (ExtractFileDir (Application.ExeName) + '\HtmlLog') then ForceDirectories (ExtractFileDir (Application.ExeName) + '\HtmlLog'); AllowedIP := TStringList.Create; If FileExists (ExtractFilePath(StartPath) + 'Settings\AllowedIP.cfg') then AllowedIP.LoadFromFile (ExtractFilePath(StartPath) + 'Settings\AllowedIP.cfg'); AllowedIP.SaveToFile (ExtractFilePath(StartPath) + 'Settings\AllowedIP.cfg'); AllowedIP.Clear; AllowedIP.Free; SistemIni := TIniFile.Create (ExtractFilePath(StartPath) + 'Settings\SystemSettings.ini'); SistemIni.ReadSections (SectionsList); for I := 0 to SectionsList.Count - 1 do begin SistemIni.ReadSectionValues (SectionsList ,tempSList); for J := 0 to tempSList.Count - 1 do SistemSettingsList.Add (tempSList [J]); end; SistemIni.Free; SectionsList.Clear; SectionsList.Free; If not PortAvailable (IntToStr (Port)) then begin uniApplication.Terminate; end; IF AnsiUpperCase (SistemSettingsList.Values ['UseImageCash']) = 'TRUE' then UseGlobalImageCache := True; ------------- on Create sFunctionTree := TuniTreeView.Create (Application); sFunctionTree.Visible := False; sFunctionTree.Name := 'sFunctionTree'; sElementsTree := TuniTreeView.Create (Application); sElementsTree.Visible := False; sElementsTree.Name := 'sElementsTree'; GetFuncTree := TuniTreeView.Create (Application); GetFuncTree.Visible := False; GetFuncTree.Name := 'GetFuncTree'; ShortDateFormat := 'dd.MM.yyyy'; ShortTimeFormat := 'HH:mm'; DateSeparator := '.'; LongTimeFormat := 'HH:mm:ss'; TimeSeparator := ':'; DecimalSeparator := '.'; CustomMeta.LoadFromFile (ExtractFileDir (ProcessPath) + '\files\customMeta.txt'); CustomCSS.LoadFromFile (ExtractFileDir (ProcessPath) + '\files\customCSS.txt'); MimeTable.AddMimeType('app','pkpass'); Quote Link to comment Share on other sites More sharing options...
Administrators Farshad Mohajeri Posted September 23, 2020 Administrators Share Posted September 23, 2020 The Code in onBeforeInit raises an exception. You need to find which line of code. Quote Link to comment Share on other sites More sharing options...
Administrators Farshad Mohajeri Posted September 23, 2020 Administrators Share Posted September 23, 2020 If not PortAvailable (IntToStr (Port)) then begin uniApplication.Terminate; end; ????? Quote Link to comment Share on other sites More sharing options...
irigsoft Posted September 23, 2020 Author Share Posted September 23, 2020 1 minute ago, Farshad Mohajeri said: The Code in onBeforeInit raises an exception. You need to find which line of code. I wil try without this code, thanks Quote Link to comment Share on other sites More sharing options...
irigsoft Posted September 23, 2020 Author Share Posted September 23, 2020 Just now, Farshad Mohajeri said: If not PortAvailable (IntToStr (Port)) then begin uniApplication.Terminate; end; ????? not full sorce!. But I try to check if port on servermodule enabled, else close application Quote Link to comment Share on other sites More sharing options...
Administrators Farshad Mohajeri Posted September 23, 2020 Administrators Share Posted September 23, 2020 uniApplication is your session application. You should not try terminating the server itself. Quote Link to comment Share on other sites More sharing options...
irigsoft Posted September 23, 2020 Author Share Posted September 23, 2020 2 minutes ago, Farshad Mohajeri said: uniApplication is your session application. You should not try terminating the server itself. When start Application, If Server Port is not enabled, Application must close. Quote Link to comment Share on other sites More sharing options...
Administrators Farshad Mohajeri Posted September 23, 2020 Administrators Share Posted September 23, 2020 In a DLL it is not possible to terminate it from code. Quote Link to comment Share on other sites More sharing options...
irigsoft Posted September 23, 2020 Author Share Posted September 23, 2020 Just now, Farshad Mohajeri said: In a DLL it is not possible to terminate it from code. OK, If it is IIS then can't terminate application. Quote Link to comment Share on other sites More sharing options...
Administrators Farshad Mohajeri Posted September 23, 2020 Administrators Share Posted September 23, 2020 yes Quote Link to comment Share on other sites More sharing options...
irigsoft Posted September 23, 2020 Author Share Posted September 23, 2020 Now I try with to add onbefforeInit first line: exit; and start IIS url: localhost:80/emenu/emenu.dll (My dll is eMenu.dll, My WebSite is eMenu) and browser start direct download on dll, what is wrong ? I am new on IIS. All on http://www.unigui.com/doc/online_help/iis_7_0.htm is executed. Quote Link to comment Share on other sites More sharing options...
irigsoft Posted September 23, 2020 Author Share Posted September 23, 2020 Answer by IIS: The Web server is configured to not list the contents of this directory. Most likely causes: A default document is not configured for the requested URL, and directory browsing is not enabled on the server. Things you can try: If you do not want to enable directory browsing, ensure that a default document is configured and that the file exists. Enable directory browsing using IIS Manager. Open IIS Manager. In the Features view, double-click Directory Browsing. On the Directory Browsing page, in the Actions pane, click Enable. Verify that the configuration/system.webServer/directoryBrowse@enabled attribute is set to true in the site or application configuration file. Detailed Error Information: Module DirectoryListingModule Notification ExecuteRequestHandler Handler StaticFile Error Code 0x00000000 Requested URL http://localhost:80/eMenu/ Physical Path D:\Webmenu\POS_Interface_Web_Escape\ Logon Method Anonymous Logon User Anonymous It's like, no application started Quote Link to comment Share on other sites More sharing options...
Administrators Farshad Mohajeri Posted September 23, 2020 Administrators Share Posted September 23, 2020 Make sure ISAPI handler is enabled for your virtual directory. Quote Link to comment Share on other sites More sharing options...
irigsoft Posted September 23, 2020 Author Share Posted September 23, 2020 Quote Link to comment Share on other sites More sharing options...
Administrators Farshad Mohajeri Posted September 23, 2020 Administrators Share Posted September 23, 2020 Please do not assign an executable. Quote Link to comment Share on other sites More sharing options...
Administrators Farshad Mohajeri Posted September 23, 2020 Administrators Share Posted September 23, 2020 Quote Link to comment Share on other sites More sharing options...
irigsoft Posted September 23, 2020 Author Share Posted September 23, 2020 Now i delete it an try to add again, but this hapend: Quote Link to comment Share on other sites More sharing options...
irigsoft Posted September 23, 2020 Author Share Posted September 23, 2020 I will try to create IIS website from begining Quote Link to comment Share on other sites More sharing options...
Administrators Farshad Mohajeri Posted September 23, 2020 Administrators Share Posted September 23, 2020 Yes, that is better. Quote Link to comment Share on other sites More sharing options...
irigsoft Posted September 23, 2020 Author Share Posted September 23, 2020 Yes, now onbeforInit ignored and site load, but first popup message angain is Error ocured. May be error is on Program code on load/Create main form , but how to catch it Quote Link to comment Share on other sites More sharing options...
irigsoft Posted September 23, 2020 Author Share Posted September 23, 2020 Log file: emenu.dll: 00001FE4: 22:53:12 []:>--------------------------------------------------------------< emenu.dll: 00001FE4: 22:53:12 []:Starting Server. Module Handle: 0000000000400000 emenu.dll: 00001FE4: 22:53:12 [TUniServerModule]:Server First Init. emenu.dll: 00001FE4: 22:53:12 []:EAccessViolation : Access violation at address 76341A9D in module 'KERNEL32.DLL'. Write of address 00000198 : Addr: $76341A9D emenu.dll: 00001FE4: 22:53:12 []:Server Started. Module Handle: 0000000000400000 emenu.dll: 0000016C: 22:53:12 [::1]:Session <OPUEvRmKET106D82322> Created. .................................................... emenu.dll: 00001714: 22:54:04 [::1]:EAccessViolation : Access violation at address 0042BAE4 in module 'emenu.dll'. Read of address 00000000 : Addr: $0042BAE4 emenu.dll: 0000016C: 22:54:46 [::1]:Session <u7voN8AXq7106D8238E> Created. emenu.dll: 0000016C: 22:54:46 [TUniGUIServerModule.HandleException]:EAccessViolation : Access violation at address 0042BAE4 in module 'emenu.dll'. Read of address 00000000 : Addr: $0042BAE4 emenu.dll: 0000016C: 22:54:46 [Access violation at address 00717B4B in module 'emenu.dll'. Read of address 00000000-::1]:EAccessViolation : Access violation at address 00717B4B in module 'emenu.dll'. Read of address 00000000 : Addr: $00717B4B emenu.dll: 0000016C: 22:54:46 [TUniGUIServerModule.HandleException]:EAccessViolation : Access violation at address 0042BAE4 in module 'emenu.dll'. Read of address 00000000 : Addr: $0042BAE4 emenu.dll: 0000016C: 22:54:46 [::1]:EAccessViolation : Access violation at address 0042BAE4 in module 'emenu.dll'. Read of address 00000000 : Addr: $0042BAE4 Quote Link to comment Share on other sites More sharing options...
irigsoft Posted September 23, 2020 Author Share Posted September 23, 2020 My problem is: How to debug application if create it from one PC, and execute ISAPI dll on other PC. It posible to use log file to debug or some other application can help me ? Quote Link to comment Share on other sites More sharing options...
irigsoft Posted September 23, 2020 Author Share Posted September 23, 2020 Yes, onBeforInit have a problem and it is on program code: If i Ignore this : ------------------------------- tempSList := TStringList.Create; ..................... SistemIni := TIniFile.Create (ExtractFilePath(StartPath) + 'Settings\SystemSettings.ini'); SistemIni.ReadSections (SectionsList); for I := 0 to SectionsList.Count - 1 do begin SistemIni.ReadSectionValues (SectionsList ,tempSList); for J := 0 to tempSList.Count - 1 do SistemSettingsList.Add (tempSList [J]); end; ------------------------------- no error ocured. In this section i load all sistem settings from local INI file (like I do it on VCL) Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.