1 Reply Latest reply on Sep 30, 2005 3:02 AM by Martin Heinemann

    (should be mapped with insert=

    Martin Heinemann Newbie

      Hi,
      after fixing a lot of grueling problems my JBoss is accepting the ejb3 files i#m feeding him with.
      But now there is the next. I generated my files using middlgen out of a simple database.
      When i deploy this files i get the following error:

      15:11:02,245 WARN [ServiceController] Problem creating service jboss.j2ee:service=EJB3,module=BeanSoupEJB3.ejb3
      org.hibernate.MappingException: Repeated column in mapping for entity: beansoup.entity.ejb.Cook2Soup column: bean_soup_id (should be mapped with insert="false" update="false")
       at org.hibernate.mapping.PersistentClass.checkColumnDuplication(PersistentClass.java:550)
       at org.hibernate.mapping.PersistentClass.checkPropertyColumnDuplication(PersistentClass.java:572)
       at org.hibernate.mapping.PersistentClass.checkColumnDuplication(PersistentClass.java:590)
       at org.hibernate.mapping.PersistentClass.validate(PersistentClass.java:381)
       at org.hibernate.mapping.RootClass.validate(RootClass.java:191)
       at org.hibernate.cfg.Configuration.validate(Configuration.java:863)
       at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1027)
       at org.hibernate.ejb.HibernatePersistence.createEntityManagerFactory(HibernatePersistence.java:439)
       at org.hibernate.ejb.HibernatePersistence.createContainerEntityManagerFactory(HibernatePersistence.java:272)
       at org.jboss.ejb3.Ejb3Deployment.initializeManagedEntityManagerFactory(Ejb3Deployment.java:476)
       at org.jboss.ejb3.Ejb3Deployment.create(Ejb3Deployment.java:219)
       at org.jboss.ejb3.Ejb3Module.createService(Ejb3Module.java:34)
       at org.jboss.system.ServiceMBeanSupport.jbossInternalCreate(ServiceMBeanSupport.java:252)
       at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSupport.java:234)
       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
       at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
       at java.lang.reflect.Method.invoke(Method.java:585)
       at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:141)
       at org.jboss.mx.server.Invocation.dispatch(Invocation.java:80)
       at org.jboss.mx.server.Invocation.invoke(Invocation.java:72)
       at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:245)
       at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:644)
       at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:974)
       at $Proxy0.create(Unknown Source)
       at org.jboss.system.ServiceController.create(ServiceController.java:356)
       at org.jboss.system.ServiceController.create(ServiceController.java:295)
       at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
       at java.lang.reflect.Method.invoke(Method.java:585)
       at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:141)
       at org.jboss.mx.server.Invocation.dispatch(Invocation.java:80)
       at org.jboss.mx.server.Invocation.invoke(Invocation.java:72)
       at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:245)
       at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:644)
       at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:176)
       at $Proxy17.create(Unknown Source)
       at org.jboss.ejb3.EJB3Deployer.create(EJB3Deployer.java:178)
       at org.jboss.deployment.MainDeployer.create(MainDeployer.java:919)
       at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:773)
       at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:737)
       at sun.reflect.GeneratedMethodAccessor42.invoke(Unknown Source)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
       at java.lang.reflect.Method.invoke(Method.java:585)
       at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:141)
       at org.jboss.mx.server.Invocation.dispatch(Invocation.java:80)
       at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:118)
       at org.jboss.mx.server.Invocation.invoke(Invocation.java:74)
       at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:127)
       at org.jboss.mx.server.Invocation.invoke(Invocation.java:74)
       at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:245)
       at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:644)
       at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:176)
       at $Proxy9.deploy(Unknown Source)
       at org.jboss.deployment.scanner.URLDeploymentScanner.deploy(URLDeploymentScanner.java:319)
       at org.jboss.deployment.scanner.URLDeploymentScanner.scan(URLDeploymentScanner.java:507)
       at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.doScan(AbstractDeploymentScanner.java:192)
       at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.loop(AbstractDeploymentScanner.java:203)
       at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.run(AbstractDeploymentScanner.java:182)
      15:11:02,271 INFO [EJB3Deployer] Deployed: file:/home/heinemam/software/jbosses/jboss-4.0.3RC2/server/default/deploy/eclipsedeploy/BeanSoupEJB3.ejb3
      15:11:02,273 ERROR [URLDeploymentScanner] Incomplete Deployment listing:
      
      --- MBeans waiting for other MBeans ---
      ObjectName: jboss.j2ee:service=EJB3,module=BeanSoupEJB3.ejb3
       State: FAILED
       Reason: org.hibernate.MappingException: Repeated column in mapping for entity: beansoup.entity.ejb.Cook2Soup column: bean_soup_id (should be mapped with insert="false" update="false")
      
      --- MBEANS THAT ARE THE ROOT CAUSE OF THE PROBLEM ---
      ObjectName: jboss.j2ee:service=EJB3,module=BeanSoupEJB3.ejb3
       State: FAILED
       Reason: org.hibernate.MappingException: Repeated column in mapping for entity: beansoup.entity.ejb.Cook2Soup column: bean_soup_id (should be mapped with insert="false" update="false")
      


      I found some threads about this and they all say that i have to insert
      @JoinColumn(insertable=false, updatable=false)

      So, now the question, where?
      I tried nearly every possibility in my Java Files.
      But nothing fixed the problem. What causes this warning?

      Thanks
      martin