Re: Error using Remedy 7.1 APIs in VB.Net

2011-08-05 Thread Opela, Gary L CTR USAF ABW 72 ABW/SCOOA
Yes, it was compiled in release mode. I just changed to which executable
my scheduled task pointed. I was pointing to the exe in the Application
Files\ProjectNameAndVersion\programname.exe now I'm hitting the one
in the release folder under bin. They are both the same size. I will see
if this helps.

Thanks for the input.



Thanks,

Gary Opela, Jr.
Remedy Engineer
ITIL V3 Foundations Certified
Avaya Phone Support
CNI/IT Tinker 72 SC
(405) 582-4272


-Original Message-
From: Action Request System discussion list(ARSList)
[mailto:arslist@arslist.org] On Behalf Of Lyle Taylor
Sent: Thursday, August 04, 2011 4:56 PM
To: arslist@arslist.org
Subject: Re: Error using Remedy 7.1 APIs in VB.Net

** 

Are you building and running your project in Release mode (as opposed to
Debug mode)?  Always use Release mode - even for debugging.

 

Lyle

 

From: Action Request System discussion list(ARSList)
[mailto:arslist@ARSLIST.ORG] On Behalf Of Opela, Gary L CTR USAF ABW 72
ABW/SCOOA
Sent: Thursday, August 04, 2011 1:45 PM
To: arslist@ARSLIST.ORG
Subject: Error using Remedy 7.1 APIs in VB.Net

 

** 

Hello all, I was just wondering if anyone had had the following error
before, and if so, then what did you do to resolve it?

 

 



System.AccessViolationException: Attempted to read or write protected
memory. This is often an indication that other memory is corrupt.

   at evalImpl(tagVARIANT* , tagVARIANT* )

   at ARNetToC.API.eval(Object v)

   at BMC.ARSystem.Server._Eval(Object v)

  at BMC.ARSystem.Server._performLogin(String methodName, String server,
String user, String password, String authentication, String locale,
String charSet, Int32 port, String apiCmdLog, String apiResLog, Boolean
logInitAndTerm)

   at BMC.ARSystem.Server.Login(String server, String user, String
password, String authentication, String locale, String charSet, Int32
port)

   at BMC.ARSystem.Server.Login(String server, String user, String
password, String authentication)

   at BMC.ARSystem.Server.Login(String server, String user, String
password)



 

 

I am getting this occasionally. Most days it runs fine, but then very
rarely it will start throwing that error on every ticket which I try to
create.

 

Below is a snippet of my code:

 

Sub CreateTicket(ByVal id As Integer, ByVal machine_name As String,
ByVal collection_name As String, ByVal submitter_user As String, ByVal
report_location As String)

 

Dim usrArray() As String = getUsrInfo(submitter_user)

Dim asgGroup() As String = GetGroup(submitter_user, usrArray(8),
usrArray(3))

Dim scheduledDate As Integer = GetSchedDate()

Dim workLog As String = getWorkLog(report_location)

Dim formName As String = remedy form

Dim server As BMC.ARSystem.Server

Dim fieldValues As New BMC.ARSystem.FieldValueList

Dim entryID As String = 

Dim result As String = 

 

Dim serverName As String = server name

Dim userName As String = login name

Dim userPass As String = password

 

server = CreateObject(BMC.ARSystem.Server)

fieldValues = CreateObject(BMC.ARSystem.FieldValueList)

 

Try

server.Login(serverName, userName, userPass)

 

fieldValues.Item(x) = Submitter


fieldValues.Item(x) = Status

fieldValues.Item(x) = Priority 

fieldValues.Item(x) = scheduledDate 

fieldValues.Item(x) = asgGroup(0)   

fieldValues.Item(x) = asgGroup(1)


 

fieldValues.Item(x) = Category

fieldValues.Item(x) = Type

fieldValues.Item(x) = Item 

fieldValues.Item(x) = Problem Description   

fieldValues.Item(x) = workLog   

 

fieldValues.Item(x) = machine_name  

fieldValues.Item(x) = usrArray(7)   

fieldValues.Item(x) = usrArray(0)   

fieldValues.Item(x) = usrArray(1)   

fieldValues.Item(x) = usrArray(2)   

fieldValues.Item(x) = usrArray(3)   

fieldValues.Item(x) = Other   

