Hi
Can I ask another question about configuration? I am now using a hibernate.cfg.xml file (with hibernate 2.1.2 and MySql as my DB), which looks like:
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">
<hibernate-configuration>
<!-- a SessionFactory instance listed as /jndi/name -->
<session-factory name="java:comp/env/hibernate/SessionFactory">
<!-- properties -->
<property name="connection.url">jdbc:mysql://localhost:3306/mir</property>
<property name="dialect">net.sf.hibernate.dialect.MySQLDialect</property>
<!--<property name="connection.url">jdbc:mysql://localhost:3306/mir</property>-->
<property name="connection.username">arijitm</property>
<property name="connection.password">password</property>
<property name="connection.driver_class">org.gjt.mm.mysql.Driver</property>
<property name="show_sql">false</property>
<property name="use_outer_join">true</property>
<!-- mapping files -->
<!-- Package DomainData -->
<mapping resource="uk/org/mygrid/mir/infomodel/DomainData/FormatType.hbm.xml"/>
<mapping resource="uk/org/mygrid/mir/infomodel/DomainData/TransferType.hbm.xml"/>
<!-- Package EScienceProcess -->
<mapping resource="uk/org/mygrid/mir/infomodel/EScienceProcess/ExperimentDesign.hbm.xml"/>
<mapping resource="uk/org/mygrid/mir/infomodel/EScienceProcess/ExperimentInstance.hbm.xml"/>
<mapping resource="uk/org/mygrid/mir/infomodel/EScienceProcess/Study.hbm.xml"/>
<mapping resource="uk/org/mygrid/mir/infomodel/EScienceProcess/Programme.hbm.xml"/>
<mapping resource="uk/org/mygrid/mir/infomodel/EScienceProcess/LabBookView.hbm.xml"/>
<!-- Package Operations -->
<mapping resource="uk/org/mygrid/mir/infomodel/Operations/FormalInputParameter.hbm.xml"/>
<mapping resource="uk/org/mygrid/mir/infomodel/Operations/FormalOutputParameter.hbm.xml"/>
<mapping resource="uk/org/mygrid/mir/infomodel/Operations/Operation.hbm.xml"/>
<mapping resource="uk/org/mygrid/mir/infomodel/Operations/OperationContent.hbm.xml"/>
<mapping resource="uk/org/mygrid/mir/infomodel/Operations/OperationType.hbm.xml"/>
<mapping resource="uk/org/mygrid/mir/infomodel/Operations/WebService.hbm.xml"/>
<mapping resource="uk/org/mygrid/mir/infomodel/Operations/WSPortType.hbm.xml"/>
<!-- Package PeopleAndOrganizations -->
<mapping resource="uk/org/mygrid/mir/infomodel/PeopleAndOrganizations/Person.hbm.xml"/>
<mapping resource="uk/org/mygrid/mir/infomodel/PeopleAndOrganizations/Address.hbm.xml"/>
<mapping resource="uk/org/mygrid/mir/infomodel/PeopleAndOrganizations/Affiliation.hbm.xml"/>
<mapping resource="uk/org/mygrid/mir/infomodel/PeopleAndOrganizations/AffiliationEpisode.hbm.xml"/>
<mapping resource="uk/org/mygrid/mir/infomodel/PeopleAndOrganizations/OrganizationalStructure.hbm.xml"/>
<mapping resource="uk/org/mygrid/mir/infomodel/PeopleAndOrganizations/OrganizationalUnit.hbm.xml"/>
<!-- Package Provenance -->
<mapping resource="uk/org/mygrid/mir/infomodel/Provenance/ActualInputParameter.hbm.xml"/>
<mapping resource="uk/org/mygrid/mir/infomodel/Provenance/ActualOutputParameter.hbm.xml"/>
<mapping resource="uk/org/mygrid/mir/infomodel/Provenance/CreationType.hbm.xml"/>
<mapping resource="uk/org/mygrid/mir/infomodel/Provenance/DataProvenance.hbm.xml"/>
<mapping resource="uk/org/mygrid/mir/infomodel/Provenance/OperationTrace.hbm.xml"/>
<mapping resource="uk/org/mygrid/mir/infomodel/Provenance/ScuflWorkflowTrace.hbm.xml"/>
<!-- Package Resources -->
<mapping resource="uk/org/mygrid/mir/infomodel/Resources/LSDocument.hbm.xml"/>
<mapping resource="uk/org/mygrid/mir/infomodel/Resources/MetaDataAnnotation.hbm.xml"/>
<mapping resource="uk/org/mygrid/mir/infomodel/Resources/Resource.hbm.xml"/>
</session-factory>
</hibernate-configuration>
The file is loaded and the database is accessed, but there is one exception:
Code:
[java] - Using Hibernate built-in connection pool (not for production use!)
[java] - Hibernate connection pool size: 1
[java] - using driver: org.gjt.mm.mysql.Driver at URL: jdbc:mysql://localhost:3306/mir
[java] - connection properties: {user=arijitm, password=password}
[java] - No TransactionManagerLookup configured (in JTA environment, use of process level read-write cache is not recommended)
[java] - Use scrollable result sets: true
[java] - Use JDBC3 getGeneratedKeys(): true
[java] - Optimize cache for minimal puts: false
[java] - Query language substitutions: {no='N', true=1, yes='Y', false=0}
[java] - cache provider: net.sf.hibernate.cache.HashtableCacheProvider
[java] - instantiating and configuring caches
[java] - building session factory
[java] - Factory name: java:comp/env/hibernate/SessionFactory
[java] - JNDI InitialContext properties:{}
[java] - Could not bind factory to JNDI
[java] 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
[java] at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:640)
[java] at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:243)
[java] at javax.naming.InitialContext.getURLOrDefaultInitCtx(InitialContext.java:280)
[java] at javax.naming.InitialContext.getNameParser(InitialContext.java:429)
[java] at net.sf.hibernate.util.NamingHelper.bind(NamingHelper.java:52)
[java] at net.sf.hibernate.impl.SessionFactoryObjectFactory.addInstance(SessionFactoryObjectFactory.java:90)
[java] at net.sf.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:172)
[java] at net.sf.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:750)
[java] at uk.org.mygrid.mir.test.HibernateTest.main(HibernateTest.java:268)
What does this imply and how can I get rid of it?
Regards
Arijit