File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes EJB and other Java EE Technologies and the fly likes orm.xml with JBoss Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "orm.xml with JBoss" Watch "orm.xml with JBoss" New topic
Author

orm.xml with JBoss

Mirko Bonasorte
Ranch Hand

Joined: May 14, 2007
Posts: 244
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:


SCJP<br />SCWCD 1.4 Upgrade (Remember: me stupid)<br />SCWCD 1.4<br /><a href="http://jcp.org/aboutJava/communityprocess/final/jsr220/index.html" target="_blank" rel="nofollow">SCBCD 5.0</a><br /><a href="http://www.enthuware.com" target="_blank" rel="nofollow">SCBCD 5.0 mock exam</a> <br /> <br />SCEA 5 Part1: Preparing...
Mirko Bonasorte
Ranch Hand

Joined: May 14, 2007
Posts: 244
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.
Jaikiran Pai
Marshal

Joined: Jul 20, 2005
Posts: 9947
    
160

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.


[My Blog] [JavaRanch Journal]
Mirko Bonasorte
Ranch Hand

Joined: May 14, 2007
Posts: 244
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
Marshal

Joined: Jul 20, 2005
Posts: 9947
    
160

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

Joined: May 14, 2007
Posts: 244
Hi,
it works!

Thanks for the support!
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: orm.xml with JBoss
 
Similar Threads
State: NOTYETINSTALLED
JPA @NamedNativeQuery and scalar results
No identifier specified for entity:
How to connect from JBoss to SQL server ?
Problem with DataSource