Joined: Thu Sep 25, 2003 10:38 am Posts: 3
|
Hi,
I need 2 session factories mapping 2 datasources and I got this error message :
ERROR [XMLHelper] Error parsing XML: /hibernate.cfg.xml(30) org.xml.sax.SAXParseException: Element "hibernate-configuration" allows no further input; "session-factory" is not allowed. at org.apache.crimson.parser.Parser2.error(Parser2.java:3160) at org.apache.crimson.parser.ValidatingParser$ChildrenValidator.consume(ValidatingParser.java:345) at org.apache.crimson.parser.Parser2.maybeElement(Parser2.java:1317) at org.apache.crimson.parser.Parser2.content(Parser2.java:1779) at org.apache.crimson.parser.Parser2.maybeElement(Parser2.java:1507) at org.apache.crimson.parser.Parser2.parseInternal(Parser2.java:500) at org.apache.crimson.parser.Parser2.parse(Parser2.java:305) at org.apache.crimson.parser.XMLReaderImpl.parse(XMLReaderImpl.java:442) at org.dom4j.io.SAXReader.read(SAXReader.java:339) at net.sf.hibernate.cfg.Configuration.configure(Configuration.java:785)
at net.sf.hibernate.cfg.Configuration.configure(Configuration.java:732)
at net.sf.hibernate.cfg.Configuration.configure(Configuration.java:719)[/color]
This is my hibernate.cfg.xml file :
<?xml version='1.0'?> <!DOCTYPE hibernate-configuration PUBLIC "-//Hibernate/Hibernate Configuration DTD 2.0//EN" "http://hibernate.sourceforge.net/hibernate-configuration-2.0.dtd">
<hibernate-configuration> <!-- shared properties -->
<!-- a SessionFactory instance listed as /secondfactory/sessionFactory --> <session-factory name="/secondfactory/sessionFactory">
<property name="transaction.manager_lookup_class">net.sf.hibernate.transaction.JBossTransactionManagerLookup</property> <property name="dialect">cirrus.hibernate.sql.PostgreSQLDialect</property> <property name="connection.driver">org.postgresql.Driver</property> <property name="statement_cache.size">5</property> <property name="show_sql">false</property>
<!-- properties for this SessionFactory only --> <property name="connection.datasource">java:/SecondDB</property>
<!-- mapping files --> <mapping resource="Company.hbm.xml"/> <mapping resource="Customer.hbm.xml"/> </session-factory>
<!-- a SessionFactory instance listed as /hibernate/sessionFactory --> <session-factory name="/hibernate/sessionFactory">
<property name="transaction.manager_lookup_class">net.sf.hibernate.transaction.JBossTransactionManagerLookup</property> <property name="dialect">cirrus.hibernate.sql.PostgreSQLDialect</property> <property name="connection.driver">org.postgresql.Driver</property> <property name="statement_cache.size">5</property> <property name="show_sql">false</property>
<!-- properties for this SessionFactory only --> <property name="connection.datasource">java:/DefaultDS</property>
<!-- mapping files --> <mapping resource="Mapping1.hbm.xml"/> <mapping resource="Mapping2.hbm.xml"/> </session-factory>
</hibernate-configuration>
What's wrong
Can someone help me ?
Tanks
_________________ Taylor
|
|