Error Creating Sessionfactory Org.hibernate.hibernateexception Could Not Find Datasource
Contents |
here for a quick overview of the could not find datasource java /comp/env/jdbc site Help Center Detailed answers to any questions you might have Meta hibernate.cfg.xml not found Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn
Javax Naming Namenotfoundexception Name Jdbc Is Not Bound In This Context
more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, javax naming namenotfoundexception name is not bound in this context helping each other. Join them; it only takes a minute: Sign up Could not find datasource in hibernate up vote 2 down vote favorite 1 I am trying to solve this issue from quit sometime now, i am using OSUSER api for simple user and group access. It works fine with JDBC providers(in OsUser.xml and PropertySet.xml) Now when i am trying to use it with "com.opensymphony.user.provider.hibernate.HibernateCredentialsProvider" it shows me error as net.sf.hibernate.HibernateException: Could not find datasource: Name jdbc2 is not bound in this Context at net.sf.hibernate.connection.DatasourceConnectionProvider.configure(DatasourceConnectionProvider.java:47) at net.sf.hibernate.connection.ConnectionProviderFactory.newConnectionProvider(ConnectionProviderFactory.java:75) at net.sf.hibernate.impl.SessionFactoryImpl.
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers or posting ads with http://stackoverflow.com/questions/17654408/could-not-find-datasource-in-hibernate us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up Hibernate http://stackoverflow.com/questions/4799321/hibernate-jboss-jndi-configuration JBOSS JNDI Configuration up vote 3 down vote favorite 2 Currently I have an application that is configured for Hibernate and JNDI but runs on a Tomcat server. I have been tasked with moving this web application to JBOSS 5.1. I have done the following so far: Removed hibernate-3.2.1.ga.jar, hibernate-annotations-3.3.0.ga.jar, and hibernate-commons-annotations-3.3.0.ga.jar from the web application that I want to deploy. I have added ojdbc.5 jar to the /default/conf/lib directory. I have the following web application files configured as so: FILE1:hibernate.cfg.xml
Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.
App EngineApache AntApache MavenjQueryJava MongoDBQuartz SchedulerLog4jContact Us How to load hibernate.cfg.xml from different directoryBy mkyong | December 23, 2009 | Updated : April 23, 2011 | Viewed : 129,068 times +333 pv/wHibernate XML configuration file "hibernate.cfg.xml" is always put at the root of your project classpath, outside of any package. If you place this configuration file into a different directory, you may encounter the following error : Initial SessionFactory creation failed.org.hibernate.HibernateException: /hibernate.cfg.xml not found Exception in thread "main" java.lang.ExceptionInInitializerError at com.mkyong.persistence.HibernateUtil.buildSessionFactory(HibernateUtil.java:25) at com.mkyong.persistence.HibernateUtil.