Cannot use my Java classes working with Jasper Reports: ClassNotFoundException - java

I have installed JasperReports Studio 6.17 in order to generate reports with Jasper Reports. Everything is ok, i can define my templates (jrxml files), filled them with jdbc or cvs remote data, and export them correctly to several formats.
The problem is when i try to use one my own Java classes such as Scritplett or as functions expressions. There is no way to recognize my classes. ClassNotFoundException is thrown each time.
Build path seems to be ok. All depedencies seems to be correct also, but i am not able to extend the functionality interacting with my Java classes. Any idea? Thanks in advance.
pd: I am not generating reports on the fly, just from the template, declaratively.

After asking to the Jasper Community, they have given me a solution.
Its a bug in the 6.17 version. In order to solved it, just add an extra jar to the plugin installation folder, relaunch Jasper with -clean option and done. Now I can refer and use my own classes within the report.
Details here: https://community.jaspersoft.com/jaspersoft-studio/issues/13616#comment-873711
Also told me that a new release is comming and will fix this issue.

Related

How to properly add craftbukkit/spigot/paper as an external library in Eclipse?

I'm having issues including bukkit/spigot/paper into my Eclipse since when I try "extends JavaPlugin" in my Class it does not seem able to import the file
I have tried versions of craftbukkit, spigot and paper on several occasions but it just does not seem to work:
From all the online tutorials I have seen, I have noticed that on their versions of eclipse the "Modulepath" and "Classpath" headings do not seem to be there, but for me they are right there:
Could someone please tell me how to fix this issue?
I'm using Intellij IDEA and there is a plugin that create all the file on it, if you really want a clean environment use this to create your project and go back on eclipse after, i can create it and send you the main folder if you can provide you paper version that you want
You cannot use paper as a External JAR. Instead download Bukkit or Spigot from the internet (or use BuildTools to compile your own jar file), and use those instead of paper.

How to setup allure for selenium +TestNG+java project?

I used extent report with java selenium for the automation testing but I would like to try allure reporting. Can anyone please explain to me how to setup Allure+ TestNG+ selenium in eclipse for automation?
Does it supports only maven based projects or even for java projects as well we can do it? Thanks
There is no pom.xml file in my current java project ...so this is a doubt if I can implement
It's fairly simple. If you don't have a pom that means you are possibly using ant to build your tests. That's not an issue. What you can do is, download the allure .jar file. Add it to your project and off you go. With allure, there is no setup required. You will, however, need to implement annotations in your classes where you would like allure yo log things.
Here is an example :
Allure will then log your tests and steps as you would suspect natively. If you want screenshots and all the other goodies you would need to implement it. The docs can help with this part.
Here is the link to the jar file for allure - https://jar-download.com/artifact-search/allure-testng
Have a nice day!
If you are not using pom, then based on latest version which is available at the time you need following JAR files to be added in build path of your project in eclipse .
In my example I would be using version 2.9.0
allure-testng-2.9.0.jar
allure-model-2.9.0.jar
allure-java-commons-2.9.0.jar
allure-descriptions-javadoc-2.9.0.jar
sl4j-api-1.x.x.jar
Finally you need allure-commandline-2.9.0.zip .choose same version which you have downloaded above files.
Extract and set the path as described in the link -https://docs.qameta.io/allure/#_manual_installation
Hope It helps! Thanks

Info about version dependancies of enterprise java libraries

