I was trying to use Beanshell to generate the file listing of all the hbn.xml files I am generating using XDoclet instead of hard coding it into hibernate.cfg.xml. The hard coded listing works fine. But when I generate the file listing into a file named hbnfiles.xml and put it under /WEB-INF/classes along with the hibernate.cfg.xml file, the listings are not recognized despite defining it as per documentation as an ENTITY in hibernate.cfg.xml. I am sure it is something really stupid. Any help is greatly appreciated.
TIA
Hibernate version: 2.1.6
Mapping documents:
Code:
<?xml version='1.0' encoding='utf-8'?>
<!DOCTYPE hibernate-configuration PUBLIC
"-//Hibernate/Hibernate Configuration DTD 2.0//EN"
"http://hibernate.sourceforge.net/hibernate-configuration-2.0.dtd" [
<!ENTITY fileList SYSTEM "file:hbnfiles.xml">
]>
<hibernate-configuration>
<!-- a SessionFactory instance listed as /jndi/name -->
<session-factory>
<property name="hibernate.connection.datasource">java:comp/env/hibernate/sapdb/alltel</property>
<property name="dialect">net.sf.hibernate.dialect.SAPDBDialect</property>
<property name="show_sql">true</property>
<property name="transaction.factory_class">net.sf.hibernate.transaction.JDBCTransactionFactory</property>
<property name="hibernate.cache.provider_class">net.sf.ehcache.hibernate.Provider</property>
<property name="hibernate.cglib.use_reflection_optimizer">false</property>
<!-- mapping files -->
&fileList;
</session-factory>
</hibernate-configuration>
Debug level Hibernate log excerpt:Code:
INFO net.sf.hibernate.cfg.Environment - Hibernate 2.1.6
INFO net.sf.hibernate.cfg.Environment - hibernate.properties not found
INFO net.sf.hibernate.cfg.Environment - using CGLIB reflection optimizer
INFO net.sf.hibernate.cfg.Configuration - configuring from resource: /hibernate.cfg.xml
INFO net.sf.hibernate.cfg.Configuration - Configuration resource: /hibernate.cfg.xml
DEBUG net.sf.hibernate.util.DTDEntityResolver - trying to locate http://hibernate.sourceforge.net/hibernate-configuration-2.0.dtd in classpath under net/sf/hibernate/
DEBUG net.sf.hibernate.util.DTDEntityResolver - found http://hibernate.sourceforge.net/hibernate-configuration-2.0.dtd in classpath
DEBUG net.sf.hibernate.cfg.Configuration - hibernate.connection.datasource=java:comp/env/hibernate/sapdb/alltel
DEBUG net.sf.hibernate.cfg.Configuration - dialect=net.sf.hibernate.dialect.SAPDBDialect
DEBUG net.sf.hibernate.cfg.Configuration - show_sql=true
DEBUG net.sf.hibernate.cfg.Configuration - transaction.factory_class=net.sf.hibernate.transaction.JDBCTransactionFactory
DEBUG net.sf.hibernate.cfg.Configuration - hibernate.cache.provider_class=net.sf.ehcache.hibernate.Provider
DEBUG net.sf.hibernate.cfg.Configuration - hibernate.cglib.use_reflection_optimizer=false
INFO net.sf.hibernate.cfg.Configuration - Configured SessionFactory: null
DEBUG net.sf.hibernate.cfg.Configuration - properties: {java.runtime.name=Java(TM) 2 Runtime Environment, Standard Edition, transaction.factory_class=net.sf.hibernate.transaction.JDBCTransactionFactory, hibernate.cache.provider_class=net.sf.ehcache.hibernate.Provider, sun.boot.library.path=C:\jdk1.4.2\jre\bin, java.vm.version=1.4.2_04-b05, java.vm.vendor=Sun Microsystems Inc., java.vendor.url=http://java.sun.com/, path.separator=;, java.vm.name=Java HotSpot(TM) Server VM, file.encoding.pkg=sun.io, user.country=US, sun.os.patch.level=Service Pack 1, java.vm.specification.name=Java Virtual Machine Specification, user.dir=C:\resin, org.xml.sax.driver=com.caucho.xml.Xml, java.runtime.version=1.4.2_04-b05, java.awt.graphicsenv=sun.awt.Win32GraphicsEnvironment, java.endorsed.dirs=C:\jdk1.4.2\jre\lib\endorsed, os.arch=x86, machine.name=localhost, java.io.tmpdir=C:\WINDOWS\TEMP\, line.separator=
, java.vm.specification.vendor=Sun Microsystems Inc., user.variant=, java.naming.factory.url.pkgs=com.caucho.naming, os.name=Windows XP, resin.home=C:\resin, sun.java2d.fontpath=, log4j.mailappender.email.subject=Errors in Local Environment, hibernate.connection.datasource=java:comp/env/hibernate/sapdb/alltel, java.library.path=C:\jdk1.4.2\bin;.;C:\WINDOWS\System32;C:\WINDOWS;C:\Oracle\Ora81\bin;C:\Program Files\Oracle\jre\1.1.7\bin;C:\apache-ant\bin;C:\jdk1.4.2\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\Program Files\ATI Technologies\ATI Control Panel;C:\Program Files\Common Files\Adaptec Shared\System;"C:\Program Files\Hummingbird\Connectivity\7.00\Accessories\";C:\Program Files\Subversion\bin, java.specification.name=Java Platform API Specification, java.class.version=48.0, log4j.mailappender.email.from=weboe@test.com, hibernate.transaction.factory_class=net.sf.hibernate.transaction.JDBCTransactionFactory, java.util.prefs.PreferencesFactory=java.util.prefs.WindowsPreferencesFactory, os.version=5.1, user.home=C:\WINDOWS\system32\config\systemprofile, user.timezone=GMT-05:00, java.awt.printerjob=sun.awt.windows.WPrinterJob, file.encoding=Cp1252, java.specification.version=1.4, show_sql=true, java.class.path=C:\resin\classes;C:\resin\lib\resin.jar;C:\jdk1.4.2\lib\tools.jar;C:\jdk1.4.2\jre\lib\rt.jar;C:\resin\lib\activation.jar;C:\resin\lib\dom.jar;C:\resin\lib\ifxjdbc.jar;C:\resin\lib\jaxp.jar;C:\resin\lib\jdbc2_0-stdext.jar;C:\resin\lib\jmx.jar;C:\resin\lib\jndi.jar;C:\resin\lib\jsdk23.jar;C:\resin\lib\jta_101.jar;C:\resin\lib\mail.jar;C:\resin\lib\mysql-connector-java-3.0.14-production-bin.jar;C:\resin\lib\sapdbc.jar;C:\resin\lib\sax.jar;C:\resin\lib\webutil.jar;C:\resin\lib\classes12.zip, user.name=SYSTEM, hibernate.show_sql=true, java.naming.factory.initial=com.caucho.naming.InitialContextFactoryImpl, java.vm.specification.version=1.0, java.home=C:\jdk1.4.2\jre, sun.arch.data.model=32, hibernate.dialect=net.sf.hibernate.dialect.SAPDBDialect, user.language=en, java.specification.vendor=Sun Microsystems Inc., awt.toolkit=sun.awt.windows.WToolkit, hibernate.cglib.use_reflection_optimizer=false, log4j.file.home=/resin/webapps/altweb/WEB-INF/logs, java.vm.info=mixed mode, java.version=1.4.2_04, java.ext.dirs=C:\jdk1.4.2\jre\lib\ext, sun.boot.class.path=C:\jdk1.4.2\jre\lib\rt.jar;C:\jdk1.4.2\jre\lib\i18n.jar;C:\jdk1.4.2\jre\lib\sunrsasign.jar;C:\jdk1.4.2\jre\lib\jsse.jar;C:\jdk1.4.2\jre\lib\jce.jar;C:\jdk1.4.2\jre\lib\charsets.jar;C:\jdk1.4.2\jre\classes, java.vendor=Sun Microsystems Inc., file.separator=\, java.vendor.url.bug=http://java.sun.com/cgi-bin/bugreport.cgi, sun.io.unicode.encoding=UnicodeLittle, sun.cpu.endian=little, log4j.mailappender.email.to=abc@test.com, dialect=net.sf.hibernate.dialect.SAPDBDialect, sun.cpu.isalist=pentium i486 i386}
INFO net.sf.hibernate.cfg.Configuration - processing one-to-many association mappings
INFO net.sf.hibernate.cfg.Configuration - processing one-to-one association property references
INFO net.sf.hibernate.cfg.Configuration - processing foreign key constraints
INFO net.sf.hibernate.dialect.Dialect - Using dialect: net.sf.hibernate.dialect.SAPDBDialect
INFO net.sf.hibernate.cfg.SettingsFactory - Use outer join fetching: true
INFO net.sf.hibernate.util.NamingHelper - JNDI InitialContext properties:{}
INFO net.sf.hibernate.connection.DatasourceConnectionProvider - Using datasource: java:comp/env/hibernate/sapdb/alltel
INFO net.sf.hibernate.transaction.TransactionFactoryFactory - Transaction strategy: net.sf.hibernate.transaction.JDBCTransactionFactory
INFO net.sf.hibernate.transaction.TransactionManagerLookupFactory - No TransactionManagerLookup configured (in JTA environment, use of process level read-write cache is not recommended)
INFO net.sf.hibernate.cfg.SettingsFactory - Use scrollable result sets: true
INFO net.sf.hibernate.cfg.SettingsFactory - Use JDBC3 getGeneratedKeys(): false
INFO net.sf.hibernate.cfg.SettingsFactory - Optimize cache for minimal puts: false
INFO net.sf.hibernate.cfg.SettingsFactory - echoing all SQL to stdout
INFO net.sf.hibernate.cfg.SettingsFactory - Query language substitutions: {}
INFO net.sf.hibernate.cfg.SettingsFactory - cache provider: net.sf.ehcache.hibernate.Provider
INFO net.sf.hibernate.cfg.Configuration - instantiating and configuring caches
INFO net.sf.hibernate.impl.SessionFactoryImpl - building session factory
DEBUG net.sf.hibernate.impl.SessionFactoryImpl - instantiating session factory with properties: {java.runtime.name=Java(TM) 2 Runtime Environment, Standard Edition, transaction.factory_class=net.sf.hibernate.transaction.JDBCTransactionFactory, hibernate.cache.provider_class=net.sf.ehcache.hibernate.Provider, sun.boot.library.path=C:\jdk1.4.2\jre\bin, java.vm.version=1.4.2_04-b05, java.vm.vendor=Sun Microsystems Inc., java.vendor.url=http://java.sun.com/, path.separator=;, java.vm.name=Java HotSpot(TM) Server VM, file.encoding.pkg=sun.io, user.country=US, sun.os.patch.level=Service Pack 1, java.vm.specification.name=Java Virtual Machine Specification, user.dir=C:\resin, org.xml.sax.driver=com.caucho.xml.Xml, java.runtime.version=1.4.2_04-b05, java.awt.graphicsenv=sun.awt.Win32GraphicsEnvironment, java.endorsed.dirs=C:\jdk1.4.2\jre\lib\endorsed, os.arch=x86, machine.name=localhost, java.io.tmpdir=C:\WINDOWS\TEMP\, line.separator=
, java.vm.specification.vendor=Sun Microsystems Inc., user.variant=, java.naming.factory.url.pkgs=com.caucho.naming, os.name=Windows XP, resin.home=C:\resin, sun.java2d.fontpath=, log4j.mailappender.email.subject=Errors in Local Environment, hibernate.connection.datasource=java:comp/env/hibernate/sapdb/alltel, java.library.path=C:\jdk1.4.2\bin;.;C:\WINDOWS\System32;C:\WINDOWS;C:\Oracle\Ora81\bin;C:\Program Files\Oracle\jre\1.1.7\bin;C:\apache-ant\bin;C:\jdk1.4.2\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\Program Files\ATI Technologies\ATI Control Panel;C:\Program Files\Common Files\Adaptec Shared\System;"C:\Program Files\Hummingbird\Connectivity\7.00\Accessories\";C:\Program Files\Subversion\bin, java.specification.name=Java Platform API Specification, java.class.version=48.0, log4j.mailappender.email.from=weboe@test.com, hibernate.transaction.factory_class=net.sf.hibernate.transaction.JDBCTransactionFactory, java.util.prefs.PreferencesFactory=java.util.prefs.WindowsPreferencesFactory, os.version=5.1, user.home=C:\WINDOWS\system32\config\systemprofile, user.timezone=GMT-05:00, java.awt.printerjob=sun.awt.windows.WPrinterJob, file.encoding=Cp1252, java.specification.version=1.4, show_sql=true, java.class.path=C:\resin\classes;C:\resin\lib\resin.jar;C:\jdk1.4.2\lib\tools.jar;C:\jdk1.4.2\jre\lib\rt.jar;C:\resin\lib\activation.jar;C:\resin\lib\dom.jar;C:\resin\lib\ifxjdbc.jar;C:\resin\lib\jaxp.jar;C:\resin\lib\jdbc2_0-stdext.jar;C:\resin\lib\jmx.jar;C:\resin\lib\jndi.jar;C:\resin\lib\jsdk23.jar;C:\resin\lib\jta_101.jar;C:\resin\lib\mail.jar;C:\resin\lib\mysql-connector-java-3.0.14-production-bin.jar;C:\resin\lib\sapdbc.jar;C:\resin\lib\sax.jar;C:\resin\lib\webutil.jar;C:\resin\lib\classes12.zip, user.name=SYSTEM, hibernate.show_sql=true, java.naming.factory.initial=com.caucho.naming.InitialContextFactoryImpl, java.vm.specification.version=1.0, java.home=C:\jdk1.4.2\jre, sun.arch.data.model=32, hibernate.dialect=net.sf.hibernate.dialect.SAPDBDialect, user.language=en, java.specification.vendor=Sun Microsystems Inc., awt.toolkit=sun.awt.windows.WToolkit, hibernate.cglib.use_reflection_optimizer=false, log4j.file.home=/resin/webapps/altweb/WEB-INF/logs, java.vm.info=mixed mode, java.version=1.4.2_04, java.ext.dirs=C:\jdk1.4.2\jre\lib\ext, sun.boot.class.path=C:\jdk1.4.2\jre\lib\rt.jar;C:\jdk1.4.2\jre\lib\i18n.jar;C:\jdk1.4.2\jre\lib\sunrsasign.jar;C:\jdk1.4.2\jre\lib\jsse.jar;C:\jdk1.4.2\jre\lib\jce.jar;C:\jdk1.4.2\jre\lib\charsets.jar;C:\jdk1.4.2\jre\classes, java.vendor=Sun Microsystems Inc., file.separator=\, java.vendor.url.bug=http://java.sun.com/cgi-bin/bugreport.cgi, sun.io.unicode.encoding=UnicodeLittle, sun.cpu.endian=little, log4j.mailappender.email.to=abc.def@test.com, dialect=net.sf.hibernate.dialect.SAPDBDialect, sun.cpu.isalist=pentium i486 i386}
DEBUG net.sf.hibernate.impl.SessionFactoryObjectFactory - initializing class SessionFactoryObjectFactory
DEBUG net.sf.hibernate.impl.SessionFactoryObjectFactory - registered: 2c929b9c00288d6a0100288d70720000 (unnamed)
INFO net.sf.hibernate.impl.SessionFactoryObjectFactory - Not binding factory to JNDI, no JNDI name configured
DEBUG net.sf.hibernate.impl.SessionFactoryImpl - instantiated session factory
DEBUG net.sf.hibernate.impl.SessionImpl - opened session
DEBUG net.sf.hibernate.impl.SessionImpl - running Session.finalize()
DEBUG net.sf.hibernate.impl.SessionImpl - flushing session
DEBUG net.sf.hibernate.impl.SessionImpl - Flushing entities and processing referenced collections
DEBUG net.sf.hibernate.impl.SessionImpl - Processing unreferenced collections
DEBUG net.sf.hibernate.impl.SessionImpl - Scheduling collection removes/(re)creates/updates
DEBUG net.sf.hibernate.impl.SessionImpl - Flushed: 0 insertions, 0 updates, 0 deletions to 0 objects
DEBUG net.sf.hibernate.impl.SessionImpl - Flushed: 0 (re)creations, 0 updates, 0 removals to 0 collections
DEBUG net.sf.hibernate.impl.SessionImpl - Dont need to execute flush
DEBUG net.sf.hibernate.impl.SessionImpl - closing session
DEBUG net.sf.hibernate.impl.SessionImpl - closing session