BIRT report created via eclipse throwing error on execution - java

I've a particular birt project which I've created using the eclipse ide. I am trying to understand how to deploy the report without having to use alternatives which would cost something.
So ultimately I am left with the birt report engine api. I've downloaded the report engine runtime package from the birt-exchange web site. I've found a particular script (ms-dos batch file - genReport.bat) which can generate reports from the rptdesign file.
There are particular some basic sample reports in this package which demonstrate how we can generate a report. The script is able to execute against these sample reports. However when I try to execute the script against a reports I've created via the birt-eclipse ide I get the following error. (I've pasted it right out of the command prompt):
Oct 13, 2009 2:14:46 PM org.eclipse.birt.report.engine.api.impl.ReportEngineHelp
er openReportDesign
SEVERE: invalid design file file:/C:/Documents%20and%20Settings/arun.jayapal/wor
kspace/atsusersReport/atsUsers.rptdesign
Oct 13, 2009 2:14:46 PM org.eclipse.birt.report.engine.api.ReportRunner runAndRe
nderReport
SEVERE: The design file file:/C:/Documents%20and%20Settings/arun.jayapal/workspa
ce/atsusersReport/atsUsers.rptdesign has error and can not be run.
org.eclipse.birt.report.engine.api.EngineException: The design file file:/C:/Doc
uments%20and%20Settings/arun.jayapal/workspace/atsusersReport/atsUsers.rptdesign
has error and can not be run.
at org.eclipse.birt.report.engine.api.impl.ReportEngineHelper.openReport
Design(ReportEngineHelper.java:258)
at org.eclipse.birt.report.engine.api.impl.ReportEngineHelper.openReport
Design(ReportEngineHelper.java:193)
at org.eclipse.birt.report.engine.api.impl.ReportEngineHelper.openReport
Design(ReportEngineHelper.java:127)
at org.eclipse.birt.report.engine.api.impl.ReportEngine.openReportDesign
(ReportEngine.java:349)
at org.eclipse.birt.report.engine.api.ReportRunner.runAndRenderReport(Re
portRunner.java:192)
at org.eclipse.birt.report.engine.api.ReportRunner.execute(ReportRunner.
java:165)
at org.eclipse.birt.report.engine.api.ReportRunner.main(ReportRunner.jav
a:120)
Caused by: Error.DesignFileException.INVALID_XML - 1 errors found!
1.) ( line = 0, tag = null) org.eclipse.birt.report.model.parser.DesignParserE
xception (code = Error.DesignParserException.UNSUPPORTED_VERSION, message : The
report file of version "3.2.20" is invalid for it is greater than the latest sup
ported one.)
at org.eclipse.birt.report.model.parser.ModuleReader.readModule(ModuleRe
ader.java:116)
at org.eclipse.birt.report.model.parser.DesignReader.read(DesignReader.j
ava:88)
at org.eclipse.birt.report.model.core.DesignSession.openDesign(DesignSes
sion.java:321)
at org.eclipse.birt.report.model.api.SessionHandle.openDesign(SessionHan
dle.java:294)
at org.eclipse.birt.report.engine.parser.ReportParser.getDesignHandle(Re
portParser.java:158)
at org.eclipse.birt.report.engine.api.impl.ReportEngineHelper.openReport
Design(ReportEngineHelper.java:253)
... 6 more
Caused by: org.eclipse.birt.report.model.parser.DesignParserException: The repor
t file of version "3.2.20" is invalid for it is greater than the latest supporte
d one.
at org.eclipse.birt.report.model.parser.ModuleState.parseAttrs(ModuleSta
te.java:112)
at org.eclipse.birt.report.model.parser.ModuleParserHandler.startElement
(ModuleParserHandler.java:229)
at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.startEle
ment(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.dtd.XMLDTDValidator.startElem
ent(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImp
l.scanStartElement(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl$Conten
tDriver.scanRootElementHook(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImp
l$FragmentContentDriver.next(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl$Prolog
Driver.next(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(U
nknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImp
l.scanDocument(Unknown Source)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(U
nknown Source)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(U
nknown Source)
at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(Unknown So
urce)
at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(Un
known Source)
at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.p
arse(Unknown Source)
at javax.xml.parsers.SAXParser.parse(Unknown Source)
at org.eclipse.birt.report.model.parser.ModuleReader.readModule(ModuleRe
ader.java:94)
How to resolve this?

I've recently done a BIRT deployment and find that it can be kind of finicky. I had the error you're describing when I tried to load and preview reports in eclipse that were generated by someone running a later version of the BIRT eclipse tools.
It looks like the samples you have are out of sync with the environment you're trying to run it on. Try upgrading the environment (since you're in eclipse, that would be your installed birt reporting plugins).

Related

Klockwork Error with dependency (SqliteAgent)

Good afternoon,
I am trying to add the klockwork plugin in QNX (eclipse based) which is using Java 1.6 version (It is needed this version). I have Klockwork version 9.6 installed. But I have some problems.
The results on the internet say that we need to add a variable in the system: _JAVA_OPTIONS = -Djava.net.preferIPv4Stack=true but it still doesn't work.
When I look for something about sql in the Klockwork installation folder, there is a file called sqlite_jni . But it is strange that it does not work because of a dependency on Klockwork when Klockworks desktop works fine.
When I execute eclipse with debug mode enabled, It shows these errors:
Exception in thread "Thread-3" java.lang.UnsatisfiedLinkError: no sqlite_jni in java.library.path at java.lang.ClassLoader.loadLibrary(Unknown Source) at java.lang.Runtime.loadLibrary0(Unknown Source) at java.lang.System.loadLibrary(Unknown Source) at com.klocwork.desktopdb.SqliteJniLoader.initDefaultLibraries(SqliteJniLoader.java:28) at com.klocwork.desktopdb.SqliteAgent.(SqliteAgent.java:21) at com.klocwork.inforceeclipse.problems.LocalProblemsStorage.readProblemUpdates(LocalProblemsStorage.java:95) at com.klocwork.inforceeclipse.problems.AbstractProblemsStorage.reloadProblems0(AbstractProblemsStorage.java:186) at com.klocwork.inforceeclipse.problems.AbstractProblemsStorage$1.run(AbstractProblemsStorage.java:159) at java.lang.Thread.run(Unknown Source)
WARN : [com.klocwork.licensing.LibInfo:41]: Could not determine library path:
ERROR: [com.klocwork.licensing.FlexLicenseServer:92]: Warning: Cannot find valid loccounter (loccounter.dll) Exception in thread "Thread-13" java.lang.NoClassDefFoundError: Could not initialize class com.klocwork.desktopdb.SqliteAgent at com.klocwork.inforceeclipse.problems.LocalProblemsStorage.readProblemUpdates(LocalProblemsStorage.java:95) at com.klocwork.inforceeclipse.problems.AbstractProblemsStorage.reloadProblems0(AbstractProblemsStorage.java:197) at com.klocwork.inforceeclipse.problems.AbstractProblemsStorage$1.run(AbstractProblemsStorage.java:159) at java.lang.Thread.run(Unknown Source)
And also It appears this dialog:
Database dialog error
Best regards and thanks in advance!
The first thing is that klockwork is compatible with QNX 32 bits.
Secondly, the klockwork lib should be added to the path:_ Klocwork\USERX\lib\ix86-pc-win32.
That's all!
Thanks.

Jenkins Tomcat deploymet error

I have been using Jenkins for quite some time for Continuous integration with my Java projects.
Recently I tried the Jenkins Deploy Plugin (https://wiki.jenkins-ci.org/display/JENKINS/Deploy+Plugin) to deploy my war file on tomcat 7. However, I am unable to do so as I am getting the following error:
Deploying C:\Program Files (x86)\Jenkins\jobs\MY_PROJS\workspace\target\projs.war to container Tomcat 7.x Remote
[C:\Program Files (x86)\Jenkins\jobs\MY_PROJS\workspace\target\projs.war] is not deployed. Doing a fresh deployment.
Deploying [C:\Program Files (x86)\Jenkins\jobs\MY_PROJS\workspace\target\projs.war]
ERROR: Publisher hudson.plugins.deploy.DeployPublisher aborted due to exception
org.codehaus.cargo.container.ContainerException: Failed to deploy [C:\Program Files (x86)\Jenkins\jobs\MY_PROJS\workspace\target\projs.war]
at org.codehaus.cargo.container.tomcat.internal.AbstractTomcatManagerDeployer.deploy(AbstractTomcatManagerDeployer.java:115)
at org.codehaus.cargo.container.tomcat.internal.AbstractTomcatManagerDeployer.redeploy(AbstractTomcatManagerDeployer.java:187)
at hudson.plugins.deploy.CargoContainerAdapter.deploy(CargoContainerAdapter.java:64)
at hudson.plugins.deploy.CargoContainerAdapter$1.invoke(CargoContainerAdapter.java:90)
at hudson.plugins.deploy.CargoContainerAdapter$1.invoke(CargoContainerAdapter.java:77)
at hudson.FilePath.act(FilePath.java:914)
at hudson.FilePath.act(FilePath.java:887)
at hudson.plugins.deploy.CargoContainerAdapter.redeploy(CargoContainerAdapter.java:77)
at hudson.plugins.deploy.DeployPublisher.perform(DeployPublisher.java:47)
at hudson.tasks.BuildStepMonitor$3.perform(BuildStepMonitor.java:45)
at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:804)
at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:776)
at hudson.maven.MavenModuleSetBuild$MavenModuleSetBuildExecution.post2(MavenModuleSetBuild.java:1030)
at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:725)
at hudson.model.Run.execute(Run.java:1695)
at hudson.maven.MavenModuleSetBuild.run(MavenModuleSetBuild.java:519)
at hudson.model.ResourceController.execute(ResourceController.java:88)
at hudson.model.Executor.run(Executor.java:231)
Caused by: java.io.IOException: Error writing request body to server
at sun.net.www.protocol.http.HttpURLConnection$StreamingOutputStream.checkError(Unknown Source)
at sun.net.www.protocol.http.HttpURLConnection$StreamingOutputStream.write(Unknown Source)
at java.io.BufferedOutputStream.flushBuffer(Unknown Source)
at java.io.BufferedOutputStream.write(Unknown Source)
at org.codehaus.cargo.container.tomcat.internal.TomcatManager.pipe(TomcatManager.java:583)
at org.codehaus.cargo.container.tomcat.internal.TomcatManager.invoke(TomcatManager.java:501)
at org.codehaus.cargo.container.tomcat.internal.TomcatManager.deployImpl(TomcatManager.java:547)
at org.codehaus.cargo.container.tomcat.internal.TomcatManager.deploy(TomcatManager.java:273)
at org.codehaus.cargo.container.tomcat.internal.TomcatManager.deploy(TomcatManager.java:256)
at org.codehaus.cargo.container.tomcat.internal.TomcatManager.deploy(TomcatManager.java:240)
at org.codehaus.cargo.container.tomcat.internal.AbstractTomcatManagerDeployer.deploy(AbstractTomcatManagerDeployer.java:107)
... 17 more
java.io.IOException: Error writing request body to server
at sun.net.www.protocol.http.HttpURLConnection$StreamingOutputStream.checkError(Unknown Source)
at sun.net.www.protocol.http.HttpURLConnection$StreamingOutputStream.write(Unknown Source)
at java.io.BufferedOutputStream.flushBuffer(Unknown Source)
at java.io.BufferedOutputStream.write(Unknown Source)
at org.codehaus.cargo.container.tomcat.internal.TomcatManager.pipe(TomcatManager.java:583)
at org.codehaus.cargo.container.tomcat.internal.TomcatManager.invoke(TomcatManager.java:501)
at org.codehaus.cargo.container.tomcat.internal.TomcatManager.deployImpl(TomcatManager.java:547)
at org.codehaus.cargo.container.tomcat.internal.TomcatManager.deploy(TomcatManager.java:273)
at org.codehaus.cargo.container.tomcat.internal.TomcatManager.deploy(TomcatManager.java:256)
at org.codehaus.cargo.container.tomcat.internal.TomcatManager.deploy(TomcatManager.java:240)
at org.codehaus.cargo.container.tomcat.internal.AbstractTomcatManagerDeployer.deploy(AbstractTomcatManagerDeployer.java:107)
at org.codehaus.cargo.container.tomcat.internal.AbstractTomcatManagerDeployer.redeploy(AbstractTomcatManagerDeployer.java:187)
at hudson.plugins.deploy.CargoContainerAdapter.deploy(CargoContainerAdapter.java:64)
at hudson.plugins.deploy.CargoContainerAdapter$1.invoke(CargoContainerAdapter.java:90)
at hudson.plugins.deploy.CargoContainerAdapter$1.invoke(CargoContainerAdapter.java:77)
at hudson.FilePath.act(FilePath.java:914)
at hudson.FilePath.act(FilePath.java:887)
at hudson.plugins.deploy.CargoContainerAdapter.redeploy(CargoContainerAdapter.java:77)
at hudson.plugins.deploy.DeployPublisher.perform(DeployPublisher.java:47)
at hudson.tasks.BuildStepMonitor$3.perform(BuildStepMonitor.java:45)
at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:804)
at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:776)
at hudson.maven.MavenModuleSetBuild$MavenModuleSetBuildExecution.post2(MavenModuleSetBuild.java:1030)
at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:725)
at hudson.model.Run.execute(Run.java:1695)
at hudson.maven.MavenModuleSetBuild.run(MavenModuleSetBuild.java:519)
at hudson.model.ResourceController.execute(ResourceController.java:88)
at hudson.model.Executor.run(Executor.java:231)
Thanks in advance for your help.
In most cases, errors like this are simply caused by URL parameter being incorrect.
See similar issue documented/resolved here where URL parameter was the culprit. Additionally, I highly reccomend thoroughly covering Apache Manager Documentation.
However, as mentioned in above comment, this may also be caused by version mismatch between the application itself and what is actually being deployed.

WebStart of Java EAR application failing from Glassfish 3.1.2.2

I built a small test Java EE Entreprise Application using NetBeans. Everything works fine in NetBeans (version 7.3) when I run/debug it.
I'm now trying to deploy the test app using WebStart. To do so, I have setup a GlassFish server of the same version that is in NetBeans (GF 3.1.2.2) and I have the JDK Version 7 U 51 installed on the machine. For right now, I'm trying to run the WebStart app on the same machine that GlassFish is on so I'm guessing it's using JRE 7U51 also.
However, when I launch the client application from within GlassFish admin page (app deployed fine), I get a NullPointerException.
Here's the full exception trace:
java.lang.NullPointerException
at java.io.StringReader.<init>(Unknown Source)
at org.glassfish.appclient.client.JWSAppClientContainerMain.insertMaskingLoader(JWSAppClientContainerMain.java:186)
at org.glassfish.appclient.client.JWSAppClientContainerMain.main(JWSAppClientContainerMain.java:132)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at com.sun.javaws.Launcher.executeApplication(Unknown Source)
at com.sun.javaws.Launcher.executeMainClass(Unknown Source)
at com.sun.javaws.Launcher.doLaunchApp(Unknown Source)
at com.sun.javaws.Launcher.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Here's the JNPL file I get from GlassFish when I want to WebStart the application:
http://pastebin.com/HPddJA3a
Please note that the JNPL file is autogenerated by GlassFish... my EAR doesn't contain one.
This is my first deployment and I've tried many things.... please help! :)
EDIT: More details on how I deploy and access the client app:
I uploaded the EAR file to Glassfish using the admin console (port 4848) and that deployment is successful (no error messages). Then, in the admin console, I see all my EE components (EJB, app jar, etc) and I can launch the client app. This just links to the following URL: http://server-test.com:8080/EEAppTest/EEAppTestEEClient (not a real URL). When I access it, I get the NullPointerException described above.

Lauch Eclipse SWT window application from command line error

First off. I am a newbie and green with respect to Java programming.
I created a Java Eclipse "SWT" "Application Window" on a Eclipse Kepler 4.3.1 (32-bit) running WindowBuilder and SWT (swt.jar). The design view is a composite.
The java application runs fine from Eclipse. I simply press the play button and presto.
Problem:
Issuing
java -cp . PkgNetAccelerator32.netAcceleratorApp
yields the following error message:
Exception in thread "main" java.lang.NoClassDefFoundError: org/eclipse/swt/widgets/Composite
at java.lang.Class.getDeclaredMethods0(Native Method)
at java.lang.Class.privateGetDeclaredMethods(Unknown Source)
at java.lang.Class.getMethod0(Unknown Source)
at java.lang.Class.getMethod(Unknown Source)
at sun.launcher.LauncherHelper.getMainMethod(Unknown Source)
at sun.launcher.LauncherHelper.checkAndLoadMain(Unknown Source)
Caused by: java.lang.ClassNotFoundException: org.eclipse.swt.widgets.Composite
at java.net.URLClassLoader$1.run(Unknown Source)
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
... 6 more
I was doing some research and several posts on other issues suggested that the cure is to create a manifest. I saw an article that said something like:
Select the src folder, right click and select export, then Java, then JAR file, specify Manifest.jar and a path on the folder, make sure the "Generate the manifest file" is selected, and press finish.
I created the manifest file and tried launching it with the following command line:
java -jar ../Manifest.jar -cp . PkgNetAccelerator32.netAcceleratorApp
That yielded the same error message above.
I saw another article that said that one should add in the swt.jar file, but that is taken care of by the manifest. No? Specifying "swt.jar" instead of the manifest that I created resulted in an error message:
no main manifest attribute, in ../swt.jar
That error message makes sense.
I am at a loss. How do I run the java application?
I am testing on my Windows 7 Professional 64-bit desktop, but I need to run on CENTOS too. That should be no problem, as I assume whatever the fix on Windows is, will work on CENTOS.
UPDATE:
I placed the two lib files in a /lib folder to match the answer given. I then issued the following command line and got the following error message.
C:\SoftDev\Projects\NetAccelerator\JavaWorkspace\NetAccelerator32>java -cp "bin/*;lib/*" PkgNetAccelerator32.netAcceleratorApp
Exception in thread "main" java.lang.UnsatisfiedLinkError: Cannot load 32-bit SWT libraries on 64-bit JVM
at org.eclipse.swt.internal.Library.loadLibrary(Unknown Source)
at org.eclipse.swt.internal.Library.loadLibrary(Unknown Source)
at org.eclipse.swt.internal.C.<clinit>(Unknown Source)
at org.eclipse.swt.widgets.Display.<clinit>(Unknown Source)
at PkgNetAccelerator32.netAcceleratorApp.open(netAcceleratorApp.java:43)
at PkgNetAccelerator32.netAcceleratorApp.main(netAcceleratorApp.java:33)
I found the following article, which produces a command line that works, just that is not reasonable for sending. I much rather use the answer.
Lets assume you have a eclipse project structure similar to this:
Workspace
-> Project
-> src (source code directory)
-> bin (compiled byte code directory as JAR)
-> lib (jar directory)
-> .classpath (eclipse file)
-> .project (eclipse file)
I am assuming that you are exporting the JAR as an executable JAR.
So in order to run a class in that exported JAR with another JAR from the lib directory (swt.jar) while your working directory is the Project directory you will need to execute:
java -cp "bin/*:lib/*" PkgNetAccelerator32.netAcceleratorApp
Using wildcards requires Java 6 or later
Please note: CENTOS requires : as a path separator. Windows uses a semi-colon.
This will add your classes and the swt classes onto the classpath and run your main class PkgNetAccelerator32.netAcceleratorApp
SWT 32bit vs 64bit
You will either need to use a 32bit JVM locally or continue to use a 64bit JVM and use the 64bit version of swt; see swt on windows 64 bit. I would suggest you match your version of your local JVM (32bit or 64bit) with the version that you will be running on the CENTOS machine. You will however need a different swt jar for CENTOS.

Eclipse RCP cannot find EclipseStarter

I have an RCP application to develop; the code was written a couple of years ago, and I have to finish it. I imported the plugins in Eclipse, I solve all the dependencies, but when I try to launch it I get this error:
!SESSION Tue Mar 29 10:13:24 CEST 2011
-----------------------------------------
!ENTRY org.eclipse.equinox.launcher 4 0 2011-03-29 10:13:24.326
!MESSAGE Exception launching the Eclipse Platform:
!STACK
java.lang.ClassNotFoundException:
org.eclipse.core.runtime.adaptor.EclipseStarter
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:617)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:575)
at org.eclipse.equinox.launcher.Main.run(Main.java:1408)
at org.eclipse.equinox.launcher.Main.main(Main.java:1384)
I try to reinstall the Eclipse zip (deleting all and reunzipping it), but it still not work. I try to start the application with the -clean option to rebuild the cache, but it still not work. But if I create some dummy hello-plugin with hello-feature and hello-product, all works fine. Anyone have some hints to solve this problem? Thanks.
Ok the problem is solved, i just change the option The product configuration is based on from features to plug-ins and add all the dependencies with the button Add Required Plug-ins. I don't know if this is the correct way, it just work.
I had the exact same issue.
My OS is windows 7. I opened Eclipse (really RAD in my case) as an administrator. Opened with out any issues.

Categories

Resources