views:

432

answers:

2

I'm trying to configure an ejb3 sample application, it's entities where mapped to postgres now I want the app run on Jboss4.3 and Informix using JPA.

If the DDL creation <property name="hibernate.hbm2ddl.auto" value="create"/> is active this error appears

> 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)

followed by

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)

What does JDBC type: 2005 mean? Any idea how I can track down the entity/column causes the problem?

Thanks

+2  A: 

More info on the data types that you try to map would be nice. Take a look at this Hibernate Forum thread -> https://forum.hibernate.org/viewtopic.php?f=1&amp;t=950692&amp;start=0

Sun
+1 You probably leaded my into the right direction about data types, I spend hours to convert postgres DDL to informix, the problems occur now are another question. Thanks
stacker
+1  A: 

Note that there is a new (as of 2010-04-26) web page, http://www.iiug.org/opensource, that has information about using Informix software with various open source packages, including Hibernate. In particular, there is downloadable code that improves the interaction of Hibernate and Informix.

Jonathan Leffler
+1 Thanks, I will check the hibernate project listed there.
stacker