I am new to enterprise application developement and trying to create a REST server with Spring REST, JPA taking to mySQL database and Javascript on the client side. As I see loads of opensource libraries doing specific task, I started off with using 'maven project' with different 'arch type' (which is nothing but predefined POM with relevent libraries as I understand) provided by Eclipse. But I often run into version mismatch issues, in many cases found specific solution to that perticular libraries in StackOverflow or other sites.
Hence I started looking for a information these version dependancies such as, this version of JPA works with that version of Hibernate library and so on. I checked maven repository of major libraries, I did not find such information so far.
My queries are:
Where can I find these information about the versions dependancies?
Are these pre defined POM in eclipse reliable? Who owns them, where can I get last modified dates on these maven 'arch types'? (I find the ones I choose having fairly old version of libraries).
If I have to start off on my own creating a Maven dependacies, where will I get information about what are the dependent libraries, for example, if I need spring MVC, for sure it needs java servlet library. I am worried becuase the maven 'spring-mvc-jap' arch type whooping 50 libaries as dependancies.(Coming from embeded domain, I find to too hard to digest :D). So not sure if it is the right way.
Please correct if I am missing anything in my understanding.
You can find this information, if you are using maven and some IDE you can go to the dependancy and make click un > and this will show the librarys used for this dependancy or if you want to use the console you have http://maven.apache.org/plugins/maven-dependency-plugin/examples/resolving-conflicts-using-the-dependency-tree.html this will show the same that the IDE.
After normally in the documentation of the library used, you can find some doc about the dependancy about this.
Other solution is get the .jar and use 7zip to see the POM and know the dependancy used.
And for finish my answer if the IDE tell you that you dont have x dependancy normally you have to add this because any of the other dependancy used have it (they used only for the compiling task), but sometime somes projet change a lots of code between the version .a to .b so you will have some problem using the version .b, at this moment i didnt find one good and easy way to fix this, only using the way that i told you (only if i found some problem in the compilation)
3> I am not sure how it works in eclipse but in IntelliJ IDEA when you start using some class without proper dependency IDEA suggest you to add proper dependency automatically. The same approach should be in eclipse.

How can I add custom fonts on Maven for Jasper Reports

I been trying to follow the example on this page:
http://grysz.com/2010/06/01/use-custom-fonts-in-jasperreports-pdf-exporter/
Still, when I ran the reports on maven, I get that my font is not available to the JVM at run-time as an error from tomcat.
Anyone has had experience adding fonts to Maven for a jasper report and can give me a little better instructions to accomplish this? I been trying this already for too long and it does not seem to work correctly.
Thanks,
Patrick
Using iReport you can export fonts as an extension.
Then you
can place your font.jar in your application and create an system-scope-dependency,
or you can maven install your font into your repository.
By the way:
You can skip those error-messages using the jasperreports.properties.
# ignore missing fonts in reports
net.sf.jasperreports.awt.ignore.missing.font=true

How do you figure out with Eclipse which JARs depend on which one?

I've trying to use Eclipse JDT AST parsing classes. After including the initial JAR, and sorting out a couple more dependencies, it is with 7+ JARs and I still having NoClassDefFoundError exceptions. This situation arises whenever I'm trying to test libraries with little or no documentation. Trial and error seems a very dumb (and annoying) approach to solve this problem.
Is there a way to automatically sort this out using Eclipse?
Update: Later I found that adding all the JARs you have, and using Ctrl-T (to view/locate types), lets you manually locate the JAR. That was the solution that Google provided so far. Is there a better way?
If you refer to this SO question Finding unused jars used in an eclipse project, you also have:
ClassPathHelper, which can quickly focus on unresolved classes:
It automatically identifies orphan jars, blocked (obscured) classes, and much more.
The only limit is dependencies that are not defined in classes, e.g. in dependency injection framework configuration files.
I have found setting up a workspace exclusively for browsing the eclipse source code incredibly useful. In this manner, you can use PDE tools like the Plug-in Spy, bundle dependency analysis, browsing the documentation, etc much like you would your own plugin projects. I found this article at Vogella a very useful guide.
If you know which bundle your desired class is you can generate the transitive closure of dependencies by creating a new OSGi launch configuration, with just the single bundle selected. By hitting the Add Required button, you can see all bundles necessary to use the one you're interested in.
Edit:
From your question it wasn't clear as to the environment you want to run the compiler in. If you're interested in an embeddable Java compiler to be run outside of an OSGi environment, may I suggest Janino.
You could use a dependency analyzer like:
JarAnalyzer
This will parse a directory full of Jars and give you an XML output dependency map, for which there are several tools for displaying in either graphical or text form.

Categories

Resources