<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<body link="#355491" alink="#4262a1" vlink="#355491" style="background: #e2e2e2; margin: 0; padding: 20px;">
<div>
        <table cellpadding="0" bgcolor="#FFFFFF" border="0" cellspacing="0" style="border: 1px solid #dadada; margin-bottom: 30px; width: 100%; -moz-border-radius: 6px; -webkit-border-radius: 6px;">
                <tbody>
                        <tr>
                                <td>
                                        <table border="0" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF" style="border: solid 2px #ccc; background: #dadada; width: 100%; -moz-border-radius: 6px; -webkit-border-radius: 6px;">
                                                <tbody>
                                                        <tr>
                                                                <td bgcolor="#000000" valign="middle" height="58px" style="border-bottom: 1px solid #ccc; padding: 20px; -moz-border-radius-topleft: 3px; -moz-border-radius-topright: 3px; -webkit-border-top-right-radius: 5px; -webkit-border-top-left-radius: 5px;">
                                                                        <h1 style="color: #333333; font: bold 22px Arial, Helvetica, sans-serif; margin: 0; display: block !important;">
                                                                        <!-- To have a header image/logo replace the name below with your img tag -->
                                                                        <!-- Email clients will render the images when the message is read so any image -->
                                                                        <!-- must be made available on a public server, so that all recipients can load the image. -->
                                                                        <a href="http://community.jboss.org/index.jspa" style="text-decoration: none; color: #E1E1E1">Community</a></h1>
                                                                </td>
                                                        </tr>
                                                        <tr>
                                                                <td bgcolor="#FFFFFF" style="font: normal 12px Arial, Helvetica, sans-serif; color:#333333; padding: 20px; -moz-border-radius-bottomleft: 4px; -moz-border-radius-bottomright: 4px; -webkit-border-bottom-right-radius: 5px; -webkit-border-bottom-left-radius: 5px;"><h3 style="margin: 10px 0 5px; font-size: 17px; font-weight: normal;">