fieldValues.Item(x) = usrArray(5) usrArray(6)   

 

Try

entryID = server.CreateEntry(formName, fieldValues)

If entryID   Then

'Update database record

updateTicket(id, entryID)

End If

Catch ex As Exception

'ERROR!

log(ex.ToString)

server.Logout()

End Try

server.Logout

Error using Remedy 7.1 APIs in VB.Net

2011-08-04 Thread Opela, Gary L CTR USAF ABW 72 ABW/SCOOA
Hello all, I was just wondering if anyone had had the following error
before, and if so, then what did you do to resolve it?

 

 



System.AccessViolationException: Attempted to read or write protected
memory. This is often an indication that other memory is corrupt.

   at evalImpl(tagVARIANT* , tagVARIANT* )

   at ARNetToC.API.eval(Object v)

   at BMC.ARSystem.Server._Eval(Object v)

  at BMC.ARSystem.Server._performLogin(String methodName, String server,
String user, String password, String authentication, String locale,
String charSet, Int32 port, String apiCmdLog, String apiResLog, Boolean
logInitAndTerm)

   at BMC.ARSystem.Server.Login(String server, String user, String
password, String authentication, String locale, String charSet, Int32
port)

   at BMC.ARSystem.Server.Login(String server, String user, String
password, String authentication)

   at BMC.ARSystem.Server.Login(String server, String user, String
password)



 

 

I am getting this occasionally. Most days it runs fine, but then very
rarely it will start throwing that error on every ticket which I try to
create.

 

Below is a snippet of my code:

 

Sub CreateTicket(ByVal id As Integer, ByVal machine_name As String,
ByVal collection_name As String, ByVal submitter_user As String, ByVal
report_location As String)

 

Dim usrArray() As String = getUsrInfo(submitter_user)

Dim asgGroup() As String = GetGroup(submitter_user, usrArray(8),
usrArray(3))

Dim scheduledDate As Integer = GetSchedDate()

Dim workLog As String = getWorkLog(report_location)

Dim formName As String = remedy form

Dim server As BMC.ARSystem.Server

Dim fieldValues As New BMC.ARSystem.FieldValueList

Dim entryID As String = 

Dim result As String = 

 

Dim serverName As String = server name

Dim userName As String = login name

Dim userPass As String = password

 

server = CreateObject(BMC.ARSystem.Server)

fieldValues = CreateObject(BMC.ARSystem.FieldValueList)

 

Try

server.Login(serverName, userName, userPass)

 

fieldValues.Item(x) = Submitter


fieldValues.Item(x) = Status

fieldValues.Item(x) = Priority 

fieldValues.Item(x) = scheduledDate 

fieldValues.Item(x) = asgGroup(0)   

fieldValues.Item(x) = asgGroup(1)


 

fieldValues.Item(x) = Category

fieldValues.Item(x) = Type

fieldValues.Item(x) = Item 

fieldValues.Item(x) = Problem Description   

fieldValues.Item(x) = workLog   

 

fieldValues.Item(x) = machine_name  

fieldValues.Item(x) = usrArray(7)   

fieldValues.Item(x) = usrArray(0)   

fieldValues.Item(x) = usrArray(1)   

fieldValues.Item(x) = usrArray(2)   

fieldValues.Item(x) = usrArray(3)   

fieldValues.Item(x) = Other   

fieldValues.Item(x) = usrArray(5) usrArray(6)   

 

Try

entryID = server.CreateEntry(formName, fieldValues)

If entryID   Then

'Update database record

updateTicket(id, entryID)

End If

Catch ex As Exception

'ERROR!

log(ex.ToString)

server.Logout()

End Try

server.Logout()



Catch ex As Exception

'ERROR!

log(ex.ToString)

End Try

 

 

Thanks,

 

Gary Opela, Jr.

Remedy Engineer, RSP Certified

ITIL V3 Foundations Certified

Avaya Phone Support

CNI/IT Tinker 72 SC

 


___
UNSUBSCRIBE or access ARSlist Archives at www.arslist.org
attend wwrug11 www.wwrug.com ARSList: Where the Answers Are


Re: Error using Remedy 7.1 APIs in VB.Net

2011-08-04 Thread Lyle Taylor
Are you building and running your project in Release mode (as opposed to Debug 
mode)?  Always use Release mode - even for debugging.

