facebook

Can’t bind named Hibernate SessionFactory into JNDI

  1. MyEclipse Archived
  2.  > 
  3. Database Tools (DB Explorer, Hibernate, etc.)
Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #245419 Reply

    jedavie
    Member

    Hi,

    I’m trying to use Hibernate in a managed environment with JBoss app server. According to Hibernate reference doc, I need a jndi-named SessionFactory. I am unable to get SessionFactory name bound into jndi. I have no problem binding ejb’s into jndi. It appears that hibernate reads the hibernate.cfg.xml parameters, except for the SessionFactory name. Following is hibernate.cfg.xml, jndi lookup-code snippet, JBoss app server log, and MyEclipse configs. I have tried binding various different SessionFactory names into jndi, with no success. Any help would be greatly appreciated. I’m out of ideas at this point.

    Thanks,
    Jim

    hibernate.cfg.xml

    <?xml version=’1.0′ encoding=’UTF-8′?>
    <!DOCTYPE hibernate-configuration PUBLIC
    “-//Hibernate/Hibernate Configuration DTD 3.0//EN”
    http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd”&gt;

    <!– Generated by MyEclipse Hibernate Tools. –>
    <hibernate-configuration>

    <session-factory>
    <property name=”hibernate.session_factory_name”>java:comp/hibernate/SessionFactory</property>
    <property name=”connection.username”>secadmin</property>
    <property name=”connection.url”>jdbc:oracle:thin:@fwcis.sandia.gov:1514:secom</property>
    <property name=”dialect”>org.hibernate.dialect.Oracle9Dialect</property>
    <property name=”myeclipse.connection.profile”>oracle_thin</property>
    <property name=”connection.password”>cis</property>
    <property name=”connection.driver_class”>oracle.jdbc.driver.OracleDriver</property>
    <property name=”hibernate.transaction.manager_lookup_class”>org.hibernate.transaction.JBossTransactionManagerLookup</property>
    <property name=”hibernate.transaction.factory_class”>org.hibernate.transaction.JTATransactionFactory</property>
    <property name=”jta.UserTransaction”>java:comp/UserTransaction</property>
    <property name=”connection.datasource”>jdbc/OracleDS</property>
    <mapping resource=”gov/sandia/sesman/Cmpproduct.hbm.xml” />

    </session-factory>

    </hibernate-configuration>

    ****************************

    Code snippet from getSessionFactory()
    try {

    Context ctx = new InitialContext();
    String jndiName = “java:comp/env/hibernate/SessionFactory”;
    sessionFactory = (SessionFactory)ctx.lookup(jndiName);

    **********************************************************************
    JBoss Application Server Output

    2006-01-26 08:10:06,015 INFO [org.jboss.system.server.Server] JBoss (MX MicroKernel) [4.0.3RC1 (build: CVSTag=JBoss_4_0_3_RC1 date=200506260723)] Started in 16s:984ms
    2006-01-26 08:10:25,172 INFO [org.hibernate.cfg.Environment] Hibernate 3.0.5
    2006-01-26 08:10:25,172 INFO [org.hibernate.cfg.Environment] hibernate.properties not found
    2006-01-26 08:10:25,172 INFO [org.hibernate.cfg.Environment] using CGLIB reflection optimizer
    2006-01-26 08:10:25,172 INFO [org.hibernate.cfg.Environment] using JDK 1.4 java.sql.Timestamp handling
    2006-01-26 08:10:25,406 INFO [org.hibernate.cfg.Environment] Hibernate 3.1alpha1
    2006-01-26 08:10:25,406 INFO [org.hibernate.cfg.Environment] hibernate.properties not found
    2006-01-26 08:10:25,406 INFO [org.hibernate.cfg.Environment] using CGLIB reflection optimizer
    2006-01-26 08:10:25,406 INFO [org.hibernate.cfg.Environment] using JDK 1.4 java.sql.Timestamp handling
    2006-01-26 08:10:25,484 INFO [org.hibernate.cfg.Configuration] Reading mappings from resource: gov/sandia/sesman/Cmpproduct.hbm.xml
    2006-01-26 08:10:25,484 DEBUG [org.hibernate.util.DTDEntityResolver] trying to locate http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd in classpath under org/hibernate/
    2006-01-26 08:10:25,484 DEBUG [org.hibernate.util.DTDEntityResolver] found http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd in classpath
    2006-01-26 08:10:25,578 INFO [org.hibernate.cfg.HbmBinder] Mapping class: gov.sandia.sesman.Cmpproduct -> CMPPRODUCT
    2006-01-26 08:10:25,578 DEBUG [org.hibernate.cfg.HbmBinder] Mapped property: tripId -> TRIP_ID
    2006-01-26 08:10:25,594 DEBUG [org.hibernate.cfg.HbmBinder] Mapped property: transmode -> TRANSMODE
    2006-01-26 08:10:25,594 DEBUG [org.hibernate.cfg.HbmBinder] Mapped property: classification -> CLASSIFICATION
    2006-01-26 08:10:25,594 DEBUG [org.hibernate.cfg.HbmBinder] Mapped property: status -> STATUS
    2006-01-26 08:10:25,594 INFO [org.hibernate.cfg.Configuration] configuring from resource: /hibernate.cfg.xml
    2006-01-26 08:10:25,594 INFO [org.hibernate.cfg.Configuration] Configuration resource: /hibernate.cfg.xml
    2006-01-26 08:10:25,594 DEBUG [org.hibernate.util.DTDEntityResolver] trying to locate http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd in classpath under org/hibernate/
    2006-01-26 08:10:25,594 DEBUG [org.hibernate.util.DTDEntityResolver] found http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd in classpath
    2006-01-26 08:10:25,594 DEBUG [org.hibernate.cfg.Configuration] connection.username=secadmin
    2006-01-26 08:10:25,594 DEBUG [org.hibernate.cfg.Configuration] connection.url=jdbc:oracle:thin:@fwcis.sandia.gov:1514:secom
    2006-01-26 08:10:25,594 DEBUG [org.hibernate.cfg.Configuration] dialect=org.hibernate.dialect.Oracle9Dialect
    2006-01-26 08:10:25,594 DEBUG [org.hibernate.cfg.Configuration] myeclipse.connection.profile=oracle_thin
    2006-01-26 08:10:25,594 DEBUG [org.hibernate.cfg.Configuration] connection.password=cis
    2006-01-26 08:10:25,594 DEBUG [org.hibernate.cfg.Configuration] connection.driver_class=oracle.jdbc.driver.OracleDriver
    2006-01-26 08:10:25,594 INFO [org.hibernate.cfg.Configuration] Configured SessionFactory: null
    2006-01-26 08:10:25,594 DEBUG [org.hibernate.cfg.Configuration] properties: {java.vendor=Sun Microsystems Inc., catalina.base=C:\jboss-4.0.3RC1\jboss-4.0.3RC1\server\default, hibernate.connection.url=jdbc:oracle:thin:@fwcis.sandia.gov:1514:secom, sun.management.compiler=HotSpot Client Compiler, catalina.useNaming=false, os.name=Windows XP, sun.boot.class.path=C:\jboss-4.0.3RC1\jboss-4.0.3RC1\lib\endorsed\resolver.jar;C:\jboss-4.0.3RC1\jboss-4.0.3RC1\lib\endorsed\xalan.jar;C:\jboss-4.0.3RC1\jboss-4.0.3RC1\lib\endorsed\xercesImpl.jar;C:\jboss-4.0.3RC1\jboss-4.0.3RC1\lib\endorsed\xml-apis.jar;C:\Program Files\Java\jdk1.5.0_04\jre\lib\rt.jar;C:\Program Files\Java\jdk1.5.0_04\jre\lib\i18n.jar;C:\Program Files\Java\jdk1.5.0_04\jre\lib\sunrsasign.jar;C:\Program Files\Java\jdk1.5.0_04\jre\lib\jsse.jar;C:\Program Files\Java\jdk1.5.0_04\jre\lib\jce.jar;C:\Program Files\Java\jdk1.5.0_04\jre\lib\charsets.jar;C:\Program Files\Java\jdk1.5.0_04\jre\classes, sun.desktop=windows, java.vm.specification.vendor=Sun Microsystems Inc., java.runtime.version=1.5.0_04-b05, user.name=jedavie, shared.loader=${catalina.base}/shared/classes,${catalina.base}/shared/lib/*.jar, jboss.bind.address=0.0.0.0, tomcat.util.buf.StringCache.byte.enabled=true, connection.driver_class=oracle.jdbc.driver.OracleDriver, jboss.home.dir=C:\jboss-4.0.3RC1\jboss-4.0.3RC1, user.language=en, java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory, sun.boot.library.path=C:\Program Files\Java\jdk1.5.0_04\jre\bin, dialect=org.hibernate.dialect.Oracle9Dialect, jboss.home.url=file:/C:/jboss-4.0.3RC1/jboss-4.0.3RC1/, java.version=1.5.0_04, user.timezone=America/Denver, jboss.server.home.dir=C:\jboss-4.0.3RC1\jboss-4.0.3RC1\server\default, sun.arch.data.model=32, java.endorsed.dirs=C:\jboss-4.0.3RC1\jboss-4.0.3RC1\lib\endorsed, jboss.server.home.url=file:/C:/jboss-4.0.3RC1/jboss-4.0.3RC1/server/default/, sun.cpu.isalist=, sun.jnu.encoding=Cp1252, file.encoding.pkg=sun.io, package.access=sun.,org.apache.catalina.,org.apache.coyote.,org.apache.tomcat.,org.apache.jasper.,sun.beans., file.separator=\, java.specification.name=Java Platform API Specification, hibernate.cglib.use_reflection_optimizer=true, java.class.version=49.0, jboss.server.config.url=file:/C:/jboss-4.0.3RC1/jboss-4.0.3RC1/server/default/conf/, user.country=US, connection.url=jdbc:oracle:thin:@fwcis.sandia.gov:1514:secom, java.home=C:\Program Files\Java\jdk1.5.0_04\jre, java.vm.info=mixed mode, jboss.lib.url=file:/C:/jboss-4.0.3RC1/jboss-4.0.3RC1/lib/, os.version=5.1, path.separator=;, connection.password=cis, java.vm.version=1.5.0_04-b05, hibernate.connection.password=cis, user.variant=, java.protocol.handler.pkgs=org.jboss.net.protocol, java.awt.printerjob=sun.awt.windows.WPrinterJob, sun.io.unicode.encoding=UnicodeLittle, awt.toolkit=sun.awt.windows.WToolkit, hibernate.connection.username=secadmin, package.definition=sun.,java.,org.apache.catalina.,org.apache.coyote.,org.apache.tomcat.,org.apache.jasper., jboss.server.temp.dir=C:\jboss-4.0.3RC1\jboss-4.0.3RC1\server\default\tmp, java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces, user.home=C:\Documents and Settings\jedavie, java.rmi.server.RMIClassLoaderSpi=org.jboss.system.JBossRMIClassLoader, java.specification.vendor=Sun Microsystems Inc., jboss.home=C:\jboss-4.0.3RC1\jboss-4.0.3RC1, java.library.path=C:\Program Files\Java\jdk1.5.0_04\bin, java.vendor.url=http://java.sun.com/, hibernate.connection.driver_class=oracle.jdbc.driver.OracleDriver, connection.username=secadmin, java.vm.vendor=Sun Microsystems Inc., hibernate.dialect=org.hibernate.dialect.Oracle9Dialect, common.loader=${catalina.home}/common/classes,${catalina.home}/common/i18n/*.jar,${catalina.home}/common/endorsed/*.jar,${catalina.home}/common/lib/*.jar, java.runtime.name=Java(TM) 2 Runtime Environment, Standard Edition, java.class.path=C:\Program Files\Java\jdk1.5.0_04/lib/tools.jar;C:\jboss-4.0.3RC1\jboss-4.0.3RC1/bin/run.jar, jbossmx.loader.repository.class=org.jboss.mx.loading.UnifiedLoaderRepository3, java.vm.specification.name=Java Virtual Machine Specification, java.vm.specification.version=1.0, catalina.home=C:\jboss-4.0.3RC1\jboss-4.0.3RC1\server\default, sun.cpu.endian=little, sun.os.patch.level=Service Pack 2, jboss.server.lib.url=file:/C:/jboss-4.0.3RC1/jboss-4.0.3RC1/server/default/lib/, java.rmi.server.codebase=http://jedavie2-xp:8083/, java.io.tmpdir=C:\DOCUME~1\jedavie\LOCALS~1\Temp\, java.vendor.url.bug=http://java.sun.com/cgi-bin/bugreport.cgi, server.loader=${catalina.home}/server/classes,${catalina.home}/server/lib/*.jar, jboss.server.data.dir=C:\jboss-4.0.3RC1\jboss-4.0.3RC1\server\default\data, os.arch=x86, java.awt.graphicsenv=sun.awt.Win32GraphicsEnvironment, myeclipse.connection.profile=oracle_thin, java.ext.dirs=C:\Program Files\Java\jdk1.5.0_04\jre\lib\ext, user.dir=C:\jboss-4.0.3RC1\jboss-4.0.3RC1\bin, line.separator=
    , java.vm.name=Java HotSpot(TM) Client VM, jboss.server.base.dir=C:\jboss-4.0.3RC1\jboss-4.0.3RC1\server, hibernate.myeclipse.connection.profile=oracle_thin, jboss.server.base.url=file:/C:/jboss-4.0.3RC1/jboss-4.0.3RC1/server/, javax.management.builder.initial=org.jboss.mx.server.MBeanServerBuilderImpl, file.encoding=Cp1252, catalina.ext.dirs=C:\jboss-4.0.3RC1\jboss-4.0.3RC1\server\default\lib, java.specification.version=1.5, jboss.server.name=default}
    2006-01-26 08:10:25,594 DEBUG [org.hibernate.cfg.Configuration] Preparing to build session factory with filters : {}
    2006-01-26 08:10:25,594 INFO [org.hibernate.cfg.Configuration] processing extends queue
    2006-01-26 08:10:25,594 INFO [org.hibernate.cfg.Configuration] processing collection mappings
    2006-01-26 08:10:25,594 INFO [org.hibernate.cfg.Configuration] processing association property references
    2006-01-26 08:10:25,594 INFO [org.hibernate.cfg.Configuration] processing foreign key constraints
    2006-01-26 08:10:25,672 INFO [org.hibernate.connection.DriverManagerConnectionProvider] Using Hibernate built-in connection pool (not for production use!)
    2006-01-26 08:10:25,672 INFO [org.hibernate.connection.DriverManagerConnectionProvider] Hibernate connection pool size: 20
    2006-01-26 08:10:25,672 INFO [org.hibernate.connection.DriverManagerConnectionProvider] autocommit mode: false
    2006-01-26 08:10:25,672 INFO [org.hibernate.connection.DriverManagerConnectionProvider] using driver: oracle.jdbc.driver.OracleDriver at URL: jdbc:oracle:thin:@fwcis.sandia.gov:1514:secom
    2006-01-26 08:10:25,672 INFO [org.hibernate.connection.DriverManagerConnectionProvider] connection properties: {user=secadmin, password=cis}
    2006-01-26 08:10:25,672 DEBUG [org.hibernate.connection.DriverManagerConnectionProvider] total checked-out connections: 0
    2006-01-26 08:10:25,672 DEBUG [org.hibernate.connection.DriverManagerConnectionProvider] opening new JDBC connection
    2006-01-26 08:10:25,953 DEBUG [org.hibernate.connection.DriverManagerConnectionProvider] created connection to: jdbc:oracle:thin:@fwcis.sandia.gov:1514:secom, Isolation Level: 2
    2006-01-26 08:10:25,953 DEBUG [org.hibernate.cfg.SettingsFactory] could not get database version from JDBC metadata
    2006-01-26 08:10:25,953 INFO [org.hibernate.cfg.SettingsFactory] RDBMS: Oracle, version: Oracle8i Enterprise Edition Release 8.1.7.2.0 – Production
    With the Partitioning option
    JServer Release 8.1.7.2.0 – Production
    2006-01-26 08:10:25,953 INFO [org.hibernate.cfg.SettingsFactory] JDBC driver: Oracle JDBC driver, version: 9.0.1.3.0
    2006-01-26 08:10:25,953 DEBUG [org.hibernate.connection.DriverManagerConnectionProvider] returning connection to pool, pool size: 1
    2006-01-26 08:10:26,000 INFO [org.hibernate.dialect.Dialect] Using dialect: org.hibernate.dialect.Oracle9Dialect
    2006-01-26 08:10:26,015 INFO [org.hibernate.transaction.TransactionFactoryFactory] Using default transaction strategy (direct JDBC transactions)
    2006-01-26 08:10:26,015 INFO [org.hibernate.transaction.TransactionManagerLookupFactory] No TransactionManagerLookup configured (in JTA environment, use of read-write or transactional second-level cache is not recommended)
    2006-01-26 08:10:26,015 INFO [org.hibernate.cfg.SettingsFactory] Automatic flush during beforeCompletion(): disabled
    2006-01-26 08:10:26,015 INFO [org.hibernate.cfg.SettingsFactory] Automatic session close at end of transaction: disabled
    2006-01-26 08:10:26,015 INFO [org.hibernate.cfg.SettingsFactory] JDBC batch size: 15
    2006-01-26 08:10:26,015 INFO [org.hibernate.cfg.SettingsFactory] JDBC batch updates for versioned data: disabled
    2006-01-26 08:10:26,015 INFO [org.hibernate.cfg.SettingsFactory] Scrollable result sets: enabled
    2006-01-26 08:10:26,015 DEBUG [org.hibernate.cfg.SettingsFactory] Wrap result sets: disabled
    2006-01-26 08:10:26,015 INFO [org.hibernate.cfg.SettingsFactory] JDBC3 getGeneratedKeys(): disabled
    2006-01-26 08:10:26,015 INFO [org.hibernate.cfg.SettingsFactory] Connection release mode: null
    2006-01-26 08:10:26,015 INFO [org.hibernate.cfg.SettingsFactory] Default batch fetch size: 1
    2006-01-26 08:10:26,015 INFO [org.hibernate.cfg.SettingsFactory] Generate SQL with comments: disabled
    2006-01-26 08:10:26,015 INFO [org.hibernate.cfg.SettingsFactory] Order SQL updates by primary key: disabled
    2006-01-26 08:10:26,015 INFO [org.hibernate.cfg.SettingsFactory] Query translator: org.hibernate.hql.ast.ASTQueryTranslatorFactory
    2006-01-26 08:10:26,015 INFO [org.hibernate.hql.ast.ASTQueryTranslatorFactory] Using ASTQueryTranslatorFactory
    2006-01-26 08:10:26,015 INFO [org.hibernate.cfg.SettingsFactory] Query language substitutions: {}
    2006-01-26 08:10:26,015 INFO [org.hibernate.cfg.SettingsFactory] Second-level cache: enabled
    2006-01-26 08:10:26,015 INFO [org.hibernate.cfg.SettingsFactory] Query cache: disabled
    2006-01-26 08:10:26,015 INFO [org.hibernate.cfg.SettingsFactory] Cache provider: org.hibernate.cache.EhCacheProvider
    2006-01-26 08:10:26,031 INFO [org.hibernate.cfg.SettingsFactory] Optimize cache for minimal puts: disabled
    2006-01-26 08:10:26,031 INFO [org.hibernate.cfg.SettingsFactory] Structured second-level cache entries: disabled
    2006-01-26 08:10:26,031 DEBUG [org.hibernate.exception.SQLExceptionConverterFactory] Using dialect defined converter
    2006-01-26 08:10:26,031 INFO [org.hibernate.cfg.SettingsFactory] Statistics: disabled
    2006-01-26 08:10:26,031 INFO [org.hibernate.cfg.SettingsFactory] Deleted entity synthetic identifier rollback: disabled
    2006-01-26 08:10:26,031 INFO [org.hibernate.cfg.SettingsFactory] Default entity-mode: pojo
    2006-01-26 08:10:26,156 INFO [org.hibernate.impl.SessionFactoryImpl] building session factory
    2006-01-26 08:10:26,156 DEBUG [org.hibernate.impl.SessionFactoryImpl] Session factory constructed with filter configurations : {}
    2006-01-26 08:10:26,156 DEBUG [org.hibernate.impl.SessionFactoryImpl] instantiating session factory with properties: {java.vendor=Sun Microsystems Inc., catalina.base=C:\jboss-4.0.3RC1\jboss-4.0.3RC1\server\default, hibernate.connection.url=jdbc:oracle:thin:@fwcis.sandia.gov:1514:secom, sun.management.compiler=HotSpot Client Compiler, catalina.useNaming=false, os.name=Windows XP, sun.boot.class.path=C:\jboss-4.0.3RC1\jboss-4.0.3RC1\lib\endorsed\resolver.jar;C:\jboss-4.0.3RC1\jboss-4.0.3RC1\lib\endorsed\xalan.jar;C:\jboss-4.0.3RC1\jboss-4.0.3RC1\lib\endorsed\xercesImpl.jar;C:\jboss-4.0.3RC1\jboss-4.0.3RC1\lib\endorsed\xml-apis.jar;C:\Program Files\Java\jdk1.5.0_04\jre\lib\rt.jar;C:\Program Files\Java\jdk1.5.0_04\jre\lib\i18n.jar;C:\Program Files\Java\jdk1.5.0_04\jre\lib\sunrsasign.jar;C:\Program Files\Java\jdk1.5.0_04\jre\lib\jsse.jar;C:\Program Files\Java\jdk1.5.0_04\jre\lib\jce.jar;C:\Program Files\Java\jdk1.5.0_04\jre\lib\charsets.jar;C:\Program Files\Java\jdk1.5.0_04\jre\classes, sun.desktop=windows, java.vm.specification.vendor=Sun Microsystems Inc., java.runtime.version=1.5.0_04-b05, user.name=jedavie, shared.loader=${catalina.base}/shared/classes,${catalina.base}/shared/lib/*.jar, jboss.bind.address=0.0.0.0, tomcat.util.buf.StringCache.byte.enabled=true, connection.driver_class=oracle.jdbc.driver.OracleDriver, jboss.home.dir=C:\jboss-4.0.3RC1\jboss-4.0.3RC1, user.language=en, java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory, sun.boot.library.path=C:\Program Files\Java\jdk1.5.0_04\jre\bin, dialect=org.hibernate.dialect.Oracle9Dialect, jboss.home.url=file:/C:/jboss-4.0.3RC1/jboss-4.0.3RC1/, java.version=1.5.0_04, user.timezone=America/Denver, jboss.server.home.dir=C:\jboss-4.0.3RC1\jboss-4.0.3RC1\server\default, sun.arch.data.model=32, java.endorsed.dirs=C:\jboss-4.0.3RC1\jboss-4.0.3RC1\lib\endorsed, jboss.server.home.url=file:/C:/jboss-4.0.3RC1/jboss-4.0.3RC1/server/default/, sun.cpu.isalist=, sun.jnu.encoding=Cp1252, file.encoding.pkg=sun.io, package.access=sun.,org.apache.catalina.,org.apache.coyote.,org.apache.tomcat.,org.apache.jasper.,sun.beans., file.separator=\, java.specification.name=Java Platform API Specification, hibernate.cglib.use_reflection_optimizer=true, java.class.version=49.0, jboss.server.config.url=file:/C:/jboss-4.0.3RC1/jboss-4.0.3RC1/server/default/conf/, user.country=US, connection.url=jdbc:oracle:thin:@fwcis.sandia.gov:1514:secom, java.home=C:\Program Files\Java\jdk1.5.0_04\jre, java.vm.info=mixed mode, jboss.lib.url=file:/C:/jboss-4.0.3RC1/jboss-4.0.3RC1/lib/, os.version=5.1, path.separator=;, connection.password=cis, java.vm.version=1.5.0_04-b05, hibernate.connection.password=cis, user.variant=, java.protocol.handler.pkgs=org.jboss.net.protocol, java.awt.printerjob=sun.awt.windows.WPrinterJob, sun.io.unicode.encoding=UnicodeLittle, awt.toolkit=sun.awt.windows.WToolkit, hibernate.connection.username=secadmin, package.definition=sun.,java.,org.apache.catalina.,org.apache.coyote.,org.apache.tomcat.,org.apache.jasper., jboss.server.temp.dir=C:\jboss-4.0.3RC1\jboss-4.0.3RC1\server\default\tmp, java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces, user.home=C:\Documents and Settings\jedavie, java.rmi.server.RMIClassLoaderSpi=org.jboss.system.JBossRMIClassLoader, java.specification.vendor=Sun Microsystems Inc., jboss.home=C:\jboss-4.0.3RC1\jboss-4.0.3RC1, java.library.path=C:\Program Files\Java\jdk1.5.0_04\bin, java.vendor.url=http://java.sun.com/, hibernate.connection.driver_class=oracle.jdbc.driver.OracleDriver, connection.username=secadmin, java.vm.vendor=Sun Microsystems Inc., hibernate.dialect=org.hibernate.dialect.Oracle9Dialect, common.loader=${catalina.home}/common/classes,${catalina.home}/common/i18n/*.jar,${catalina.home}/common/endorsed/*.jar,${catalina.home}/common/lib/*.jar, java.runtime.name=Java(TM) 2 Runtime Environment, Standard Edition, java.class.path=C:\Program Files\Java\jdk1.5.0_04/lib/tools.jar;C:\jboss-4.0.3RC1\jboss-4.0.3RC1/bin/run.jar, jbossmx.loader.repository.class=org.jboss.mx.loading.UnifiedLoaderRepository3, java.vm.specification.name=Java Virtual Machine Specification, java.vm.specification.version=1.0, catalina.home=C:\jboss-4.0.3RC1\jboss-4.0.3RC1\server\default, sun.cpu.endian=little, sun.os.patch.level=Service Pack 2, jboss.server.lib.url=file:/C:/jboss-4.0.3RC1/jboss-4.0.3RC1/server/default/lib/, java.rmi.server.codebase=http://jedavie2-xp:8083/, java.io.tmpdir=C:\DOCUME~1\jedavie\LOCALS~1\Temp\, java.vendor.url.bug=http://java.sun.com/cgi-bin/bugreport.cgi, server.loader=${catalina.home}/server/classes,${catalina.home}/server/lib/*.jar, jboss.server.data.dir=C:\jboss-4.0.3RC1\jboss-4.0.3RC1\server\default\data, os.arch=x86, java.awt.graphicsenv=sun.awt.Win32GraphicsEnvironment, myeclipse.connection.profile=oracle_thin, java.ext.dirs=C:\Program Files\Java\jdk1.5.0_04\jre\lib\ext, user.dir=C:\jboss-4.0.3RC1\jboss-4.0.3RC1\bin, line.separator=
    , java.vm.name=Java HotSpot(TM) Client VM, jboss.server.base.dir=C:\jboss-4.0.3RC1\jboss-4.0.3RC1\server, hibernate.myeclipse.connection.profile=oracle_thin, jboss.server.base.url=file:/C:/jboss-4.0.3RC1/jboss-4.0.3RC1/server/, javax.management.builder.initial=org.jboss.mx.server.MBeanServerBuilderImpl, file.encoding=Cp1252, catalina.ext.dirs=C:\jboss-4.0.3RC1\jboss-4.0.3RC1\server\default\lib, java.specification.version=1.5, jboss.server.name=default}
    2006-01-26 08:10:26,156 DEBUG [net.sf.ehcache.CacheManager] Creating new CacheManager with default config
    2006-01-26 08:10:26,172 DEBUG [net.sf.ehcache.CacheManager] Configuring ehcache from classpath.
    2006-01-26 08:10:26,172 WARN [net.sf.ehcache.config.Configurator] No configuration found. Configuring ehcache from ehcache-failsafe.xml found in the classpath: jar:file:/C:/jboss-4.0.3RC1/jboss-4.0.3RC1/server/default/lib/ehcache-1.1.jar!/ehcache-failsafe.xml
    2006-01-26 08:10:26,172 DEBUG [net.sf.ehcache.config.Configuration$DiskStore] Disk Store Path: C:\DOCUME~1\jedavie\LOCALS~1\Temp\
    2006-01-26 08:10:26,390 DEBUG [org.hibernate.persister.entity.BasicEntityPersister] Static SQL for entity: gov.sandia.sesman.Cmpproduct
    2006-01-26 08:10:26,390 DEBUG [org.hibernate.persister.entity.BasicEntityPersister] Version select: select TRIP_ID from SECADMIN.CMPPRODUCT where TRIP_ID =?
    2006-01-26 08:10:26,390 DEBUG [org.hibernate.persister.entity.BasicEntityPersister] Snapshot select: select cmpproduct_.TRIP_ID, cmpproduct_.TRANSMODE as TRANSMODE0_, cmpproduct_.CLASSIFICATION as CLASSIFI3_0_, cmpproduct_.STATUS as STATUS0_ from SECADMIN.CMPPRODUCT cmpproduct_ where cmpproduct_.TRIP_ID=?
    2006-01-26 08:10:26,390 DEBUG [org.hibernate.persister.entity.BasicEntityPersister] Insert 0: insert into SECADMIN.CMPPRODUCT (TRANSMODE, CLASSIFICATION, STATUS, TRIP_ID) values (?, ?, ?, ?)
    2006-01-26 08:10:26,390 DEBUG [org.hibernate.persister.entity.BasicEntityPersister] Update 0: update SECADMIN.CMPPRODUCT set TRANSMODE=?, CLASSIFICATION=?, STATUS=? where TRIP_ID=?
    2006-01-26 08:10:26,390 DEBUG [org.hibernate.persister.entity.BasicEntityPersister] Delete 0: delete from SECADMIN.CMPPRODUCT where TRIP_ID=?
    2006-01-26 08:10:26,406 DEBUG [org.hibernate.loader.entity.EntityLoader] Static select for entity gov.sandia.sesman.Cmpproduct: select cmpproduct0_.TRIP_ID as TRIP1_0_, cmpproduct0_.TRANSMODE as TRANSMODE0_0_, cmpproduct0_.CLASSIFICATION as CLASSIFI3_0_0_, cmpproduct0_.STATUS as STATUS0_0_ from SECADMIN.CMPPRODUCT cmpproduct0_ where cmpproduct0_.TRIP_ID=?
    2006-01-26 08:10:26,406 DEBUG [org.hibernate.loader.entity.EntityLoader] Static select for entity gov.sandia.sesman.Cmpproduct: select cmpproduct0_.TRIP_ID as TRIP1_0_, cmpproduct0_.TRANSMODE as TRANSMODE0_0_, cmpproduct0_.CLASSIFICATION as CLASSIFI3_0_0_, cmpproduct0_.STATUS as STATUS0_0_ from SECADMIN.CMPPRODUCT cmpproduct0_ where cmpproduct0_.TRIP_ID=?
    2006-01-26 08:10:26,406 DEBUG [org.hibernate.loader.entity.EntityLoader] Static select for entity gov.sandia.sesman.Cmpproduct: select cmpproduct0_.TRIP_ID as TRIP1_0_, cmpproduct0_.TRANSMODE as TRANSMODE0_0_, cmpproduct0_.CLASSIFICATION as CLASSIFI3_0_0_, cmpproduct0_.STATUS as STATUS0_0_ from SECADMIN.CMPPRODUCT cmpproduct0_ where cmpproduct0_.TRIP_ID=? for update
    2006-01-26 08:10:26,406 DEBUG [org.hibernate.loader.entity.EntityLoader] Static select for entity gov.sandia.sesman.Cmpproduct: select cmpproduct0_.TRIP_ID as TRIP1_0_, cmpproduct0_.TRANSMODE as TRANSMODE0_0_, cmpproduct0_.CLASSIFICATION as CLASSIFI3_0_0_, cmpproduct0_.STATUS as STATUS0_0_ from SECADMIN.CMPPRODUCT cmpproduct0_ where cmpproduct0_.TRIP_ID=? for update nowait
    2006-01-26 08:10:26,406 DEBUG [org.hibernate.impl.SessionFactoryObjectFactory] initializing class SessionFactoryObjectFactory
    2006-01-26 08:10:26,406 DEBUG [org.hibernate.impl.SessionFactoryObjectFactory] registered: 067d8ce2090743ee01090743f0660000 (unnamed)
    2006-01-26 08:10:26,422 INFO [org.hibernate.impl.SessionFactoryObjectFactory] Not binding factory to JNDI, no JNDI name configured
    2006-01-26 08:10:26,422 DEBUG [org.hibernate.impl.SessionFactoryImpl] instantiated session factory
    2006-01-26 08:10:26,422 INFO [org.hibernate.impl.SessionFactoryImpl] Checking 0 named queries
    2006-01-26 08:10:26,422 INFO [STDOUT] factory ready
    2006-01-26 08:10:26,422 ERROR [org.jboss.ejb.plugins.LogInterceptor] RuntimeException in method: public abstract gov.sandia.sesman.Cmpproduct gov.sandia.sesman.interfaces.SesMan.wrtRow() throws java.rmi.RemoteException,java.lang.Exception:
    java.lang.RuntimeException: javax.naming.NameNotFoundException: hibernate not bound

    *************************************************

    About MyEclipse

    *** Date: Thu Jan 26 08:45:40 MST 2006

    *** System properties:
    OS=WindowsXP
    OS version=5.1
    Java version=1.5.0_04

    *** MyEclipse details:
    MyEclipse Enterprise Workbench

    Version: 4.0.200 M2
    Build id: 20051205-4.1-Milestone2

    *** Eclipse details:
    Eclipse SDK

    Version: 3.1.1
    Build id: M20050929-0840

    Eclipse Platform

    Version: 3.1.1
    Build id: M20050929-0840

    Eclipse RCP

    Version: 3.1.1
    Build id: M20050929-0840

    Eclipse Java Development Tools

    Version: 3.1.1
    Build id: M20050929-0840

    Eclipse Plug-in Development Environment

    Version: 3.1.1
    Build id: M20050929-0840

    Eclipse Project SDK

    Version: 3.1.1
    Build id: M20050929-0840

    Eclipse startup command=-os
    win32
    -ws
    win32
    -arch
    x86
    -launcher
    C:\eclipse-SDK-3.1.1-win32\eclipse\eclipse.exe
    -name
    Eclipse
    -showsplash
    600
    -exitdata
    9f4_64
    -vm
    C:\WINDOWS\system32\javaw.exe

    ***********************************************************

    MyEclipse ErrorLog

    !ENTRY org.eclipse.ui 4 0 2006-01-25 14:47:16.903
    !MESSAGE Warning: Detected recursive attempt by part com.genuitec.eclipse.hibernate.editors.HibernateConfigXMLEditor to create itself (this is probably, but not necessarily, a bug)
    !STACK 1
    org.eclipse.ui.PartInitException: Warning: Detected recursive attempt by part com.genuitec.eclipse.hibernate.editors.HibernateConfigXMLEditor to create itself (this is probably, but not necessarily, a bug)
    at org.eclipse.ui.internal.WorkbenchPartReference.getPart(WorkbenchPartReference.java:543)
    at org.eclipse.ui.internal.EditorReference.getEditor(EditorReference.java:223)
    at org.eclipse.ui.internal.EditorManager.findEditor(EditorManager.java:477)
    at org.eclipse.ui.internal.EditorManager.findEditor(EditorManager.java:402)
    at org.eclipse.ui.internal.EditorManager.findEditor(EditorManager.java:372)
    at org.eclipse.ui.internal.WorkbenchPage.findEditor(WorkbenchPage.java:1780)
    at com.genuitec.eclipse.core.util.EditorUtil.getEditorForInput(Unknown Source)
    at com.genuitec.eclipse.core.util.EditorUtil.checkConflictingEditor(Unknown Source)
    at com.ibm.xmleditor.internal.XMLMultiPageEditorPart.init(XMLMultiPageEditorPart.java:568)
    at org.eclipse.ui.internal.EditorManager.createSite(EditorManager.java:778)
    at org.eclipse.ui.internal.EditorReference.createPartHelper(EditorReference.java:596)
    at org.eclipse.ui.internal.EditorReference.createPart(EditorReference.java:384)
    at org.eclipse.ui.internal.WorkbenchPartReference.getPart(WorkbenchPartReference.java:552)
    at org.eclipse.ui.internal.EditorReference.getEditor(EditorReference.java:223)
    at org.eclipse.ui.internal.EditorManager.findEditor(EditorManager.java:477)
    at org.eclipse.ui.internal.EditorManager.findEditor(EditorManager.java:402)
    at org.eclipse.ui.internal.WorkbenchPage.busyOpenEditorBatched(WorkbenchPage.java:2311)
    at org.eclipse.ui.internal.WorkbenchPage.busyOpenEditor(WorkbenchPage.java:2295)
    at org.eclipse.ui.internal.WorkbenchPage.access$9(WorkbenchPage.java:2287)
    at org.eclipse.ui.internal.WorkbenchPage$9.run(WorkbenchPage.java:2273)
    at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:69)
    at org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPage.java:2268)
    at org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPage.java:2249)
    at org.eclipse.ui.ide.IDE.openEditor(IDE.java:371)
    at org.eclipse.ui.ide.IDE.openEditor(IDE.java:334)
    at org.eclipse.jdt.internal.ui.javaeditor.EditorUtility.openInEditor(EditorUtility.java:251)
    at org.eclipse.jdt.internal.ui.javaeditor.EditorUtility.openInEditor(EditorUtility.java:131)
    at org.eclipse.jdt.internal.ui.actions.OpenActionUtil.open(OpenActionUtil.java:49)
    at org.eclipse.jdt.ui.actions.OpenAction.run(OpenAction.java:169)
    at org.eclipse.jdt.ui.actions.OpenAction.run(OpenAction.java:153)
    at org.eclipse.jdt.ui.actions.SelectionDispatchAction.dispatchRun(SelectionDispatchAction.java:222)
    at org.eclipse.jdt.ui.actions.SelectionDispatchAction.run(SelectionDispatchAction.java:198)
    at org.eclipse.jdt.internal.ui.packageview.PackageExplorerActionGroup.handleOpen(PackageExplorerActionGroup.java:296)
    at org.eclipse.jdt.internal.ui.packageview.PackageExplorerPart$4.open(PackageExplorerPart.java:869)
    at org.eclipse.jface.viewers.StructuredViewer$2.run(StructuredViewer.java:741)
    at org.eclipse.core.internal.runtime.InternalPlatform.run(InternalPlatform.java:1044)
    at org.eclipse.core.runtime.Platform.run(Platform.java:783)
    at org.eclipse.ui.internal.JFaceUtil$1.run(JFaceUtil.java:44)
    at org.eclipse.jface.util.SafeRunnable.run(SafeRunnable.java:148)
    at org.eclipse.jface.viewers.StructuredViewer.fireOpen(StructuredViewer.java:739)
    at org.eclipse.jface.viewers.StructuredViewer.handleOpen(StructuredViewer.java:968)
    at org.eclipse.jface.viewers.StructuredViewer$6.handleOpen(StructuredViewer.java:1067)
    at org.eclipse.jface.util.OpenStrategy.fireOpenEvent(OpenStrategy.java:243)
    at org.eclipse.jface.util.OpenStrategy.access$2(OpenStrategy.java:238)
    at org.eclipse.jface.util.OpenStrategy$1.handleEvent(OpenStrategy.java:277)
    at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:66)
    at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:843)
    at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3080)
    at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2713)
    at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:1699)
    at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:1663)
    at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:367)
    at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:143)
    at org.eclipse.ui.internal.ide.IDEApplication.run(IDEApplication.java:103)
    at org.eclipse.core.internal.runtime.PlatformActivator$1.run(PlatformActivator.java:226)
    at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:376)
    at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:163)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at org.eclipse.core.launcher.Main.invokeFramework(Main.java:334)
    at org.eclipse.core.launcher.Main.basicRun(Main.java:278)
    at org.eclipse.core.launcher.Main.run(Main.java:973)
    at org.eclipse.core.launcher.Main.main(Main.java:948)
    !SUBENTRY 1 org.eclipse.ui 4 0 2006-01-25 14:47:16.903
    !MESSAGE Warning: Detected recursive attempt by part com.genuitec.eclipse.hibernate.editors.HibernateConfigXMLEditor to create itself (this is probably, but not necessarily, a bug)

    #245431 Reply

    Riyad Kalla
    Member

    IIRC the <session-factory> tag has a name attribute, try using that:

    
    <session-factory name="java:comp/hibernate/SessionFactory">
    ....
    </session-factory>
    
    #245474 Reply

    jedavie
    Member

    Riyad,

    Thanks for the fast response. Unfortunately, the error still persists no matter whether I define the JNDI name using a <session-factory name> tag or a <property name> tag with the hibernate.cfg.xml. I can’t understand where the problem might be, because the JBoss app server console clearly shows other properties from the hibernate.cfg.xml file being read and utilized. Any other ideas or suggestions?
    Thanks,
    Jim

    #245506 Reply

    Riyad Kalla
    Member
Viewing 4 posts - 1 through 4 (of 4 total)
Reply To: Can’t bind named Hibernate SessionFactory into JNDI

You must be logged in to post in the forum log in