Invalid TraceListenerData type in configuration

Topics: Data Access Application Block, Exception Handling Application Block, Logging Application Block
Jul 8, 2009 at 3:05 AM

I get the below error when i try to handle an exception. The policy would log the exception into the DB using a DB trace listener. I do not get this error if  i use any other listener.

Error Message:
Invalid TraceListenerData type in configuration 'listenerDataType="Microsoft.Practices.EnterpriseLibrary.Logging.Database.Configuration.FormattedDatabaseTraceListenerData, Microsoft.Practices.EnterpriseLibrary.Logging.Database, Version=4.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"'. (c:\inetpub\wwwroot\ps_wcf\web.config line 32)

Jul 8, 2009 at 5:56 AM

Hi,

Please verify that you have a reference to the Microsoft.Practices.EnterpriseLibrary.Logging.Database.dll. If you dont have, reference the assembly and build.

Valiant Dudan
Global Technology and Solutions
Avanade, Inc.
entlib.support@avanade.com

Jul 8, 2009 at 9:59 AM

Thanks for the response. I had failed to add this reference and i dont face the issue anymore.

 

But, when i try to log the exception though my WCF service, i get the below error

Timestamp: 7/8/2009 9:54:34 AM
Message: Tracing to LogSource 'DBLog Category' failed. Processing for other sources will continue. See summary information below for more information. Should this problem persist, stop the service and check the configuration file(s) for possible error(s) in the configuration of the categories and sinks.


Summary for Enterprise Library Distributor Service:
======================================
-->
Message:
Timestamp: 7/8/2009 9:54:33 AM
Message: HandlingInstanceID: 40523d31-bc2a-4a75-a853-eadedf505928
An exception of type 'System.FormatException' occurred and was caught.
----------------------------------------------------------------------
07/08/2009 15:24:33
Type : System.FormatException, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
Message : Input string was not in a correct format.
Source : mscorlib
Help link :
Data : System.Collections.ListDictionaryInternal
TargetSite : Void StringToNumber(System.String, System.Globalization.NumberStyles, NumberBuffer ByRef, System.Globalization.NumberFormatInfo, Boolean)
Stack Trace :    at System.Number.StringToNumber(String str, NumberStyles options, NumberBuffer& number, NumberFormatInfo info, Boolean parseDecimal)
   at System.Number.ParseInt32(String s, NumberStyles style, NumberFormatInfo info)
   at System.Convert.ToInt32(String value)
   at Tomra.Enterprise.PS.WCF.PSService.GetDistributorList(EntityProtocol entityInput) in E:\Projects\MICHIGAN\SourceCode\PSWebApp\Tomra.Enterprise.PS.WCF\PSService.svc.cs:line 255

Additional Info:

MachineName : CHNMCT90199
TimeStamp : 7/8/2009 9:54:33 AM
FullName : Microsoft.Practices.EnterpriseLibrary.ExceptionHandling, Version=4.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35
AppDomainName : /LM/w3svc/1/ROOT/PS_WCF-2-128915204290688472
ThreadIdentity : ITLINFOSYS\rajasoorya_kc
WindowsIdentity : ITLINFOSYS\rajasoorya_kc

Category: DBLog Category
Priority: 0
EventId: 100
Severity: Error
Title:Enterprise Library Exception Handling
Machine: CHNMCT90199
App Domain: /LM/w3svc/1/ROOT/PS_WCF-2-128915204290688472
ProcessId: 840
Process Name: c:\windows\system32\inetsrv\w3wp.exe
Thread Name:
Win32 ThreadId:4924
Extended Properties: Category - Error
ExceptionID - 1
WrappedMessage - Custom: Application encountered an error
InnerMessage - Input string was not in a correct format.
Source - PSService
Method - GetDistributorList
TargetSite - Void StringToNumber(System.String, System.Globalization.NumberStyles, NumberBuffer ByRef, System.Globalization.NumberFormatInfo, Boolean)
StackTrace -    at System.Number.StringToNumber(String str, NumberStyles options, NumberBuffer& number, NumberFormatInfo info, Boolean parseDecimal)
   at System.Number.ParseInt32(String s, NumberStyles style, NumberFormatInfo info)
   at System.Convert.ToInt32(String value)
   at Tomra.Enterprise.PS.WCF.PSService.GetDistributorList(EntityProtocol entityInput) in E:\Projects\MICHIGAN\SourceCode\PSWebApp\Tomra.Enterprise.PS.WCF\PSService.svc.cs:line 255
NameSpace -

--> MachineName: CHNMCT90199
--> TimeStamp: 7/8/2009 9:54:34 AM
--> FullName: Microsoft.Practices.EnterpriseLibrary.Logging, Version=4.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35
--> AppDomainName: /LM/w3svc/1/ROOT/PS_WCF-2-128915204290688472
--> WindowsIdentity: NT AUTHORITY\NETWORK SERVICE

