Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

Problem with agent which crashes server

Posted on 2004-11-10
41
Medium Priority
?
352 Views
Last Modified: 2013-12-18
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

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
0
Comment
Question by:ITDharam
  • 15
  • 11
  • 6
  • +3
41 Comments
 
LVL 31

Expert Comment

by:qwaletee
ID: 12546795
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
 
LVL 8

Author Comment

by:ITDharam
ID: 12547397
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
 
LVL 14

Expert Comment

by:p_partha
ID: 12547650
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
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
LVL 8

Author Comment

by:ITDharam
ID: 12547793
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
 
LVL 14

Expert Comment

by:p_partha
ID: 12547815
it may be that LSS file is misssing do one thing: Comment Generate function and check whether it works smoothly

partha
0
 
LVL 31

Expert Comment

by:qwaletee
ID: 12548045
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
 
LVL 8

Author Comment

by:ITDharam
ID: 12548812
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
 
LVL 14

Assisted Solution

by:p_partha
p_partha earned 500 total points
ID: 12549195
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
 
LVL 8

Author Comment

by:ITDharam
ID: 12549291
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
 
LVL 14

Expert Comment

by:p_partha
ID: 12549603
YOu have to comment the Lss also..

Partha
0
 
LVL 31

Assisted Solution

by:qwaletee
qwaletee earned 500 total points
ID: 12557874
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
 
LVL 46

Expert Comment

by:Sjef Bosman
ID: 12564243
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
 
LVL 8

Author Comment

by:ITDharam
ID: 12567962
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
 
LVL 8

Author Comment

by:ITDharam
ID: 12568215
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
 
LVL 8

Author Comment

by:ITDharam
ID: 12568235
and that is Proposion Commerce Accelerator
0
 
LVL 1

Expert Comment

by:Alexey_Zubkov
ID: 12568268
Try to recompile all LS code in the database. In designer's menu: Tools-> Recompile All Lotusscript.
0
 
LVL 8

Author Comment

by:ITDharam
ID: 12568304
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
 
LVL 46

Expert Comment

by:Sjef Bosman
ID: 12571335
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
 

Expert Comment

by:Pomster
ID: 12579888
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
 
LVL 8

Author Comment

by:ITDharam
ID: 12587283
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
 
LVL 46

Expert Comment

by:Sjef Bosman
ID: 12587395
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
 
LVL 8

Author Comment

by:ITDharam
ID: 12595045
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
 
LVL 46

Expert Comment

by:Sjef Bosman
ID: 12595321
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
 
LVL 1

Expert Comment

by:Alexey_Zubkov
ID: 12595523
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
 
LVL 46

Expert Comment

by:Sjef Bosman
ID: 12595857
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
 
LVL 8

Author Comment

by:ITDharam
ID: 12596423
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
 
LVL 8

Author Comment

by:ITDharam
ID: 12596644
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
 
LVL 1

Expert Comment

by:Alexey_Zubkov
ID: 12596772
"*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
 
LVL 8

Author Comment

by:ITDharam
ID: 12596805
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
 
LVL 1

Assisted Solution

by:Alexey_Zubkov
Alexey_Zubkov earned 500 total points
ID: 12596905
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
 
LVL 46

Expert Comment

by:Sjef Bosman
ID: 12596974
You might just pull it off when you copy the commerce*.dll to your \Lotus\Notes directory. Usually, an install is not required.
0
 
LVL 46

Expert Comment

by:Sjef Bosman
ID: 12596990
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
 
LVL 8

Author Comment

by:ITDharam
ID: 12660374
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
 
LVL 46

Accepted Solution

by:
Sjef Bosman earned 500 total points
ID: 12664788
> 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
 
LVL 8

Author Comment

by:ITDharam
ID: 12682315
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
 
LVL 46

Expert Comment

by:Sjef Bosman
ID: 12682406
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
 
LVL 31

Expert Comment

by:qwaletee
ID: 12693171
Sjef,

You think I am?
0
 
LVL 31

Expert Comment

by:qwaletee
ID: 12693183
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
 
LVL 46

Expert Comment

by:Sjef Bosman
ID: 12694442
Qwaletee,

That's your interpretation. Mine is just the statement.
0
 
LVL 31

Expert Comment

by:qwaletee
ID: 12702558
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
 
LVL 46

Expert Comment

by:Sjef Bosman
ID: 12704510
:) I will. Not easy for a goy, though...
0

Featured Post

Become an Android App Developer

Ready to kick start your career in 2018? Learn how to build an Android app in January’s Course of the Month and open the door to new opportunities.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

  In today’s Arena we can’t imagine our lives without Internet as we are highly used to of it. If we consider our life style just for only 2 min we found that face to face communication is swapped by e-communication.  Every Where from Works place to…
This article covers general Notes 8.5 troubleshooting information including recreating the Notes\Data folder.
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an anti-spam), the admin…
Is your OST file inaccessible, Need to transfer OST file from one computer to another? Want to convert OST file to PST? If the answer to any of the above question is yes, then look no further. With the help of Stellar OST to PST Converter, you can e…
Suggested Courses

564 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question