Jump to content
We've recently updated our Privacy Statement, available here ×

TJasperServerExec : run report in Talend with parameter


d.taillade

Recommended Posts

Hello,

I need to run a report with parameters calculated in Talend. I found the plugin tJasperServerExec and I read the tutorial http://community.jaspersoft.com/wiki/tjasperserverexec-tutorial

But I get this error :

[iNFO ]: org.apache.commons.httpclient.HttpMethodDirector - Redirect requested but followRedirects is disabledAxisFault faultCode: {http://xml.apache.org/axis/}HTTP faultSubcode:  faultString: (302)D�plac� Temporairement faultActor:  faultNode:  faultDetail:  {}:return code:  302{http://xml.apache.org/axis/}HttpErrorCode:302(302)D�plac� Temporairement at org.apache.axis.transport.http.CommonsHTTPSender.invoke(CommonsHTTPSender.java:218) at org.apache.axis.strategies.InvocationStrategy.visit(InvocationStrategy.java:32) at org.apache.axis.SimpleChain.doVisiting(SimpleChain.java:118) at org.apache.axis.SimpleChain.invoke(SimpleChain.java:83) at org.apache.axis.client.AxisClient.invoke(AxisClient.java:165) at org.apache.axis.client.Call.invokeEngine(Call.java:2784) at org.apache.axis.client.Call.invoke(Call.java:2767) at org.apache.axis.client.Call.invoke(Call.java:2443) at org.apache.axis.client.Call.invoke(Call.java:2366)[WARN ]: org.apache.commons.httpclient.HttpMethodBase - Going to buffer response body of large or unknown size. Using getResponseBodyAsStream instead is recommended. at org.apache.axis.client.Call.invoke(Call.java:1812) at com.jaspersoft.jasperserver.irplugin.wsclient.RepositorySoapBindingStub.runReport(RepositorySoapBindingStub.java:193) at com.jaspersoft.jasperserver.irplugin.wsclient.WSClient.runReport(WSClient.java:390) at com.jaspersoft.jasperserver.irplugin.wsclient.WSClient.runReport(WSClient.java:311) at test1.jasper_0_1.jasper.tFileInputDelimited_2Process(jasper.java:577) at test1.jasper_0_1.jasper.runJobInTOS(jasper.java:975) at test1.jasper_0_1.jasper.main(jasper.java:832)Exception in component tJasperServerExec_1AxisFault faultCode: {http://xml.apache.org/axis/}HTTP faultSubcode:  faultString: (302)D�plac� Temporairement faultActor:  faultNode:  faultDetail:  {}:return code:  302{http://xml.apache.org/axis/}HttpErrorCode:302(302)D�plac� Temporairement at org.apache.axis.transport.http.CommonsHTTPSender.invoke(CommonsHTTPSender.java:218) at org.apache.axis.strategies.InvocationStrategy.visit(InvocationStrategy.java:32) at org.apache.axis.SimpleChain.doVisiting(SimpleChain.java:118) at org.apache.axis.SimpleChain.invoke(SimpleChain.java:83) at org.apache.axis.client.AxisClient.invoke(AxisClient.java:165) at org.apache.axis.client.Call.invokeEngine(Call.java:2784) at org.apache.axis.client.Call.invoke(Call.java:2767) at org.apache.axis.client.Call.invoke(Call.java:2443) at org.apache.axis.client.Call.invoke(Call.java:2366) at org.apache.axis.client.Call.invoke(Call.java:1812) at com.jaspersoft.jasperserver.irplugin.wsclient.RepositorySoapBindingStub.runReport(RepositorySoapBindingStub.java:193)[statistics] disconnected at com.jaspersoft.jasperserver.irplugin.wsclient.WSClient.runReport(WSClient.java:390) at com.jaspersoft.jasperserver.irplugin.wsclient.WSClient.runReport(WSClient.java:311) at test1.jasper_0_1.jasper.tFileInputDelimited_2Process(jasper.java:577) at test1.jasper_0_1.jasper.runJobInTOS(jasper.java:975) at test1.jasper_0_1.jasper.main(jasper.java:832)[/code]

Is anyone can help me ? Thanks in advance !

Link to comment
Share on other sites

  • Replies 6
  • Created
  • Last Reply

Top Posters In This Topic

Thanks for your answer. So I tested tRestClient but it doesn't work (I don't know how to set it ...)

My report is published on server, in Reports/TestFactures, and it's called "facture".

When I want to execute it via URL to generate a PDF, I do : http://localhost:8080/jasperserver/flow.html?_flowId=viewReportFlow&ParentFolderUri=/reports/TestFactures&reportUnit=/reports/TestFactures/facture&decorate=no&WITH_NUMFACT=1&IN_NOTIN=0&NUMFACT=161102523&output=pdf

and it's worked !

 

In Talend, I use tRestClient. In parameter I do :

URL : "http://localhost:8080/jasperserver/rest_v2/reports/reports/TestFactures/facture.pdf?j_username=myusername&j_password=mypassword"

Parameters : I write the parameters of my URL with values (WITH_NUMFACT, IN_NOTIN and NUMFACT)

I don't know if to write other marameters.

When I execute this, I get the error : "No message body reader has been found for class org.dom4j.Document, ContentType: text/html;charset=UTF-8"

I read lots of forums and the "JasperReports Server Web Service Guide" but I don't manage to do it ... and I don't understand how generate the PDF and save it on server or anywhere.

Do you have some examples, tutorials, ... ? Thanks in advance for your help !

Link to comment
Share on other sites

Hello,

it doesn't work with "http://localhost:8080/jasperserver/rest_v2/reports/reports/TestFactures/facture.pdf?j_username=myusername&j_password=mypassword&WITH_NUMFACT=1&IN_NOTIN=0&NUMFACT=161102523&output=pdf"

I tested with API Chrome : Advanced Rest Client this URL and the status is OK

In response Header :

Server: Apache-Coyote/1.1
Cache-Control: private
Expires: Thu, 01 Jan 1970 01:00:00 CET
P3p: CP="ALL"
Content-Disposition: attachment; filename="facture.pdf"
Output-Final: true
Content-Type: application/pdf
Content-Length: 55627
Date: Fri, 30 Dec 2016 14:55:11 GMT
In raw, I have lots of text (perhaps the pdf contains ?)
%PDF-1.5 %���� 7 0 obj <</Filter/FlateDecode/Length 2996>>stream x���v����MOmc�� [...]
 
When I tested with Talend, I remove checkbox "Convert Response to DOM Document" and I get the same result in the field "String"
 
If it's the PDF, how can I save in a file ?
 
Thanks in advance for your help !
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...