Précédent   Forum des professionnels en informatique > Logiciels > Solutions d'entreprise > Business Intelligence > Jasper
Jasper Forum d'entraide sur Jasper Reports. Avant de poster --> FAQ Jasper, Tutoriels Jasper
Partagez cette discussion sur d'autres réseaux sociaux : Viadeo Twitter Google Facebook Digg Delicious MySpace Yahoo
Réponse Proposer ce sujet en actualité
 
Outils de la discussion
Publicité
'
Vieux 05/10/2006, 11h34   #1
Membre habitué
 
Avatar de agougeon
 
Inscription : mai 2005
Messages : 253
Détails du profil
Informations forums :
Inscription : mai 2005
Messages : 253
Points : 106
Points : 106
Par défaut Probleme avec la compilation

Bonjour,
Je test le framework de jasper, jasper report... et j'ai un probleme lors de la compilation :
voici le message d'erreur :
Citation:
java.io.IOException: CreateProcess: javac -classpath C:\sources\temp;C:\sources\temp\lib\jasperreports-1.2.0.jar;C:\sources\temp\lib\xerces-2.0.jar;C:\sources\temp\lib\commons-digester-1.7.jar;C:\sources\temp\lib\commons-collections-3.2.jar;C:\sources\temp\lib\commons-logging-1.1.jar;C:\sources\temp\lib\commons-beanutils.jar C:\sources\temp\Simple_Report_1160040535081_20083.java error=2
at java.lang.Win32Process.create(Native Method)
at java.lang.Win32Process.<init>(Unknown Source)
at java.lang.Runtime.execInternal(Native Method)
at java.lang.Runtime.exec(Unknown Source)
at java.lang.Runtime.exec(Unknown Source)
at java.lang.Runtime.exec(Unknown Source)
at net.sf.jasperreports.engine.design.JRJavacCompiler.compileClasses(JRJavacCompiler.java:62)
at net.sf.jasperreports.engine.design.JRAbstractClassCompiler.compileUnits(JRAbstractClassCompiler.java:67)
at net.sf.jasperreports.engine.design.JRAbstractCompiler.compileReport(JRAbstractCompiler.java:190)
at net.sf.jasperreports.engine.design.JRDefaultCompiler.compileReport(JRDefaultCompiler.java:131)
at net.sf.jasperreports.engine.JasperCompileManager.compileReport(JasperCompileManager.java:211)
at test.JasperReportsIntro.main(JasperReportsIntro.java:21)

NESTED BY :
java.io.IOException: CreateProcess: javac -classpath C:\sources\temp;C:\sources\temp\lib\jasperreports-1.2.0.jar;C:\sources\temp\lib\xerces-2.0.jar;C:\sources\temp\lib\commons-digester-1.7.jar;C:\sources\temp\lib\commons-collections-3.2.jar;C:\sources\temp\lib\commons-logging-1.1.jar;C:\sources\temp\lib\commons-beanutils.jar C:\sources\temp\Simple_Report_1160040535081_20083.java error=2
at java.lang.Win32Process.create(Native Method)
at java.lang.Win32Process.<init>(Unknown Source)
at java.lang.Runtime.execInternal(Native Method)
at java.lang.Runtime.exec(Unknown Source)
at java.lang.Runtime.exec(Unknown Source)
at java.lang.Runtime.exec(Unknown Source)
at net.sf.jasperreports.engine.design.JRJavacCompiler.compileClasses(JRJavacCompiler.java:62)
at net.sf.jasperreports.engine.design.JRAbstractClassCompiler.compileUnits(JRAbstractClassCompiler.java:67)
at net.sf.jasperreports.engine.design.JRAbstractCompiler.compileReport(JRAbstractCompiler.java:190)
at net.sf.jasperreports.engine.design.JRDefaultCompiler.compileReport(JRDefaultCompiler.java:131)
at net.sf.jasperreports.engine.JasperCompileManager.compileReport(JasperCompileManager.java:211)
at test.JasperReportsIntro.main(JasperReportsIntro.java:21)

