Bonjour,
j'ai un soucis avec jasper report, la tâche de compilation ant ne trouve pas mes extensions (functions custom). Pourtant dans le studio, tout compile correctement et j'arrive à voir mon rapport. Mais impossible de le compiler avec ant, je dois rater quelque chose là.
Voici pour commencer mon classpath dans jaspersoft studio:
Le fichier lib-prod2-asp-1.60-RC.jar contient mes fonctions custom. Comme je l'ai dit, il fonctionne bien dans jasper studio. Les fonctions custom définies sont
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 <?xml version="1.0" encoding="UTF-8"?> <classpath> <classpathentry kind="src" path="resource/reporting/src"/> <classpathentry kind="src" path="translations"/> <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/> <classpathentry exported="true" kind="con" path="net.sf.jasperreports.JR_CONTAINER"/> <classpathentry exported="true" kind="con" path="com.jaspersoft.server.JRS_CONTAINER"/> <classpathentry kind="lib" path="/home/user/libraries/lib-util-3.14.jar"/> <classpathentry kind="lib" path="/home/user/libraries/lib-otf-core-7.8.jar"/> <classpathentry kind="lib" path="/home/user/libraries/lib-otf-ext-group-2.41.jar"/> <classpathentry kind="lib" path="/home/user/libraries/lib-otf-net-util-2.16.jar"/> <classpathentry kind="lib" path="/home/user/libraries/lib-service-net-1.15.jar"/> <classpathentry kind="lib" path="/home/user/libraries/lib-service-satellite-1.0.jar"/> <classpathentry kind="lib" path="/home/user/libraries/lib-tracking-4.21.jar"/> <classpathentry kind="lib" path="/home/user/libraries/lib-lbs-spec-2.20.jar"/> <classpathentry kind="lib" path="/home/user/libraries/lib-prod-messenger-1.63.jar"/> <classpathentry kind="lib" path="/home/user/libraries/lib-prod-planningassistant-4.0.jar"/> <classpathentry kind="lib" path="/home/user/libraries/lib-prod-addressbook-1.22.jar"/> <classpathentry kind="lib" path="/home/user/libraries/lib-prod-reporting-1.74.jar"/> <classpathentry kind="lib" path="/home/user/libraries/lib-prod-cao-2.53.jar"/> <classpathentry kind="lib" path="/home/user/libraries/lib-prod-diagnostics-3.14.jar"/> <classpathentry kind="lib" path="/home/user/libraries/lib-prod-fatigue-1.4.jar"/> <classpathentry kind="lib" path="/home/user/libraries/lib-filetransfer-1.8.jar"/> <classpathentry kind="lib" path="/home/user/libraries/cactus-1.7.2.jar"/> <classpathentry kind="lib" path="/home/user/libraries/junit-4.10.jar"/> <classpathentry kind="lib" path="/home/user/libraries/mockobjects-core-0.09.jar"/> <classpathentry kind="lib" path="/home/user/libraries/easymock-2.4.jar"/> <classpathentry kind="lib" path="/home/user/libraries/commons-logging-1.0.3.jar"/> <classpathentry kind="lib" path="/home/user/libraries/javaee-5.0.jar"/> <classpathentry kind="lib" path="/home/user/libraries/bagna-debug-1.0.jar"/> <classpathentry kind="lib" path="/home/user/libraries/jbossall-client-4.2.3-2.jar"/> <classpathentry kind="lib" path="/home/user/libraries/jboss-ejb3-embed-0.9.jar"/> <classpathentry kind="lib" path="/home/user/libraries/jboss-annotations-ejb3-4.2.2.jar"/> <classpathentry kind="lib" path="/home/user/libraries/jbossws-spi-1.0.2.jar"/> <classpathentry kind="lib" path="/home/user/libraries/jbossws-native-core-3.1.1.jar"/> <classpathentry kind="lib" path="/home/user/libraries/axis-ant-1.1.jar"/> <classpathentry kind="lib" path="/home/user/libraries/axis-1.1.jar"/> <classpathentry kind="lib" path="/home/user/libraries/wsdl4j-1.4.jar"/> <classpathentry kind="lib" path="/home/user/libraries/jaxrpc-1.1.jar"/> <classpathentry kind="lib" path="/home/user/libraries/saaj-1.1.jar"/> <classpathentry kind="lib" path="/home/user/libraries/commons-discovery-0.2.jar"/> <classpathentry kind="lib" path="/home/user/libraries/xlocate-cxf-client-1.14.0.3.jar"/> <classpathentry kind="lib" path="/home/user/libraries/xroute-cxf-client-1.14.0.2.jar"/> <classpathentry kind="lib" path="/home/user/libraries/xservercommon-cxf-client-3.14.0.3.jar"/> <classpathentry kind="lib" path="/home/user/libraries/jabbabase-cxf-client-2.4.10.jar"/> <classpathentry kind="lib" path="/home/user/libraries/commons-beanutils-1.6.1.jar"/> <classpathentry kind="lib" path="/home/user/libraries/lib-geocoder-1.1.jar"/> <classpathentry kind="lib" path="/home/user/libraries/jasperreports-6.0.3.jar"/> <classpathentry kind="lib" path="/home/user/libraries/jfreechart-1.0.6.jar"/> <classpathentry kind="lib" path="/home/user/libraries/jcommon-1.0.10.jar"/> <classpathentry kind="lib" path="/home/user/libraries/bagna-debug-1.1.jar"/> <classpathentry kind="lib" path="/home/user/release-lib/lib-prod2-asp-1.60-RC.jar"/> <classpathentry kind="lib" path="/home/user/libraries/json-lib-2.2.3.jar"/> <classpathentry kind="lib" path="/home/user/libraries/commons-lang-2.0.jar"/> <classpathentry kind="lib" path="/home/user/libraries/ezmorph-1.0.6.jar"/> <classpathentry kind="lib" path="/home/user/libraries/commons-collections-3.2.1.jar"/> <classpathentry kind="output" path="bin"/> </classpath>
Code java : 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 @Function("toSensorValue") public static String toSensorValue(String traceProperty, String device){ if (device==null || traceProperty==null){ return null; } String key = device+"="; for (String pair : traceProperty.split(";")){ if (pair.startsWith(key)){ return pair.substring(key.length()); } } return null; } @Function("toSensorBinary") public static String toSensorBinary(String traceProperty, String device){ String binary = toSensorValue(traceProperty, device); if (binary!=null){ if (binary.trim().equals("1")){ return "open"; } else if (binary.trim().equals("0")){ return "closed"; } } return null; } @Function("toSensorTemperature") public static Double toSensorTemperature(String traceProperty, String device){ String temperature = toSensorValue(traceProperty, device); if (temperature!=null){ try{ return new Double(temperature); } catch (NumberFormatException e){} } return null; } @Function("parseTetherHistory") public static TetherHistory parseTetherHistory(String jsonArray){ return new TetherHistory(jsonArray); }
Voici maintenant les extraits relevant dans ant:
Code xml : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14 <repository pathid="report.libraries"> <external name="commons-logging" version="1.0.3"/> <external name="jasperreports" version="6.0.3"/> <external name="commons-digester" version="1.8"/> <external name="commons-collections" version="3.2.1"/> <external name="commons-beanutils" version="1.6.1"/> <external name="commons-javaflow" version="20060411"/> <external name="itextpdf" version="5.5.0"/> <external name="itext-pdfa" version="5.5.0"/> <external name="jfreechart" version="1.0.6"/> <external name="jcommon" version="1.0.10"/> <external name="poi" version="3.10.1"/> <external name="json-lib" version="2.2.3"/> </repository>
Code xml : 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 <path id="jrc.classpath"> <path refid="report.libraries"/> <repository> <external name="javaee" version="5.0"/> </repository> </path> <taskdef name="jrc" classname="net.sf.jasperreports.ant.JRAntCompileTask"> <classpath refid="jrc.classpath"/> </taskdef> <mkdir dir="${release.conf.dir}/reporting" /> <jrc destdir="${release.conf.dir}/reporting" xmlvalidation="true" keepjava="true"> <classpath> <path refid="jrc.classpath"/> <pathelement location="/home/user/libraries/lib-util-3.14.jar"/> <pathelement location="/home/user/libraries/lib-otf-core-7.8.jar"/> <pathelement location="/home/user/libraries/lib-otf-ext-group-2.41.jar"/> <pathelement location="/home/user/libraries/lib-otf-net-util-2.16.jar"/> <pathelement location="/home/user/libraries/lib-service-net-1.15.jar"/> <pathelement location="/home/user/libraries/lib-service-satellite-1.0.jar"/> <pathelement location="/home/user/libraries/lib-tracking-4.21.jar"/> <pathelement location="/home/user/libraries/lib-lbs-spec-2.20.jar"/> <pathelement location="/home/user/libraries/lib-prod-messenger-1.63.jar"/> <pathelement location="/home/user/libraries/lib-prod-planningassistant-4.0.jar"/> <pathelement location="/home/user/libraries/lib-prod-addressbook-1.22.jar"/> <pathelement location="/home/user/libraries/lib-prod-reporting-1.74.jar"/> <pathelement location="/home/user/libraries/lib-prod-cao-2.53.jar"/> <pathelement location="/home/user/libraries/lib-prod-diagnostics-3.14.jar"/> <pathelement location="/home/user/libraries/lib-prod-fatigue-1.4.jar"/> <pathelement location="/home/user/libraries/lib-filetransfer-1.8.jar"/> <pathelement location="/home/user/libraries/cactus-1.7.2.jar"/> <pathelement location="/home/user/libraries/junit-4.10.jar"/> <pathelement location="/home/user/libraries/mockobjects-core-0.09.jar"/> <pathelement location="/home/user/libraries/easymock-2.4.jar"/> <pathelement location="/home/user/libraries/commons-logging-1.0.3.jar"/> <pathelement location="/home/user/libraries/javaee-5.0.jar"/> <pathelement location="/home/user/libraries/bagna-debug-1.0.jar"/> <pathelement location="/home/user/libraries/jbossall-client-4.2.3-2.jar"/> <pathelement location="/home/user/libraries/jboss-ejb3-embed-0.9.jar"/> <pathelement location="/home/user/libraries/jboss-annotations-ejb3-4.2.2.jar"/> <pathelement location="/home/user/libraries/jbossws-spi-1.0.2.jar"/> <pathelement location="/home/user/libraries/jbossws-native-core-3.1.1.jar"/> <pathelement location="/home/user/libraries/axis-ant-1.1.jar"/> <pathelement location="/home/user/libraries/axis-1.1.jar"/> <pathelement location="/home/user/libraries/wsdl4j-1.4.jar"/> <pathelement location="/home/user/libraries/jaxrpc-1.1.jar"/> <pathelement location="/home/user/libraries/saaj-1.1.jar"/> <pathelement location="/home/user/libraries/commons-discovery-0.2.jar"/> <pathelement location="/home/user/libraries/xlocate-cxf-client-1.14.0.3.jar"/> <pathelement location="/home/user/libraries/xroute-cxf-client-1.14.0.2.jar"/> <pathelement location="/home/user/libraries/xservercommon-cxf-client-3.14.0.3.jar"/> <pathelement location="/home/user/libraries/jabbabase-cxf-client-2.4.10.jar"/> <pathelement location="/home/user/libraries/commons-beanutils-1.6.1.jar"/> <pathelement location="/home/user/libraries/lib-geocoder-1.1.jar"/> <pathelement location="/home/user/libraries/jasperreports-6.0.3.jar"/> <pathelement location="/home/user/libraries/jfreechart-1.0.6.jar"/> <pathelement location="/home/user/libraries/jcommon-1.0.10.jar"/> <pathelement location="/home/user/libraries/bagna-debug-1.1.jar"/> <pathelement location="/home/user/release-lib/lib-prod2-asp-1.60-RC.jar"/> <pathelement location="/home/user/libraries/json-lib-2.2.3.jar"/> <pathelement location="/home/user/libraries/commons-lang-2.0.jar"/> <pathelement location="/home/user/libraries/ezmorph-1.0.6.jar"/> <pathelement location="/home/user/libraries/commons-collections-3.2.1.jar"/> </classpath> <src> <fileset dir="${resource.dir}/reporting/src"> <include name="*.jrxml" /> </fileset> </src> </jrc>
et le résultat:
Les idées sont bienvenues
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 [jrc] /home/user/report/build/sensor_report_asset_1435217595570_332068.java:261: cannot find symbol [jrc] symbol : method toSensorTemperature(java.lang.String,java.lang.String) [jrc] location: class sensor_report_asset_1435217595570_332068 [jrc] value = toSensorTemperature(((java.lang.String)field_stemValue.getValue()),((java.lang.String)parameter_LOG1.getValue())) !=null || //$JR_EXPR_ID=17$ [jrc] ^ [jrc] /home/user/report/build/sensor_report_asset_1435217595570_332068.java:262: cannot find symbol [jrc] symbol : method toSensorTemperature(java.lang.String,java.lang.String) [jrc] location: class sensor_report_asset_1435217595570_332068 [jrc] toSensorTemperature(((java.lang.String)field_stemValue.getValue()),((java.lang.String)parameter_LOG2.getValue())) !=null || //$JR_EXPR_ID=17$ [jrc] ^ [jrc] /home/user/report/build/sensor_report_asset_1435217595570_332068.java:263: cannot find symbol [jrc] symbol : method toSensorBinary(java.lang.String,java.lang.String) [jrc] location: class sensor_report_asset_1435217595570_332068 [jrc] toSensorBinary(((java.lang.String)field_stemValue.getValue()),((java.lang.String)parameter_DOOR.getValue())) !=null; //$JR_EXPR_ID=17$ [jrc] ^ [jrc] /home/user/report/build/sensor_report_asset_1435217595570_332068.java:278: cannot find symbol [jrc] symbol : method parseTetherHistory(java.lang.String) [jrc] location: class sensor_report_asset_1435217595570_332068 [jrc] value = parseTetherHistory(((java.lang.String)parameter_TETHER_HISTORY.getValue())); //$JR_EXPR_ID=20$ [jrc] ^ [jrc] /home/user/report/build/sensor_report_asset_1435217595570_332068.java:343: cannot find symbol [jrc] symbol : method toSensorTemperature(java.lang.String,java.lang.String) [jrc] location: class sensor_report_asset_1435217595570_332068 [jrc] value = toSensorTemperature( ((java.lang.String)field_stemValue.getValue()), ((java.lang.String)parameter_LOG1.getValue()) ); //$JR_EXPR_ID=33$ [jrc] ^ [jrc] /home/user/report/build/sensor_report_asset_1435217595570_332068.java:363: cannot find symbol [jrc] symbol : method toSensorTemperature(java.lang.String,java.lang.String) [jrc] location: class sensor_report_asset_1435217595570_332068 [jrc] value = toSensorTemperature( ((java.lang.String)field_stemValue.getValue()), ((java.lang.String)parameter_LOG2.getValue()) ); //$JR_EXPR_ID=37$ [jrc] ^ [jrc] /home/user/report/build/sensor_report_asset_1435217595570_332068.java:383: cannot find symbol [jrc] symbol : method toSensorBinary(java.lang.String,java.lang.String) [jrc] location: class sensor_report_asset_1435217595570_332068 [jrc] value = toSensorBinary( ((java.lang.String)field_sbinValue.getValue()), ((java.lang.String)parameter_DOOR.getValue()) )== "open"?0:null; //$JR_EXPR_ID=41$ [jrc] ^ [jrc] /home/user/report/build/sensor_report_asset_1435217595570_332068.java:261: cannot find symbol [jrc] symbol : method toSensorTemperature(java.lang.String,java.lang.String) [jrc] location: class sensor_report_asset_1435217595570_332068 [jrc] value = toSensorTemperature(((java.lang.String)field_stemValue.getValue()),((java.lang.String)parameter_LOG1.getValue())) !=null || //$JR_EXPR_ID=17$ [jrc] ^ [jrc] /home/user/report/build/sensor_report_asset_1435217595570_332068.java:262: cannot find symbol [jrc] symbol : method toSensorTemperature(java.lang.String,java.lang.String) [jrc] location: class sensor_report_asset_1435217595570_332068 [jrc] toSensorTemperature(((java.lang.String)field_stemValue.getValue()),((java.lang.String)parameter_LOG2.getValue())) !=null || //$JR_EXPR_ID=17$ [jrc] ^ [jrc] /home/user/report/build/sensor_report_asset_1435217595570_332068.java:263: cannot find symbol [jrc] symbol : method toSensorBinary(java.lang.String,java.lang.String) [jrc] location: class sensor_report_asset_1435217595570_332068 [jrc] toSensorBinary(((java.lang.String)field_stemValue.getValue()),((java.lang.String)parameter_DOOR.getValue())) !=null; //$JR_EXPR_ID=17$ [jrc] ^ [jrc] /home/user/report/build/sensor_report_asset_1435217595570_332068.java:278: cannot find symbol [jrc] symbol : method parseTetherHistory(java.lang.String) [jrc] location: class sensor_report_asset_1435217595570_332068 [jrc] value = parseTetherHistory(((java.lang.String)parameter_TETHER_HISTORY.getValue())); //$JR_EXPR_ID=20$ [jrc] ^ [jrc] /home/user/report/build/sensor_report_asset_1435217595570_332068.java:343: cannot find symbol [jrc] symbol : method toSensorTemperature(java.lang.String,java.lang.String) [jrc] location: class sensor_report_asset_1435217595570_332068 [jrc] value = toSensorTemperature( ((java.lang.String)field_stemValue.getValue()), ((java.lang.String)parameter_LOG1.getValue()) ); //$JR_EXPR_ID=33$ [jrc] ^ [jrc] /home/user/report/build/sensor_report_asset_1435217595570_332068.java:363: cannot find symbol [jrc] symbol : method toSensorTemperature(java.lang.String,java.lang.String) [jrc] location: class sensor_report_asset_1435217595570_332068 [jrc] value = toSensorTemperature( ((java.lang.String)field_stemValue.getValue()), ((java.lang.String)parameter_LOG2.getValue()) ); //$JR_EXPR_ID=37$ [jrc] ^ [jrc] /home/user/report/build/sensor_report_asset_1435217595570_332068.java:383: cannot find symbol [jrc] symbol : method toSensorBinary(java.lang.String,java.lang.String) [jrc] location: class sensor_report_asset_1435217595570_332068 [jrc] value = toSensorBinary( ((java.lang.String)field_sbinValue.getValue()), ((java.lang.String)parameter_DOOR.getValue()) )== "open"?0:null; //$JR_EXPR_ID=41$ [jrc] ^
Partager