Binding a SessionFactory
</h3>
<span style="margin-bottom: 10px;">
reply from <a href="http://community.jboss.org/people/lulseged">Lulseged Zerfu</a> in <i>JNDI and Naming</i> - <a href="http://community.jboss.org/message/537092#537092">View the full discussion</a>
</span>
<hr style="margin: 20px 0; border: none; background-color: #dadada; height: 1px;">
<div class="jive-rendered-content"><p>Hi</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>Yes I have removed it but there is an exception while creating a SessionFactory.</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>Lulseged</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>2010-04-13 11:00:18,795 INFO [org.hibernate.cfg.Environment] - <Hibernate 3.5.0-Final></p><p>2010-04-13 11:00:18,800 INFO [org.hibernate.cfg.Environment] - <loaded properties from resource hibernate.properties: {hibernate.c3p0.timeout=1800, hibernate.use_sql_comments=true, hibernate.cache.provider_class=net.sf.ehcache.hibernate.SingletonEhCacheProvider, hibernate.c3p0.max_statements=50, hibernate.c3p0.max_size=20, hibernate.cache.use_query_cache=true, hibernate.cache.use_second_level_cache=true, hibernate.cache.use_structured_entries=true, hibernate.c3p0.min_size=5, hibernate.generate_statistics=true, hibernate.bytecode.use_reflection_optimizer=false}></p><p>2010-04-13 11:00:18,805 INFO [org.hibernate.cfg.Environment] - <Bytecode provider name : javassist></p><p>2010-04-13 11:00:18,812 INFO [org.hibernate.cfg.Environment] - <using JDK 1.4 java.sql.Timestamp handling></p><p>2010-04-13 11:00:18,971 INFO [org.hibernate.cfg.Configuration] - <configuring from resource: /hibernate.cfg.xml></p><p>2010-04-13 11:00:18,971 INFO [org.hibernate.cfg.Configuration] - <Configuration resource: /hibernate.cfg.xml></p><p>2010-04-13 11:00:19,082 INFO [org.hibernate.cfg.Configuration] - <Reading mappings from resource : hbm/ResourceListUser.hbm.xml></p><p>2010-04-13 11:00:19,170 INFO [org.hibernate.cfg.HbmBinder] - <Mapping class: com.ericsson.ims.pag.xdms.resource.list.domain.ResourceListUser -> presentity></p><p>2010-04-13 11:00:19,192 INFO [org.hibernate.cfg.Configuration] - <Reading mappings from resource : hbm/ResourceList.hbm.xml></p><p>2010-04-13 11:00:19,216 INFO [org.hibernate.cfg.HbmBinder] - <Mapping class: com.ericsson.ims.pag.xdms.resource.list.domain.ResourceList -> resourcelist></p><p>2010-04-13 11:00:19,295 INFO [org.hibernate.cfg.Configuration] - <Reading mappings from resource : hbm/ResourceListType.hbm.xml></p><p>2010-04-13 11:00:19,315 INFO [org.hibernate.cfg.HbmBinder] - <Mapping class: com.ericsson.ims.pag.xdms.resource.list.domain.ResourceListType -> resourcelisttype></p><p>2010-04-13 11:00:19,319 INFO [org.hibernate.cfg.Configuration] - <Reading mappings from resource : hbm/ResourceListEntry.hbm.xml></p><p>2010-04-13 11:00:19,331 INFO [org.hibernate.cfg.HbmBinder] - <Mapping class: com.ericsson.ims.pag.xdms.resource.list.domain.ResourceListEntry -> resourcelistentry></p><p>2010-04-13 11:00:19,332 INFO [org.hibernate.cfg.Configuration] - <Reading mappings from resource : hbm/ResourceListEntryReference.hbm.xml></p><p>2010-04-13 11:00:19,343 INFO [org.hibernate.cfg.HbmBinder] - <Mapping class: com.ericsson.ims.pag.xdms.resource.list.domain.ResourceListEntryReference -> resourcelistentryref></p><p>2010-04-13 11:00:19,344 INFO [org.hibernate.cfg.Configuration] - <Reading mappings from resource : hbm/ResourceListExternal.hbm.xml></p><p>2010-04-13 11:00:19,354 INFO [org.hibernate.cfg.HbmBinder] - <Mapping class: com.ericsson.ims.pag.xdms.resource.list.domain.ResourceListExternal -> resourcelistexternal></p><p>2010-04-13 11:00:19,354 INFO [org.hibernate.cfg.Configuration] - <Reading mappings from resource : hbm/Subscription.hbm.xml></p><p>2010-04-13 11:00:19,365 INFO [org.hibernate.cfg.HbmBinder] - <Mapping class: com.ericsson.ims.pag.common.domain.Subscription -> subscription></p><p>2010-04-13 11:00:19,365 INFO [org.hibernate.cfg.Configuration] - <Configured SessionFactory: jdbc/resource-list></p><p>2010-04-13 11:00:19,366 INFO [org.hibernate.cfg.HbmBinder] - <Mapping collection: com.ericsson.ims.pag.xdms.resource.list.domain.ResourceListUser.subscriptions -> subscription></p><p>2010-04-13 11:00:19,367 INFO [org.hibernate.cfg.HbmBinder] - <Mapping collection: com.ericsson.ims.pag.xdms.resource.list.domain.ResourceListUser.resourceLists -> resourcelist></p><p>2010-04-13 11:00:19,367 INFO [org.hibernate.cfg.HbmBinder] - <Mapping collection: com.ericsson.ims.pag.xdms.resource.list.domain.ResourceList.resourceListTypes -> resourcelisttype></p><p>2010-04-13 11:00:19,367 INFO [org.hibernate.cfg.HbmBinder] - <Mapping collection: com.ericsson.ims.pag.xdms.resource.list.domain.ResourceListType.resourceListTypes -> resourcelisttype></p><p>2010-04-13 11:00:19,367 INFO [org.hibernate.cfg.HbmBinder] - <Mapping collection: com.ericsson.ims.pag.xdms.resource.list.domain.ResourceListType.resourceListExternals -> resourcelistexternal></p><p>2010-04-13 11:00:19,367 INFO [org.hibernate.cfg.HbmBinder] - <Mapping collection: com.ericsson.ims.pag.xdms.resource.list.domain.ResourceListType.resourceListEntryReferences -> resourcelistentryref></p><p>2010-04-13 11:00:19,367 INFO [org.hibernate.cfg.HbmBinder] - <Mapping collection: com.ericsson.ims.pag.xdms.resource.list.domain.ResourceListType.resourceListEntries -> resourcelistentry></p><p>2010-04-13 11:00:19,377 INFO [org.hibernate.connection.DriverManagerConnectionProvider] - <Using Hibernate built-in connection pool (not for production use!)></p><p>2010-04-13 11:00:19,377 INFO [org.hibernate.connection.DriverManagerConnectionProvider] - <Hibernate connection pool size: 10></p><p>2010-04-13 11:00:19,377 INFO [org.hibernate.connection.DriverManagerConnectionProvider] - <autocommit mode: false></p><p>2010-04-13 11:00:19,390 INFO [org.hibernate.connection.DriverManagerConnectionProvider] - <using driver: com.mysql.jdbc.Driver at URL: jdbc:mysql://127.0.0.1:3306/ddb></p><p>2010-04-13 11:00:19,390 INFO [org.hibernate.connection.DriverManagerConnectionProvider] - <connection properties: {user=ddbuser, password=ddbuser}></p><p>2010-04-13 11:00:19,390 TRACE [org.hibernate.connection.DriverManagerConnectionProvider] - <total checked-out connections: 0></p><p>2010-04-13 11:00:19,390 DEBUG [org.hibernate.connection.DriverManagerConnectionProvider] - <opening new JDBC connection></p><p>2010-04-13 11:00:19,686 DEBUG [org.hibernate.connection.DriverManagerConnectionProvider] - <created connection to: jdbc:mysql://127.0.0.1:3306/ddb, Isolation Level: 4></p><p>2010-04-13 11:00:19,686 INFO [org.hibernate.cfg.SettingsFactory] - <RDBMS: MySQL, version: 5.1.45-community-log></p><p>2010-04-13 11:00:19,687 INFO [org.hibernate.cfg.SettingsFactory] - <JDBC driver: MySQL-AB JDBC Driver, version: mysql-connector-java-commercial-5.1.12 ( Revision: ${bzr.revision-id} )></p><p>2010-04-13 11:00:19,731 INFO [org.hibernate.dialect.Dialect] - <Using dialect: org.hibernate.dialect.MySQLInnoDBDialect></p><p>2010-04-13 11:00:19,736 INFO [org.hibernate.engine.jdbc.JdbcSupportLoader] - <Disabling contextual LOB creation as JDBC driver reported JDBC version [3] less than 4></p><p>2010-04-13 11:00:19,736 TRACE [org.hibernate.connection.DriverManagerConnectionProvider] - <returning connection to pool, pool size: 1></p><p>2010-04-13 11:00:19,738 INFO [org.hibernate.transaction.TransactionFactoryFactory] - <Using default transaction strategy (direct JDBC transactions)></p><p>2010-04-13 11:00:19,741 INFO [org.hibernate.transaction.TransactionManagerLookupFactory] - <No TransactionManagerLookup configured (in JTA environment, use of read-write or transactional second-level cache is not recommended)></p><p>2010-04-13 11:00:19,741 INFO [org.hibernate.cfg.SettingsFactory] - <Automatic flush during beforeCompletion(): disabled></p><p>2010-04-13 11:00:19,741 INFO [org.hibernate.cfg.SettingsFactory] - <Automatic session close at end of transaction: disabled></p><p>2010-04-13 11:00:19,742 INFO [org.hibernate.cfg.SettingsFactory] - <JDBC batch size: 15></p><p>2010-04-13 11:00:19,742 INFO [org.hibernate.cfg.SettingsFactory] - <JDBC batch updates for versioned data: disabled></p><p>2010-04-13 11:00:19,743 INFO [org.hibernate.cfg.SettingsFactory] - <Scrollable result sets: enabled></p><p>2010-04-13 11:00:19,743 INFO [org.hibernate.cfg.SettingsFactory] - <JDBC3 getGeneratedKeys(): enabled></p><p>2010-04-13 11:00:19,743 INFO [org.hibernate.cfg.SettingsFactory] - <Connection release mode: auto></p><p>2010-04-13 11:00:19,744 INFO [org.hibernate.cfg.SettingsFactory] - <Default schema: ddb></p><p>2010-04-13 11:00:19,745 INFO [org.hibernate.cfg.SettingsFactory] - <Maximum outer join fetch depth: 3></p><p>2010-04-13 11:00:19,745 INFO [org.hibernate.cfg.SettingsFactory] - <Default batch fetch size: 1></p><p>2010-04-13 11:00:19,745 INFO [org.hibernate.cfg.SettingsFactory] - <Generate SQL with comments: enabled></p><p>2010-04-13 11:00:19,746 INFO [org.hibernate.cfg.SettingsFactory] - <Order SQL updates by primary key: disabled></p><p>2010-04-13 11:00:19,746 INFO [org.hibernate.cfg.SettingsFactory] - <Order SQL inserts for batching: disabled></p><p>2010-04-13 11:00:19,746 INFO [org.hibernate.cfg.SettingsFactory] - <Query translator: org.hibernate.hql.ast.ASTQueryTranslatorFactory></p><p>2010-04-13 11:00:19,748 INFO [org.hibernate.hql.ast.ASTQueryTranslatorFactory] - <Using ASTQueryTranslatorFactory></p><p>2010-04-13 11:00:19,748 INFO [org.hibernate.cfg.SettingsFactory] - <Query language substitutions: {}></p><p>2010-04-13 11:00:19,749 INFO [org.hibernate.cfg.SettingsFactory] - <JPA-QL strict compliance: disabled></p><p>2010-04-13 11:00:19,749 INFO [org.hibernate.cfg.SettingsFactory] - <Second-level cache: enabled></p><p>2010-04-13 11:00:19,749 INFO [org.hibernate.cfg.SettingsFactory] - <Query cache: enabled></p><p>2010-04-13 11:00:19,755 INFO [org.hibernate.cfg.SettingsFactory] - <Cache region factory : org.hibernate.cache.impl.bridge.RegionFactoryCacheProviderBridge></p><p>2010-04-13 11:00:19,755 INFO [org.hibernate.cache.impl.bridge.RegionFactoryCacheProviderBridge] - <Cache provider: net.sf.ehcache.hibernate.SingletonEhCacheProvider></p><p>2010-04-13 11:00:19,760 INFO [org.hibernate.cfg.SettingsFactory] - <Optimize cache for minimal puts: disabled></p><p>2010-04-13 11:00:19,760 INFO [org.hibernate.cfg.SettingsFactory] - <Structured second-level cache entries: enabled></p><p>2010-04-13 11:00:19,761 INFO [org.hibernate.cfg.SettingsFactory] - <Query cache factory: org.hibernate.cache.StandardQueryCacheFactory></p><p>2010-04-13 11:00:19,768 INFO [org.hibernate.cfg.SettingsFactory] - <Echoing all SQL to stdout></p><p>2010-04-13 11:00:19,769 INFO [org.hibernate.cfg.SettingsFactory] - <Statistics: enabled></p><p>2010-04-13 11:00:19,769 INFO [org.hibernate.cfg.SettingsFactory] - <Deleted entity synthetic identifier rollback: disabled></p><p>2010-04-13 11:00:19,769 INFO [org.hibernate.cfg.SettingsFactory] - <Default entity-mode: pojo></p><p>2010-04-13 11:00:19,770 INFO [org.hibernate.cfg.SettingsFactory] - <Named query checking : enabled></p><p>2010-04-13 11:00:19,770 INFO [org.hibernate.cfg.SettingsFactory] - <Check Nullability in Core (should be disabled when Bean Validation is on): enabled></p><p>2010-04-13 11:00:19,814 INFO [org.hibernate.impl.SessionFactoryImpl] - <building session factory></p><p> > orderByFragment(order-by)</p><p>  > sortSpecification({sort specification})</p><p>   > sortKeySpecification(sort key)</p><p>    > sortKey($PlaceHolder$.ORDERING)</p><p>    < sortKey(null)</p><p>   < sortKeySpecification(null)</p><p>  < sortSpecification(null)</p><p> < orderByFragment(null)</p><p> > orderByFragment(order-by)</p><p>  > sortSpecification({sort specification})</p><p>   > sortKeySpecification(sort key)</p><p>    > sortKey($PlaceHolder$.ORDERING)</p><p>    < sortKey(null)</p><p>   < sortKeySpecification(null)</p><p>  < sortSpecification(null)</p><p> < orderByFragment(null)</p><p> > orderByFragment(order-by)</p><p>  > sortSpecification({sort specification})</p><p>   > sortKeySpecification(sort key)</p><p>    > sortKey($PlaceHolder$.ORDERING)</p><p>    < sortKey(null)</p><p>   < sortKeySpecification(null)</p><p>  < sortSpecification(null)</p><p> < orderByFragment(null)</p><p> > orderByFragment(order-by)</p><p>  > sortSpecification({sort specification})</p><p>   > sortKeySpecification(sort key)</p><p>    > sortKey($PlaceHolder$.ORDERING)</p><p>    < sortKey(null)</p><p>   < sortKeySpecification(null)</p><p>  < sortSpecification(null)</p><p> < orderByFragment(null)</p><p>2010-04-13 11:00:20,393 INFO [org.hibernate.impl.SessionFactoryObjectFactory] - <Factory name: jdbc/resource-list></p><p>2010-04-13 11:00:20,395 INFO [org.hibernate.util.NamingHelper] - <JNDI InitialContext properties:{}></p><p>2010-04-13 11:00:20,401 WARN [org.hibernate.impl.SessionFactoryObjectFactory] - <Could not bind factory to JNDI></p><p>javax.naming.NoInitialContextException: Need to specify class name in environment or system property, or as an applet parameter, or in an application resource file:  java.naming.factory.initial</p><p>    at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:645)</p><p>    at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:288)</p><p>    at javax.naming.InitialContext.getURLOrDefaultInitCtx(InitialContext.java:325)</p><p>    at javax.naming.InitialContext.getNameParser(InitialContext.java:480)</p><p>    at org.hibernate.util.NamingHelper.bind(NamingHelper.java:75)</p><p>    at org.hibernate.impl.SessionFactoryObjectFactory.addInstance(SessionFactoryObjectFactory.java:113)</p><p>    at org.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:376)</p><p>    at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1385)</p><p>    at com.ericsson.ims.pag.xdms.resource.list.session.ResourceListSession.<init>(ResourceListSession.java:14)</p><p>    at com.ericsson.ims.pag.xdms.resource.list.session.ResourceListSession.instance(ResourceListSession.java:30)</p><p>    at com.ericsson.ims.pag.xdms.resource.list.session.ResourceListSessionTest.setUp(ResourceListSessionTest.java:17)</p><p>    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)</p><p>    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)</p><p>    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)</p><p>    at java.lang.reflect.Method.invoke(Method.java:597)</p><p>    at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44)</p><p>    at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)</p><p>    at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41)</p><p>    at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:27)</p><p>    at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:31)</p><p>    at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:76)</p><p>    at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)</p><p>    at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193)</p><p>    at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52)</p><p>    at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191)</p><p>    at org.junit.runners.ParentRunner.access$000(ParentRunner.java:42)</p><p>    at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184)</p><p>    at org.junit.runners.ParentRunner.run(ParentRunner.java:236)</p><p>    at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:46)</p><p>    at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)</p><p>    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)</p><p>    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)</p><p>    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)</p><p>    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)</p><p>2010-04-13 11:00:20,418 INFO [org.hibernate.cache.UpdateTimestampsCache] - <starting update timestamps cache at region: org.hibernate.cache.UpdateTimestampsCache></p><p>2010-04-13 11:00:20,424 INFO [org.hibernate.cache.StandardQueryCache] - <starting query cache at region: org.hibernate.cache.StandardQueryCache></p><p>Collection counts = 0</p></div>
<div style="background-color: #f4f4f4; padding: 10px; margin-top: 20px;">
<p style="margin: 0;">Reply to this message by <a href="http://community.jboss.org/message/537092#537092">going to Community</a></p>
        <p style="margin: 0;">Start a new discussion in JNDI and Naming at <a href="http://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2083">Community</a></p>
</div></td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</div>
</body>
</html>