System.UnauthorizedAccessException: Access to the path is denied IBM DB2

FishmanTobin
FishmanTobin used Ask the Experts™
on
I have several programs which are not ASP.net but VB.net and I am getting this error:
 
System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.TypeInitializationException: The type initializer for 'IBM.Data.DB2.iSeries.iDB2Trace' threw an exception. ---> System.UnauthorizedAccessException: Access to the path is denied.
 
 sporatically from some and consistently from others.
 
This all began after we upgraded to S6R1 and began using version 12 of the IBM.net connector.
 
The command this is occuring on is:
 
Public Connection As New iDB2Connection
 
Here is the full stack trace after the above command is executed:
 
System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.TypeInitializationException: The type initializer for 'IBM.Data.DB2.iSeries.iDB2Trace' threw an exception. ---> System.UnauthorizedAccessException: Access to the path is denied.
   at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
   at System.Threading.EventWaitHandle..ctor(Boolean initialState, EventResetMode mode, String name)
   at IBM.Data.DB2.iSeries.iDB2NamedEvent..ctor(String eventName)
   at IBM.Data.DB2.iSeries.iDB2Trace..cctor()
   --- End of inner exception stack trace ---
   at IBM.Data.DB2.iSeries.iDB2Connection..ctor()

 
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Gary PattersonVP Technology / Senior Consultant

Commented:
From the error message and stack trace, it looks like your process does not have rights to a file or folder that is being used as a trace log file.

IBM has a likely PTF for this issue:

http://www-01.ibm.com/support/docview.wss?uid=nas23fe81c193be8ca8d8625756f004215b7

- Gary Patterson


Author

Commented:
Gary it says this PTF solves this problem.  What PTF?  Where should I look for log file folders for trace?
Gary PattersonVP Technology / Senior Consultant

Commented:
PTF number is listed at the top of the article: SE37122.  Also in the title bar of your browser most likely when viewing the page.

ADO.NET provider trace log file by default is iDB2Log.txt

Tracing is controlled kicked off using the cwbmptrc program supplied with Client Access.  If I understand correctly, this program just changes some registry entries that the AS/400 .NET provider looks at to decide if it needs to produce trace output.  This means that if you use the program to turn on tracing, it stays on until you disable it.

You can also specify tracing in your connection string using the "Trace" parameter.

Here is a nice article on tracing:  http://systeminetwork.com/node/26086

- Gary Patterson
OWASP: Threats Fundamentals

Learn the top ten threats that are present in modern web-application development and how to protect your business from them.

Author

Commented:
Not quite.  I made sure tracing was off and I gave the everyone group full control of my entire C drive.  Same error persists.
VP Technology / Senior Consultant
Commented:
Have you verified that the PTF above was applied?

- Gary

Author

Commented:
We can't find the PTF online anywhere.

Author

Commented:
We contacted IBM showed them the article you found and they gave us a link to the patch.  That worked points awarded.  Thanks.

Author

Commented:
Thanks for your help with this.
Gary PattersonVP Technology / Senior Consultant

Commented:
Glad to help.  For future reference, you can obtain PTF's online via Fix Central at

http://www.ibm.com/support/fixcentral/

- Gary Patterson

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial