Jump to content
We've recently updated our Privacy Statement, available here ×

iReports with Hibernate Question


AndrewWA

Recommended Posts

Hi,

I'm using iReports 2.0.0 with Hibernate, or at least i'm trying to. Everytime I try to test my Hibernate connection it comes up with the error like "Error Reading Resource : blah/model/Address.hbm.xml". My Hibernate stuff all works in Eclipse and deployed on JBoss so i'm happy that my mappings are correct. I've narrowed the problem down the the version mapping within each file, if i remove iReports has no problem with that file.

 

Code:
<version name="version" type="int">
<column name="version" not-null="true" />
</version>

 

Thats the column in question.

 

Is there a reason this doesn't work in iReports and is there a workaround for it without changing all my mapping files?

 

Andrew Aitken

Link to comment
Share on other sites

  • Replies 4
  • Created
  • Last Reply

Top Posters In This Topic

  • 5 months later...

You can actually encounter two kinds of errors ...

 

1) "Error reading resource ..."

2) "Could not parse mapping document from resource ..."

 

Ensure that you have the right hibernate3.jar file (ireport2.0.3 ships with hibernate jar from 3.0.5). Changing the hiberante3.jar from the 3.2 version seems to fix the first error.

 

For the second one, try adding the classes directory (where the java classes that are mapped are found) to the CLASSPATH setting in iReport (Options->Classpath).

 

--

Zac George

Link to comment
Share on other sites

  • 3 years later...

plz any one can help me,

i'm unable to connect hibernate from ireport 1.3 and i hv one more problem is where to save hibernate.cfg.xml file.

i  wrote configuration file and saved on desktop,but when i connect hibernate from ireport it showing

"/hibernate.cfg.xml not found" due to that i failed to connect.Earlier i used to connect ireport using jdbc connection.

 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...