Win a copy of Java Mock Exams (software) this week in the Programmer Certification (OCPJP) forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

hibernate not bound error

 
Joe Marchi
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • 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
  • 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.


 
What are you doing? You are supposed to be reading this tiny ad!
the new thread boost feature brings a LOT of attention to your favorite threads
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!