By: akmalkhan - akmalkhan
ClassNotFound : Class path error from iReport
When i design report using JavaBean ,iReport is not deducting my Bean and says that Bean is not available in classpath. But i included that class into classpath using menu. But still it says error.
Pls how to connect my Bean from iReport. Where to set class path.
If you have any screen shot or demo , pls send it too.
I believe the problem lies with the implementation of the iReport's classpath's classloader. The "missing" classes are found in a separate classloader rather then the Class that complaints the missing class.
I have the same issue - the reports DOES compile, but there is a constant 'problem' being reported.
The class IS in the classpath, AND the package is being imported by the report.
There is no way that I can put the application in the iReport lib directory - that's NOT a solution. A PROPER fix is LONG overdue, I'd say.
In fact, You are not really need to create a JAR for the same. You can directely map your classes from the project folder.
I am going to post my way I used to get rid of it.
1. go to "Tools->Options->iReport" and then select the CLASSPATH tab
2. click on 'Add Folder' the select the directory contains classes (eg:- "ProjectPath\target\classes")
3. Click OK, You are done with class path now.
4. click on add DataSource Button from the top header buttons. A window will gets open.
5. Click on "New" on the right PAN of the last window.
6. Choose JavaBeans set datasource, click next.
7. enter any name you want to give to your datasource.
8. In the factory class option enter the fully qualified class path of your bean (eg: com.jasper.bean.BeanClass)
9. Select the radio button (Either a Collection/ ArrayList depending on your bean retreiving method)
10. In The static method area give the name of the retreivaial method (eg:- listAllBean)
11. click on 'Test'
12. If you are succeed click on SAVE.
Hope it helps.