Problem with agent which crashes server

I have a manual agent that when run crashes my server.

This agent was created for a website running R5 Domino, I moved the site, and the agent, to a R6.5.3 server and ever since then it crashes my server.  I could use some help, I'm hoping it is as simple as code needing to be updated.

Here is the existing code from the agent.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Sub Initialize
 '-----------------------------------------------------------------------------------------------------
 ' Declare variables
 '-----------------------------------------------------------------------------------------------------
      On Error Goto HandleError
      
      Dim s As New NotesSession
      Dim db As NotesDatabase
      Dim contextDoc As NotesDocument
      Dim item As NotesItem
      Dim donorNumber As String, actionFlag As String
      Dim userName As String
      Dim kind As String
      
'-----------------------------------------------------------------------------------------------------
'      Get username
'-----------------------------------------------------------------------------------------------------
      Set contextDoc = s.DocumentContext
      Set db = s.CurrentDatabase
      Set item = contextDoc.GetFirstItem( "Remote_User" )
      If Not ( item Is Nothing ) Then
            userName = Trim( item.Text )
      End If
      
'-----------------------------------------------------------------------------------------------------
' Create Notes Doc
'-----------------------------------------------------------------------------------------------------
      Set item = contextDoc.GetFirstItem( "Kind" )
      If Not ( item Is Nothing ) Then
            kind = Cstr( item.Text )
            
            Select Case kind
            Case "Web T-Shirt"
                  donorNumber = GenerateNotesTShritDoc( db, contextDoc,userName )
                  
            Case "Web Donation Form"
                  donorNumber = GenerateNotesDonation( db, contextDoc, userName)
                  
            End Select
            
      End If
      
      
      
      Exit Sub
HandleError:
      Print "Submit Web Order::Initialize "
      Print      "Error " & Err() & " at line " & Erl() & ": " & Error()
      Exit Sub
End Sub

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
LVL 8
ITDharamAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

qwaleteeCommented:
I've got to believe that the problem occurs in the GenerateNotes***** functions.  You could also hep debug this with some msgbox statments (which print to server console), or print statemnets (which show results in the browser -- make sure to add <BR> to the end of every print).
0
ITDharamAuthor Commented:
When I opened up the Agent I didn't realize it had actually found an error.

"Submit Web Donation: (Options): 4: Error loading USE or USELX module: WebRoutines"

I looked up USE and it calls a script, I believe.  So I looked in scripts and and there is a script in the DB called WebRoutines.  It is signed with the same ID, Server ID, as everything else in the DB.

qwaletee, thanks for the input, I'm not familiar with the print statements...and I'm actually not very familiar with this DB either, I just inherited it.  If it isn't too much trouble, could you spell out how I would integrate that?  Or is the information I've just provided enough to get you going?

Thanks,
0
p_parthaCommented:
Something like this and let us know what and all is printed

Sub Initialize
 '-----------------------------------------------------------------------------------------------------
 ' Declare variables
 '-----------------------------------------------------------------------------------------------------
     On Error Goto HandleError
     
     Dim s As New NotesSession
     Dim db As NotesDatabase
     Dim contextDoc As NotesDocument
     Dim item As NotesItem
     Dim donorNumber As String, actionFlag As String
     Dim userName As String
     Dim kind As String
     Print "entering uptil here 1"
'-----------------------------------------------------------------------------------------------------
'     Get username
'-----------------------------------------------------------------------------------------------------
     Set contextDoc = s.DocumentContext
     Set db = s.CurrentDatabase
     Set item = contextDoc.GetFirstItem( "Remote_User" )
     If Not ( item Is Nothing ) Then
          userName = Trim( item.Text )
     End If
     Print "uptil here 2"
'-----------------------------------------------------------------------------------------------------
' Create Notes Doc
'-----------------------------------------------------------------------------------------------------
     Set item = contextDoc.GetFirstItem( "Kind" )
     If Not ( item Is Nothing ) Then
          kind = Cstr( item.Text )
          Print "uptil here 3"
          Select Case kind
          Case "Web T-Shirt"
               donorNumber = GenerateNotesTShritDoc( db, contextDoc,userName )
               Print "uptil here 4"
          Case "Web Donation Form"
               donorNumber = GenerateNotesDonation( db, contextDoc, userName)
               Print uptil here 4 second case"
          End Select
         
     End If
     
     Print "out of code"
     
     Exit Sub
HandleError:
     Print "Submit Web Order::Initialize "
     Print     "Error " & Err() & " at line " & Erl() & ": " & Error()
     Exit Sub
