File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Object Relational Mapping and the fly likes hibernate not bound error Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "hibernate not bound error" Watch "hibernate not bound error" New topic

hibernate not bound error

Joe Marchi

Joined: Apr 25, 2010
Posts: 11
Hi Folks, im getting the following error message when running chapter 5 a exercise from JbossAtWork book. I have been using JBoss 5.1 and Java 6 with Oracle XE thus far and have had no problems running the previous exercises up until this point.

the error message:
[STDOUT] com.jbossatwork.util.ServiceLocatorException: com.jbossatwork.util.ServiceLocatorException: javax.naming.NamingException: Could not dereference object [Root exception is javax.naming.NameNotFoundException: hibernate not bound]

here is a short hand version of what my ear, war and common jars look like:

jaw.ear (contains)
- application.xml
- jboss-app.xml
- common.jar
- jaw.har
- webapp.war

common.jar (contains)
- classes (including HibernateCarDAO.class, CarDTO.class, ServiceLocator.class)

jaw.har (contains)
- CarDTO.hbm.xml
- hibernate-service.xml

webapp.war (contains)
- classes (including ControllerServlet.class)
- lib folder
- jboss-web.xml
- web.xml
- jsps and other files

hibernate-service.xml looks as follows:

build.xml for hibernatedoclet looks as follows: generates the following tags: sends the following to to perform a ServiceLocator.getHibernateSession(HIBERNATE_SESSION_FACTORY) which inturn does the

what am I doing wrong É and is their an alternative way to binding the mbean É

I have used the hibernate jars contained in the C:\jboss-5.1.0.GA\common\lib for my compile and xdoclet classpaths
and also tried to alternatively use this version of hibernate instead for compile and xdoclet classpaths
C:\hibernate-distribution-3.5.1-Final and C:\hibernate-distribution-3.5.1-Final\lib\required

where am i going wrong. let me know if you need any additional snippets of this program.

Thanks in advance

Joe Marchi

Joined: Apr 25, 2010
Posts: 11
Note to anyone going through the same problem of migrating the books code into the new JBoss. It appears that JBoss 5.1.0-GA has a new way of building a hibernate har file. I used this reference jboss 5.1.0-GA imgration to aid me in solving the problem.

hibernate-service.xml is now named service-hibernate.xml in the new JBoss version and it’s content has changed also.

I agree. Here's the link:
subject: hibernate not bound error
jQuery in Action, 3rd edition