NESTED BY :
net.sf.jasperreports.engine.JRException: Error compiling report java source files : C:\sources\temp\Simple_Report_1160040535081_20083.java
at net.sf.jasperreports.engine.design.JRJavacCompiler.compileClasses(JRJavacCompiler.java:93)
at net.sf.jasperreports.engine.design.JRAbstractClassCompiler.compileUnits(JRAbstractClassCompiler.java:67)
at net.sf.jasperreports.engine.design.JRAbstractCompiler.compileReport(JRAbstractCompiler.java:190)
at net.sf.jasperreports.engine.design.JRDefaultCompiler.compileReport(JRDefaultCompiler.java:131)
at net.sf.jasperreports.engine.JasperCompileManager.compileReport(JasperCompileManager.java:211)
at test.JasperReportsIntro.main(JasperReportsIntro.java:21)
Caused by: java.io.IOException: CreateProcess: javac -classpath C:\sources\temp;C:\sources\temp\lib\jasperreports-1.2.0.jar;C:\sources\temp\lib\xerces-2.0.jar;C:\sources\temp\lib\commons-digester-1.7.jar;C:\sources\temp\lib\commons-collections-3.2.jar;C:\sources\temp\lib\commons-logging-1.1.jar;C:\sources\temp\lib\commons-beanutils.jar C:\sources\temp\Simple_Report_1160040535081_20083.java error=2
at java.lang.Win32Process.create(Native Method)
at java.lang.Win32Process.<init>(Unknown Source)
at java.lang.Runtime.execInternal(Native Method)
at java.lang.Runtime.exec(Unknown Source)
at java.lang.Runtime.exec(Unknown Source)
at java.lang.Runtime.exec(Unknown Source)
at net.sf.jasperreports.engine.design.JRJavacCompiler.compileClasses(JRJavacCompiler.java:62)
... 5 more
et voici mon code :

Code :
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
 
package test;
 
import java.io.File;
 
import net.sf.jasperreports.engine.JRException;
import net.sf.jasperreports.engine.JasperCompileManager;
import net.sf.jasperreports.engine.JasperPrint;
import net.sf.jasperreports.engine.JasperReport;
import net.sf.jasperreports.engine.design.JasperDesign;
import net.sf.jasperreports.engine.xml.JRXmlLoader;
 
public class JasperReportsIntro
{
  public static void main(String[] args)
  {
    JasperReport jasperDesign;
    JasperPrint jasperPrint;
    try
    {
    	JasperDesign design = JRXmlLoader.load(new File("xml/report.jrxml"));
    	JasperReport report = JasperCompileManager.compileReport(design);
    }
    catch (JRException e)
    {
      e.printStackTrace();
    }
  }
}
et voici mon report très simple :
Code :
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
 
<?xml version="1.0" encoding="UTF-8"  ?>
<!-- Created with iReport - A designer for JasperReports -->
<!DOCTYPE jasperReport SYSTEM "lib//jasperreport.dtd">
<jasperReport
		 name="Simple_Report"
		 columnCount="1"
		 printOrder="Vertical"
		 orientation="Portrait"
		 pageWidth="595"
		 pageHeight="842"
		 columnWidth="555"
		 columnSpacing="0"
		 leftMargin="20"
		 rightMargin="20"
		 topMargin="30"
		 bottomMargin="30"
		 whenNoDataType="NoPages"
		 isTitleNewPage="false"
		 isSummaryNewPage="false">
	<property name="ireport.scriptlethandling" value="0" />
	<property name="ireport.encoding" value="UTF-8" />
	<import value="java.util.*" />
	<import value="net.sf.jasperreports.engine.*" />
	<import value="net.sf.jasperreports.engine.data.*" />
 
 
		<background>
			<band height="0"  isSplitAllowed="true" >
			</band>
		</background>
		<title>
			<band height="0"  isSplitAllowed="true" >
			</band>
		</title>
		<pageHeader>
			<band height="0"  isSplitAllowed="true" >
			</band>
		</pageHeader>
		<columnHeader>
			<band height="0"  isSplitAllowed="true" >
			</band>
		</columnHeader>
		<detail>
			<band height="20"  isSplitAllowed="true" >
				<staticText>
					<reportElement
						x="180"
						y="0"
						width="200"
						height="20"
						key="staticText"/>
					<box topBorder="None" topBorderColor="#000000" leftBorder="None" leftBorderColor="#000000" rightBorder="None" rightBorderColor="#000000" bottomBorder="None" bottomBorderColor="#000000"/>
					<textElement>
						<font/>
					</textElement>
				<text><![CDATA[Hello World!]]></text>
				</staticText>
			</band>
		</detail>
		<columnFooter>
			<band height="0"  isSplitAllowed="true" >
			</band>
		</columnFooter>
		<pageFooter>
			<band height="0"  isSplitAllowed="true" >
			</band>
		</pageFooter>
		<summary>
			<band height="0"  isSplitAllowed="true" >
			</band>
		</summary>
</jasperReport>

Merci.

PS : J'ai du mettre le fichier dtd car sinon j'ai une erreur de type connection....
et avec la dtd dans mon projet ça passe.
l'erreur se trouve JasperReport report = JasperCompileManager.compileReport(design);
car la creation du design, il n'y a pas de problème.
agougeon est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 05/10/2006, 12h08   #2
Membre habitué
 
Avatar de agougeon
 