Exception Information Details:
======================================
Exception Type: System.Data.SqlClient.SqlException
Errors: System.Data.SqlClient.SqlErrorCollection
Class: 14
LineNumber: 65536
Number: 18456
Procedure:
Server: chnmct113554
State: 1
Source: .Net SqlClient Data Provider
ErrorCode: -2146232060
Message: Login failed for user 'ITLINFOSYS\CHNMCT90199$'.
Data: System.Collections.ListDictionaryInternal
TargetSite: Void OnError(System.Data.SqlClient.SqlException, Boolean)
HelpLink: NULL

StackTrace Information Details:
======================================
   at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection)
   at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj)
   at System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj)
   at System.Data.SqlClient.SqlInternalConnectionTds.CompleteLogin(Boolean enlistOK)
   at System.Data.SqlClient.SqlInternalConnectionTds.AttemptOneLogin(ServerInfo serverInfo, String newPassword, Boolean ignoreSniOpenTimeout, Int64 timerExpire, SqlConnection owningObject)
   at System.Data.SqlClient.SqlInternalConnectionTds.LoginNoFailover(String host, String newPassword, Boolean redirectedUserInstance, SqlConnection owningObject, SqlConnectionString connectionOptions, Int64 timerStart)
   at System.Data.SqlClient.SqlInternalConnectionTds.OpenLoginEnlist(SqlConnection owningObject, SqlConnectionString connectionOptions, String newPassword, Boolean redirectedUserInstance)
   at System.Data.SqlClient.SqlInternalConnectionTds..ctor(DbConnectionPoolIdentity identity, SqlConnectionString connectionOptions, Object providerInfo, String newPassword, SqlConnection owningObject, Boolean redirectedUserInstance)
   at System.Data.SqlClient.SqlConnectionFactory.CreateConnection(DbConnectionOptions options, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningConnection)
   at System.Data.ProviderBase.DbConnectionFactory.CreatePooledConnection(DbConnection owningConnection, DbConnectionPool pool, DbConnectionOptions options)
   at System.Data.ProviderBase.DbConnectionPool.CreateObject(DbConnection owningObject)
   at System.Data.ProviderBase.DbConnectionPool.UserCreateRequest(DbConnection owningObject)
   at System.Data.ProviderBase.DbConnectionPool.GetConnection(DbConnection owningObject)
   at System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection owningConnection)
   at System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory)
   at System.Data.SqlClient.SqlConnection.Open()
   at Microsoft.Practices.EnterpriseLibrary.Logging.Database.FormattedDatabaseTraceListener.ExecuteStoredProcedure(LogEntry logEntry)
   at Microsoft.Practices.EnterpriseLibrary.Logging.Database.FormattedDatabaseTraceListener.TraceData(TraceEventCache eventCache, String source, TraceEventType eventType, Int32 id, Object data)
   at Microsoft.Practices.EnterpriseLibrary.Logging.LogSource.TraceData(TraceEventType eventType, Int32 id, LogEntry logEntry, TraceListenerFilter traceListenerFilter)
   at Microsoft.Practices.EnterpriseLibrary.Logging.LogWriter.ProcessLog(LogEntry log)
Category:
Priority: -1
EventId: 6352
Severity: Error
Title:
Machine: CHNMCT90199
Application Domain: /LM/w3svc/1/ROOT/PS_WCF-2-128915204290688472
Process Id: 840
Process Name: c:\windows\system32\inetsrv\w3wp.exe
Win32 Thread Id: 4924
Thread Name:
Extended Properties:

For more information, see Help and Support Center at http://go.microsoft.com/fwlink/events.asp.

 

Jul 10, 2009 at 7:46 AM

Hi,

Looking at the stacktrace that you've provided, You are getting a FormatException, and according to the stack trace its more likely to happen in the conversion of a string to int. It is highlighted in red below.

Category: DBLog Category
Priority: 0
EventId: 100
Severity: Error
Title:Enterprise Library Exception Handling
Machine: CHNMCT90199
App Domain: /LM/w3svc/1/ROOT/PS_WCF-2-128915204290688472
ProcessId: 840
Process Name: c:\windows\system32\inetsrv\w3wp.exe
Thread Name:
Win32 ThreadId:4924
Extended Properties: Category - Error
ExceptionID - 1
WrappedMessage - Custom: Application encountered an error
InnerMessage - Input string was not in a correct format.
Source - PSService
Method - GetDistributorList
TargetSite - Void StringToNumber(System.String, System.Globalization.NumberStyles, NumberBuffer ByRef, System.Globalization.NumberFormatInfo, Boolean)
StackTrace -    at System.Number.StringToNumber(String str, NumberStyles options, NumberBuffer& number, NumberFormatInfo info, Boolean parseDecimal)
   at System.Number.ParseInt32(String s, NumberStyles style, NumberFormatInfo info)
   at System.Convert.ToInt32(String value)
   at Tomra.Enterprise.PS.WCF.PSService.GetDistributorList(EntityProtocol entityInput) in E:\Projects\MICHIGAN\SourceCode\PSWebApp\Tomra.Enterprise.PS.WCF\PSService.svc.cs:line 255

 

Valiant Dudan
Global Technology and Solutions
Avanade, Inc.
entlib.support@avanade.com