BIRT Exchange Forum: Can not load the report engine - BIRT Exchange Forum

Jump to content


 

No Latest Open Poll.

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Can not load the report engine Rate Topic: -----

#1 User is offline   spamwerk Icon

  • Newbie
  • Pip
  • Group: Members
  • Posts: 6
  • Joined: 04-April 12


Posted 20 April 2012 - 01:44 AM

Dear all,

I'm trying follow this tutorial which

Quote

shows a web page that will read a report design file and create HTML controls for you to populate for values used as parameters passed into the report you wish to run.


I have to deploy everything on websphere. The webviewer example is installed on the application server by simply using the provided birt.war from the runtime 3.7. The example shows that it was successfully installed.

Now when I run my web page everything is fine, until I select the report to load. It says that can not load the report engine and after that gives a nullpointer exception. I tried several locations without success, so I'm not sure where I should link to or whether I can do this with the webviewer example

This is the method where it goes wrong. I edited it a little to show which locations I've tried
//get a handle to the report engine
	private ReportEngine getReportEngine(String engineHome) {
		EngineConfig config = new EngineConfig();
		ReportEngine engine = null;
		int counter = 0;
		String[] locations = {	"C:\\temp\\ba5770\\workspace.birt\\birt-runtime-3_7_2\\WebViewerExample\\",
								"C:\\temp\\ba5770\\workspace.birt\\birt-runtime-3_7_2\\WebViewerExample",
								"http://localhost:9080/webviewer/",
								"http://localhost:9080/webviewer/frameset?",
								"C:\\Program Files\\IBM\\SDP\\runtimes\\base_v61\\profiles\\AppSrv01\\birt_webviewer\\birt_webviewer.ear\\birt.war",
								"C:\\Program Files\\IBM\\SDP\\runtimes\\base_v61\\profiles\\AppSrv01\\birt_webviewer\\birt_webviewer.ear\\birt.war\\"
		};
		
		while(counter < locations.length) {
				System.out.println("engineHome: " + locations[counter]);
				config.setEngineHome(locations[counter]);
				engine = new ReportEngine(config);
				counter ++;
		}
		System.out.println(engine.getVersion());
		return engine;
	}



