Hibernate Console MappingNotFoundException with external jar resources

Hello all,

Seem to be having problems with the hibernate console seemingly not being able to find mapping resources from the jars in my projects ivy cache (i.e. inside project jars).

We've got a mix of annotations and old style hibernate hbm.xml files. My hibernate cfg file defines these xml files are mapping resources instead of mapping class. e.g.

     <mapping resource="com/company/project/persistence/hibernate/hbm/PersistentObject.hbm.xml"/>

When I attempt queries in the hibernate console I'm getting MappingNotFoundException for these older resources:

     java.lang.RuntimeException: org.hibernate.MappingNotFoundException: file: C:\Users\rosbaldeston\.ivy2\cache\com.compnay\hibernateutilities\jars\hibernateutilities-x.y.z.jar!\com\company\project\persistence\hibernate\hbm\PersistentObject.hbm.xml not found


The jar in question exists, the hbm.xml files inside the jar also exist. The IDE resolves and will navigate these mappings without problems. But for some reason the hibernate console can't?


I tried extratinf the hbm files into a package structured build folder and adding that to the classpath. However the IDE then highlighted all these Mappings as unresolveavble. When I click on them it's clear the IDE editor can see both sets of mapping file and seems confused by the aparent duplication. The hibernate console works a bit better the class it complained about resolves but I get a similar MappingNotFoundException  about mapping files hidden even deeper in the 3rd party jars (jbpm).

Wondering if I'm doing something wrong or if theres just a bug in the HQL console?


Using latest IntelliJ 11 (11.13) on Windows 7, Hibernate 3.5.6, and IvyIDEA if thats relevant at all.

3 comments
Comment actions Permalink

Was just trying IDEA 12 for the first time and checking out the database console changes. Noticed the DDL generation was throwing erors. After checking the forums I had a spooky sense of deja-vu (above).

IDEA 12 still seems to struggle with this project setup, can't help but wonder if it's IvyIDEA plugin thats the cause. But the message shows it's looking in the correct location for the resource and the resource does exist. But IDEA still fails with this message?

generateDDL_error.png

0
Comment actions Permalink

Ok, thnaks, does look very similar. I'll vote for that - was hoping I just did something wrong.

0

Please sign in to leave a comment.