org.hibernate.MappingException: Could not determine type for: com.satgate.IpConf.type.hibernate.IpNetworkMapping, at table: ip_networks, for columns: [org.hibernate.mapping.Column(net)]

Hibernate JIRA | Denis Chapligin | 2 years ago
  1. 0

    I have a custom class, that represents an ip network and operations on it: public class IpNetwork implements Comparable<IpNetwork> { private final BigInteger address; private final short bitmask; /* other stuff skipped */ } And i would like to store it into the pgsql database, using proprietary pgsql inet type, so i wrote my own UserType implementation: public class IpNetworkMapping implements UserType { public int[] sqlTypes() {return Types.OTHER;} public Class returnedClass() { return IpNetwork.class;} /** Implementation details skipped */ } Now i'm able to use it in my entity classes, like that: @TypeDef( name = "IpNetworkType", defaultForType = IpNetwork.class, typeClass = IpNetworkMapping.class ) @Entity @Table(name="ip_networks") public class Network extends AbstractIdentifiableObject { @Column(name = "net") @Type(type = "IpNetworkType") private IpNetwork network; /** Other fields skipped */ } And it works just fine in hibernate versions up to 4.3.5.Final, but 4.3.6.Final and 4.3.7.Final throw exception on initialization: [2014-11-05T10:32:18.207+0200] [glassfish 4.1] [SEVERE] [] [javax.enterprise.system.core] [tid: _ThreadID=49 _ThreadName=admin-listener(5)] [timeMillis: 1415176338207] [levelValue: 1000] [[ Exception while preparing the app : [PersistenceUnit: entityManagerFactory] Unable to build Hibernate SessionFactory org.hibernate.MappingException: Could not determine type for: com.satgate.IpConf.type.hibernate.IpNetworkMapping, at table: ip_networks, for columns: [org.hibernate.mapping.Column(net)] at org.hibernate.mapping.SimpleValue.getType(SimpleValue.java:336) at org.hibernate.mapping.SimpleValue.isValid(SimpleValue.java:310) at org.hibernate.mapping.Property.isValid(Property.java:241) at org.hibernate.mapping.PersistentClass.validate(PersistentClass.java:496) at org.hibernate.mapping.RootClass.validate(RootClass.java:270) at org.hibernate.cfg.Configuration.validate(Configuration.java:1358) at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1849) at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl$4.perform(EntityManagerFactoryBuilderImpl.java:850) at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl$4.perform(EntityManagerFactoryBuilderImpl.java:843) at org.hibernate.boot.registry.classloading.internal.ClassLoaderServiceImpl.withTccl(ClassLoaderServiceImpl.java:398) at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.build(EntityManagerFactoryBuilderImpl.java:842) at org.hibernate.jpa.HibernatePersistenceProvider.createContainerEntityManagerFactory(HibernatePersistenceProvider.java:152) at org.glassfish.persistence.jpa.PersistenceUnitLoader.loadPU(PersistenceUnitLoader.java:199) at org.glassfish.persistence.jpa.PersistenceUnitLoader.<init>(PersistenceUnitLoader.java:107) at org.glassfish.persistence.jpa.JPADeployer$1.visitPUD(JPADeployer.java:223) at org.glassfish.persistence.jpa.JPADeployer$PersistenceUnitDescriptorIterator.iteratePUDs(JPADeployer.java:510) at org.glassfish.persistence.jpa.JPADeployer.createEMFs(JPADeployer.java:230) at org.glassfish.persistence.jpa.JPADeployer.prepare(JPADeployer.java:168) at com.sun.enterprise.v3.server.ApplicationLifecycle.prepareModule(ApplicationLifecycle.java:925) at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:434) [...rest of call stack skipped...]

    Hibernate JIRA | 2 years ago | Denis Chapligin
    org.hibernate.MappingException: Could not determine type for: com.satgate.IpConf.type.hibernate.IpNetworkMapping, at table: ip_networks, for columns: [org.hibernate.mapping.Column(net)]
  2. 0

    I have a custom class, that represents an ip network and operations on it: public class IpNetwork implements Comparable<IpNetwork> { private final BigInteger address; private final short bitmask; /* other stuff skipped */ } And i would like to store it into the pgsql database, using proprietary pgsql inet type, so i wrote my own UserType implementation: public class IpNetworkMapping implements UserType { public int[] sqlTypes() {return Types.OTHER;} public Class returnedClass() { return IpNetwork.class;} /** Implementation details skipped */ } Now i'm able to use it in my entity classes, like that: @TypeDef( name = "IpNetworkType", defaultForType = IpNetwork.class, typeClass = IpNetworkMapping.class ) @Entity @Table(name="ip_networks") public class Network extends AbstractIdentifiableObject { @Column(name = "net") @Type(type = "IpNetworkType") private IpNetwork network; /** Other fields skipped */ } And it works just fine in hibernate versions up to 4.3.5.Final, but 4.3.6.Final and 4.3.7.Final throw exception on initialization: [2014-11-05T10:32:18.207+0200] [glassfish 4.1] [SEVERE] [] [javax.enterprise.system.core] [tid: _ThreadID=49 _ThreadName=admin-listener(5)] [timeMillis: 1415176338207] [levelValue: 1000] [[ Exception while preparing the app : [PersistenceUnit: entityManagerFactory] Unable to build Hibernate SessionFactory org.hibernate.MappingException: Could not determine type for: com.satgate.IpConf.type.hibernate.IpNetworkMapping, at table: ip_networks, for columns: [org.hibernate.mapping.Column(net)] at org.hibernate.mapping.SimpleValue.getType(SimpleValue.java:336) at org.hibernate.mapping.SimpleValue.isValid(SimpleValue.java:310) at org.hibernate.mapping.Property.isValid(Property.java:241) at org.hibernate.mapping.PersistentClass.validate(PersistentClass.java:496) at org.hibernate.mapping.RootClass.validate(RootClass.java:270) at org.hibernate.cfg.Configuration.validate(Configuration.java:1358) at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1849) at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl$4.perform(EntityManagerFactoryBuilderImpl.java:850) at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl$4.perform(EntityManagerFactoryBuilderImpl.java:843) at org.hibernate.boot.registry.classloading.internal.ClassLoaderServiceImpl.withTccl(ClassLoaderServiceImpl.java:398) at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.build(EntityManagerFactoryBuilderImpl.java:842) at org.hibernate.jpa.HibernatePersistenceProvider.createContainerEntityManagerFactory(HibernatePersistenceProvider.java:152) at org.glassfish.persistence.jpa.PersistenceUnitLoader.loadPU(PersistenceUnitLoader.java:199) at org.glassfish.persistence.jpa.PersistenceUnitLoader.<init>(PersistenceUnitLoader.java:107) at org.glassfish.persistence.jpa.JPADeployer$1.visitPUD(JPADeployer.java:223) at org.glassfish.persistence.jpa.JPADeployer$PersistenceUnitDescriptorIterator.iteratePUDs(JPADeployer.java:510) at org.glassfish.persistence.jpa.JPADeployer.createEMFs(JPADeployer.java:230) at org.glassfish.persistence.jpa.JPADeployer.prepare(JPADeployer.java:168) at com.sun.enterprise.v3.server.ApplicationLifecycle.prepareModule(ApplicationLifecycle.java:925) at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:434) [...rest of call stack skipped...]

    Hibernate JIRA | 2 years ago | Denis Chapligin
    org.hibernate.MappingException: Could not determine type for: com.satgate.IpConf.type.hibernate.IpNetworkMapping, at table: ip_networks, for columns: [org.hibernate.mapping.Column(net)]
  3. 0

    JPA - Probleme mit Wechsel von EclipseLink auf Hibernate

    java-forum.org | 1 year ago
    org.hibernate.MappingException: Could not instantiate id generator [entity-name=de.zerrenda.zerrendaee6.entities.Showcase]
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    Atom service break Oracle DB support

    GitHub | 2 years ago | davinciagf
    org.hibernate.MappingException: org.hibernate.dialect.Oracle9iDialect does not support identity key generation
  6. 0

    [HHH-8846] org.hibernate.MappingException: Could not determine type for: java.util.List on presence of a transient field - Hibernate JIRA

    atlassian.net | 12 months ago
    org.hibernate.MappingException: Could not determine type for: java.util.List, at table: table_name, for columns:
