Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Hibernate in weblogic server 9.2.2

 
balakumar sg
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
When i try deploy the hibernate application in weblogic server9.2.2, i got the error like


org.hibernate.HibernateException: /hibernate.cfg.xml not found
at org.hibernate.util.ConfigHelper.getResourceAsStream(ConfigHelper.java:147)
at org.hibernate.cfg.Configuration.getConfigurationInputStream(Configuration.java:1287)
at org.hibernate.cfg.Configuration.configure(Configuration.java:1309)
at com.cengage.hibernate.SessionManager.currentSession(SessionManager.java:48)
at com.cengage.hibernate.AdminServiceImpl.getUser(AdminServiceImpl.java:80)
at com.cengage.actions.LoginAction.execute(LoginAction.java:81)
at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:425)
at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:228)
at com.cengage.actions.MyRequestProcessor.process(MyRequestProcessor.java:38)



My build structure is:
war
|
|--WEB_INF
|
|--lib
|--classes
|--web.xml
|--eprod.hbm.xml
|--hibernate.cfg.xml


is it right?

pls advice me this is very critical position?
 
Cameron Wallace McKenzie
author and cow tipper
Saloon Keeper
Posts: 4968
1
Hibernate Spring Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
So, somewhere in your code, you create the Configuration object:

Configuration configuration = new AnnotationConfiguration();

Now, that code is packaged somewhere, and it's probably in a separate jar file or something that is also in the lib directory or somewhere. The way Java classloaders work, is only the classloader creating the Configuration object can read the cfg.xml file, and that classloader doesn't know about the lib directory.

So, put the cfg file in the root of the jar file that has the Hibernate Configuration call. Sometimes I've seen it put right in the WEB-INF\classes directory.

Regardless, make sure you know where it SHOULD be, so people doing future updates don't run into the same problem.

Make any sense?

-Cameron McKenzie
 
Paul Sturrock
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
balakumar balakumar, please check your private messages.
 
balakumar sg
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
|--WEB_INF
|
|--lib
|--classes
|--web.xml
|--eprod.hbm.xml
|--hibernate.cfg.xml


is it right?

or


Configuration configuration = new AnnotationConfiguration();
which jar file can i use to import the AnnotationConfiguration file? if i use the AnnotationConfiguration , will it work?

Pls advice me?

thanks for reply
 
balakumar sg
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
WEB_INF has the following files and folders
lib
classes
web.xml
eprod.hbm.xml
hibernate.cfg.xml

etc..

is it correct?
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"balakumar balakumar ",
It is important that you check your private messages regarding an important administrative matter.
-Ben
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic