- This topic has 10 replies, 2 voices, and was last updated 19 years, 11 months ago by Riyad Kalla.
-
AuthorPosts
-
jerremyMemberSUMMARY:
When I run ant to build my app, it builds a 9MB war file–I can then copy this to the tomcat webapps dir & restart tomcat and everything works fineWhen I use myEclipse to deploy the ap (unexploded), the war file is only just over 1MB and the app does not work.
DETAILS:
I am trying to get myEclipse setup to work with an opensource struts development project called xplanner. To get going, I downloaded version 6.1 of Xplanner source from here:
http://sourceforge.net/project/showfiles.php?group_id=49017I then created a J2EE project and added struts & faces capabilities. Then I copied the files from xplanner into my working environment, changing the directories as appropriate. I then went through and fixed a number of errors with DTDs.
xplanner has a whole lib directory of external packages it uses. In xplanner, this sits in the directory above the root of the project. I moved this lib directory into the main workspace directory and added all the needed libraries to the project so that the import errors on all the source code were resolved.
ROOT CAUSE?
Maybe these additional libraries used by xplanner are not getting packaged up in the myEclipse war (maybe there are other issues, to, I don’t know)–how can I configure the myEclipse packaging process to include additional libraries?Any sugestions on how to further diagnose what is going on? What more info could I send you to help? I could upload a ZIP file of my workspace if that would help–its all opensource software.
Note: I’ve looked through the documentation & tried to find relevant info on this forum & have not had luck finding an answer–If there is something on the support forum that I missed, please point me to the right thread?
Environment:
Windows XP Professional SP2 + kept up to date with network updates
Eclipse 2.1.1 installed fresh for use with MyEclipseIDE
My Eclipse IDE 2.8B1 (although version number of the plugins is reported as 2.7.101–is this correct?)
JDK: j2sdk1.4.2_04
Tomcat 5.0.24Best regards,
Jerremy
Riyad KallaMemberJerremy,
Check out this FAQ entry for a directory structure: http://www.myeclipseide.com/FAQ+index-myfaq-yes-id_cat-30.html#111The problem sounds like you are adding the app’s required JARs to your build path, but you need to include them in yotu WEB-INF/lib directory so they are deployed WITH your app as well. The rules for putting things in the WEB-INF/lib dir is pretty much: any lib that the app needs to run that is not provided by the app server. So for example, the struts JARs, the faces JARs, any application JARs, support JARs, etc. And things like JDBC drivers need to added to your App Server install, so you might include your JDBC driver in your Project/lib dir instead of the Project/WebRoot/WEB-INF/lib dir, because its needed to successfully use the project BUT not needed to be deployed with the project.
This is a good rule of thumb to develop by, and it sounds like you already did 90% of the leg work to reorganize xPlanner into the necessary MYEclipse format, good work.
jerremyMemberCool. That helped– now have the libraries getting copied over–I’m a lot closer to getting this to work. Thank you!
Now I’m running into the next problem–Error opening Hibernation session. I’ll dig into this next.Regards,
Jerremy
Riyad KallaMemberCool. That helped– now have the libraries getting copied over–I’m a lot closer to getting this to work. Thank you!
No problem, I’m glad it helped.
Now I’m running into the next problem–Error opening Hibernation session.
Hmm, I’ve done *some* hibernate, so post if you have a specific question and I’ll see if I can help.
jerremyMemberO.K., I tracked down the remaining issue–It turns out that there are a series of property files and xml mapping files that the build.xml packages under WEB-INF/classes. I copied these files to src\WebRoot\WEB-INF\classes and everything is working now. Thanks again for your fast response to my original support request. 😀
jerremyMemberDoh! I spoke to soon. I just restarted everything, and it still doesn’t work right. From the FAQ, it sounds like the right thing for me to do would be to add these files to the WEB-INF\conf directory & change the app to look for them there–is that the best solution?
Riyad KallaMemberDoh! I spoke to soon. I just restarted everything, and it still doesn’t work right. From the FAQ, it sounds like the right thing for me to do would be to add these files to the WEB-INF\conf directory & change the app to look for them there–is that the best solution?
Hah, I was just going to say “woops!” when I read your last post, Eclipse scrubs the output directory before a rebuild, whcih erases everything. So if you want these properties files copied to the base \classes dir, then you need to put them in your base \src dir so they are copied over on a rebuild. OR, you can add them to a \conf dir like you said, and then add that \conf dir as a source folder to your Java Build Path settinsg. This will cause Eclipse to copy them into your output folder. Then you should be all set.
jerremyMemberExcellent! I copied the files into Webroot\WEB-INF\classes, refreshed the project and re-deployed and it worked! Thanks again!
😀
Riyad KallaMemberExcellent! I copied the files into Webroot\WEB-INF\classes,
Did you setup an additioanl source folder, or just manually copied the files back there again? If you did it manually, they will be erased when Eclipse does a build of the project. I just want to make sure you are up and running permanently, not just for the duration of the Eclipse session 🙂
jerremyMemberYou’re right, I did as you suggested and put the files in \src and everything works.
Riyad KallaMemberYou’re right, I did as you suggested and put the files in \src and everything works.
Awesome. If you run into any more problems, you know where to ask.
-
AuthorPosts