In your hibernate.cfg.xml, Have you set the property connection.datasource to the data source ? Something like :
<property name="connection.datasource">java:comp/env/jdbc/bankDataSource</property> Also don't forget to include <resource-ref> in web.xml for your data source. Shing --- Fabian Dittrich <[EMAIL PROTECTED]> wrote: > I tried to put the context.xml file in META-INF > > The file is like: > <?xml version="1.0" encoding="UTF-8"?> > > <Context> > > <Resource name="jdbc/bankDataSource" > auth="Container" > type=" javax.sql.DataSource" > driverClassName="com.mysql.jdbc.Driver" > url="jdbc:mysql://localhost/MCG" > username="root" > password="" maxActive="20" > defaultAutoCommit="false" > timeBetweenEvictionRunsMillis="60000" /> > > </Context> > > I get following error: > > An exception has occurred. > > You may continue by > *restarting<http://localhost:8080/mcgWebapps/app?service=restart> > * the session. > > org.apache.hivemind.ApplicationRuntimeException > Unable to construct > service > com.nuromobile.accounting.hibernate.SessionCreator: > Unable to > instantiate instance of class > com.nuromobile.accounting.hibernate.DefaultSessionCreator: > Could not find > datasource location: > file:/C:/Programming/Tomcat5.5/webapps/mcgWebapps/WEB-INF/classes/META-INF/hivemodule.xml, > line 6, column 52 > 1<?xml version="1.0"?> 2<module > id="com.nuromobile.accounting.hibernate" > version="1.0.0"> 3 > 4 > 5 <service-point id="SessionCreator"> 6 > <create-instance > class="DefaultSessionCreator" /> 7 </service-point> > 8 <service-point > id="SessionOwner"> 9 <invoke-factory > model="threaded"> 10 <construct > class="DefaultSessionOwner" /> 11 </invoke-factory> > org.apache.hivemind.ApplicationRuntimeException > Unable to instantiate > instance of class > com.nuromobile.accounting.hibernate.DefaultSessionCreator: > Could not find datasource location: > file:/C:/Programming/Tomcat5.5/webapps/mcgWebapps/WEB-INF/classes/META-INF/hivemodule.xml, > line 6, column 52 > 1<?xml version="1.0"?> 2<module > id="com.nuromobile.accounting.hibernate" > version="1.0.0"> 3 > 4 > 5 <service-point id="SessionCreator"> 6 > <create-instance > class="DefaultSessionCreator" /> 7 </service-point> > 8 <service-point > id="SessionOwner"> 9 <invoke-factory > model="threaded"> 10 <construct > class="DefaultSessionOwner" /> 11 </invoke-factory> > org.hibernate.HibernateException Could not find > datasource messages: > > - Could not find datasource > - Cannot create resource instance > > throwableCount: 2 throwables: > > - org.hibernate.HibernateException: Could not > find datasource > - javax.naming.NamingException: Cannot create > resource instance > > javax.naming.NamingException Cannot create > resource instance Stack > Trace: > > - > org.apache.naming.factory.ResourceFactory.getObjectInstance( > ResourceFactory.java:142) > - > javax.naming.spi.NamingManager.getObjectInstance(NamingManager.java:304) > > - > org.apache.naming.NamingContext.lookup(NamingContext.java:792) > - > org.apache.naming.NamingContext.lookup(NamingContext.java:139) > - > org.apache.naming.NamingContext.lookup(NamingContext.java:780) > - > org.apache.naming.NamingContext.lookup(NamingContext.java:139) > - > org.apache.naming.NamingContext.lookup(NamingContext.java:780) > - > org.apache.naming.NamingContext.lookup(NamingContext.java:139) > - > org.apache.naming.NamingContext.lookup(NamingContext.java:780) > - > org.apache.naming.NamingContext.lookup(NamingContext.java:152) > - > org.apache.naming.SelectorContext.lookup(SelectorContext.java:136) > - > javax.naming.InitialContext.lookup(InitialContext.java:351) > - > org.hibernate.connection.DatasourceConnectionProvider.configure( > DatasourceConnectionProvider.java:52) > - > > org.hibernate.connection.ConnectionProviderFactory.newConnectionProvider > (ConnectionProviderFactory.java:124) > - > > org.hibernate.connection.ConnectionProviderFactory.newConnectionProvider > (ConnectionProviderFactory.java:56) > - > org.hibernate.cfg.SettingsFactory.createConnectionProvider( > SettingsFactory.java:397) > - > org.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:62) > > - > org.hibernate.cfg.Configuration.buildSettings(Configuration.java:1933) > > - > org.hibernate.cfg.Configuration.buildSessionFactory( > Configuration.java:1216) > - > com.nuromobile.accounting.hibernate.DefaultSessionCreator.<init>( > DefaultSessionCreator.java:24) > - > sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native > Method) > - > sun.reflect.NativeConstructorAccessorImpl.newInstance( > NativeConstructorAccessorImpl.java:39) > - > sun.reflect.DelegatingConstructorAccessorImpl.newInstance( > DelegatingConstructorAccessorImpl.java:27) > - > java.lang.reflect.Constructor.newInstance(Constructor.java:494) > - java.lang.Class.newInstance0(Class.java:350) > - java.lang.Class.newInstance(Class.java:303) > - > org.apache.hivemind.util.InstanceCreationUtils.createInstance( > InstanceCreationUtils.java:54) > - > > org.apache.hivemind.impl.CreateClassServiceConstructor.constructCoreServiceImplementation > (CreateClassServiceConstructor.java:35) > - > > org.apache.hivemind.impl.servicemodel.AbstractServiceModelImpl.constructCoreServiceImplementation > (AbstractServiceModelImpl.java:107) > - > > org.apache.hivemind.impl.servicemodel.AbstractServiceModelImpl.constructNewServiceImplementation > (AbstractServiceModelImpl.java:157) > - > > org.apache.hivemind.impl.servicemodel.AbstractServiceModelImpl.constructServiceImplementation > (AbstractServiceModelImpl.java:139) > - > > org.apache.hivemind.impl.servicemodel.SingletonServiceModel.getActualServiceImplementation > (SingletonServiceModel.java:68) > - > $SessionCreator_10f96499be7._service($SessionCreator_10f96499be7.java) > > - > $SessionCreator_10f96499be7.createSession($SessionCreator_10f96499be7.java) > > - > $SessionCreator_10f96499be6.createSession($SessionCreator_10f96499be6.java) > > - > com.nuromobile.accounting.hibernate.DefaultSessionOwner.getSession( > DefaultSessionOwner.java:17) > - > $SessionOwner_10f96499be0.getSession($SessionOwner_10f96499be0.java) > > - > $SessionOwner_10f96499be1.getSession($SessionOwner_10f96499be1.java) > > - > com.nuromobile.accounting.views.SuperView.getNumberOfResults( > SuperView.java:94) > - > com.nuromobile.accounting.views.SuperView.access$0(SuperView.java:92) > > - > com.nuromobile.accounting.views.SuperView$1.getRowCount( > SuperView.java:44) > - > > org.apache.tapestry.contrib.table.model.common.BasicTableModelWrap.getRowCount > === message truncated === Home page : http://uk.geocities.com/matmsh/index.html ___________________________________________________________ The all-new Yahoo! Mail goes wherever you go - free your email address from your Internet provider. http://uk.docs.yahoo.com/nowyoucan.html --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]