康壽消息:Hibernate在初始化過程中「無法打開連接」錯誤?
log4j:WARN No appenders could be found for logger (org.jboss.logging).
log4j:WARN Please initialize the log4j system properly.
log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info.
org.hibernate.exception.GenericJDBCException: Could not open connection
配置文件
<!-- Database connection settings -->
<property name="connection.driver_class">com.mysql.jdbc.Driver</property>
<property name="connection.url">jdbc:mysql://localhost/support</property>
<property name="connection.username">prince</property>
<property name="connection.password">prince</property>
<property name="show_sql">false</property>
<property name="format_sql">false</property>
<!-- JDBC connection pool (use the built-in) -->
<property name="connection.pool_size">1</property>
<!-- SQL dialect -->
<property name="dialect">org.hibernate.dialect.MySQL5InnoDBDialect</property>
<!-- Disable the second-level cache -->
<!--<property name="cache.provider_class">org.hibernate.cache.internal.NoCacheProvider</property>-->
<property name="hibernate.hbm2ddl.auto">create</property>
<property name="connection.autocommit">false</property>
<!-- Mapping files -->
<mapping class="com.swiftant.model.Ticket"/>
<mapping class="com.swiftant.model.TicketPriority"/>
<mapping class="com.swiftant.model.TicketStatus"/>
<mapping class="com.swiftant.model.Role"/>
<mapping class="com.swiftant.model.BusinessUnit"/>
<mapping class="com.swiftant.model.Member"/>
</session-factory>
修正:只需添加log4j.properties項目的類路徑和其固定 – 2012-07-30 04:56:31
沒有u得到正確的網址是什麼? ' jdbc:mysql:// localhost/support ',默認端口號? –
Cruis
2012-07-30 08:48:15