Guest User

Untitled

a guest
Oct 28th, 2017
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.51 KB | None | 0 0
  1. Exception in thread "main" java.lang.ExceptionInInitializerError
  2. at org.springframework.context.support.AbstractRefreshableApplicationContext.createBeanFactory(AbstractRefreshableApplicationContext.java:194)
  3. at org.springframework.context.support.AbstractRefreshableApplicationContext.refreshBeanFactory(AbstractRefreshableApplicationContext.java:127)
  4. at org.springframework.context.support.AbstractApplicationContext.obtainFreshBeanFactory(AbstractApplicationContext.java:465)
  5. at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:395)
  6. at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:139)
  7. at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:83)
  8. at test.InsertTest.main(InsertTest.java:14)
  9.  
  10. <?xml version="1.0" encoding="UTF-8"?>
  11. <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:p="http://www.springframework.org/schema/p" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd">
  12.  
  13.  
  14. <bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource">
  15. <property name="driverClassName" value="com.mysql.jdbc.Driver"></property>
  16. <property name="url" value="jdbc:mysql://localhost:3306/test"></property>
  17. <property name="username" value="root"></property>
  18. <property name="password" value="root"></property>
  19. </bean>
  20.  
  21. <bean id="mysessionFactory" class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
  22. <property name="dataSource" ref="dataSource"></property>
  23.  
  24. <property name="mappingResources">
  25. <list>
  26. <value>employee.hbm.xml</value>
  27. </list>
  28. </property>
  29.  
  30. <property name="hibernateProperties">
  31. <props>
  32. <prop key="hibernate.dialect">org.hibernate.dialect.MySQLDialect</prop>
  33. <prop key="hibernate.hbm2ddl.auto">update</prop>
  34. <prop key="hibernate.show_sql">true</prop>
  35.  
  36. </props>
  37. </property>
  38. </bean>
  39.  
  40. <bean id="template" class="org.springframework.orm.hibernate3.HibernateTemplate">
  41. <property name="sessionFactory" ref="mysessionFactory"></property>
  42. </bean>
  43.  
  44. <bean id="d" class="test.EmployeeDao">
  45. <property name="template" ref="template"></property>
  46. </bean>
  47.  
  48.  
  49. </beans>
Add Comment
Please, Sign In to add comment