1. Error in reading hibernate.cfg.xml after updating hibernate3.jar coderanch.comHi, I was getting some errors on initializing hibernate environment: 1) FACADE_KEY: CommonSession Hibernate 3.1 rc3 hibernate.properties not found using CGLIB reflection optimizer using JDK 1.4 java.sql.Timestamp handling configuring from resource: /hibernate.cfg.xml Configuration resource: /hibernate.cfg.xml Reading mappings from resource: com/igt/atg/persistance/common/IbeCityMasters.hbm.xml Warning parsing XML: XML InputStream(932) http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd |
2. Accessing hibernate.cfg.xml from web project through JAR file coderanch.comWell, the Java see the file hibernate.cfg.xml (File.exists() and File.canRead() returns true), but the message "fine!" after sessionFactory doesn't appears, doesn't catch an exception and the connection with database not works. I don't have idea what is wrong. public class HibernateUtil { private static SessionFactory sessionFactory; static { String file = null; try { file = HibernateUtil.class.getClassLoader().getResource("hibernate.cfg.xml").getPath().toString(); sessionFactory = new AnnotationConfiguration().configure(file).buildSessionFactory(); ... |
3. cfg.xml inside a jar forum.hibernate.org |
4. Configuration file from jar, but not hibernate.cfg.xml forum.hibernate.orgConfiguration config = new Configuration(); URL confFile = this.getClass().getResource(configFile); ... |
5. read hibernate.cfg.xml from within a jar file forum.hibernate.orghibernate.cfg.xml IS in the root of the jar. My package heirarchy looks like this: hibernate.cfg.xml log4j.xml oscache.properties com ___company ___SessionManager.java - opens all Sessions ___common ______program1 _________Main.java (uses SessionManager) ______program2 _________Main.java (uses SessionManager) The only way I've found to get it to work is to have *2* copies of hibernate.cfg.xml (1 at the root, the other in com.company along with SessionManager). ... |
6. hibernate.cfg.xml in jar file how do I read it. forum.hibernate.orgHibernate version: 3 I know this has probably been covered a 1000 times, but I can not seem to find the right keywords to pull up any info on the subject. Basically I need to find a way to read a configuration file + map files out of a jar. I have a project that communicates with several databases. I need ... |
7. Packing project in jar: Hibernate.cfg.xml or other not found forum.hibernate.orgRegular Joined: Thu Apr 05, 2007 7:05 am Posts: 53 Location: Troisdorf, Germany Hi, wrote a persistence layer for my project with hibernate tools and now I want to pack it in a jar, so that I could run it somewhere outside from eclipse. For this I use an ant file which we used before, when the persistence layer didn't existed. ... |