Lyle

From: Action Request System discussion list(ARSList) 
[mailto:arslist@ARSLIST.ORG] On Behalf Of Opela, Gary L CTR USAF ABW 72 
ABW/SCOOA
Sent: Thursday, August 04, 2011 1:45 PM
To: arslist@ARSLIST.ORG
Subject: Error using Remedy 7.1 APIs in VB.Net

**
Hello all, I was just wondering if anyone had had the following error before, 
and if so, then what did you do to resolve it?



System.AccessViolationException: Attempted to read or write protected memory. 
This is often an indication that other memory is corrupt.
   at evalImpl(tagVARIANT* , tagVARIANT* )
   at ARNetToC.API.eval(Object v)
   at BMC.ARSystem.Server._Eval(Object v)
  at BMC.ARSystem.Server._performLogin(String methodName, String server, String 
user, String password, String authentication, String locale, String charSet, 
Int32 port, String apiCmdLog, String apiResLog, Boolean logInitAndTerm)
   at BMC.ARSystem.Server.Login(String server, String user, String password, 
String authentication, String locale, String charSet, Int32 port)
   at BMC.ARSystem.Server.Login(String server, String user, String password, 
String authentication)
   at BMC.ARSystem.Server.Login(String server, String user, String password)



I am getting this occasionally. Most days it runs fine, but then very rarely it 
will start throwing that error on every ticket which I try to create.

Below is a snippet of my code:

Sub CreateTicket(ByVal id As Integer, ByVal machine_name As String, ByVal 
collection_name As String, ByVal submitter_user As String, ByVal 
report_location As String)

Dim usrArray() As String = getUsrInfo(submitter_user)
Dim asgGroup() As String = GetGroup(submitter_user, usrArray(8), 
usrArray(3))
Dim scheduledDate As Integer = GetSchedDate()
Dim workLog As String = getWorkLog(report_location)
Dim formName As String = remedy form
Dim server As BMC.ARSystem.Server
Dim fieldValues As New BMC.ARSystem.FieldValueList
Dim entryID As String = 
Dim result As String = 

Dim serverName As String = server name
Dim userName As String = login name
Dim userPass As String = password

server = CreateObject(BMC.ARSystem.Server)
fieldValues = CreateObject(BMC.ARSystem.FieldValueList)

Try
server.Login(serverName, userName, userPass)

fieldValues.Item(x) = Submitter
fieldValues.Item(x) = Status
fieldValues.Item(x) = Priority
fieldValues.Item(x) = scheduledDate
fieldValues.Item(x) = asgGroup(0)
fieldValues.Item(x) = asgGroup(1)

fieldValues.Item(x) = Category
fieldValues.Item(x) = Type
fieldValues.Item(x) = Item
fieldValues.Item(x) = Problem Description
fieldValues.Item(x) = workLog

fieldValues.Item(x) = machine_name
fieldValues.Item(x) = usrArray(7)
fieldValues.Item(x) = usrArray(0)
fieldValues.Item(x) = usrArray(1)
fieldValues.Item(x) = usrArray(2)
fieldValues.Item(x) = usrArray(3)
fieldValues.Item(x) = Other
fieldValues.Item(x) = usrArray(5) usrArray(6)

Try
entryID = server.CreateEntry(formName, fieldValues)
If entryID   Then
'Update database record
updateTicket(id, entryID)
End If
Catch ex As Exception
'ERROR!
log(ex.ToString)
server.Logout()
End Try
server.Logout()

Catch ex As Exception
'ERROR!
log(ex.ToString)
End Try


Thanks,

Gary Opela, Jr.
Remedy Engineer, RSP Certified
ITIL V3 Foundations Certified
Avaya Phone Support
CNI/IT Tinker 72 SC

_attend WWRUG11 www.wwrug.comhttp://www.wwrug.com ARSlist: Where the Answers 
Are_


 NOTICE: This email message is for the sole use of the intended recipient(s) 
and may contain confidential and privileged information. Any unauthorized 
review, use, disclosure or distribution is prohibited. If you are not the 
intended recipient, please contact the sender by reply email and destroy all 
copies of the original message.



___
UNSUBSCRIBE or access ARSlist Archives at www.arslist.org
attend wwrug11 www.wwrug.com ARSList: Where the Answers Are