2

こんにちは、Ubuntu の Tomcat サーバーに Web アプリをデプロイしました。しかし、ログイン時に次のエラーが発生します。

HTTP Status 500 - Request processing failed; nested exception is org.hibernate.exception.SQLGrammarException: could not execute query

message Request processing failed; nested exception is org.hibernate.exception.SQLGrammarException: could not execute query
description The server encountered an internal error that prevented it from fulfilling this request.

org.springframework.web.util.NestedServletException: Request processing failed; nested exception is org.hibernate.exception.SQLGrammarException: could not execute query
org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:894)
org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:789)
org.hibernate.exception.SQLGrammarException: could not execute query
com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Table 'dbname.User' doesn't exist

私の休止状態の設定

   <property name="hibernate.connection.driver_class">com.mysql.jdbc.Driver</property>
    <property name="hibernate.connection.password">root</property>
    <property name="hibernate.connection.url">jdbc:mysql://localhost/dbname</property>
    <property name="hibernate.connection.username">root</property>
    <property name="hibernate.dialect">org.hibernate.dialect.MySQLDialect</property>

    <mapping class="com.some.Pojo.User"/>
    <mapping class="com.some.Pojo.Location"/>
    <mapping class="com.some.Pojo.Country"/>
    <mapping class="com.some.Pojo.TrainingRequest"/>
    <mapping class="com.some.Pojo.Priority"/>
    <mapping class="com.some.Pojo.Quarter"/>
    <mapping class="com.some.Pojo.Training"/>
    <mapping class="com.some.Pojo.TrainingType"/>
    <mapping class="com.some.Pojo.Product"/>
    <mapping class="com.some.Pojo.Status"/> 
    <mapping class="com.some.Pojo.SortCategory"/>

JDBC プロパティ

jdbc.driverClassName=com.mysql.jdbc.Driver
jdbc.dialect=org.hibernate.dialect.MySQLDialect
jdbc.databaseurl=jdbc\:mysql\://localhost\:3306/dbname
jdbc.username=root
jdbc.password=root
jdbc.show_sql=true

サーブレット構成

      <beans:bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource"
    destroy-method="close" p:driverClassName="${jdbc.driverClassName}"
    p:url="${jdbc.databaseurl}"
    p:username="${jdbc.username}" p:password="${jdbc.password}" />


    <!-- creating single instance of sessionfactory to be available throughout the application -->

<beans:bean id="sessionFactory" class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
<beans:property name="dataSource" ref="dataSource" />
<beans:property name="configLocation">
    <beans:value>classpath:hibernate.cfg.xml</beans:value>
</beans:property>
<beans:property name="configurationClass">
    <beans:value>org.hibernate.cfg.AnnotationConfiguration</beans:value>
</beans:property>
<beans:property name="hibernateProperties">
    <beans:props>
        <beans:prop key="hibernate.dialect">${jdbc.dialect}</beans:prop>
        <beans:prop key="hibernate.show_sql">true</beans:prop>
    </beans:props>
</beans:property>
</beans:bean>

何か不足していますか?TomcatサーバーとMysqlサーバーをDBとしてUbuntuにデプロイしました。

4

1 に答える 1

3

私は何かが欠けているかもしれませんが、この行はあなたに答えを示していません:

com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: テーブル 'dbname.User' が存在しません

于 2013-07-09T22:14:11.770 に答える