Bonjour tout le monde, je suis presentement sur jasperreports-0.6.1-project
Et j'essaie de faire rouler l'exemple de BarbecueApp
Comme argument.
-Tcsv
-Ftestss



mais quand je le roule. J'ai un
java.io.EOFException
at java.io.ObjectInputStream$PeekInputStream.readFully(ObjectInputStream.java:2230)
at java.io.ObjectInputStream$BlockDataInputStream.readShort(ObjectInputStream.java:2696)
at java.io.ObjectInputStream.readStreamHeader(ObjectInputStream.java:761)
at java.io.ObjectInputStream.<init>(ObjectInputStream.java:277)
at net.sf.jasperreports.engine.util.JRLoader.loadObject(JRLoader.java:128)
at com.hydroquebec.mac.ssep.ce.util.rapport.jasperreport.BarbecueApp.main(BarbecueApp.java:214)
pour un code qui est quand meme assez simple
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
File sourceFile = new File(fileName);
				
				//File sourceFile = new File(contextReportFile);
				boolean creer = sourceFile.createNewFile();
				if(!creer)
					creer = sourceFile.mkdir();
		
				JasperPrint jasperPrint = (JasperPrint)JRLoader.loadObject(sourceFile);
		
				File destFile = new File(sourceFile.getParent(), jasperPrint.getName() + ".csv");
				
				JRCsvExporter exporter = new JRCsvExporter();
				
				exporter.setParameter(JRExporterParameter.JASPER_PRINT, jasperPrint);
				exporter.setParameter(JRExporterParameter.OUTPUT_FILE_NAME, destFile.toString());
				
				exporter.exportReport();

				System.err.println("CSV creation time : " + (System.currentTimeMillis() - start));
				System.exit(0);
et il plante sur en ligne en gras. Est ce que une personne aurait une idee.
pour aller plus profond dans le jar

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
public static Object loadObject(File file) throws JRException
	{
		if (!file.exists() || !file.isFile())
		{
			throw new JRException( new FileNotFoundException(String.valueOf(file)) );
		}

		Object obj = null;

		FileInputStream fis = null;
		ObjectInputStream ois = null;

		try
		{
			fis = new FileInputStream(file);
			ois = new ObjectInputStream(fis);
			obj = ois.readObject();
		}
		catch (IOException e)
		{
			throw new JRException("Error loading object from file : " + file, e);
		}
		catch (ClassNotFoundException e)
		{
			throw new JRException("Class not found when loading object from file : " + file, e);
		}
		finally
		{
			if (ois != null)
			{
				try
				{
					ois.close();
				}
				catch(IOException e)
				{
				}
			}

			if (fis != null)
			{
				try
				{
					fis.close();
				}
				catch(IOException e)
				{
				}
			}
		}

		return obj;
	}
le gros probleme ca passe pas sur ois = new ObjectInputStream(fis);

merci d avance