WebApp quits unexpectedly on startup as a service

I have the service running in my develpment Windows 2008 64bit server VM. When I try to start it up on my client’s Win 2008 server (not a vm) it will not start. I get an alert that says it did not start because it quit unexpectedly.

I read on the forum that this may be due the app open event trying to access a file not available to the service. My app open even only test that my MBS Utility plugin serial is valid…

[code]// John Baughman, MBS Util, 12345, 12345678
dim x as integer = 100
dim s as string = "MBS "
dim n as string = decodeBase64(“abcdefghijklm==”, encodings.UTF8)
dim y as integer = 59

if not registerMBSPlugin(n, s+“Util”, 1234x+5, 123456x+y) then
MsgBox “MBS Plugin serial not valid?”
end if[/code]

The WebApp starts up just fine when started up normally by double clicking it. A year or so ago I had it working fine but we never went the service route. The OS has had several updates sincc. Now I need to run it as a service and can’t get it to work.

Any suggestions?

Does it work if you comment out the license key check?

Christian, I will try that tomorrow night. It’s getting very late for me here.

Looking at my Session open event I am looking for a file…

[code]Dim f, g As FolderItem
f = GetFolderItem(“Resources”)
g = f.parent.parent.Child(“4DHost.txt”)

If g.exists Then
Dim textInput As TextInputStream
Dim newHost, newPort As String
textInput = TextInputStream.Open(g)
//textInput.Encoding = Encodings.MacRoman //strings are MacRoman
newHost = textInput.ReadLine(Encodings.ASCII)
newPort = textInput.ReadLine

Host = newHost+":"+newPort

End If[/code]

I wonder if that could be the problem. I will also test tomorrow, but if this is an issue then my app is dead in the water as a service. The whole purpose of the app is to display pdfs that exist in the file system. It worked fine before.

please check if f or g is nil, before using them!

Also catch IO exception.

I commented out the MBS stuff as well as the file access stuff in the session open event. It still crashes when attempting to open as a service.

I am also having trouble getting a database to open properly as a service on the same production machine. Both the database and Xojo worked just fine as services on this box a year ago. I’m stumped.

Did you specify a user to run the service, or are you just running it as a default local service? that would affect the location of the standard folders such as documents, etc. I bet that you installed logged in as yourself and have files in the documents folder, application data folder or some other standard folder. When you double-click the executable to start it, again it is probably with your user (or some admin account used to install). When run as a local service, the application is not starting under the user and as a result these folders are inaccessible. You may want to try again with the “all users” branch, or with custom folders created ad-hoc.

Louis you hit the nail on the head. I got it working by setting Log On to use the Admin account. Same for the database.

Thanks to all for the help.


Glad I could help.