[20-4-12 11:18:10:232 CEST] 000002e1 SystemOut     O engineHome: C:\temp\ba5770\workspace.birt\birt-runtime-3_7_2\WebViewerExample\
[20-4-12 11:18:10:529 CEST] 000002e1 SystemOut     O Can not load the report engine
[20-4-12 11:18:10:529 CEST] 000002e1 SystemOut     O engineHome: C:\temp\ba5770\workspace.birt\birt-runtime-3_7_2\WebViewerExample
[20-4-12 11:18:10:717 CEST] 000002e1 SystemOut     O Can not load the report engine
[20-4-12 11:18:10:717 CEST] 000002e1 SystemOut     O engineHome: http://localhost:9080/webviewer/
[20-4-12 11:18:10:888 CEST] 000002e1 SystemOut     O Can not load the report engine
[20-4-12 11:18:10:888 CEST] 000002e1 SystemOut     O engineHome: http://localhost:9080/webviewer/frameset?
[20-4-12 11:18:11:060 CEST] 000002e1 SystemOut     O Can not load the report engine
[20-4-12 11:18:11:060 CEST] 000002e1 SystemOut     O engineHome: C:\Program Files\IBM\SDP\runtimes\base_v61\profiles\AppSrv01\birt_webviewer\birt_webviewer.ear\birt.war
[20-4-12 11:18:11:248 CEST] 000002e1 SystemOut     O Can not load the report engine
[20-4-12 11:18:11:248 CEST] 000002e1 SystemOut     O engineHome: C:\Program Files\IBM\SDP\runtimes\base_v61\profiles\AppSrv01\birt_webviewer\birt_webviewer.ear\birt.war\
[20-4-12 11:18:11:420 CEST] 000002e1 SystemOut     O Can not load the report engine
[20-4-12 11:18:11:420 CEST] 000002e1 ServletWrappe E   SRVE0068E: Uncaught exception thrown in one of the service methods of the servlet: /MonitoringTool.jsp. Exception thrown : java.lang.NullPointerException
	at org.eclipse.birt.report.engine.api.ReportEngine.getVersion(ReportEngine.java:576)
	at org.abn.us.monitoringTool.Parameters.getReportEngine(Parameters.java:41)
	at org.abn.us.monitoringTool.Parameters.getParametersDefns(Parameters.java:145)
	at org.abn.us.monitoringTool.ParameterServlet.getReportParameters(ParameterServlet.java:54)
	at com.ibm._jsp._MonitoringTool._jspService(_MonitoringTool.java:91)
	at com.ibm.ws.jsp.runtime.HttpJspBase.service(HttpJspBase.java:87)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
	at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1152)
	at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:593)
	at com.ibm.ws.wswebcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:534)
	at com.ibm.wsspi.webcontainer.servlet.GenericServletWrapper.handleRequest(GenericServletWrapper.java:122)
	at com.ibm.ws.jsp.webcontainerext.AbstractJSPExtensionServletWrapper.handleRequest(AbstractJSPExtensionServletWrapper.java:233)
	at com.ibm.ws.jsp.webcontainerext.AbstractJSPExtensionProcessor.handleRequest(AbstractJSPExtensionProcessor.java:295)
	at com.ibm.ws.webcontainer.webapp.WebApp.handleRequest(WebApp.java:3548)
	at com.ibm.ws.webcontainer.webapp.WebGroup.handleRequest(WebGroup.java:269)
	at com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:831)
	at com.ibm.ws.wswebcontainer.WebContainer.handleRequest(WebContainer.java:1478)
	at com.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChannelLink.java:133)
	at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleDiscrimination(HttpInboundLink.java:450)
	at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleNewRequest(HttpInboundLink.java:508)
	at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.processRequest(HttpInboundLink.java:296)
	at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.ready(HttpInboundLink.java:270)
	at com.ibm.ws.tcp.channel.impl.NewConnectionInitialReadCallback.sendToDiscriminators(NewConnectionInitialReadCallback.java:214)
	at com.ibm.ws.tcp.channel.impl.NewConnectionInitialReadCallback.complete(NewConnectionInitialReadCallback.java:113)
	at com.ibm.ws.tcp.channel.impl.AioReadCompletionListener.futureCompleted(AioReadCompletionListener.java:165)
	at com.ibm.io.async.AbstractAsyncFuture.invokeCallback(AbstractAsyncFuture.java:217)
	at com.ibm.io.async.AsyncChannelFuture.fireCompletionActions(AsyncChannelFuture.java:161)
	at com.ibm.io.async.AsyncFuture.completed(AsyncFuture.java:136)
	at com.ibm.io.async.ResultHandler.complete(ResultHandler.java:196)
	at com.ibm.io.async.ResultHandler.runEventProcessingLoop(ResultHandler.java:751)
	at com.ibm.io.async.ResultHandler$2.run(ResultHandler.java:881)
	at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1497)

