Table with Geometry fields gives error "String cannot have zero length"

Table with Geometry fields gives error "String cannot have zero length"

book

Article ID: KB0076174

calendar_today

Updated On:

Products Versions
TIBCO Cloud Integration - Connect ( Scribe ) V1.1

Description

When using the SQL Connector with Microsoft SQL Server as a target, attempting to insert data into a Geometry field generates errors similar to the following:

"String cannot have zero length"
Message: Execute process failed:
Exception Type : FileNotFoundException
Message : Could not load file or assembly 'Microsoft.SqlServer.Types, Version=11.0.0.0


Note: This error was generated with Microsoft SQL Server 2016, but other versions could be affected as well. See the following Knowledge Base article: Sql Data Types Geography, Geometry, or Hierarchyid causes error ???The following error has occurred in the SQL Connector: DataReader.GetFieldType(3) returned null.???
(D44837)
 

 

Issue/Introduction

When using the SQL Connector with Microsoft SQL as a target, attempting to insert data into a Geometry field generates errors.

Resolution

Workaround:


Install version 11.0.0.0 of the Microsoft.SqlServer.Types assembly.

IMPORTANT NOTE: Repeat this process for each server that hosts a TIBCO Scribe Online Agent used to execute Solutions with a Microsoft SQL Server target Connection. 
 

Confirm That The File Is Not Already There

  1. On the affected machine, open Windows Explorer and navigate to C:\Windows\assembly to view the Global Assembly Cache (GAC).
  2. Scroll to the assembly labeled Microsoft.SqlServer.Types; there should be several versions of this file listed.
  3. Confirm that version 11.0.0.0 is NOT present. If the file is not present, add the file to the GAC.
 

Add The Version 11.0.0.0 File To The GAC

  1. Open a Command Prompt as Admin.
  2. Navigate to the NETFX<versionnumber> Tools directory. This directory may be located in one of the following areas:
C:\Program Files (x86)\Microsoft SDKs\Windows\v8.1A\bin\NETFX 4.5.1 Tools
or
C:\Program Files (x86)\Microsoft SDKs\Windows\v10.0A\bin\NETFX 4.6.1 Tools
  1. Execute the following command, which references the specific TIBCO Scribe Online Agent being used.
gacutil /i "C:\Program Files (x86)\Scribe Software\<your scribe agent>\Connectors\Scribe.Adapter.Sql\Microsoft.SqlServer.Types.dll"
  1. Return to Windows Explorer.
  2. Navigate to C:\Windows\assembly and verify that Microsoft.SqlServer.Types version 11.0.0.0 is now installed in the GAC.
  3. Open TIBCO Scribe Online and run the Map with the error.
  4. If the error is still received an agent restart may be required.