Not finding the right solution?
Take a tour to get the most out of Samebug.

Tired of useless tips?

Automated exception search integrated into your IDE

Root Cause Analysis

  1. org.hibernate.MappingException

    Could not determine type for: com.satgate.IpConf.type.hibernate.IpNetworkMapping, at table: ip_networks, for columns: [org.hibernate.mapping.Column(net)]

    at org.hibernate.mapping.SimpleValue.getType()
  2. Hibernate
    Configuration.buildSessionFactory
    1. org.hibernate.mapping.SimpleValue.getType(SimpleValue.java:336)
    2. org.hibernate.mapping.SimpleValue.isValid(SimpleValue.java:310)
    3. org.hibernate.mapping.Property.isValid(Property.java:241)
    4. org.hibernate.mapping.PersistentClass.validate(PersistentClass.java:496)
    5. org.hibernate.mapping.RootClass.validate(RootClass.java:270)
    6. org.hibernate.cfg.Configuration.validate(Configuration.java:1358)
    7. org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1849)
    7 frames
  3. org.hibernate.jpa
    EntityManagerFactoryBuilderImpl$4.perform
    1. org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl$4.perform(EntityManagerFactoryBuilderImpl.java:850)
    2. org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl$4.perform(EntityManagerFactoryBuilderImpl.java:843)
    2 frames
  4. org.hibernate.boot
    ClassLoaderServiceImpl.withTccl
    1. org.hibernate.boot.registry.classloading.internal.ClassLoaderServiceImpl.withTccl(ClassLoaderServiceImpl.java:398)
    1 frame
  5. org.hibernate.jpa
    HibernatePersistenceProvider.createContainerEntityManagerFactory
    1. org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.build(EntityManagerFactoryBuilderImpl.java:842)
    2. org.hibernate.jpa.HibernatePersistenceProvider.createContainerEntityManagerFactory(HibernatePersistenceProvider.java:152)
    2 frames
  6. Embedded GlassFish Web
    JPADeployer.prepare
    1. org.glassfish.persistence.jpa.PersistenceUnitLoader.loadPU(PersistenceUnitLoader.java:199)
    2. org.glassfish.persistence.jpa.PersistenceUnitLoader.<init>(PersistenceUnitLoader.java:107)
    3. org.glassfish.persistence.jpa.JPADeployer$1.visitPUD(JPADeployer.java:223)
    4. org.glassfish.persistence.jpa.JPADeployer$PersistenceUnitDescriptorIterator.iteratePUDs(JPADeployer.java:510)
    5. org.glassfish.persistence.jpa.JPADeployer.createEMFs(JPADeployer.java:230)
    6. org.glassfish.persistence.jpa.JPADeployer.prepare(JPADeployer.java:168)
    6 frames
  7. Kernel Classes
    ApplicationLifecycle.deploy
    1. com.sun.enterprise.v3.server.ApplicationLifecycle.prepareModule(ApplicationLifecycle.java:925)
    2. com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:434)
    2 frames