Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us in Toronto Sept 9th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
gadje1
Creator
Creator

Error "String index out of range: -1" with tJasperOutput component

Hello,

When running a job to generate a PDF output list, I have an error with tJasperOutput component.

Démarrage du job GenererFichierCommandeGRUE_SEMI_J2_AEA a 16:02 18/07/2019.
[statistics] connecting to socket on port 3576
[statistics] connected
Listes des tournées AEA supprimées !
Nous sommes le : 18/07/2019, il est : 16:02:12 -  Edition des tournées pour le 22/07/2019.
Génération des listes AEA !
===========================
Exception in component tJasperOutput_1 (GenererFichierCommandeGRUE_SEMI_J2_AEA)
net.sf.jasperreports.engine.JRException: Error compiling report java source files: C:\Talend\workplace\.Java\INTRANET\poms\jobs\process\INTRANET\SOUS_JOBS\Commandes_Grue_Semi\ListesCommandeGRUE_SEMI_AEA\genererfichiercommandegrue_semi_j2_aea_0.1\src\main\ext-resources\Reject_Report_1563458580468_822076.java .
	at net.sf.jasperreports.engine.design.JRJavacCompiler.compileClasses(JRJavacCompiler.java:105)
	at net.sf.jasperreports.engine.design.JRAbstractClassCompiler.compileUnits(JRAbstractClassCompiler.java:74)
	at net.sf.jasperreports.engine.design.JRAbstractCompiler.compileReport(JRAbstractCompiler.java:212)
	at net.sf.jasperreports.engine.JasperCompileManager.compile(JasperCompileManager.java:357)
	at net.sf.jasperreports.engine.JasperCompileManager.compileToFile(JasperCompileManager.java:273)
	at net.sf.jasperreports.engine.JasperCompileManager.compileReportToFile(JasperCompileManager.java:566)
	at intranet.genererfichiercommandegrue_semi_j2_aea_0_1.GenererFichierCommandeGRUE_SEMI_J2_AEA.tAS400Input_1Process(GenererFichierCommandeGRUE_SEMI_J2_AEA.java:2170)
	at intranet.genererfichiercommandegrue_semi_j2_aea_0_1.GenererFichierCommandeGRUE_SEMI_J2_AEA.tJava_1Process(GenererFichierCommandeGRUE_SEMI_J2_AEA.java:3733)
	at intranet.genererfichiercommandegrue_semi_j2_aea_0_1.GenererFichierCommandeGRUE_SEMI_J2_AEA.tRunJob_1Process(GenererFichierCommandeGRUE_SEMI_J2_AEA.java:4067)
	at intranet.genererfichiercommandegrue_semi_j2_aea_0_1.GenererFichierCommandeGRUE_SEMI_J2_AEA.runJobInTOS(GenererFichierCommandeGRUE_SEMI_J2_AEA.java:4327)
	at intranet.genererfichiercommandegrue_semi_j2_aea_0_1.GenererFichierCommandeGRUE_SEMI_J2_AEA.main(GenererFichierCommandeGRUE_SEMI_J2_AEA.java:4146)
Caused by: java.io.IOException: Cannot run program "javac": CreateProcess error=2, Le fichier spécifié est introuvable
	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:74)
	... 10 more
Caused by: java.io.IOException: CreateProcess error=2, Le fichier spécifié est introuvable
	at java.lang.ProcessImpl.create(Native Method)
	at java.lang.ProcessImpl.<init>(Unknown Source)
	at java.lang.ProcessImpl.start(Unknown Source)
	... 14 more
[statistics] disconnected

Le Job GenererFichierCommandeGRUE_SEMI_J2_AEA sest terminé à {1,date,HH:mm dd/MM/yyyy}. [code de sortie={2,number}]

I only retrieve information from one member as below in a CSV file.  instead a PDF file

 

NoCde,DateBon,Adherent
447755,31/01/2019,AD215,
475910,03/07/2019,AD215,
456578,31/01/2019,AD215,
470176,24/05/2019,AD215,

 

And if I put a tLogRow output instead of tJasperOutput I get this:

 

Démarrage du job GenererFichierCommandeGRUE_SEMI_J2_AEA a 15:46 18/07/2019.
[statistics] connecting to socket on port 3824
[statistics] connected
Aucune liste à effacer pour AEA !
Nous sommes le : 18/07/2019, il est : 15:46:40 -  Edition des tournées pour le 22/07/2019.
Génération des listes AEA !
===========================
447755|31/01/2019|AD215|
475910|03/07/2019|AD215|
456578|31/01/2019|AD215|
470176|24/05/2019|AD215|
479064|17/07/2019|AD145|
469870|04/06/2019|AD019|
479088|17/07/2019|AD019|
479102|17/07/2019|AD250|
479129|17/07/2019|AD028|
479154|17/07/2019|AD328|
479162|18/07/2019|AD359|
[statistics] disconnected

