-->
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.  [ 11 posts ] 
Author Message
 Post subject: fileList from BeanShell not recognized
PostPosted: Thu Nov 11, 2004 1:02 pm 
Senior
Senior

Joined: Wed Mar 24, 2004 11:40 am
Posts: 146
Location: Indianapolis, IN, USA
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


Top
 Profile  
 
 Post subject:
PostPosted: Thu Nov 11, 2004 4:23 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
Maybe related to: http://opensource.atlassian.com/project ... se/HB-1265 ?

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject: fileList from BeanShell not recognized
PostPosted: Fri Nov 12, 2004 3:09 pm 
Senior
Senior

Joined: Wed Mar 24, 2004 11:40 am
Posts: 146
Location: Indianapolis, IN, USA
max,

thanks for the reply. i don't know if i am being dense but i can't tell how the JIRA is related to my problem. could you possibly point me in the right direction?

TIA


Top
 Profile  
 
 Post subject:
PostPosted: Fri Nov 12, 2004 6:08 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
that bug and it's dupe: http://opensource.atlassian.com/project ... wse/HB-677 all relates to resolvement of xml entities ...and that is your problem, right ?

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Fri Nov 12, 2004 6:15 pm 
Senior
Senior

Joined: Wed Mar 24, 2004 11:40 am
Posts: 146
Location: Indianapolis, IN, USA
yeah, i think that is basically my problem because the ENTITY is not being recognized properly in hibernate.cfg.xml. i just thought i must be doing something really stupid because it was documented in several places as the way to use beanshell generated listing of mappings. i'll go ahead and use the JIRA fix. thank you very much for your help.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Nov 12, 2004 6:26 pm 
Senior
Senior

Joined: Wed Mar 24, 2004 11:40 am
Posts: 146
Location: Indianapolis, IN, USA
i did notice that the bug fix was for version 2.1.2. i am currently using 2.1.6. is this something that just hasn't been added or do you think i may have some jar file issue? i am pretty sure that i am using 2.1.6.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Nov 12, 2004 6:29 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
i don't know the complete status for the bug, just that Emmanuel had some remaining issues with it back then - something to do with the different xml parsers does not behave identically for this stuff....

...but i don't know the details....Emmanuel, can you comment on this one ?

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Mon Nov 15, 2004 12:02 pm 
Senior
Senior

Joined: Wed Mar 24, 2004 11:40 am
Posts: 146
Location: Indianapolis, IN, USA
max,

i got the source for hibernate 2.1.6 to install the patches from JIRA. those patches were already in place. but i went ahead and created the JAR just in case that was something that wasn't currently in place on the distro. despite applying the patch, my problem persists. it seems to make sense that the issue i have is the file ENTITY not getting resolved in the hibernate.cfg.xml file.

is anyone else using a beanshell generated listing of *.hbm.xml files within the hibernate.cfg.xml file? if so, have any of you encountered this issue? any help is greatly appreciated.

TIA


Top
 Profile  
 
 Post subject:
PostPosted: Mon Nov 15, 2004 12:19 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
don't think you should focus on it being a beanshell generated list - it's just the entity resolvement.

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Mon Nov 15, 2004 12:28 pm 
Senior
Senior

Joined: Wed Mar 24, 2004 11:40 am
Posts: 146
Location: Indianapolis, IN, USA
good point. i guess any entity resolvement that people are using within the hibernate.cfg.xml would be a point of interest and whether anyone has encountered any issues.

by the way, I am using Resin 2.1.12, so is it possible that the resin XML parser is causing this issue?


Top
 Profile  
 
 Post subject:
PostPosted: Mon Nov 15, 2004 12:30 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
yes - we have had issues with resin xml stuff behaving differently than others....but don't know the state of that.

_________________
Max
Don't forget to rate


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 11 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.