Salut tout le monde.

Je rencontre un petit problème plutôt chagrinant. J'ai un projet qui marche super bien sous Eclipse, et dans lequel je peux ouvrir différents fichiers.
Quand j'ouvre un fichier Excel, je le transforme en flux XML pour pouvoir faire un traitement standard avec mon parseur SAX.

Le problème c'est que l'implentation de POI pour analyser mes fichiers Excel marche à merveille sous Eclipse, mais ne marche plus du tout dès que j'exporte le projet en JAR...
Voici un bout de mon code, si quelqu'un y voit une anomalie, ou si quelqu'un à une idée en rapport avec les accès aux librairies...
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
82
83
84
85
86
87
package com.maSociete.MonSoft.io;
 
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
 
import javax.swing.JOptionPane;
 
import org.apache.poi.hssf.usermodel.HSSFCell;
import org.apache.poi.hssf.usermodel.HSSFCellStyle;
import org.apache.poi.hssf.usermodel.HSSFDataFormat;
import org.apache.poi.hssf.usermodel.HSSFRow;
import org.apache.poi.hssf.usermodel.HSSFSheet;
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
import org.apache.poi.poifs.filesystem.POIFSFileSystem;
 
import com.maSociete.monSoft.monSoftProgram;
import com.maSociete.monSoft.Util;
 
/**
 * @author leminipouce
 *
 *      The goal of this class is to parse Excel file, in order to have them readable 
 * in monSoft.
 * 
 * The way this class is implemented is to parse the XLS file and build equivalent
 * XML stream, respecting the XML format defined for monSoft.
 */
public final class MonSoftXLSToXML
{
 
	/**
         * display the stream
         */
	public static boolean display(String stream) {
		String options[] = new String[] {"Agree", "Exit"};
 
		int chosen = JOptionPane.showOptionDialog(null, 
				stream,
				"", 
				JOptionPane.YES_NO_OPTION, JOptionPane.WARNING_MESSAGE,
				null, options, options[0]);
		switch(chosen) {
			case 0:
				return true;
			case JOptionPane.CLOSED_OPTION:
				return false;				
		}
		return false;
	}
 
	/** 
         * Builds a String, containing the XML stream corresponding to the XLS file given 
         * in param.
         * This XML stream is well formatted, respecting the Dashbaord DTD.
         */
	public static String buildXmlFromXls(File xlsFile){
		String xmlStream=null;
		StringBuffer buildingXmlStream=new StringBuffer("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<tree>\n");
 
		POIFSFileSystem fs=null;		//Neccessary to open the Excel file
		HSSFWorkbook workBook=null;	//Reference to the Excel workbook
		HSSFSheet mapDataSheet=null;	//Reference to the primary Sheet, containing the data set
 
		if(display("Coucou 1")){};
 
		try{
			if(display("xlsFile "+xlsFile.getName()+" path "+xlsFile.getPath())){};
			if(display("FIS "+new FileInputStream(xlsFile).toString())){};
			fs = new POIFSFileSystem(new FileInputStream(xlsFile));
			if(display("FS "+fs.toString())){};
		}catch (FileNotFoundException e){
			if(display("FNFException ")){};
			e.printStackTrace();
			return null;
		}catch (IOException e){
			if(display("IOException ")){};
			e.printStackTrace();
			return null;
		}catch(Exception e){
			if(display("Exception ")){};
			e.printStackTrace();
			return null;
		}
 
		if(display("FS récupéré ")){};
La méthode display est un bout de code récupéré pour afficher un string sous forme de "pop-up".
J'affiche sans problème le "Coucou 1", le xlsFile.getName() ainsi que la référence du FileInputStream, par contre, je ne fais aucun autre affichage => je ne dépasse pas la tentative d'instanciation de mon object POIFSFileSystem fs, mais je ne lève pas non plus d'exception !
A priori il n'y a pas de problème vis à vis des accès à POI puisque je passe sans problème le stade du la création de la référence à l'objet
POIFSFileSystem fs=null;


Dans le jar que j'exporte, il y a toutes mes librairies (j'utilise aussi, entre autres JDOM, et qui marche à merveille si je ne tente pas d'ouvrir d'XLS.)
Pour être sûr que le problème ne vient pas d'une résolution d'adresse interne au jar POI, je l'ai décompressé, et ses packages se trouvent au même endroit que les miens... J'avoues ne plus y comprendre grand chose.

Par avance, Merci pour votre aide.