"Exception in thread" error "java.lang.NoClassDefFoundError:" exporting sqlserver data to postgresql


using the postgresql importer 9.4.6 the Migartion Toolkit v49.0.4-2 this command was used

runMTK.bat -sourcedbtype sqlserver -targetdbtype postgres -allTables -targetSchema public dbo

and for lack of several files .jar gives error of:


Exception in thread "main" java.lang.NoClassDefFoundError:

asked by JOL 29.09.2016 в 17:50

1 answer

  • Download the jdk-8u101-windows-i586.exe and install it and it should be in the following path: C:\Program Files (x86)\Java\jre1.8.0_101\ .

  • Download the jtds-1.3.1-dist , extract the file jtds-1.3.1.jar and place it in C:\Program Files (x86)\Java\jre1.8.0_101\lib\ext .

  • Download postgresql-9.4.1210.jre6.jar and place it in C:\Program Files (x86)\Java\jre1.8.0_101\lib\ext .

  • Download pg74.216.jdbc2.jar of the official site and place it in C:\Program Files (x86)\Java\jre1.8.0_101\lib\ext .

  • configure the Java environment variables . You can see how to do it here .

  • Create a database in PostgreSQL and define a user (login role) with privileges preferably of root . I created the user dbo with privelegios root and then I created the database importarDat and indicate that the owner is dbo .

  • Change the file toolkit.properties that is in C:\Program Files (x86)\PostgresPlus\edbmtk\etc . Place the following:

    SRC_DB_URL=jdbc:jtds:sqlserver://DireccionIPservidorsqlserevr:Puertousado/Nombre    BaseDatos de sqlserver
    SRC_DB_USER=usuario de sqlserver
    SRC_DB_PASSWORD=contraseña del usuario sqlserver
    TARGET_DB_URL=jdbc:postgresql://direccion ip del servidor postgresql o localhost:puertousado/nombre de la base de datos  postgresql donde se importaran los datos
    TARGET_DB_USER=usuario de la base de datos postgresql
    TARGET_DB_PASSWORD=usuario de la base de datos postgresql


  • And ready. Luck and successes.

    answered by 29.09.2016 в 18:09