Le Job GenererFichierCommandeGRUE_SEMI_J2_AEA sest terminé à {1,date,HH:mm dd/MM/yyyy}. [code de sortie={2,number}]

 

0683p000009M6eb.jpg

 

Would anyone have an idea of what is causing this problem ?

thanks in advance.

Labels (2)
6 Replies
gadje1
Creator
Creator
Author

Now, I have another error type :

Exception in component tJasperOutput_1 (GenererFichierCommandeGRUE_SEMI_J2_AEA)
java.lang.StringIndexOutOfBoundsException: String index out of range: -1
	at java.lang.String.substring(Unknown Source)
	at intranet.genererfichiercommandegrue_semi_j2_aea_0_1.GenererFichierCommandeGRUE_SEMI_J2_AEA.tAS400Input_1Process(GenererFichierCommandeGRUE_SEMI_J2_AEA.java:1526)
	at intranet.genererfichiercommandegrue_semi_j2_aea_0_1.GenererFichierCommandeGRUE_SEMI_J2_AEA.tJava_1Process(GenererFichierCommandeGRUE_SEMI_J2_AEA.java:3696)
	at intranet.genererfichiercommandegrue_semi_j2_aea_0_1.GenererFichierCommandeGRUE_SEMI_J2_AEA.runJobInTOS(GenererFichierCommandeGRUE_SEMI_J2_AEA.java:3966)
	at intranet.genererfichiercommandegrue_semi_j2_aea_0_1.GenererFichierCommandeGRUE_SEMI_J2_AEA.main(GenererFichierCommandeGRUE_SEMI_J2_AEA.java:3780)
[statistics] disconnected

Le Job GenererFichierCommandeGRUE_SEMI_J2_AEA sest terminé à {1,date,HH:mm dd/MM/yyyy}. [code de sortie={2,number}]


I tried to make a less complex job with an input csv file and an output tJasperOutput to test the tJasperOutput behavior but I have the same error message.

 

0683p000009M6fP.jpg

May be my problem is in the iReport model ?

0683p000009M6IA.jpg

thanks

Anonymous
Not applicable

Hi,

 

    This issue normally happens when you are trying to read a string from a position which is not present in the input value. For example trying to read a string from 10th position when overall string length is just 5 characters. So could you please verify whether you are doing any string operation like that in your component (either in component configuration area or in actual data.

 

Warm Regards,
Nikhil Thampi

Please appreciate our Talend community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂

 

gadje1
Creator
Creator
Author

My CSV test file could not be simpler:

Adherent; Nom
123; Dupont
234; In
345; Martin
456; Duchmol

There is not a lot of solutions concerning the index, [0,1].

No problem to create an output file in Json format:

{"Data": [{ "Adherent": "123", "Nom": "Dupont"}, { "Adherent": "234", "Nom": "During"}, { "Adherent": "345" "Nom": "Martin"}, { "Adherent": "456", "Nom": "Duchmol"}]}

In my test work, I don't do any string manipulation. I only have 2 fields in my CSV file, "Adherent" and "Nom".
But my real job uses a tMap as shown on my capture

gadje1
Creator
Creator
Author

Here is my tMap configuration :

0683p000009M6gc.jpg

 

I am intrigued by the last line of the error message :

Le Job GenererFichierCommandeGRUE_SEMI_J2_AEA sest terminé à {1,date,HH:mm dd/MM/yyyy}. [code de sortie={2,number}]

 

Anonymous
Not applicable

Hi,

 

    Since you have shared only a snippet of error message, I am assuming you are getting the last error in tMap. Could you first add a tLogrow to print the output and check whether there are no issues till the output part of tMap?

 

    Once its confirmed that till tMap its working fine, we will see the problematic component.

 

Warm Regards,
Nikhil Thampi

Please appreciate our Talend community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂

gadje1
Creator
Creator
Author

Hello and thank you for your answer,

At this time, i try to have a PDF file from a file CSV  juste for test my tJasperOutput component configuration.
regarding my error message:
"String index out of range: -1", it seems to be OK now, it look that this came from a syntax problem in a context.
But now I have another error message that talk about jasperreports.engine:
"Error: net.sf.jasperreports.engine package does not exist".

I added a PATHCLASS system variable that point on jasperreports.jar but i alway have the same error message.



To see the whole post, download it here
OriginalPost.pdf