[20-4-12 11:18:11:420 CEST] 000002e1 WebApp        E   [Servlet Error]-[/MonitoringTool.jsp]: java.lang.NullPointerException
	at org.eclipse.birt.report.engine.api.ReportEngine.getVersion(ReportEngine.java:576)
	at org.abn.us.monitoringTool.Parameters.getReportEngine(Parameters.java:41)
	at org.abn.us.monitoringTool.Parameters.getParametersDefns(Parameters.java:145)
	at org.abn.us.monitoringTool.ParameterServlet.getReportParameters(ParameterServlet.java:54)
	at com.ibm._jsp._MonitoringTool._jspService(_MonitoringTool.java:91)
	at com.ibm.ws.jsp.runtime.HttpJspBase.service(HttpJspBase.java:87)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
	at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1152)
	at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:593)
	at com.ibm.ws.wswebcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:534)
	at com.ibm.wsspi.webcontainer.servlet.GenericServletWrapper.handleRequest(GenericServletWrapper.java:122)
	at com.ibm.ws.jsp.webcontainerext.AbstractJSPExtensionServletWrapper.handleRequest(AbstractJSPExtensionServletWrapper.java:233)
	at com.ibm.ws.jsp.webcontainerext.AbstractJSPExtensionProcessor.handleRequest(AbstractJSPExtensionProcessor.java:295)
	at com.ibm.ws.webcontainer.webapp.WebApp.handleRequest(WebApp.java:3548)
	at com.ibm.ws.webcontainer.webapp.WebGroup.handleRequest(WebGroup.java:269)
	at com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:831)
	at com.ibm.ws.wswebcontainer.WebContainer.handleRequest(WebContainer.java:1478)
	at com.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChannelLink.java:133)
	at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleDiscrimination(HttpInboundLink.java:450)
	at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleNewRequest(HttpInboundLink.java:508)
	at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.processRequest(HttpInboundLink.java:296)
	at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.ready(HttpInboundLink.java:270)
	at com.ibm.ws.tcp.channel.impl.NewConnectionInitialReadCallback.sendToDiscriminators(NewConnectionInitialReadCallback.java:214)
	at com.ibm.ws.tcp.channel.impl.NewConnectionInitialReadCallback.complete(NewConnectionInitialReadCallback.java:113)
	at com.ibm.ws.tcp.channel.impl.AioReadCompletionListener.futureCompleted(AioReadCompletionListener.java:165)
	at com.ibm.io.async.AbstractAsyncFuture.invokeCallback(AbstractAsyncFuture.java:217)
	at com.ibm.io.async.AsyncChannelFuture.fireCompletionActions(AsyncChannelFuture.java:161)
	at com.ibm.io.async.AsyncFuture.completed(AsyncFuture.java:136)
	at com.ibm.io.async.ResultHandler.complete(ResultHandler.java:196)
	at com.ibm.io.async.ResultHandler.runEventProcessingLoop(ResultHandler.java:751)
	at com.ibm.io.async.ResultHandler$2.run(ResultHandler.java:881)
	at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1497)

[20-4-12 11:18:11:420 CEST] 000002e1 LocalTranCoor E   WLTC0017E: Resources rolled back due to setRollbackOnly() being called.


Should I use http://wiki.eclipse...._%28BIRT%29_2.1 instead of the webviewer, or might it be cause because there is a difference in version? Please help!

Thanks in advance
0

#2 User is offline   pxuxp Icon

  • Newbie
  • Pip
  • Group: Members
  • Posts: 5
  • Joined: 24-January 12


Posted 20 April 2012 - 01:58 AM

I'm no expert, so can't be sure if this is your problem or not, but you're not calling Platform.startup() anywhere...

I use the following code to start the BIRT engine - albeit not in a Web app:

	private void startEngine() throws BirtException
	{
		System.out.println( "Starting BIRT engine..." );
		EngineConfig config = new EngineConfig();
		Platform.startup( config );
		ReportEngineFactory ref = new ReportEngineFactory();
		engine = ref.createReportEngine( config );
		System.out.println( "Done." );
	}

0

#3 User is offline   cbrell Icon

  • Member
  • Group: Members
  • Posts: 523
  • Joined: 17-March 09


Posted 08 May 2012 - 06:00 AM

That's true. The constructor of the ReportEngine class should only be used inside of Eclipse RCP. You need to use the Platform approach to create a ReportEngine object. See: http://www.eclipse.o...hp#reportengine
Interested to join BIRT User Group Mannheim (Germany)?
Have a look at: http://www.xing.com/...-group-mannheim or write me an email
0

#4 User is offline   cbrell Icon

  • Member
  • Group: Members
  • Posts: 523
  • Joined: 17-March 09


Posted 08 May 2012 - 06:09 AM

In addition it seems to be the case that you did not specify a valid birt home.
The paths are looking like you provided a war or ear file as birt home. If you want to run the report engine from within your application you have to unzip the birt runtime download and provide the path to folder reportEngine instead. See: http://www.eclipse.o...eAPI.php#config
Interested to join BIRT User Group Mannheim (Germany)?
Have a look at: http://www.xing.com/...-group-mannheim or write me an email
0

#5 User is offline   spamwerk Icon

  • Newbie
  • Pip
  • Group: Members
  • Posts: 6
  • Joined: 04-April 12


Posted 13 May 2012 - 11:54 PM

Thanks for the helps guys! I got it working now :)
0

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users