Error in script task-

  • Hello Friends,

    There is a error I am getting when running an SSIS package in 64 bit. The error comes up as -

    'Validation error- Unzip Zip file- The task is configured to pre-compile the script, but binary code is not found. Please visit the IDE in Script Task Editor by clicking Design Script button to cause binary code to be generated'.

    I am trying to unzip a file which works perfectly in the 32 bit machine but starts giving problems in 64 bit.

    ALong with the above mentioned error, I am also getting the messages within the script like-

    1. Type 'java.io.FileInputStream' is not defined

    2. Type 'java.util.zip.ZipInputStream' is not defined

    3. Type 'java.io.FileOutputStream' is not defined

    4. Type 'ZipEntry' is not defined.

    -----------------------------------------------------------------------------------------

    This is the code included in the script task-

    Imports System

    Imports System.Data

    Imports System.Math

    Imports Microsoft.SqlServer.Dts.Runtime

    Imports java.io.FileInputStream

    Imports java.io.FileOutputStream

    Imports java.util.zip.ZipInputStream

    Imports java.util.zip.ZipOutputStream

    Imports java.util.zip

    Imports java.io

    Public Class ScriptMain

    ' The execution engine calls this method when the task executes.

    ' To access the object model, use the Dts object. Connections, variables, events,

    ' and logging features are available as static members of the Dts class.

    Public Sub Main()

    Try

    Dim strSourceFile As String

    Dim strDestinationDirectory As String

    strSourceFile = "C:\Visio2020Upload\" & Dts.Variables("file").Value.ToString()

    strDestinationDirectory = "C:\Visio2020Upload\"

    Dim oFileInputStream As New java.io.FileInputStream(strSourceFile)

    Dim oZipInputStream As New java.util.zip.ZipInputStream(oFileInputStream)

    Dim bTrue As Boolean = True

    Dim sbBuf(1024) As SByte

    While 1 = 1

    Dim oZipEntry As ZipEntry = oZipInputStream.getNextEntry()

    If oZipEntry Is Nothing Then Exit While

    If oZipEntry.isDirectory Then

    If Not My.Computer.FileSystem.DirectoryExists(strDestinationDirectory & oZipEntry.getName) Then

    My.Computer.FileSystem.CreateDirectory(strDestinationDirectory & oZipEntry.getName)

    End If

    Else

    Dim oFileOutputStream As New java.io.FileOutputStream(strDestinationDirectory.Replace("\", "/") & oZipEntry.getName())

    While 1 = 1

    Dim iLen As Integer = oZipInputStream.read(sbBuf)

    If iLen < 0 Then Exit While

    oFileOutputStream.write(sbBuf, 0, iLen)

    End While

    oFileOutputStream.close()

    End If

    End While

    oZipInputStream.close()

    oFileInputStream.close()

    Catch ex As Exception

    Throw New Exception(ex.Message)

    End Try

    End Sub

    End Class

    --------------------------------------------------------------------------

    Has anyone encountered the same scenario. Any help would be deeply appreciated...

    Warm Regards,

    Paul

  • I probably would check if those references exist in the script tasks and they are 64 bit compatible.

    ---------------------------------------------------------------------------------------
    It begins by taking the first step.

  • Hello Leju,

    Thanks a lot for your reply. I have confirmed that the references exist in the script task. However, am not sure on how to check if they are 64 bit compatible.

    Both the 32 bit and 64 bit versions of java exist on the machine. Would you happen to have any idea about it ?

    Thanks and Regards,

    Paul

  • Are the referenced objects in the GAC? If so the GAC util can list them out, I have seem three values in processor architecture: AMD64, MSIL, and x86.

    For the assemblies in question you are hoping for processorArchitecture=MSIL otherwise you might have issues getting the right one at run time.

    CEWII

Viewing 4 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply