org.springframework.beans.factory.BeanCreationException

Error creating bean with name 'MCT' defined in com.myproject.JpaConfig: Invocation of init method failed; nested exception is org.hibernate.MappingException: Foreign key (FK2e496501ee5lgk3viylwiicsa:MANAGED_APP_TO_CON_TO_STRUCT [MANAGED_APP_TO_CONTACT_ID])) must have same number of columns as the referenced primary key (MANAGED_APPLICATION_TO_CONTACT [CONTACT_ID,MANAGED_APPLICATION_ID])


Solutions on the web19801

Solution icon of stackoverflow
Error creating bean with name 'MCT' defined in com.myproject.JpaConfig: Invocation of init method failed; nested exception is org.hibernate.MappingException: Foreign key (FK2e496501ee5lgk3viylwiicsa:MANAGED_APP_TO_CON_TO_STRUCT

Solution icon of stackoverflow
Error creating bean with name 'entityManagerFactory' defined in class path resource [spring/test-persistenceContext.xml]: Invocation of init method failed; nested exception is org.hibernate.MappingException: Foreign key (FKEC0DF9EF331D3E16

Solution icon of stackoverflow
via Stack Overflow by Chris Smith
, 1 month ago
exception; nested exception is org.hibernate.MappingException: Foreign key (FKf9pmu6lvjibn8nbpni3fy1pf0:user_authorzations [])) must have same number of columns as the referenced primary key (authorization [id])

Solution icon of github
via GitHub by KoloritnijClap
, 9 months ago
threw exception; nested exception is org.hibernate.MappingException: Foreign key (FKkytnqb3jin856ophy3ot4odu0:user [connection_id,user_connection_user_id,user_connection_provider_id,user_connection_provider_user_id])) must have same number of columns as the referenced primary key (UserConnection [userId,providerId,providerUserId])

Solution icon of stackoverflow
Error creating bean with name 'sessionFactory' defined in com.globetouch.config.ServletConfig: Invocation of init method failed; nested exception is org.hibernate.AnnotationException: A Foreign key refering com.globetouch.business.entities.SIMProvisionedRange from com.globetouch.business.entities.AdminAccounts has the wrong number of column. should be 2

Solution icon of web
via nabble.com by Unknown author, 1 year ago
Error creating bean with name 'sessionFactory': Invocation of init method failed; nested exception is org.hibernate.MappingException: identifier mapping has wrong number of columns: com.toolcrib.UserDetails type: object

Solution icon of web
Error creating bean with name 'entityManagerFactory' defined in resource loaded from byte array: Invocation of init method failed; nested exception is org.hibernate.AnnotationException: Foreign key circularity dependency involving the following tables:

Solution icon of stackoverflow
Error creating bean with name 'sessionFactory' defined in ServletContext resource [/WEB-INF/spring-servlet.xml]: Invocation of init method failed; nested exception is org.hibernate.MappingException: Unable to load class declared as <mapping class="com.don.library.form.Movie"/> in the configuration:

Solution icon of web
via viralpatel.net by Unknown author, 1 year ago
Error creating bean with name ‘sessionFactory’ defined in ServletContext resource [/WEB-INF/spring-servlet.xml]: Invocation of init method failed; nested exception is org.hibernate.MappingException: Unable to load class declared as in the configuration:

Solution icon of web
Error creating bean with name 'sessionFactory' defined in ServletContext resource [/WEB-INF/spring-servlet.xml]: Invocation of init method failed; nested exception is org.hibernate.MappingException: Unable to load class declared as <mapping class="net.viralpatel.contact.form.Contact"/> in the configuration:

Stack trace

  • org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'MCT' defined in com.myproject.JpaConfig: Invocation of init method failed; nested exception is org.hibernate.MappingException: Foreign key (FK2e496501ee5lgk3viylwiicsa:MANAGED_APP_TO_CON_TO_STRUCT [MANAGED_APP_TO_CONTACT_ID])) must have same number of columns as the referenced primary key (MANAGED_APPLICATION_TO_CONTACT [CONTACT_ID,MANAGED_APPLICATION_ID]) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1578) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:545) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:482) at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:306) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230) at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:302) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:197) at org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:1054) at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:829) at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:538) at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:446) at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:328) at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:107) at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4990) at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5490) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150) at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:901) at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:877) at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:649) at org.apache.catalina.startup.HostConfig.manageApp(HostConfig.java:1763) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:483) at org.apache.tomcat.util.modeler.BaseModelMBean.invoke(BaseModelMBean.java:301) at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:819) at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:801) at org.apache.catalina.mbeans.MBeanFactory.createStandardContext(MBeanFactory.java:618) at org.apache.catalina.mbeans.MBeanFactory.createStandardContext(MBeanFactory.java:565) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:483) at org.apache.tomcat.util.modeler.BaseModelMBean.invoke(BaseModelMBean.java:301) at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:819) at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:801) at javax.management.remote.rmi.RMIConnectionImpl.doOperation(RMIConnectionImpl.java:1466) at javax.management.remote.rmi.RMIConnectionImpl.access$300(RMIConnectionImpl.java:76) at javax.management.remote.rmi.RMIConnectionImpl$PrivilegedOperation.run(RMIConnectionImpl.java:1307) at javax.management.remote.rmi.RMIConnectionImpl.doPrivilegedOperation(RMIConnectionImpl.java:1399) at javax.management.remote.rmi.RMIConnectionImpl.invoke(RMIConnectionImpl.java:828) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:483) at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:323) at sun.rmi.transport.Transport$1.run(Transport.java:200) at sun.rmi.transport.Transport$1.run(Transport.java:197) at java.security.AccessController.doPrivileged(Native Method) at sun.rmi.transport.Transport.serviceCall(Transport.java:196) at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:568) at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:826) at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.lambda$run$240(TCPTransport.java:683)

Write tip

You have a different solution? A short tip here would help you and many other users who saw this issue last week.

Users with the same issue

Samebug visitor profile picture
Unknown user
Once, 2 weeks ago
Samebug visitor profile picture
Unknown user
Once, 3 weeks ago
Samebug visitor profile picture
Unknown user
Once, 1 month ago
Samebug visitor profile picture
Unknown user
Once, 1 month ago
Samebug visitor profile picture
Unknown user
Once, 1 month ago
227 more bugmates