• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

FileNotFoundException with hibernate and JBoss

 
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I get the following exception from jboss when I start my app using hibernate.


...org.springframework.beans.factory.BeanCreationE xception: Error creating bean with name 'hibernateTemplate' defined in ServletContext resource [/WEB-INF/SMSSpringBeans.xml]: Cannot resolve reference to b
ean 'sessionFactory' while setting bean property 'sessionFactory'; nested exception is org.springframework.beans.factory.BeanCreationExce ption: Error creating bean with name 'sessionFactory' defined in
ServletContext resource [/WEB-INF/SMSSpringBeans.xml]: Invocation of init method failed; nested exception is java.io.FileNotFoundException: class path resource [AggregatorJSON.hbm.xml] cannot be opened
because it does not exist



It does not matter where I put the files or the paths I put in the list items. Setting and unsetting the "mappingDirectoryLocations" property doesn't help either (or I don't know the secret sauce for it). Not having it produces the same result. Currently the xml files are in the WEB-INF directory with the spring xml file.

I have the following configurations in my spring xml file.



Any help will be appreciated.


Thanks,
Joe
 
Joe Croft
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
First I want to thank everyone for their lack of response to mine as well as the other similar questions going back a ways that I found.

On the upside, I found the answer. For those who may be struggling with this issue, it can be solved with snowdrop from the jboss distribution (http://www.jboss.org/snowdrop). Mind you of the three ways they show you can make use of snowdrop, the only one that worked for me was to use the snowdrop spring deployer and than build your <app>.spring deployment as they show. Of course, the default spring deployer does not have all that you need to access hibernate, but that can be solved by adding the appropriate spring jars to it.

A couple additional thoughts, your spring definition xml file should be renamed to jboss-spring.xml and placed in the META-INF directory of your <app>.spring deployment. All of the other xml files that may be reference should be in the root directory of your <app>.spring deployment. Your classes should follow the standard class trees under the deployment's root directory as well.

 
You don't know me, but I've been looking all over the world for. Thanks to the help from this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic