[jboss-user] [EJB 3.0] - Reference-Problems within an ear

Hilwi do-not-reply at jboss.com
Sat Apr 12 15:57:04 EDT 2008


Hello!

I have a problem deploying an ear with multiple ejb-modules.

I have an ejb-module called "JbsCore.jar" and another ejb-module called "JbsCalendar.jar". I set up the order of the modules in the application.xml and set <module-order>strict</module-order> to make sure that JbsCalendar is deployed after JbsCore.

Within JbsCalendar I have an entity-bean named Appointment that references an entity-bean (JbsUser) within JbsCore in this way:


  | @ManyToOne
  | public JbsUser getLastChangeUser() {
  |   return lastChangeUser;
  | }
  | 

When I now try to deploy my application I get the following error:


  | org.hibernate.AnnotationException: @OneToOne or @ManyToOne on org.jabusuite.calendar.Appointment.lastChangeUser references an unknown entity: org.jabusuite.core.users.JbsUser
  |         at org.hibernate.cfg.FkSecondPass.doSecondPass(FkSecondPass.java:56)
  |         at org.hibernate.cfg.AnnotationConfiguration.processFkSecondPassInOrder(AnnotationConfiguration.java:428)
  |         at org.hibernate.cfg.AnnotationConfiguration.secondPassCompile(AnnotationConfiguration.java:286)
  |         at org.hibernate.cfg.Configuration.buildMappings(Configuration.java:1115)
  |         at org.hibernate.ejb.Ejb3Configuration.buildMappings(Ejb3Configuration.java:1233)
  | [...]
  | 

As I have seen in the jboss-logs JbsCalendar is deployed just after JbsCore so this problem seems to have nothing to do with the deployment-order. This reference is used in nearly all entity-beans within JbsCore so this seems not to be a general problem with the reference.

Isn't it possible to reference entities from another jar within the same ear? Both ejb-modules use the same persistence-unit.

Am I doing something wrong? Is there another/better way to separate an enterprise-application into different modules?

I'm using JBoss 4.2.2GA

Hilwi

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4143668#4143668

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4143668



More information about the jboss-user mailing list