-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: Hibernate JPA problems
PostPosted: Wed Dec 09, 2009 5:26 pm 
Newbie

Joined: Tue Dec 01, 2009 2:41 pm
Posts: 4
I am about to leave the JPA and Hibernate behind. I've written dozens of database-oriented applications in Java and I've never had as much trouble configuring and using something as I have with Hibernate. The JPA is supposed to make handling databases easier, but raw JDBC is several orders of magnitudued easier to use and configure than either the Hibernate core or the JPA. I'm also kind of surprised that something that seems to be as widely used as Hibernate doesn't have better documentation.

/rant

I am trying to deploy an application on JBoss. My persistence XML looks like this:

Code:
<?xml version="1.0" encoding="UTF-8"?>
<persistence version="1.0" 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">
   <persistence-unit name="ScaleWriter" transaction-type="JTA">
      <provider>org.hibernate.ejb.HibernatePersistence</provider>
      <jta-data-source>java:/jdbc/FloorScaleDS</jta-data-source>
      <class>com.goulston.application.scalewriter.FloorScalePK</class>
      <class>com.goulston.application.scalewriter.FloorScale</class>
      <class>com.goulston.application.scalewriter.Config</class>
      <properties>
         <property name="hibernate.dialect" value="org.hibernate.dialect.MySQL5Dialect"/>
         <property name="hibernate.hbm2ddl.auto" value="update"/>
      </properties>
   </persistence-unit>
</persistence>


The JBoss deployer reports that it can't find the FloorScale entity class. It reports that it is looking for it as WEB-INF.classes.com.goulston.application.scalewriter.FloorScale. Sure enough, if I go look at the deployment in JBoss, the persistence XML file resides in WEB-INF, which seems to be correct, and is a peer of the classes directory. I have no idea why Hibernate is trying to go up a directory to look for the entity classes. I've noticed that it seems to have some "interesting" ideas on where it is supposed to find things on the file system. I have poked into every dark corner on Google that I can find, and the Hibernate documentation is of no help, since it doesn't address any of this. Suggestions would be greatly appreciated.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.