• 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
  • Ron McLeod
  • Rob Spoor
  • Tim Cooke
  • Junilu Lacar
Sheriffs:
  • Henry Wong
  • Liutauras Vilda
  • Jeanne Boyarsky
Saloon Keepers:
  • Jesse Silverman
  • Tim Holloway
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Mikalai Zaikin
  • Piet Souris

hibernate not bound error

 
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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)
- META-INF
- 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
- META-INF
- hibernate-service.xml

webapp.war (contains)
- META-INF
- WEB-INF
- 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:


ControllerServlet.java generates the following tags:


HibernateCarDAO.java sends the following to ServiceLocator.java to perform a ServiceLocator.getHibernateSession(HIBERNATE_SESSION_FACTORY) which inturn does the
ctx.lookup(jndiSessionFactoryName)



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
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.


 
You showed up just in time for the waffles! And this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic