How to Deploy/Publish Jasper Report to Jasper Server

My favourite way is to use the Jasper Studio Publish function, with this function's help, the IDE would package everything necessary and do the publish job in background.

LESSON 1: Fall Back to SOAP API

By default, Jasper Studio uses REST API to publish jasper report to jasper server, and we always get error as follows:

org.apache.http.client.HttpResponseException: Bad Request
	at com.jaspersoft.studio.server.protocol.restv2.RESTv2ExceptionHandler.handleException(RESTv2ExceptionHandler.java:58)
	at com.jaspersoft.studio.server.protocol.restv2.ARestV2ConnectionJersey.toObj(ARestV2ConnectionJersey.java:52)
	at com.jaspersoft.studio.server.protocol.restv2.RestV2ConnectionJersey.addOrModifyResource(RestV2ConnectionJersey.java:352)
	at com.jaspersoft.studio.server.protocol.ProxyConnection.addOrModifyResource(ProxyConnection.java:283)
	at com.jaspersoft.studio.server.publish.Publish.publishResources(Publish.java:172)
	at com.jaspersoft.studio.server.publish.Publish.publish(Publish.java:60)
	at com.jaspersoft.studio.server.publish.wizard.Publish2ServerWizard$3.run(Publish2ServerWizard.java:273)
	at org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:122)

This is really unpleasant and disappointing, but at last I found the solution, it works for Jasper Report Server 5.6 and Jasper Report Studio 5.6.

In short, the solution is to employ to SOAP API, rather than REST API.

How to Deploy/Publish Jasper Report to Jasper Server_第1张图片

LESSON 2: Create Report Unit

 With this setting, the IDE would package everything necessary and do the publish job in background. Otherwise, you will have to upload the various resources and establish proper references manually. This function is just awesome!

How to Deploy/Publish Jasper Report to Jasper Server_第2张图片

Reference

[1] jasperreports-server-user-guide_5.6.pdf




你可能感兴趣的:(How to Deploy/Publish Jasper Report to Jasper Server)