End Sub

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
0
Introducing Cloud Class® training courses

Tech changes fast. You can learn faster. That’s why we’re bringing professional training courses to Experts Exchange. With a subscription, you can access all the Cloud Class® courses to expand your education, prep for certifications, and get top-notch instructions.

ITDharamAuthor Commented:
I can't modify the agent because it is saying "Data not saved due to script error'.

In the options tab there is a  (Use "WebRoutines") that is red
0
p_parthaCommented:
it may be that LSS file is misssing do one thing: Comment Generate function and check whether it works smoothly

partha
0
qwaleteeCommented:
When you changed Domino versions, did you also change the OS?  WIndows is not case-sensitive about USE statments, while all other versions of DOmino are case-sensitive.

WebROutines should eb a Script Library containing several LotusScript functions, including the two we discussed earlier.
0
ITDharamAuthor Commented:
qwaletee  I'm not positive what the original OS was, but now it is W2K.

p partha, I don't understand what you want me to do.  Please expand.

Thanks guys,
0
p_parthaCommented:
the reason why u are not able to save the file is becoz the code might be referring to the LSS file (which was compiled and then later removed).. So i told you to comment the function GenerateNotesDonation or GenerateNotesTShritDoc to see whether the LSS is the one which is causing the crash
Hope i am clear

Partha
0
ITDharamAuthor Commented:
Partha, after commenting out both the lines like so...

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
' Create Notes Doc
'-----------------------------------------------------------------------------------------------------
      Set item = contextDoc.GetFirstItem( "Kind" )
      If Not ( item Is Nothing ) Then
            kind = Cstr( item.Text )
            
            Select Case kind
            Case "Web T-Shirt"
      '            donorNumber = GenerateNotesTShritDoc( db, contextDoc,userName )
                  
            Case "Web Donation Form"
      '            donorNumber = GenerateNotesDonation( db, contextDoc, userName)
                  
            End Select
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

I still cannot save getting the same cannot load USE....
0
p_parthaCommented:
YOu have to comment the Lss also..

Partha
0
qwaleteeCommented:
Oh stop trying to debug it this way.  First thing is to verify that you have the script library, tht it is a valid script library, that it conatins the functions you are trying to use, and the exact speling of it.

In fact, please try to create a new agent that uses the same script library.  The agent does not have to do anything, just to use the library.  Can you save it?

If you can save the new agent, can you call the functions?  I.e., can you save it if you add the following lines to the Initialize routine?

               Dim db as NotesDatabase, contextDoc as notesDocument, userName as string, donorNumber
               donorNumber = GenerateNotesTShritDoc( db, contextDoc,userName )
               donorNumber = GenerateNotesDonation( db, contextDoc, userName)

If you can't get to this point (saving that code), then you don't have a suable script library, or you;ve speled its name wrong.  End of story.

If you can get here, then you do have a usable script library and you either selled something wrong in the real agent, or Domino went a little bonkers and corrupted the agent, and you probably need to recerate it.
0
Sjef BosmanGroupware ConsultantCommented:
Some questions:
-> the function "GenerateNotesTShritDoc": is the name spelled correctly? Or is it just a typo?
-> if you have an error handler, you should ALWAYS have a RESUME in it; modify your code like this:
    exitsub:
         Exit Sub
    HandleError:
         Print "Submit Web Order::Initialize "
         Print "Error " & Err & " at line " & Erl & ": " & Error$
         Resume exitsub

Most likely it is the typo...
0
ITDharamAuthor Commented:
I noticed the tshritdoc typo as well, but that is how it was programmed...no typo on my part.

qwaletee, I'll try your suggestion and try again.

bosman, again, if I can't save the agent, see earlier in question, then I can't add the resume.  But I certainly will once I get this thing going again.  As far as the shrit typo, I think it must be programmed in, but I'm not sure how to validate this, some more guidance would be appreciated.
0
ITDharamAuthor Commented:
OK,

qwaletee, I create a new agent and under 'options' I put USE "WebRoutines"  and it errored out.

When I open WebRoutines which is a Script Library it has under options

Use "CreditCardRoutines"
Use "DonorRoutines"

When I add a comment and save,  the "CreditCardRoutines" goes red.

When I open CreditCardRoutines it has the following under options
Uselsx "*Commerce"
Use "DonorRoutines"

When I add a comment and save, I get  "CreditCardRoutins: (Options): 4: Error loading USE or USELSX module: *Commerce"

and that is where I lose the trail.  Commerce is not an agent or a script library, and it is the first Uselsx