Inscription : mai 2005
Messages : 253
Détails du profil
Informations forums :
Inscription : mai 2005
Messages : 253
Points : 106
Points : 106
apparemment j'ai pas le compilateur java ????
pas possible, j'execute du code java sur d'autre projet dans eclipse et ça marche nickel..... faut pas non plus abusé, je débute en jasperreport mais je sais que j'ai la JDK... et que eclipse pointe bien dessus.

Mais peut etre faut il un compilateur special qui n'est pas dans la lib jasper !!!
agougeon est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 23/01/2007, 18h27   #3
Membre du Club
 
Inscription : mars 2006
Messages : 77
Détails du profil
Informations forums :
Inscription : mars 2006
Messages : 77
Points : 44
Points : 44
Alors ? tu as résolu ton problème ? je serais très intéressé.

Merci en avance.
fadjerx est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 23/01/2007, 18h41   #4
Membre du Club
 
Inscription : mars 2006
Messages : 77
Détails du profil
Informations forums :
Inscription : mars 2006
Messages : 77
Points : 44
Points : 44
Hi,

I found the solution ! I'm working on Eclipse and the problem is caused by it !

Add these two jars to your classpath :
org.eclipse.jdt.core.manipulation_1.0.0.v20060605-1400.jar
org.eclipse.jdt.core_3.2.0.v_671.jar

There are in the plungin directory of Eclipse.
fadjerx est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 16/03/2007, 10h04   #5
Invité de passage
 
Inscription : mars 2007
Messages : 1
Détails du profil
Informations forums :
Inscription : mars 2007
Messages : 1
Points : 1
Points : 1
Par défaut Si ça peut-être utile

J'ai eu la même erreur, ou presque. Il s'agissait d'une erreur de ma configuration d'Eclipse.

C'est un peu en retard mais je suis tombé sur ce message, donc si ça peut aider une prochaine victime

Mon erreur
Code :
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
 
net.sf.jasperreports.engine.JRException: Error compiling report java source files : D:\EclipseWK\EssaiJasperReport\HelloReportWorld_1174035394458_11427.java 
	at net.sf.jasperreports.engine.design.JRJavacCompiler.compileClasses(JRJavacCompiler.java:93)
	at net.sf.jasperreports.engine.design.JRAbstractClassCompiler.compileUnits(JRAbstractClassCompiler.java:67)
	at net.sf.jasperreports.engine.design.JRAbstractCompiler.compileReport(JRAbstractCompiler.java:190)
	at net.sf.jasperreports.engine.design.JRDefaultCompiler.compileReport(JRDefaultCompiler.java:105)
	at net.sf.jasperreports.engine.JasperCompileManager.compileReport(JasperCompileManager.java:211)
	at net.sf.jasperreports.engine.JasperCompileManager.compileReport(JasperCompileManager.java:144)
	at EssaiJasperReport.main(EssaiJasperReport.java:19)
Caused by: java.io.IOException: CreateProcess: javac -classpath D:\EclipseWK\EssaiJasperReport;D:\EclipseWK\EssaiJasperReport\lib\jasperreports-1.3.1.jar;D:\EclipseWK\EssaiJasperReport\lib\commons-beanutils-core.jar;D:\EclipseWK\EssaiJasperReport\lib\commons-collections-3.2.jar;D:\EclipseWK\EssaiJasperReport\lib\commons-digester-1.8.jar;D:\EclipseWK\EssaiJasperReport\lib\commons-logging-1.1.jar D:\EclipseWK\EssaiJasperReport\HelloReportWorld_1174035394458_11427.java error=2
	at java.lang.ProcessImpl.create(Native Method)
	at java.lang.ProcessImpl.<init>(Unknown Source)
	at java.lang.ProcessImpl.start(Unknown Source)
	at java.lang.ProcessBuilder.start(Unknown Source)
	at java.lang.Runtime.exec(Unknown Source)
	at java.lang.Runtime.exec(Unknown Source)
	at net.sf.jasperreports.engine.design.JRJavacCompiler.compileClasses(JRJavacCompiler.java:62)
	... 6 more
Le problème était que la machine virtuelle par défaut pointait sur une simple JRE. (Pour y accéder : Windows/Preferences/Java/Installed JRE)
C:\Program Files\Java\jdk1.5.0_11

En utilisant la machine du SDK (pointer simplement le dossier du SDK), tout fonctionne.
C:\Program Files\Java\jdk1.5.0_11

En tout cas depuis Jasper fonctionne parfaitement
Calavera- est déconnecté   Envoyer un message privé Réponse avec citation 00
Réponse Proposer ce sujet en actualité
Outils de la discussion



Fuseau horaire GMT +2. Il est actuellement 22h49.


 
 
 
 
Partenaires

Hébergement Web