1 Reply Latest reply on Feb 2, 2011 1:45 AM by nickarls

    General EE (EJB, CDI, injection, deployment, project structures)

    jensmander

      Hi,

       

      I have some general EE questions. I am planning to have several backend projects like CRM, DocumentManagement, AccountServices and so on. I build some mockup projects for testing reasons and that is what brings up some questions.

       

      There are some cross references between these projects. I would like to build all of these projects by using Maven but I don't know how to set up the dependency scope to the dependent projects? Due to reading the Maven manual I would think I have to use "provided" but I'm not sure if that is the correct way. I want to deploy all of my project separately so the container provides to project (classes/resources) to all of the others. Did I get it right?

      Now that leads me to the next question. I had some trouble by using local interfaces of EJBs. If I returned a complex type like a customer (represented through a "Customer" class object) from out of a CustomerService-method in the CRMProject for example and  I received an exception in the calling method (other deployment unit) which points out that the type of "Customer" does not match the type of "Customer". This seems really strange to me and I haven't any clue why this is happening ;(. I didn't find a solution yet except of using remote interfaces but I can not believe that using a remote interfaces should be the right way if I only work in the EE environment on the same server.

       

      The next and first of all my final question at the moment is how to inject EJBs through different projects best. Do I always have to wrap all my projects into an EAR-file? And why I always have to specify a mappedName? I can't believe that this string based approach is what the whole EE community is using, right? But how do you (the experts) deal with these "problems"?

       

      Oh finally there is one more small thing. Does CDI allow injection (@Inject) over different deployment units and if so how does I implement it? I didn't got it yet ;(

       

      I hope anybody can help me out with some hints or some piece of advise

       

      Best regards and thank you in anticipation

       

      Sascha

       

      P.s. I am using JBossAS 6 Final