views:

246

answers:

2

Hi all, long time listener, first time caller here.

We are in the process of moving from BEA WebLogic 10 to GlassFish v3. We have successfully moved a massive project to GlassFish, and everything's working, but now we're planning for the future.

Specifically, we are using MyEclipse 8.5 with a single Enterprise Application project (DCMHub) that produces an EAR file, and a single Web Application project (DCMWeb) that goes into the EAR.

However, DCMWeb is actually a whole bunch of related applications all bunched up into one huge gooey mess of jsps, class files, and jars. What we'd like to do is to break them up into logical units. For instance, instead of having just one Web Application (DCMWeb), we'd want to have several, say, DCMWeb_A, DCMWeb_B, and DCMWeb_C, as well as some web services (DCMWebService_A, DCMWebService_B), and so on. (Obviously, we won't use those particular names; I'm just calling them that for ease of asking the question.)

Now here comes the tricky bit. All of these Web Applications and Web Services will share some common functionality. For instance, we want single sign-on, so the concept of a user, authentication, and permissions should be the same. Similarly, we want to share certain classes, such as what Department a user is in, or what Office he works at, etc.

If this were just a plain old Java application, I might create a bunch of jars for the presentation, e.g., DCMWeb_A, DCMWeb_B, DCMWeb_C, DCMWebService_A, DCMWebService_B, and some additional jars for the shared classes and business logic, e.g., CommonClasses.jar, UserAndDeskLogic.jar, etc.

But this isn't a plain old Java application. It's an Enterprise application, and I'd like to structure this so that a) it's easy for us to make the transition from ugly project to beautiful project in simple steps without breaking anything major along the way, and b) something that eventually results in us being fully compliant with the "correct" way of doing things in Java EE 6 so that we can take advantage of all the latest goodies from Java, GlassFish, and MyEclipse as they become available.

Right now, here's the rough structure of what we've got in MyEclpse 8.5:

DCMHub (Enterprise Application)
   META-INF
      application.xml
      MANIFEST.MF

DCMWeb (Web Application)
   src (all the java source files)
   WebContent
   css (all our style files)
   images (all our .jpgs, .gifs, etc.)
   include (all our jsp fragments)
   javascript (all out .js files)
   META-INF
      MANIFEST.MF
   secure (all jsps requiring authentication to view)
   WEB-INF
      classes
      lib
      tlds
      applicationContext.xml
      dcmweb-servlet.xml
      faces-config.xml
      log4j.properties
      log4j.xml
      oscache.properties
      sun-jaxws.xml
      sun-web.xml
      web.xml
   xmlhttp
   login.jsp (our unauthenticated user login page)

Now, obviously, one of the things we're thinking of using to encapsulate some of the business logic is the use of EJB 3's. But how do I introduce those? My previous attempts have all failed. Either I can't get MyEclipse to deploy them as part of the EAR, or more often, I can't get the Web Application project to "see" the classes in the EJB project. (Though I can Goto-Definition on them, oddly enough, but MyEclipse still marks it as an error.)

So sorry for the really long-winded question, but what is the best way to organize this application so that we can move forward, yet not break whatever we currently have working as we do it?

Thanks very much!

 Jeff G

P.S. I was able to get my EJB to load and my MyEclipse project to reference it, so that part is solved. But I'm still after the big question: namely, what's the best way to move forward?

A: 

Plain jee eclipse Can dó utility projects in ears with common functionality. Does MyEclipse have a similar concept?

Thorbjørn Ravn Andersen
A: 

Yes, MyEclipse has Utility Projects. How does that work, exactly? What happens when I deploy an EAR with, say, two Web Modules?

Jeffrey Getzin