[hibernate-issues] [Hibernate-JIRA] Commented: (HHH-4745) /hibernate.cfg.xml not found

Mike Bishop (JIRA) noreply at atlassian.com
Fri Jan 1 08:34:32 EST 2010


    [ http://opensource.atlassian.com/projects/hibernate/browse/HHH-4745?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=35060#action_35060 ] 

Mike Bishop commented on HHH-4745:
----------------------------------

Check that.  The forward slash in the error message (/hibernate.cfg...) occurs only if I do not pass the file name on .configure.  I removed the cfg.xml file entirely and replaced with hibernnate.properties, removed the string parameter from .configure and did mvn compile.  Made no difference, it still looks for /hibernate.cfg.xml.  
Can't believe you're still getting Jira issues like this in 2010 (happy new years BTW).  

> /hibernate.cfg.xml not found
> ----------------------------
>
>                 Key: HHH-4745
>                 URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-4745
>             Project: Hibernate Core
>          Issue Type: Bug
>          Components: core
>    Affects Versions: 3.3.2
>         Environment: Windows XP; maven; hibernate-distribution-3.3.2.GA; hibernate-entitymanager-3.4.0.GA
> MS SQL Server 2008 Developer. sqljdbc4.jar (microsoft sqljdbc_2) 
>            Reporter: Mike Bishop
>
> no matter where I put it, no matter what the classpath, sessionFactory cannot find hibernate.cfg.xml. 
> Here is the class path - 
> .;C:\my-app\target;C:\Hibernate\hibernate-distribution-3.3.2.GA;C:\Hibernate\hibernate-distribution-3.3.2.GA\lib\required;C:\Hibernate\hibernate-annotations-3.4.0.GA;C:\Hibernate\hibernate-entitymanager-3.4.0.GA;C:\jdbc\MSSQL\sqljdbc_2.0\enu\sqljdbc4.jar; 
> Here is the snippet from HibernateUtil 
> import org.hibernate.*;
> import org.hibernate.cfg.*; 
> public class HibernateUtil {
> 	
> 	private static SessionFactory sessionFactory; 
> 	
> 	static {
> 		try {
> 			sessionFactory = new Configuration()
> 			.configure("hibernate.cfg.xml")
> 			.buildSessionFactory();
> 		}
> 		catch (Throwable ex) {
> 			// Make sure you log the exception, as it might be swallowed 
> 			System.err.println("Initial SessionFactory creation failed. " + ex);
> 			throw new ExceptionInInitializerError(ex);
> 		}
>   }

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


More information about the hibernate-issues mailing list