- This topic has 10 replies, 2 voices, and was last updated 20 years, 5 months ago by Riyad Kalla.
-
AuthorPosts
-
Mike SuiterMemberwhen i first subscribed to myelipse, i was told that a future release would allow me to configure myeclipse to work with my existing eclipse project. we have one big project that contains EJBs, JSPs, and clients. it seemed that with myeclipse, you had to have EJBs and one project and JSPs as another project in order to use the deployment tools.
so, can i now use the deployment tools with my current large eclipse project? our project layout is similar to this:
wp33 project src com wp client1 client2 server.ejb (my main ejb code) demo.ejb (our demo ejb code) demo.jsp (our demo jsp code)
this is all under one folder on the drive. now, i want to create additional projects for my existing EJBs, etc. to take advantage of the myeclipse features. what is the best way to do this? can i keep the EJB code in both my main project and new myeclipse EJB project, and possibly link them so both projects see the same code? ideally, i would like to keep all my source code under one folder on the filesystem, but i don’t know if this is possible with multiple projects.
any help on how to do this would be appreciated.
Riyad KallaMemberCan you explain where your JSP files for your webapp live? What is client1 and client2? What’s in them? Also is your package actually named “server.ejb” or did you just shorcut “server/ejb”?
What you can do is configure your web application as a Web Module project, then configure your EJB’s as EJB Module Projects, then create one EAP project that links them all together, and then you can just deploy that, viola!
Without mode details, I’m limited to that generic answer 😉
Mike SuiterMemberthis is a simplified structure of our packages. JSP files for the webapp are in com.wp.demo.jsp package. client1 and client2 are just standalone java clients. EJBs are in com.wp.server.ejb and com.wp.demo.ejb. we also have some JWSDP 1.3 web services.
we do deployment using an EAR. that contains 4 WARs for our web modules, 1 JAR for our EJBs, and JARs needed for runtime (log4j, etc.).
Riyad KallaMemberHave you tried creating 4 Web Module Projects for each web module, 1 EJB Project for your EJBs and then setting up the “JARs needed for runtime” as external libraries for whichever project needs them, and then adjust the deployment of that project to copy out all dependencies to the WEB-INF/lib dir?
Lastly create the EAR project and associate all these projects together… viola.
I’m not sure whats not working here.
Mike SuiterMemberok, i understand that i need to create several myeclipse projects. what i can’t figure out is how to configure them correctly. let me try to explain better.
we currently have 1 eclipse project. say it is on the filesystem at ‘Java’. the .classpath and .project files are at this level. this single project contains all our source code, including java clients, EJBs, JSPs, servlets, web services, etc. the filesystem is laid out like:
Java src com wp client1 client2 ... server ejb demo ejb jsp webservices ... lib build classes deploy
src is all the source files, lib are extra JARs, and build/classes is where compiled code goes. deploy is used by our ant build to create distributable files.
our single eclipse projects is called ‘wp33’. the source folder is ‘wp33/src’ and output folder is ‘wp33/build/classes’. so, the ‘wp33’ eclipse project maps to ‘Java’ on the filesystem. the com.wp.server.ejb package is at Java\src\com\wp\server\ejb on the filesystem.
now i want to create myeclipse projects that will be deployable to an app server. how do i configure them to do this? i can’t have multiple projects at the ‘Java’ level on the filesystem because it doesn’t allow multiple .classpath and .project files. if i put the project at Java\src\com\wp\server\ejb, then i lose the package structure.
so, how do i configure these projects? when i do new EJB or JSP project, what settings do i use for the location and source folder?
i can’t find any documentation that shows how to do this. it’s easy to create an empty new EJB project, add some beans, and deploy. our existing code structure is a bit more complex than that, so i need a little more direction!
thanks!
Riyad KallaMemberAhhh, you won’t be able to setup this currently configuration in MyEclipse. The problem is that you essentially have a Java Project, a Web Module Project and a EJB Module Project all mushed together. While this directory stucture is nice and clean for organization sake, it won’t be compatible with MyEclipse because it would not have the ability to differentiate the pieces of the project from eachother.
This, http://www.myeclipseide.com/FAQ+index-myfaq-yes-id_cat-30.html#111, is a fairly standard exploded WAR format for a Web Module Project, if you are able to restructre your app, but I unstand if you are not (not everyone can).
Mike SuiterMembermaybe it’s time for us to reorganize our eclipse projects. here is what i’m thinking to doing and please let me know if i’m approaching this right or not.
1. make a separate web module project for each of our web apps
2. make a separate ejb module project for our EJBs
3. make a java project for our remaining code
4. make an enterprise application project that links all the abovethis is how i would physically lay it out on the filesystem
Java WebProject1 src lib ... WebProject2 src lib ... EJBProject1 src ... EJBProject2 src ... JavaProject src build classes deploy ...
please let me know if i’m heading in the right direction. if i should be doing something else, let me know what that is. we have over 1000 java files, so i want to do the project reorganization right the first time.
thanks for all your help on this.
Riyad KallaMemberYour organization looks almost perfect, the only thing I didn’t see is that in the WebProject parts, you should have a “WebRoot” dir (note: in ME settings you can config what this dir is called, by default its WebRoot, I like webroot and others use docroot) where the base of your webapp starts, just like the FAQ link I sent.
Also can you explain which project needs the code from the JavaProject? Also does the JavaProject rely on any external JARs? These little details will effect deployment, so if we know ahead of time, we can get this ‘right’ as you said.
Mike SuiterMemberthe webroot dir was part of the … 😉
the JavaProject will contain common code, utilities, and java clients. the EJBs and possibly web projects will need some of these classes. hope this helps.
Riyad KallaMemberOk one note to mention is that if the Java Project relies on an external library that you need deployed when you deploy the reliant webapps or something, you need to make that an external Jar reference of the Web App, otherwise it won’t get deployed.
Otherwise your structure looks very clean and should interoperate well, I will ask another support person to double check me before you go off and start ripping up the floor though.
Riyad KallaMembermsuiter,
Everything checks out, as some extra information for you, you might want to check out this long thread of a user trying to configure their project to work with ME, and Scott had some important points to make that you might find helpful: https://www.genuitec.com/forums/topic/how-to-get-libraries-of-dependency-project-to-deploy/&postdays=0&postorder=asc&start=0 -
AuthorPosts