....I should have added this in the beginning, but I just remembered.  I had to load commerce accelerator when this website was installed.  An individual from another company 'verified' that it was working.
0
ITDharamAuthor Commented:
and that is Proposion Commerce Accelerator
0
Alexey_ZubkovCommented:
Try to recompile all LS code in the database. In designer's menu: Tools-> Recompile All Lotusscript.
0
ITDharamAuthor Commented:
Alexey,

When I run that I get a bunch of errors saying invalid syntax for a lot of the agents, scripts and some forms too.
0
Sjef BosmanGroupware ConsultantCommented:
All I can say is: start with the first error and get it fixed. The Recompile All will first build a tree of function dependencies. Compilation will start with the libraries that are being used by others but don't use other libraries themselves. The first errors you get are therefore most likely the ones that are essential to your problem. You can dump some lines here with the accompanying error message if you want some more advice.

A parallel path you can walk: find out how on earth the application could have been save in the first place, when you get that many errors now. Who touched it in the past, and when? The names and dates are in the design, so you can ask them why. Ah, they left...
0
PomsterCommented:
The script library CreditCardRoutines is referring to an lsx (Uselsx "*Commerce"). Do you have the lsx installed on your machine? You'll need it in order to recompile the librairy. The name of the lsx is Commerce and * will tell Notes to find the lsx according to entries in the registry (in contrast to specifiying the path yourself). LSx are Lotus Script Extensions that enable you to use new objects that do not exist in the default domino object model. Exempke of an lsx would be the Oracle LSX wich will enable a developper to work with an Orcale DB (read, write, commit, etc). Lsx will normally take the form of a DLL file. So find the lsx and you should be able to compile. If you can find it then look on the computer of the developper of the Notes DB (or a backup).

Hope it helps Marc-Antoine Pomerleau
0
ITDharamAuthor Commented:
Pomster, you're on the right track.

I looked at the uselsx module and this site is using something called commerce accelerator.

there is a commerceaccelerator.dll and a registry entry that points to it under lotus script extensions and the .dll points to commerce.

Still don't know why it doesn't work.

I created a new lotus script with only uselsx "commerce" and same problems.

Thanks for the efforts guys.  Points doubled to the person who fixes.
0
Sjef BosmanGroupware ConsultantCommented:
The error probably isn't in the commerce-dll at all. Probably is is a product you bought (years ago?), so you should have the documentation. If you have the DLL-vieweron your system, you can seen the exported hooks by double-clicking the dll in the Explorer (or File Manager). Only those names are recognized. Check if and where these names are used, and whether it's done properly.

Btw, doubling the points is not allowed.
0
ITDharamAuthor Commented:
bosman, didn't know about the point thing.  I thought I had seen this done many times in past.  

Offer retracted on points.

As far as the DLL, I don't really know what a 'hook' is, I could see it's dependencies though, and they are wsock32.dll and kernel32.dll

As far as documentation...I have the text file that came with it, it didn't come with much.
0
Sjef BosmanGroupware ConsultantCommented:
What I meant with "hooks" are the function and variable names that are exported from the DLL. These names can be used from LotusScript.

Did you try to recompile everything? Then click on the very first error you get and click OK. The module in question will be opened. My method is usually to go to the Options section and change one of the lines a little, then change it back, otherwise the Designer won't see that it has to recompile the lot. Do so, then try to save the module. Then you'll see some errors at the bottom, there might be more. These need to be resolved. You can share them with us if you like... ;)

The 500 point maximum was imposed a few months ago, probably donating points was done many times in the past as you said. It's somewhere in the Help, I don't know where.
0
Alexey_ZubkovCommented:
ITDharam, when you wrote new empty agent with UseLSX, you reffered to Lsx lib by name.
Try reffer to it by path. I.e. UseLsx "C:\Some_folder\commerceaccelerator.dll"
If you will have an error again, than this dll is damaged, may be virus, or something.
0
Sjef BosmanGroupware ConsultantCommented:
If you do a search on commerceaccelerator on Google, you get 45 results, all pointing to IBM WebSphere related pages. Probably you can find the original dll in WebSphere if it is indeed damaged or so.

Someone successfully used it, see:
http://www.proposion.com/site/Discussion.nsf/0/4ae4c15c3fc92f4085256c8b0002e2ad?opendocument
0
ITDharamAuthor Commented:
Alexey.

Major difference is that I'm opening the agent in the database off a server, and I'm opening, and trying to recompile the agent from my machine.  I mapped the server drive and created a new script library use "Z:\lotus\domino\commerceaccelerator.dll" and it compiled just fine.

