Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » BIRT » NullPointerException in jar from Eclipse(Eclipse runnable JAR fils, but project runs OK in Eclipse)
NullPointerException in jar from Eclipse [message #812224] Sat, 03 March 2012 12:38 Go to next message
Michael Entwisle is currently offline Michael Entwisle
Messages: 2
Registered: March 2012
Junior Member
I create a reporting API project and it runs fine under Eclipse. I export this using the Eclipse Export/Runnable JAR comand. When I execute this JAR (java -jar myjar.jar), I get an "Exception in thread "main" java.lang.NullPointerException".

I'm new to BIRT.

BIRT is 3.7.2, Eclipse is Indigo.

The problems seems to be at the line:
IReportEngineFactory factory = (IReportEngineFactory) Platform
.createFactoryObject(IReportEngineFactory.EXTENSION_REPORT_ENGINE_FACTORY);

It appears in a simple demo program also.

Can you please advise me:

1. what might be the cause of this error?
2. what is the reoommended means of getting an executable JAR file for BIRT and for executing it (the Runnable JAP seems to contain lots of possibly unnecessary JARs)?

May thanks,
Re: NullPointerException in jar from Eclipse [message #812653 is a reply to message #812224] Sun, 04 March 2012 04:47 Go to previous messageGo to next message
Michael Entwisle is currently offline Michael Entwisle
Messages: 2
Registered: March 2012
Junior Member
I am much clearer now.

If I create a Runnable JAR and execute it with the java -jar Myjar.jar command, I get a NullPointerException.
If I execute the same jar with the command java -cp "Myjar.jar;F:/Eclipse/birt-runtime-3_7_2/ReportEngine/lib" path.to.mainclass it works. This command also works with a regular exported jar (not a runnable JAR).

If I remove the classpath reference to the birt runtime, the command returns a NoClassDefFoundError

If not sure why the Runnable JAR needs the classpath reference, or why it doesn't work in the java -jar format - the Runnable JAR contains many of the runtime classes.
Re: NullPointerException in jar from Eclipse [message #1044160 is a reply to message #812224] Thu, 18 April 2013 15:03 Go to previous message
Darren Gipson is currently offline Darren Gipson
Messages: 3
Registered: April 2013
Junior Member
If anyone else comes across this issue, please make sure you choose the following option when exporting the package.

* Package required libraries into generated JAR
Previous Topic:Printing with BIRT Web Viewer and Tomcat
Next Topic:prevent sql injection in dataset
Goto Forum:
  


Current Time: Thu Oct 23 08:06:55 GMT 2014

Powered by FUDForum. Page generated in 0.01933 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software