Bonjour,

J'ai mis en place une transformation avec PDI (spoon 5.4.0.1-130). Elle réalise des extractions de données vers une base MYSQL et MSSQL.

Concernant la connexion vers la base MYSQL : aucun problème.
Par contre, vers la base MSSQL : Le type de connexion "MS SQL Server (Native)" ne fonctionne pas :

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
Erreur lors de la connexion à la Base de données [MSSQL] : org.pentaho.di.core.exception.KettleDatabaseException: 
Error occurred while trying to connect to the database
 
Error connecting to database: (using class com.microsoft.sqlserver.jdbc.SQLServerDriver)
Échec de la connexion TCP/IP à l'hôte 10.0.0.9, port 1433. Erreur*: «*Connection refused: connect. Vérifiez les propriétés de connexion. Assurez-vous qu'une instance de SQL Server est en cours d'exécution sur l'hôte et accepte les connexions TCP/IP au port. Vérifiez que les connexions TCP au port ne sont pas bloquées par un pare-feu.*».
Voici les actions que j'ai menées :

  1. Vérification des informations saisies (Host name, couple id/mdp etc...) : OK
  2. Insertion/Vérification de la librairie "sqljdbc4.jar" dans le répertoire "lib" de PDI : OK

J'ai donc essayé d'établir une nouvelle connexion avec cette fois ci le type de connexion "MS SQL Server" : succès . J'ai remarqué que les drivers de connexion n'étaient pas les mêmes (donc la librairie "sqljdbc4.jar" devrait servir pour le native. Bref, j’exécute ma transformation avec spoon et tout marche parfaitement.

Je décide donc d'automatiser le lancement de ma transformation par le biais d'un script. Pour cela j'utilise l'utilitaire "Pan.bat" qui va se charger d'exécuter ma transformation. Je tape ma ligne, la transformation démarre :

  1. Initialisation de la connexion vers MYSQL : OK
  2. Initialisation de la connexion vers MSSQL : KO


Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
C:\Pentaho_CE\data-integration>Pan.bat /rep:env_pdi /trans:CONTACTS
DEBUG: Using JAVA_HOME
DEBUG: _PENTAHO_JAVA_HOME=C:\Program Files\Java\jdk1.8.0_05
DEBUG: _PENTAHO_JAVA=C:\Program Files\Java\jdk1.8.0_05\bin\java.exe

C:\Pentaho_CE\data-integration>"C:\Program Files\Java\jdk1.8.0_05\bin\java.exe"
 "-Xmx512m" "-XX:MaxPermSize=256m" "-Djava.library.path=libswt\win64" "-DKETTLE_
HOME=" "-DKETTLE_REPOSITORY=" "-DKETTLE_USER=" "-DKETTLE_PASSWORD=" "-DKETTLE_PL
UGIN_PACKAGES=" "-DKETTLE_LOG_SIZE_LIMIT=" "-DKETTLE_JNDI_ROOT=" -jar launcher\p
entaho-application-launcher-5.4.0.1-130.jar -lib ..\libswt\win64  -main org.pent
aho.di.pan.Pan /rep:env_pdi /trans:CONTACTS
Java HotSpot(TM) 64-Bit Server VM warning: ignoring option MaxPermSize=256m; sup
port was removed in 8.0
2015/08/11 16:26:11 - Pan - Démarrage
2015/08/11 16:26:11 - RepositoriesMeta - Lecture du fichier XML : C:\Users\xxxx\.kettle\repositories.xml
2015/08/11 16:26:11 - CONTACTS - Distribution démarrée pour la tranforma
tion [CONTACTS]
2015/08/11 16:26:12 - MYSQL - Insertion table contact / phone.0 - Connected to
 database [MYSQL - MYSQL] (commit=1000)
2015/08/11 16:26:12 - MYSQL - Insertion numéros.0 - Connected to database [MYS
QL - MYSQL] (commit=1000)
2015/08/11 16:26:18 - MSSQL - Extraction des contacts.0 - ERROR (version 5.4.0.1-
130, build 1 from 2015-06-14_12-34-55 by buildguy) : An ERROR occurred, processi
ng will be stopped:
2015/08/11 16:26:18 - MSSQL - Extraction des contacts.0 - ERROR occurred while tr
ying to connect to the database
2015/08/11 16:26:18 - MSSQL - Extraction des contacts.0 -
2015/08/11 16:26:18 - MSSQL - Extraction des contacts.0 - ERROR connecting to dat
abase: (using class net.sourceforge.jtds.jdbc.Driver)
2015/08/11 16:26:18 - MSSQL - Extraction des contacts.0 - Unable to get informati
on from SQL Server: 10.0.0.9.
2015/08/11 16:26:18 - MSSQL - Extraction contacts.0 - ERROR (version 5.4.0.1-130,
 build 1 from 2015-06-14_12-34-55 by buildguy) : An ERROR occurred, processing w
ill be stopped:
2015/08/11 16:26:18 - MSSQL - Extraction contacts.0 - ERROR occurred while trying
 to connect to the database
2015/08/11 16:26:18 - MSSQL - Extraction contacts.0 -
2015/08/11 16:26:18 - MSSQL - Extraction contacts.0 - ERROR connecting to databas
e: (using class net.sourceforge.jtds.jdbc.Driver)
2015/08/11 16:26:18 - MSSQL - Extraction contacts.0 - Unable to get information f
rom SQL Server: 10.0.0.9.
2015/08/11 16:26:18 - MSSQL - Extraction numéros.0 - ERROR (version 5.4.0.1-130,
build 1 from 2015-06-14_12-34-55 by buildguy) : An ERROR occurred, processing wi
ll be stopped:
2015/08/11 16:26:18 - MSSQL - Extraction numéros.0 - ERROR occurred while trying
to connect to the database
2015/08/11 16:26:18 - MSSQL - Extraction numéros.0 -
2015/08/11 16:26:18 - MSSQL - Extraction numéros.0 - ERROR connecting to database
: (using class net.sourceforge.jtds.jdbc.Driver)
2015/08/11 16:26:18 - MSSQL - Extraction numéros.0 - Unable to get information fr
om SQL Server: 10.0.0.9.
2015/08/11 16:26:18 - MSSQL - Extraction des contacts.0 - ERROR (version 5.4.0.1-
130, build 1 from 2015-06-14_12-34-55 by buildguy) : Erreur lors de l'initialisa
tion de l'étape [MSSQL - Extraction des contacts]
2015/08/11 16:26:18 - MSSQL - Extraction contacts.0 - ERROR (version 5.4.0.1-130,
 build 1 from 2015-06-14_12-34-55 by buildguy) : Erreur lors de l'initialisation
 de l'étape [MSSQL - Extraction contacts]
2015/08/11 16:26:18 - MSSQL - Extraction numéros.0 - ERROR (version 5.4.0.1-130,
build 1 from 2015-06-14_12-34-55 by buildguy) : Erreur lors de l'initialisation
de l'étape [MSSQL - Extraction numéros]
2015/08/11 16:26:18 - CONTACTS - ERROR (version 5.4.0.1-130, build 1 fro
m 2015-06-14_12-34-55 by buildguy) : L'initialisation de l'étape [MSSQL - Extract
ion contacts.0] a échoué!
2015/08/11 16:26:18 - CONTACTS - ERROR (version 5.4.0.1-130, build 1 fro
m 2015-06-14_12-34-55 by buildguy) : L'initialisation de l'étape [MSSQL - Extract
ion des contacts.0] a échoué!
2015/08/11 16:26:18 - CONTACTS - ERROR (version 5.4.0.1-130, build 1 fro
m 2015-06-14_12-34-55 by buildguy) : L'initialisation de l'étape [MSSQL - Extract
ion numéros.0] a échoué!
2015/08/11 16:26:18 - MYSQL - Extraction contacts.0 - Finished reading query,
closing connection.
2015/08/11 16:26:18 - MSSQL - Extraction contacts.0 - Finished reading query, clo
sing connection.
2015/08/11 16:26:18 - MSSQL - Extraction des contacts.0 - Finished reading query,
 closing connection.
2015/08/11 16:26:18 - MSSQL - Extraction numéros.0 - Finished reading query, clos
ing connection.
2015/08/11 16:26:18 - MYSQL - Extraction téléphones.0 - Finished reading query
, closing connection.
Impossible de preparer l'execution de la transformation
Il m'annonce que la connexion n'a pas pu être établie... Pourtant, quand je lance manuellement avec spoon (PDI) tout fonctionne.

Peut être le temps de connexion est trop court?

Si vous avez une idée... Merci d'avance !

Edit 1 :

J'ai une première piste :

Why do I get a java.sql.SQLException: "Unable to get information from SQL Server" when trying to connect to an SQL Server instance?

The exception you are getting is usually caused by a timeout. When connecting to named instances jTDS needs to connect via UDP to port 1434 to get information about available SQL Server instances. While doing this it times out, throwing the exception you see (which means that jTDS was not able to get information about the running instances).

Connection timeouts occur when there is no server listening on the port (BTW, are you sure your SQL Server is configured to use TCP/IP and that you actually use named instances?).

On SQL Server 2005 the SQL Browser service must be running on the server host as the instance name lookup port UDP 1434 is hosted by this service on SQL Server 2005 rather than the SQL Server itself. The default install does not configure the SQL Browser service to start automatically so you must do it manually.

Source
Je vais chercher si un paramètre permettrait d'augmenter le temps de récupération des infos de connexion...