求解决原因......
2013-06-06 14:57:38,500 ERROR [main] context.ContextLoader (ContextLoader.java:220) - Context initialization failedorg.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in file [D:\Tomcat 6.0\webapps\security\WEB-INF\classes\applicationContext-dao.xml]: Invocation of init method failed; nested exception is org.hibernate.HibernateException: Unable to access java.sql.DatabaseMetaData to determine appropriate Dialect to use
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1420)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:519)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:291)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:288)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:190)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:563)
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:895)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:425)
at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:276)
at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:197)
at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:47)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4206)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4705)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:799)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:779)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:601)
at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1079)
at org.apache.catalina.startup.HostConfig.deployDirectories(HostConfig.java:1002)
at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:506)
at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1317)
at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:324)
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:142)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1065)
at org.apache.catalina.core.StandardHost.start(StandardHost.java:840)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1057)
at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:463)
at org.apache.catalina.core.StandardService.start(StandardService.java:525)
at org.apache.catalina.core.StandardServer.start(StandardServer.java:754)
at org.apache.catalina.startup.Catalina.start(Catalina.java:595)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:289)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:414)
Caused by: org.hibernate.HibernateException: Unable to access java.sql.DatabaseMetaData to determine appropriate Dialect to use
at org.hibernate.dialect.resolver.DialectFactory.determineDialect(DialectFactory.java:141)
at org.hibernate.dialect.resolver.DialectFactory.buildDialect(DialectFactory.java:97)
at org.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:120)
at org.hibernate.cfg.Configuration.buildSettingsInternal(Configuration.java:2163)
at org.hibernate.cfg.Configuration.buildSettings(Configuration.java:2159)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1383)
at org.springframework.orm.hibernate3.LocalSessionFactoryBean.newSessionFactory(LocalSessionFactoryBean.java:860)
at org.springframework.orm.hibernate3.LocalSessionFactoryBean.buildSessionFactory(LocalSessionFactoryBean.java:779)
at org.springframework.orm.hibernate3.AbstractSessionFactoryBean.afterPropertiesSet(AbstractSessionFactoryBean.java:211)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1477)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1417)
... 36 more
Caused by: java.sql.SQLException: 不支持的特性
at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:134)
at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:179)
at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:269)
at oracle.jdbc.dbaccess.DBError.throwUnsupportedFeatureSqlException(DBError.java:689)
at oracle.jdbc.OracleDatabaseMetaData.getDatabaseMajorVersion(OracleDatabaseMetaData.java:4442)
at org.hibernate.dialect.resolver.DialectFactory.determineDialect(DialectFactory.java:131)
... 46 more --------------------编程问答-------------------- applicationContext-dao.xml 文件中的 Error creating bean with name 'sessionFactory' defined --------------------编程问答-------------------- <!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN 2.0//EN" "http://www.springframework.org/dtd/spring-beans-2.0.dtd">
<beans>
<bean id="dataSource" class="com.jolbox.bonecp.BoneCPDataSource" destroy-method="close" dependency-check="none">
<property name="driverClass">
<value>oracle.jdbc.driver.OracleDriver</value>
</property>
<property name="jdbcUrl">
<value>jdbc:oracle:thin:@localhost:1521:TEST</value>
</property>
<property name="username">
<value>system</value>
</property>
<property name="password">
<value>sinolog</value>
</property>
</bean>
<bean id="sessionFactory" class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
<property name="dataSource"><ref local="dataSource" /></property>
<property name="mappingResources">
<list>
<value>com/huaxin/bean/Resources.hbm.xml</value>
<value>com/huaxin/bean/Roles.hbm.xml</value>
<value>com/huaxin/bean/Users.hbm.xml</value>
<value>com/huaxin/bean/Notice.hbm.xml</value>
</list>
</property>
<property name="hibernateProperties">
<props>
<prop key="hibernate.dialect">${hibernate.dialect}</prop>
<prop key="hibernate.show_sql">${hibernate.show_sql}</prop>
<prop key="hibernate.jdbc.fetch_size">${hibernate.jdbc.fetch_size}</prop>
<prop key="hibernate.jdbc.batch_size">${hibernate.jdbc.batch_size}</prop>
<prop key="hibernate.connection.release_mode">after_transaction</prop>
</props>
</property>
</bean>
<bean abstract="true" lazy-init="true" id="hibernateDao">
<property name="sessionFactory"><ref local="sessionFactory" /></property>
</bean>
<bean id="transactionManager" class="org.springframework.orm.hibernate3.HibernateTransactionManager">
<property name="sessionFactory"><ref local="sessionFactory" /></property>
<property name="dataSource"><ref local="dataSource" /></property>
</bean>
<bean id="txProxyTemplate" abstract="true" class="org.springframework.transaction.interceptor.TransactionProxyFactoryBean">
<property name="transactionManager"><ref bean="transactionManager" /></property>
<property name="transactionAttributes">
<props>
<prop key="create*">PROPAGATION_REQUIRED,-com.huaxin.exception.ApplyException</prop>
<prop key="save*">PROPAGATION_REQUIRED,-com.huaxin.exception.ApplyException</prop>
<prop key="remove*">PROPAGATION_REQUIRED,-com.huaxin.exception.ApplyException</prop>
<prop key="update*">PROPAGATION_REQUIRED,-com.huaxin.exception.ApplyException</prop>
<prop key="delete*">PROPAGATION_REQUIRED,-com.huaxin.exception.ApplyException</prop>
<prop key="batch*">PROPAGATION_REQUIRED,-com.huaxin.exception.ApplyException</prop>
<prop key="*">PROPAGATION_REQUIRED,readOnly</prop>
</props>
</property>
</bean>
<bean id="usersDao" parent="txProxyTemplate">
<property name="target">
<bean parent="hibernateDao" class="com.huaxin.dao.impl.UsersDaoImpl" />
</property>
</bean>
<bean id="rolesDao" parent="txProxyTemplate">
<property name="target">
<bean parent="hibernateDao" class="com.huaxin.dao.impl.RolesDaoImpl" />
</property>
</bean>
<bean id="resourcesDao" parent="txProxyTemplate">
<property name="target">
<bean parent="hibernateDao" class="com.huaxin.dao.impl.ResourcesDaoImpl" />
</property>
</bean>
<bean id="noticeDao" parent="txProxyTemplate">
<property name="target">
<bean parent="hibernateDao" class="com.huaxin.dao.impl.NoticeDaoImpl" />
</property>
</bean>
</beans>
--------------------编程问答-------------------- Unable to access java.sql.DatabaseMetaData to determine appropriate Dialect to use 你数据库服务开了么 --------------------编程问答-------------------- <prop key="hibernate.dialect">${hibernate.dialect}</prop> 应该是不识别dialect
补充:Java , Java EE