Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/398.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java hibernate3:hbm2ddl异常_Java_Hibernate_Maven - Fatal编程技术网

Java hibernate3:hbm2ddl异常

Java hibernate3:hbm2ddl异常,java,hibernate,maven,Java,Hibernate,Maven,我正试图建立一个3年的项目,但几乎没有文档,也没有以前从事过这项工作的人 我在尝试运行mvn-X hibernate3时遇到以下异常:hbm2ddl 原因:org.hibernate.MappingException:正在创建AnnotationConfiguration实例 需要使用 hibernate版本-3.5.4-Final 这是hibernate插件的配置 <plugin> <groupId>org.codehaus.mo

我正试图建立一个3年的项目,但几乎没有文档,也没有以前从事过这项工作的人

我在尝试运行mvn-X hibernate3时遇到以下异常:hbm2ddl

原因:org.hibernate.MappingException:正在创建AnnotationConfiguration实例 需要使用

hibernate版本-3.5.4-Final

这是hibernate插件的配置

        <plugin>
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>hibernate3-maven-plugin</artifactId>
            <version>2.2</version>
            <configuration>
                <componentProperties>
                    <drop>true</drop>
                    <configurationfile>src/main/conf/hibernate.cfg.xml</configurationfile>
                    <propertyfile>src/main/resources/database.properties</propertyfile>
                </componentProperties>
            </configuration>
            <dependencies>
                <dependency>
                    <groupId>mysql</groupId>
                    <artifactId>mysql-connector-java</artifactId>
                    <version>5.1.6</version>
                </dependency>
                <dependency>
                    <groupId>org.hibernate</groupId>
                    <artifactId>hibernate-core</artifactId>
                    <version>${hibernate.version}</version>
                </dependency>
                <dependency>
                    <groupId>org.hibernate</groupId>
                    <artifactId>hibernate-entitymanager</artifactId>
                    <version>${hibernate.version}</version>
                </dependency>
            </dependencies>
        </plugin>

org.codehaus.mojo
hibernate3 maven插件
2.2
真的
src/main/conf/hibernate.cfg.xml
src/main/resources/database.properties
mysql
mysql连接器java
5.1.6
org.hibernate
冬眠核心
${hibernate.version}
org.hibernate
休眠实体管理器
${hibernate.version}
已修复!感谢:

我不得不把它添加到插件配置中

              <components>
               <component>
                <name>hbm2ddl</name>
                <implementation>annotationconfiguration</implementation>
               </component>
              </components>

hbm2ddl
注释配置

您是否尝试将hibernate annotations jar添加到依赖项中?我尝试将其添加到插件依赖项中。我添加了hibernate commons注释。版本3.5.4-Final没有通用注释。我尝试了一些具体的方法,但遇到了其他问题。是否有我应该尝试的特定版本?请使用与您正在使用的hibernate core版本相同的hibernate注释。org.hibernatehibernate注释${hibernate核心版本}。。。但我不认为这是问题所在。看起来像是hibernate引导配置。添加依赖项并粘贴任何新问题我将其添加到插件依赖项中。它已经作为构建依赖项存在。我也犯了同样的错误。