I have created a jasper report using Jaspersoft Studio 6.19.1. This report utilizes a referenced jar file. The report works fine when running it locally. However, I'm getting an error when running the report from the repository. The error is unable to resolve referenced java class. My question what is the correct way to add and configure a jar file to the server?
Thank you
Related
I am using Jasper Reports in my Grails 3 application to generate PDF files. I had some issue with Jasper Report plugin for Grails. So we are using Jasperreport jars to generate the PDF.
compile 'net.sf.jasperreports:jasperreports:6.2.1'
I created a 'JasperReports' in project level and added all the jrxml and jasper files. In the development environment I use the below way to compile the report.
jasperReport = JasperCompileManager.compileReport('JasperReports/FYF_Report.jrxml')
Everything works fine in development but when the war is generated it is not including the 'JasperReports' folder. I tried adding the folder in conf but it did not work.
Let me know if I am missing any configuration to include the 'JasperReports' folder in war.
I resolved the issue by adding the JasperReports folder in src/main/webapp. Path to access the files will be different in local and Production, So I am getting the real path from context as below
def sc=session.getServletContext()
def reportsPath=sc.getRealPath("/")
jasperReport = JasperCompileManager.compileReport(reportsPath+'JasperReports/FYF_Report.jrxml')
I am trying to create a web service using axis2.
I have created it.
I am following the below steps for getting the wsdl info.
Right click Project -> Run on server -> Next.
No class found error is coming. Is any jar file is required.
Please guide me how to resolve this.
Error: java.lang.NoClassDefFoundError: org/apache/ws/commons/schema/utils/NamespaceMap at org.apache.axis2.deployment.util.Utils.fillAxisService(Utils.java:437) at org.apache.axis2.deployment.ServiceBuilder.populateService(ServiceBuilder.java:396) at org.apache.axis2.deployment.repository.util.ArchiveReader.buildServiceGroup(ArchiveReader.java:109) at org.apache.axis2.deployment.repository.util.ArchiveReader.processServiceGroup(ArchiveReader.java:232) at org.apache.axis2.deployment.ServiceDeployer.deploy(ServiceDeployer.java:154) at
You can download and include the XmlSchema jar in the lib folder of your dynamic web project /WebContent/WEB_INF folder.
But, this will only solve the problem temporarily. On creating WS client the XMLSchema jar will not get included. So check the compatibility of the version of your server with axis2 version (like Tomcat 6 created problem with axis2 1.7 but works fine with axis2 1.5.2).
On successful compatibility the XMLSchema jar will get included in the respective folder automatically.
You can correct your issue by referencing the XmlSchema jar in the lib folder. You can find the latest version of the jar file in the link below.
http://www.java2s.com/Code/Jar/x/DownloadXmlSchema142jar.htm
I am using Jasper Reports 5.2.0 and Spring MVC with Maven.
I have done reports using JasperViewer, but suddenly I am getting this error that can't be resolved:
net.sf.jasperreports.engine.util.JRFontNotFoundException: Font '
net/sf/jasperreports/fonts/pictonic/pictonic.ttf
net/sf/jasperreports/fonts/pictonic/pictonic.svg
net/sf/jasperreports/fonts/pictonic/pictonic.eot
net/sf/jasperreports/fonts/pictonic/pictonic.woff
' is not available to the JVM. See the Javadoc for more details.
Delete the jar extra placed jars in your lib folder it works properly
or use same version jar file in maven dependency and webroot ->lib folder or in class path
For me, in one instance, the problem was with the jasperreports version as I had more that one jasperreports jar in my classpath.
My reports were compiled with jasperreports-5.6.0 and in my classpath jasperreports-4.1.1.jar was also included and accidentally jasperreports-4.1.1.jar was "up" in the Build class path order.
Actually, my eclipse project had jasperreports-5.6.0 as a library jar and this project had another project as "Required projects in the build path" that contained the old version of jasperreports.
I moved the jasperreports-5.6.0 to "Up in the build classpath order" than the old version, and the problem got resolved.
Again, later I removed the project dependency and got the problem resolved as well.
So check, whether you have more than one jasperreports library anyhow; if so, remove the unnecessary duplicate jar.
The Problem is one of the fonts you used in Jasper Reports not installed in the system. The solution is to install all missing fonts. Another alternative is to use only the fonts "Serif" and "San-Serif" which eliminates the need of installing fonts seperately and would even work when the code is moved accross different servers.
My Report works fine in iReport designer.
But when I try to run it on JasperServer it is giving me the following exception:
java.lang.Exception: 1 - oracle.jdbc.driver.OracleDriver
I have ojdbc6.jar in the classpath.
I have resolved the issue myself.
The problem was I haven't restarted the jasper server.
I had put the jar in the following path:
C:/Program Files/jasperreports-server-cp-4.5.0/apache-tomcat/lib
After having the jar in the classpath, I restarted the jasper server. Even then, it was not working and I restarted the PC and now it's working.
Thanks simont and mdhahlman for responding.
Open iReport, go to Tools > Otions > Ireport > CLASSPATH, Then Add your oracle ODBC jar file there.
I'm using JasperReports 3.7.6 with NetBeans 6.9.1 and iReport 3.7.6. I have a report that uses scriptlets. When I run it from iReport everything is fine because I can tell iReport where to find the .jar file with the scriptlets. When I run that same report from a JSF-2.0 application the fields that rely on the scriptlet are not being populated correctly - i.e. the scriptlet isn't being called. I've tried putting the scriptlet in the project's library folder and I've tried copying the package containing the scriptlet into the project. Neither has worked. I'm not sure how I can get the report to call the scriptlets when it is run from my JSF project. Can anyone shed some light on this for me?
Ugh. What is it with me and rookie mistakes? I have my JSF project pulling the .jasper files from a specific locations. To that end I have my iReport compiling the reports to that particular file location. At some point in the past week I was fiddling with another report and didn't want it to go to the same location as my project reports ... so I changed the compile location in iReport. It was after that when I created all the scriptlet functionality. When I added the scriptlet functionality and compiled the reports, I forgot to change the compile location back to the project report folder. The reports were compiling elsewhere. So my project was using the old versions of the report files. Updating the compile location in iReport and recompiling the reports fixed the issue. The .jar file in my library works fine.