卡两天了 包里也有org.hibernate.dialect.PostgreSQLDialect这个类 但是就是找不到
异常:Caused by: org.hibernate.service.classloading.spi.ClassLoadingException: Unable to load class [org.hibernate.dialect.PostgreSQLDialect;]
at org.hibernate.service.classloading.internal.ClassLoaderServiceImpl.classForName(ClassLoaderServiceImpl.java:141)
at org.hibernate.service.jdbc.dialect.internal.DialectFactoryImpl.constructDialect(DialectFactoryImpl.java:73)
... 57 more
Caused by: java.lang.ClassNotFoundException: org/hibernate/dialect/PostgreSQLDialect;
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:247)
at org.hibernate.service.classloading.internal.ClassLoaderServiceImpl.classForName(ClassLoaderServiceImpl.java:138)
... 58 more
2013-1-22 9:01:08 org.apache.catalina.core.StandardContext startInternal
严重: Error listenerStart
2013-1-22 9:01:08 org.apache.catalina.core.StandardContext startInternal
严重: Context [/s_test1] startup failed due to previous errors
2013-1-22 9:01:08 org.apache.catalina.core.ApplicationContext log
信息: Closing Spring root WebApplicationContext
2013-1-22 9:01:08 org.apache.catalina.loader.WebappClassLoader clearReferencesJdbc
严重: The web application [/s_test1] registered the JDBC driver [org.postgresql.Driver] but failed to unregister it when the web application was stopped. To prevent a memory leak, the JDBC Driver has been forcibly unregistered.
2013-1-22 9:01:08 org.apache.coyote.AbstractProtocol start
信息: Starting ProtocolHandler ["http-bio-8080"]
2013-1-22 9:01:08 org.apache.coyote.AbstractProtocol start
信息: Starting ProtocolHandler ["ajp-bio-8009"]
2013-1-22 9:01:08 org.apache.catalina.startup.Catalina start
信息: Server startup in 9653 ms
下面是applicationcontext.xml<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans" xmlns:context="http://www.springframework.org/schema/context" xmlns:aop="http://www.springframework.org/schema/aop" xmlns:tx="http://www.springframework.org/schema/tx" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation=" http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-2.5.xsd http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.5.xsd http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-2.5.xsd">
<!-- struts配置文件中取得loginaction spring把业务层leeservice注入action中-->
<bean id="LoginAction" class="esw.test.LoginAction" scope="prototype">
<property name="leeService" ref="leeService"/>
</bean> <!-- 业务逻辑组件 spring把DAO层persondao注入业务层中-->
<bean id="leeService" class= "esw.test.LeeServiceImpl">
<property name="personDao" ref="personDao"></property>
</bean>
<!-- Daobean spring把sessionfactory注入dao层-->
<bean id="personDao" class="esw.test.PersonDaoHibernate">
<property name="sessionFactory" ref="sessionFactory"></property>
</bean>
<!-- 声明bean -->
<!-- 数据源 tomcat连接池 -->
<bean id="dataSource" class="org.springframework.jndi.JndiObjectFactoryBean" >
<property name="jndiName" value="java:comp/env/postgre"/>
</bean>
<!-- sessionfactory代码 -->
<bean id="sessionFactory" class="org.springframework.orm.hibernate4.LocalSessionFactoryBean">
<property name="dataSource" ref="dataSource"></property>
<property name="mappingResources">
<list>
<value>Person.hbm.xml</value>
</list>
</property>
<!-- 这种写法为什么有错误?为什么显示红叉? 提示说:cvc-complex-type.2.3: Element 'property' cannot have character [children], because the type's content type is element-only.
<property name="dialect"> org.hibernate.dialect.PostgreSQLDialect</property>
<property name="show_sql">true</property>
<property name="hbm2dd1.auto">update</property>
<property name="fomat">true</property>
-->
<property name="hibernateProperties"> <value> hibernate.dialect=org.hibernate.dialect.PostgreSQLDialect; hibernate.show_sql=true ;
hibernate.hbm2dd1.auto=update;
hibernate.format_sql=true; </value>
</property>
</bean>
</beans>
ssh框架hibernate.dialectbean
异常:Caused by: org.hibernate.service.classloading.spi.ClassLoadingException: Unable to load class [org.hibernate.dialect.PostgreSQLDialect;]
at org.hibernate.service.classloading.internal.ClassLoaderServiceImpl.classForName(ClassLoaderServiceImpl.java:141)
at org.hibernate.service.jdbc.dialect.internal.DialectFactoryImpl.constructDialect(DialectFactoryImpl.java:73)
... 57 more
Caused by: java.lang.ClassNotFoundException: org/hibernate/dialect/PostgreSQLDialect;
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:247)
at org.hibernate.service.classloading.internal.ClassLoaderServiceImpl.classForName(ClassLoaderServiceImpl.java:138)
... 58 more
2013-1-22 9:01:08 org.apache.catalina.core.StandardContext startInternal
严重: Error listenerStart
2013-1-22 9:01:08 org.apache.catalina.core.StandardContext startInternal
严重: Context [/s_test1] startup failed due to previous errors
2013-1-22 9:01:08 org.apache.catalina.core.ApplicationContext log
信息: Closing Spring root WebApplicationContext
2013-1-22 9:01:08 org.apache.catalina.loader.WebappClassLoader clearReferencesJdbc
严重: The web application [/s_test1] registered the JDBC driver [org.postgresql.Driver] but failed to unregister it when the web application was stopped. To prevent a memory leak, the JDBC Driver has been forcibly unregistered.
2013-1-22 9:01:08 org.apache.coyote.AbstractProtocol start
信息: Starting ProtocolHandler ["http-bio-8080"]
2013-1-22 9:01:08 org.apache.coyote.AbstractProtocol start
信息: Starting ProtocolHandler ["ajp-bio-8009"]
2013-1-22 9:01:08 org.apache.catalina.startup.Catalina start
信息: Server startup in 9653 ms
下面是applicationcontext.xml<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans" xmlns:context="http://www.springframework.org/schema/context" xmlns:aop="http://www.springframework.org/schema/aop" xmlns:tx="http://www.springframework.org/schema/tx" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation=" http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-2.5.xsd http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.5.xsd http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-2.5.xsd">
<!-- struts配置文件中取得loginaction spring把业务层leeservice注入action中-->
<bean id="LoginAction" class="esw.test.LoginAction" scope="prototype">
<property name="leeService" ref="leeService"/>
</bean> <!-- 业务逻辑组件 spring把DAO层persondao注入业务层中-->
<bean id="leeService" class= "esw.test.LeeServiceImpl">
<property name="personDao" ref="personDao"></property>
</bean>
<!-- Daobean spring把sessionfactory注入dao层-->
<bean id="personDao" class="esw.test.PersonDaoHibernate">
<property name="sessionFactory" ref="sessionFactory"></property>
</bean>
<!-- 声明bean -->
<!-- 数据源 tomcat连接池 -->
<bean id="dataSource" class="org.springframework.jndi.JndiObjectFactoryBean" >
<property name="jndiName" value="java:comp/env/postgre"/>
</bean>
<!-- sessionfactory代码 -->
<bean id="sessionFactory" class="org.springframework.orm.hibernate4.LocalSessionFactoryBean">
<property name="dataSource" ref="dataSource"></property>
<property name="mappingResources">
<list>
<value>Person.hbm.xml</value>
</list>
</property>
<!-- 这种写法为什么有错误?为什么显示红叉? 提示说:cvc-complex-type.2.3: Element 'property' cannot have character [children], because the type's content type is element-only.
<property name="dialect"> org.hibernate.dialect.PostgreSQLDialect</property>
<property name="show_sql">true</property>
<property name="hbm2dd1.auto">update</property>
<property name="fomat">true</property>
-->
<property name="hibernateProperties"> <value> hibernate.dialect=org.hibernate.dialect.PostgreSQLDialect; hibernate.show_sql=true ;
hibernate.hbm2dd1.auto=update;
hibernate.format_sql=true; </value>
</property>
</bean>
</beans>
ssh框架hibernate.dialectbean
解决方案 »
- 请教Spring MVC与表单日期提交的问题
- 我用的是jspsmartupload上传 Excel表
- 谁给个32位linux的MyEclipse8.5GA的下载地址
- catch中能执行response.sendRedirect吗?
- 如何为String类型自定义方法
- 使用javabean无法写入数据库。
- 向大家问问一个简单的类型转化的问题?
- 在线坐等maven大牛解决部署问题
- 我用JSWDK做平台为什么连不了数据库?
- 为什么我的JBUILDER6中输入import javax.后面弹出的自动完成中没有servlet这一项?
- struts2 查询输出的问题。
- Exception in thread "main" org.hibernate.HibernateException: /hibernate.cfg.xml
当然,这只是我的猜测。。
不是很确定。
信息: The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: .:/Library/Java/Extensions:/System/Library/Java/Extensions:/usr/lib/java
2013-1-22 10:38:56 org.apache.tomcat.util.digester.SetPropertiesRule begin
警告: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'source' to 'org.eclipse.jst.jee.server:Copy of s_test1' did not find a matching property.
2013-1-22 10:38:57 org.apache.coyote.AbstractProtocol init
信息: Initializing ProtocolHandler ["http-bio-8080"]
2013-1-22 10:38:57 org.apache.coyote.AbstractProtocol init
信息: Initializing ProtocolHandler ["ajp-bio-8009"]
2013-1-22 10:38:57 org.apache.catalina.startup.Catalina load
信息: Initialization processed in 1346 ms
2013-1-22 10:38:57 org.apache.catalina.core.StandardService startInternal
信息: Starting service Catalina
2013-1-22 10:38:57 org.apache.catalina.core.StandardEngine startInternal
信息: Starting Servlet Engine: Apache Tomcat/7.0.34
2013-1-22 10:39:01 org.apache.catalina.core.ApplicationContext log
信息: No Spring WebApplicationInitializer types detected on classpath
2013-1-22 10:39:01 org.apache.catalina.core.ApplicationContext log
信息: Initializing Spring root WebApplicationContext
2013-1-22 10:39:01 org.springframework.web.context.ContextLoader initWebApplicationContext
信息: Root WebApplicationContext: initialization started
2013-1-22 10:39:02 org.springframework.context.support.AbstractApplicationContext prepareRefresh
信息: Refreshing Root WebApplicationContext: startup date [Tue Jan 22 10:39:02 CST 2013]; root of context hierarchy
2013-1-22 10:39:02 org.springframework.beans.factory.xml.XmlBeanDefinitionReader loadBeanDefinitions
信息: Loading XML bean definitions from ServletContext resource [/WEB-INF/applicationContext.xml]
2013-1-22 10:39:02 org.springframework.beans.factory.support.DefaultListableBeanFactory preInstantiateSingletons
信息: Pre-instantiating singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@7c41f227: defining beans [LoginAction,leeService,personDao,dataSource,sessionFactory]; root of factory hierarchy
2013-1-22 10:39:03 org.hibernate.annotations.common.Version <clinit>
INFO: HCANN000001: Hibernate Commons Annotations {4.0.1.Final}
2013-1-22 10:39:03 org.hibernate.Version logVersion
INFO: HHH000412: Hibernate Core {4.1.9.Final}
2013-1-22 10:39:03 org.hibernate.cfg.Environment <clinit>
INFO: HHH000206: hibernate.properties not found
2013-1-22 10:39:03 org.hibernate.cfg.Environment buildBytecodeProvider
INFO: HHH000021: Bytecode provider name : javassist
2013-1-22 10:39:03 org.hibernate.internal.util.xml.DTDEntityResolver resolveEntity
WARN: HHH000223: Recognized obsolete hibernate namespace http://hibernate.sourceforge.net/. Use namespace http://www.hibernate.org/dtd/ instead. Refer to Hibernate 3.6 Migration Guide!
2013-1-22 10:39:05 org.springframework.beans.factory.support.DefaultSingletonBeanRegistry destroySingletons
信息: Destroying singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@7c41f227: defining beans [LoginAction,leeService,personDao,dataSource,sessionFactory]; root of factory hierarchy
2013-1-22 10:39:05 org.springframework.web.context.ContextLoader initWebApplicationContext
严重: Context initialization failed
这时控制台最上面的报错提示
谢谢