• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

orm.xml with JBoss

 
Ranch Hand
Posts: 244
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

I'm trying to use persistence with JBoss, but I get an error about the validation of jboss.xml.
Here it is my details:
 
Mirko Bonasorte
Ranch Hand
Posts: 244
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi guys,
it seems to be a bug.
Here it's the link to Hibernate bug tracker.
It seems to happen when using both annotations and orm.xml.
In fact, in my projects I had created two jars, one with annotations and another one without.
 
Sheriff
Posts: 10445
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Mirko Bonasorte:


Here it is my details:



There's a problem with the contents of your orm.xml file:

<entity-mappings version="1.0">


Change this to


I tried with the orm.xml that you posted and got the same error as the one you got. I then changed the entity-mappings declaration as above and got it working.
 
Mirko Bonasorte
Ranch Hand
Posts: 244
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Jaikiran!

So, the schema location seems to be mandatory... But the O'Reilly book does not make any mention about it.
According to you, it is an error of the book or an Hibernate bug?

Thanks a lot!
 
Jaikiran Pai
Sheriff
Posts: 10445
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Mirko Bonasorte:
According to you, it is an error of the book or an Hibernate bug?



I wouldn't call it a bug in Hibernate. Looks like the book missed out on that definition. Hibernate does make a mention about adding the schema declaration for persistence.xml (i would consider, it holds true for orm.xml too):


Be sure to define the grammar definition in the persistence element since the EJB3 specification requires the schema validation


<persistence xmlns="http://java.sun.com/xml/ns/persistence"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd"
version="1.0">


[ October 30, 2007: Message edited by: Jaikiran Pai ]
 
Mirko Bonasorte
Ranch Hand
Posts: 244
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
it works!

Thanks for the support!
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic