代码之家  ›  专栏  ›  技术社区  ›  stacker

是什么导致了这个org.hibernate.mappingexception?

  •  1
  • stacker  · 技术社区  · 15 年前

    我正在尝试配置一个ejb3示例应用程序,它是映射到postgres的实体,现在我希望应用程序使用jpa在jboss4.3和informix上运行。

    如果创建ddl <property name="hibernate.hbm2ddl.auto" value="create"/> 激活此错误出现

    > WARN  [ServiceController] Problem
    > starting service
    > persistence.units:ear=weblog.ear,jar=weblog.jar,unitName=weblog
    > javax.persistence.PersistenceException:
    > [PersistenceUnit: weblog] Unable to
    > build EntityManagerFactory
    >         at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:677)
    >         at org.hibernate.ejb.HibernatePersistence.createContainerEntityManagerFactory(HibernatePersistence.java:132)
    >         at org.jboss.ejb3.entity.PersistenceUnitDeployment.start(PersistenceUnitDeployment.java:246)
    

    然后

    Caused by: org.hibernate.MappingException: No Dialect mapping for JDBC type: 2005
                at org.hibernate.dialect.TypeNames.get(TypeNames.java:56)
                at org.hibernate.dialect.TypeNames.get(TypeNames.java:81)
                at org.hibernate.dialect.Dialect.getTypeName(Dialect.java:291)
                at org.hibernate.mapping.Column.getSqlType(Column.java:182)
                at org.hibernate.mapping.Table.sqlCreateString(Table.java:394)
                at org.hibernate.cfg.Configuration.generateSchemaCreationScript(Configuration.java:854)
                at org.hibernate.tool.hbm2ddl.SchemaExport.<init>(SchemaExport.java:74)
                at org.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:311)
                at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1300)
                at org.hibernate.cfg.AnnotationConfiguration.buildSessionFactory(AnnotationConfiguration.java:874)
                at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:669)
    

    jdbc type:2005是什么意思? 知道我如何追踪导致问题的实体/列吗?

    谢谢

    2 回复  |  直到 15 年前
        1
  •  2
  •   Sun    15 年前

    关于您试图映射的数据类型的更多信息将是很好的。 看看这个hibernate论坛的主题-> https://forum.hibernate.org/viewtopic.php?f=1&t=950692&start=0

        2
  •  1
  •   Jonathan Leffler    15 年前

    注意,有一个新的(截至2010年4月26日)网页, http://www.iiug.org/opensource ,其中包含有关将informix软件与各种开源软件包(包括hibernate)一起使用的信息。特别是,有一些可下载的代码可以改进hibernate和informix的交互。