0

控制台留言:

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>

4

1 回答 1

0

固定的:

只需在项目的类路径中添加 log4j.properties 及其固定

于 2012-07-30T04:57:09.140 回答