0 Replies Latest reply on Dec 12, 2006 6:45 AM by Epristan Zelebeev

    Entity name confusion

    Epristan Zelebeev Newbie

      I have two different applications deployed on the same jboss4.0.4.GA server. Each application using its own persistence unit. Persistent units declared in persistent.xml (<persistence-unit name="app1">, <persistence-unit name="app2">). Both applications using ejb3 entity beans with same name. This name is very common (Event) and i have no possibility to refactor applications and rename beans. Jboss rises exception when applications deployed. Is it normal behavior?

      org.hibernate.AnnotationException: Use of the same entity name twice: Event
       at org.hibernate.cfg.annotations.EntityBinder.bindEntity(EntityBinder.java:221)
       at org.hibernate.cfg.AnnotationBinder.bindClass(AnnotationBinder.java:531)
       at org.hibernate.cfg.AnnotationConfiguration.processArtifactsOfType(AnnotationConfiguration.java:452)
       at org.hibernate.cfg.AnnotationConfiguration.secondPassCompile(AnnotationConfiguration.java:268)
       at org.hibernate.cfg.Configuration.buildMappings(Configuration.java:1039)
       at org.hibernate.ejb.Ejb3Configuration.buildMappings(Ejb3Configuration.java:1211)
       at org.hibernate.ejb.EventListenerConfigurator.configure(EventListenerConfigurator.java:154)
       at org.hibernate.ejb.Ejb3Configuration.configure(Ejb3Configuration.java:847)
       at org.hibernate.ejb.Ejb3Configuration.configure(Ejb3Configuration.java:385)