-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 posts ] 
Author Message
 Post subject: hibernate.cfg.xml not found
PostPosted: Sun Dec 26, 2004 1:30 am 
Regular
Regular

Joined: Wed Sep 03, 2003 8:04 am
Posts: 55
I have put hibernate.cfg.xml into WEB-INF/classes, after deployed to RESIN-3.0.10, the following code reported "can not find hibernate.cfg.xml" ?

Code:
public class HibernateUtil
{
    static
    {
        try {
            sessionFactory = new Configuration().configure().buildSessionFactory();
        } catch (Throwable ex) {
            throw new ExceptionInInitializerError(ex);
        }
    }
...
}
......
net.sf.hibernate.HibernateException: /hibernate.cfg.xml not found
   at net.sf.hibernate.cfg.Configuration.getConfigurationInputStream(Ljava.lang.String;)Ljava.io.InputStream;(Configuration.java:872)
   at net.sf.hibernate.cfg.Configuration.configure(Ljava.lang.String;)Lnet.sf.hibernate.cfg.Configuration;(Configuration.java:896)
   at net.sf.hibernate.cfg.Configuration.configure()Lnet.sf.hibernate.cfg.Configuration;(Configuration.java:883)
   at com.zsoft.util.HibernateUtil.<clinit>()V(HibernateUtil.java:14)
   at jrockit.vm.RNI.getRunnableCode(I)I(Unknown Source)
   at jrockit.vm.RNI.trampoline()V(Unknown Source)



Best Regards!

_________________
garbage in,garbage out


Top
 Profile  
 
 Post subject: Re: hibernate.cfg.xml not found
PostPosted: Sun Dec 26, 2004 4:41 am 
Newbie

Joined: Fri Dec 24, 2004 11:24 am
Posts: 5
try to put it(hibernate.cfg.xml) where hibernate.class is

midas wrote:
I have put hibernate.cfg.xml into WEB-INF/classes, after deployed to RESIN-3.0.10, the following code reported "can not find hibernate.cfg.xml" ?

Code:
public class HibernateUtil
{
    static
    {
        try {
            sessionFactory = new Configuration().configure().buildSessionFactory();
        } catch (Throwable ex) {
            throw new ExceptionInInitializerError(ex);
        }
    }
...
}
......
net.sf.hibernate.HibernateException: /hibernate.cfg.xml not found
   at net.sf.hibernate.cfg.Configuration.getConfigurationInputStream(Ljava.lang.String;)Ljava.io.InputStream;(Configuration.java:872)
   at net.sf.hibernate.cfg.Configuration.configure(Ljava.lang.String;)Lnet.sf.hibernate.cfg.Configuration;(Configuration.java:896)
   at net.sf.hibernate.cfg.Configuration.configure()Lnet.sf.hibernate.cfg.Configuration;(Configuration.java:883)
   at com.zsoft.util.HibernateUtil.<clinit>()V(HibernateUtil.java:14)
   at jrockit.vm.RNI.getRunnableCode(I)I(Unknown Source)
   at jrockit.vm.RNI.trampoline()V(Unknown Source)



Best Regards!


Top
 Profile  
 
 Post subject: Re: hibernate.cfg.xml not found
PostPosted: Sun Dec 26, 2004 4:46 am 
Newbie

Joined: Fri Dec 24, 2004 11:24 am
Posts: 5
HibernateUtil.class

guanqi wrote:
try to put it(hibernate.cfg.xml) where hibernate.class is

midas wrote:
I have put hibernate.cfg.xml into WEB-INF/classes, after deployed to RESIN-3.0.10, the following code reported "can not find hibernate.cfg.xml" ?

Code:
public class HibernateUtil
{
    static
    {
        try {
            sessionFactory = new Configuration().configure().buildSessionFactory();
        } catch (Throwable ex) {
            throw new ExceptionInInitializerError(ex);
        }
    }
...
}
......
net.sf.hibernate.HibernateException: /hibernate.cfg.xml not found
   at net.sf.hibernate.cfg.Configuration.getConfigurationInputStream(Ljava.lang.String;)Ljava.io.InputStream;(Configuration.java:872)
   at net.sf.hibernate.cfg.Configuration.configure(Ljava.lang.String;)Lnet.sf.hibernate.cfg.Configuration;(Configuration.java:896)
   at net.sf.hibernate.cfg.Configuration.configure()Lnet.sf.hibernate.cfg.Configuration;(Configuration.java:883)
   at com.zsoft.util.HibernateUtil.<clinit>()V(HibernateUtil.java:14)
   at jrockit.vm.RNI.getRunnableCode(I)I(Unknown Source)
   at jrockit.vm.RNI.trampoline()V(Unknown Source)



Best Regards!


Top
 Profile  
 
 Post subject: but ...
PostPosted: Mon Jan 03, 2005 4:54 am 
Regular
Regular

Joined: Wed Sep 03, 2003 8:04 am
Posts: 55
the hibernate.cfg.xml is actually in CLASSPATH ?

thanks for your answer.

_________________
garbage in,garbage out


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.