0 Replies Latest reply on Aug 11, 2010 11:07 AM by daxxy

    How does mapping take place

    daxxy

      I have an application that references entity beans in two separate EJB projects.


      The application has no persistance.xml. Each individual project has a persistance.xml.  The ear application.xml references each project and the ear Build Path includes both EJB projects.  There are 2 entity manager components in components.xml that reference each distinct persistance context.


      When the application is deployed, you see the 2 separate sets of ejb's firing up.  Binding occurs for both entities:



      09:39:00,374 INFO  [AnnotationBinder] Binding entity from annotated class: dne.nmst.dac.model.SiteTypeMap
      09:39:00,374 INFO  [EntityBinder] Bind entity dne.nmst.dac.model.SiteTypeMap on table site_type_map
      09:39:00,377 INFO  [AnnotationBinder] Binding entity from annotated class: dne.nmst.dac.model.CdpNeighbors
      09:39:00,377 INFO  [EntityBinder] Bind entity dne.nmst.dac.model.CdpNeighbors on table cdp_neighbors






      AND



      09:39:00,626 INFO  [AnnotationBinder] Binding entity from annotated class: dne.nmst.contacts.model.Doors
      09:39:00,626 INFO  [EntityBinder] Bind entity dne.nmst.contacts.model.Doors on table doors
      09:39:00,628 INFO  [AnnotationBinder] Binding entity from annotated class: dne.nmst.contacts.model.Alternate3
      09:39:00,628 INFO  [EntityBinder] Bind entity dne.nmst.contacts.model.Alternate3 on table alternate3





      But only the first one performs mapping




      09:39:00,395 INFO  [CollectionBinder] Mapping collection: dne.nmst.dac.model.Devices.assetTags -> asset_tags
      09:39:00,395 INFO  [CollectionBinder] Mapping collection: dne.nmst.dac.model.Devices.bgpNeighbors -> bgp_neighbors
      09:39:00,395 INFO  [CollectionBinder] Mapping collection: dne.nmst.dac.model.Devices.cdpNeighbors -> cdp_neighbors
      




      This bit does not occur for the 2nd set of EJBs.  I can't figure out what is different between the two projects or what is different about how I hooked them into the main application.


      When I try to reference the second bean I get an error that the entity is not mapped.


      Any clue where to look for the solution?