org.hibernate.MappingException

There are no available Samebug tips for this exception. Do you have an idea how to solve this issue? A short tip would help users who saw this issue last week.

  • 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...]
    via by Denis Chapligin,
  • GitHub comment 7#134672301
    via GitHub by hareluya86
    ,
  • GitHub comment 21#52621705
    via GitHub by ceefour
    ,
  • 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...]
    via by Denis Chapligin,
    • org.hibernate.MappingException: Unable to find column with logical name: mandt in org.hibernate.mapping.Table(EnumType) and its related supertables and secondary tables at org.hibernate.cfg.Ejb3JoinColumn.checkReferencedColumnsType(Ejb3JoinColumn.java:582) at org.hibernate.cfg.BinderHelper.createSyntheticPropertyReference(BinderHelper.java:258) at org.hibernate.cfg.ToOneFkSecondPass.doSecondPass(ToOneFkSecondPass.java:116) at org.hibernate.cfg.Configuration.processEndOfQueue(Configuration.java:1598) at org.hibernate.cfg.Configuration.processFkSecondPassInOrder(Configuration.java:1521) at org.hibernate.cfg.Configuration.secondPassCompile(Configuration.java:1422) at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1846) at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl$4.perform(EntityManagerFactoryBuilderImpl.java:857) at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl$4.perform(EntityManagerFactoryBuilderImpl.java:850) at org.hibernate.boot.registry.classloading.internal.ClassLoaderServiceImpl.withTccl(ClassLoaderServiceImpl.java:425) at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.build(EntityManagerFactoryBuilderImpl.java:849) at org.hibernate.jpa.HibernatePersistenceProvider.createEntityManagerFactory(HibernatePersistenceProvider.java:75) at org.hibernate.ejb.HibernatePersistence.createEntityManagerFactory(HibernatePersistence.java:54) at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:55) at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:39) at platform.data.DatabaseSession.<init>(DatabaseSession.java:94) at platform.data.MandtDaoImpl.loadAllMandt(MandtDaoImpl.java:16) at platform.data.Mandt.getMandt(Mandt.java:18) at platform.data.Mandt.lambda$0(Mandt.java:10) at platform.utils.Lazy.value(Lazy.java:24) at platform.data.Mandt.deflt(Mandt.java:13) at pm.business.InjectedLinkProject.getResourceTypes(InjectedLinkProject.java:66) at pm.business.InjectedLinkProject.<init>(InjectedLinkProject.java:57) at pm.business.PmLogic.<clinit>(PmLogic.java:17) at main.business.MainApplication.<clinit>(MainApplication.java:22) at main.application.MainController.<clinit>(MainController.java:25) at Routes$$anonfun$routes$1$$anonfun$applyOrElse$158$$anonfun$apply$158.apply(routes_routing.scala:2477) at Routes$$anonfun$routes$1$$anonfun$applyOrElse$158$$anonfun$apply$158.apply(routes_routing.scala:2477) at play.core.Router$HandlerInvokerFactory$$anon$5.resultCall(Router.scala:267) at play.core.Router$HandlerInvokerFactory$JavaActionInvokerFactory$$anon$15$$anon$1.invocation(Router.scala:255) at play.core.j.JavaAction$$anon$1.call(JavaAction.scala:55) at play.core.j.JavaAction$$anonfun$11.apply(JavaAction.scala:82) at play.core.j.JavaAction$$anonfun$11.apply(JavaAction.scala:82) at scala.concurrent.impl.Future$PromiseCompletingRunnable.liftedTree1$1(Future.scala:24) at scala.concurrent.impl.Future$PromiseCompletingRunnable.run(Future.scala:24) at play.core.j.HttpExecutionContext$$anon$2.run(HttpExecutionContext.scala:40) at play.api.libs.iteratee.Execution$trampoline$.execute(Execution.scala:46) at play.core.j.HttpExecutionContext.execute(HttpExecutionContext.scala:32) at scala.concurrent.impl.Future$.apply(Future.scala:31) at scala.concurrent.Future$.apply(Future.scala:492) at play.core.j.JavaAction$class.apply(JavaAction.scala:82) at play.core.Router$HandlerInvokerFactory$JavaActionInvokerFactory$$anon$15$$anon$1.apply(Router.scala:252) at play.api.mvc.Action$$anonfun$apply$1$$anonfun$apply$4$$anonfun$apply$5.apply(Action.scala:130) at play.api.mvc.Action$$anonfun$apply$1$$anonfun$apply$4$$anonfun$apply$5.apply(Action.scala:130) at play.utils.Threads$.withContextClassLoader(Threads.scala:21) at play.api.mvc.Action$$anonfun$apply$1$$anonfun$apply$4.apply(Action.scala:129) at play.api.mvc.Action$$anonfun$apply$1$$anonfun$apply$4.apply(Action.scala:128) at scala.Option.map(Option.scala:146) at play.api.mvc.Action$$anonfun$apply$1.apply(Action.scala:128) at play.api.mvc.Action$$anonfun$apply$1.apply(Action.scala:121) at play.api.libs.iteratee.Iteratee$$anonfun$mapM$1.apply(Iteratee.scala:483) at play.api.libs.iteratee.Iteratee$$anonfun$mapM$1.apply(Iteratee.scala:483) at play.api.libs.iteratee.Iteratee$$anonfun$flatMapM$1.apply(Iteratee.scala:519) at play.api.libs.iteratee.Iteratee$$anonfun$flatMapM$1.apply(Iteratee.scala:519) at play.api.libs.iteratee.Iteratee$$anonfun$flatMap$1$$anonfun$apply$14.apply(Iteratee.scala:496) at play.api.libs.iteratee.Iteratee$$anonfun$flatMap$1$$anonfun$apply$14.apply(Iteratee.scala:496) at scala.concurrent.impl.Future$PromiseCompletingRunnable.liftedTree1$1(Future.scala:24) at scala.concurrent.impl.Future$PromiseCompletingRunnable.run(Future.scala:24) at akka.dispatch.TaskInvocation.run(AbstractDispatcher.scala:41) at akka.dispatch.ForkJoinExecutorConfigurator$AkkaForkJoinTask.exec(AbstractDispatcher.scala:393) at scala.concurrent.forkjoin.ForkJoinTask.doExec(ForkJoinTask.java:260) at scala.concurrent.forkjoin.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1339) at scala.concurrent.forkjoin.ForkJoinPool.runWorker(ForkJoinPool.java:1979) at scala.concurrent.forkjoin.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:107)

    Users with the same issue

    Unknown visitor
    Unknown visitor1 times, last one,
    nasimknasimk
    4 times, last one,
    kuldeepkuldeep
    16 times, last one,
    Unknown visitor
    Unknown visitor2 times, last one,
    Unknown visitor
    Unknown visitor1 times, last one,
    41 more bugmates