So then this makes me think that this whole test of trying to recompile the agent will not work because the paths are relative to the server, and not my client.

bosman, it appears that the dll is not corrupt as I was able to create a new script library AFTER I mapped the server drive with the existing DLL locally.  I don't know how to read what the 'hooks' are from the DLL itself, but I did read the documentation and I found that 'commerce' is the correct call.

I did notice that in the original agent it says uselsx "*commerce"   any idea what the * is for?

And if I can't compile this code from my client, how do I save changes to it?  Would I just throw this DLL into my program directory?  btw, I'm installing commerce accelerator locally to see if I can get my machine to recognize 'commerce'
0
ITDharamAuthor Commented:
I just rebooted, after installing commerce accelerator, then recompiled and it worked.

So then the question is, how can I verify that commerce is a valid lsx on the server?
0
Alexey_ZubkovCommented:
"*commerce" - In this string, * means that path to the dll is taking from windows registry.
So when you have installed commerce accelerator locally, the istallator just wrote right values in registry for dll.

> So then the question is, how can I verify that commerce is a valid lsx on the server?
Heh, answer to you question is very simple :) Try to run your agent on server. If server dont crashes, then all is OK :)
0
ITDharamAuthor Commented:
Nice test there, but it won't fly.  This is a production server serving mail and DBs to a hundred people.  How about an alternative test, although I do like yoursl
0
Alexey_ZubkovCommented:
Try run agent on the workstation. If it works... Well, I think it is only one way - run agent on server and see result.

You can look into the server registry for HKLM_Software_Lotus and then so on for lsx key "commerce" and compare it to your workstation registry. And look into filesystem for proper paths and files.

But even if all is OK, you cant say precisely, crashes your server or not.

0
Sjef BosmanGroupware ConsultantCommented:
You might just pull it off when you copy the commerce*.dll to your \Lotus\Notes directory. Usually, an install is not required.
0
Sjef BosmanGroupware ConsultantCommented:
I mean, to compile everything, you copy it to your system. Don't run the agent locally, just compile everything and run it on the server.
0
ITDharamAuthor Commented:
Alexey,

As best I can tell, the call is correct.  I did look in the registry, and commerce is referenced for the commerceaccelerator.dll  When I copy that same dll to the same path on my machine, and register it, then I can compile

bosman, by moving DLL to my machine I was able to compile but still having problems.

BTW, through the web client where people generally submit this form which then runs these agents/scripts, sometimes the page doesn't load properly, and from what I've read this can be caused by the calls the form makes when it is loading, not just when the submit button is pressed.

I apologize for the delay in my response, I've been busy, sick, and soon going out of town...but the problem persists.

Thank you,
0
Sjef BosmanGroupware ConsultantCommented:
> by moving DLL to my machine I was able to compile but still having problems.
Then what are those problems? Did everything compile correctly? Or do you have runtime problems?

I think a bottom-up approach is best here, so please concentrate on the steps to be taken, one at the time? Focus, please! First, you have to get everything compiled without errors. Then you can start testing. Looking at web-browser users at the moment is of no use whatsoever.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
ITDharamAuthor Commented:
I think I know why they call you Bossman!

This may seem like a cop out but I'm going to have to close this question.  I've run out of time to work on this, the person who owns this site has moved it back to their original host who are also the creators of the package that runs this credit auth.

Thanks guys, I really appreciate your time, I wish I had more time to fix this because I think I'd learn a lot.  Unfortunately, or fortunately, Notes Dev is just a very small fraction of what I do.

Thanks again.
0
Sjef BosmanGroupware ConsultantCommented:
You'd have to talk to my ancestors, but there have been more who thought the name was more or less appropriate. I totally disagree of course! It's a pity we'll never know the answer. Stealing a project away from you... How can they!! Not fair. At all.

Thanks for the points.

Sjef "I'm not hiding behind some alias" Bosman
0
qwaleteeCommented:
Sjef,

You think I am?
0
qwaleteeCommented:
ITDharam,

Please give any of my points back to Pomster.  He really found the crux of the matter.  Or Alexey, since he sugegsted how to get it to work on your server.

- qwaletee
0
Sjef BosmanGroupware ConsultantCommented:
Qwaletee,

That's your interpretation. Mine is just the statement.
0
qwaleteeCommented:
The real marque of qwaletee is Dovid Eliezer ben Yakov ben-Zion. That's just the statement.  Interpret it if you can.

he he
0
Sjef BosmanGroupware ConsultantCommented:
:) I will. Not easy for a goy, though...
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Lotus IBM

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.