Battle_Slug
Battle_Slug

Reputation: 2105

JavaBean as Datasource in iReport: “General рroblem: null” (jar is in the classpath!)

I am using JasperReports 5.6 via API. I am building a report using iReport. The problem is that I've already set a jar with bean factory in the classpath of iReport as

com.myname.beanproject.beanpackage.BeanFactoryClass

Also I set up static method to call a list of beans:

getListEntries

but still getting a error while testing a connection. What am I doing wrong?

Error is not helpful at all:

General problem: null

As I can see, the problem is not in classpath neither factory: when I change any, the error is changing either to

"No class found"

(if I add something to class name)

or

"General problem: com.myname.beanproject.beanpackage.BeanFactoryClass.getListEntries11111()"

(if I add 11111 to the name of factory method to test)

Upvotes: 3

Views: 1781

Answers (2)

Ismail
Ismail

Reputation: 75

Your getListEntries() method should be static and public too that way , ireport can deal with it :) i ran into the same problem, i had put my method like that

protected static getmyBeans().....

i fix the connection test after i put

public static getmyBeans()..... 

in my factoryClass so check your method defenition and dont forget to rebuild your jar code and restart ireport good luck, and sorry if i do mistakes in my english language

Upvotes: 3

Riccati
Riccati

Reputation: 447

I just ran into the same problem. Your getListEntries() method should be static. That fixed it for me.

Upvotes: 0

Related Questions