- This topic has 6 replies, 4 voices, and was last updated 20 years, 3 months ago by Scott Anderson.
-
AuthorPosts
-
PipelineParticipantEclipse version 3.0.0, build 200406251208
MyEclipse version 3.7.200, build: 200407091200-3.8-Beta2
WebLogic Server 8.1 SP3, JDK 1.4.1_02I want to use log4j in both my EJB and Web Application projects that are part of an Enterprise Application Project.
I have read several question in the support forum that deal with this but it seems that all the threads that I have
been able to find result in an answer where the developer is told to place the log4j jar file in the root directory
of the EAR file and make the appropriate entries for the classpath setting in the MANIFEST.MF file of the
respective projects. This all makes perfect sense.My question deals more with how one sets up log4j in a development environment with MyEclipse. If I want to use log4j
in both my EJB and Web projects, where should I place the log4j jar file and where should I place the log4j properties
file so that both projects can see them? Again, this is in a development environment where we are not deploying using
EAR files, but deploying via the MyEclipse Deployment Manager with the Web application as an exploded archive and the
EJB application as a packed archive. The Web application makes reference to the EJB jar file via an entry in the
MANIFEST.MF file in the Web project.So the bottom-line question is basically how I should configure this so that the developers can simply use the
existing MyEclipse Deployment Manager to deploy/redeploy the projects, without having to jump through hoops in order
for them to use log4j.Thanks,
Cor
Riyad KallaMemberCor,
I’m moving this post to Random thoughts because its a general development question, users are free to reply if they can help.
PipelineParticipantRiyad,
Could you move this question to the configuration forum? It would appear that the Random Thoughts forum does not see as much traffic as that forum and I believe that my question is a question of proper configuration of MyEclipse to work with log4j.
Thank you,
Cor
P.S. Is there anyway that you could get anyone from your support team to look at this question? Our company has purchased a block of user licenses for MyEclipse so I hope that our questions would actually be answered by MyEclipse staff rather than being relegated to the Random Thoughts forum.
P.P.S. Please don’t take this last comment the wrong way; You guys have been great so far in answering our questions. Thanks again!
Riyad KallaMemberCor,
I’ve asked if any of the other support team knows the answer to this or can help, but this isn’t a MyEclipse specific configuration issue (just like getting Spring Framework, Castor, JAXB or any other 3rd party library to work with projects in MyEclipse) are not MyEclipse specific either, so I don’t want to move it back, but believe me that doesn’t mean anyone is going to ignore it. If you don’t get a reply its because we haven’t tried this setup and have such a large TODO list to handle that its tough for us to cut out some time and start hacking away locally comming up with a solution via the same methods you or your team would. We definately appreciate the support from your company and will do what we can to help within our limits right now (we are trying to get 3.8 GA out the door as we speak, testing new builds every 8 hours and also trying to get timely answers out to forums as well…)Have you tried googling for this? This seems like a general project setup question… IDEA, JBuilder, NetBeans, etc. would all suffer from the same situation as well I imagine and log4j is so popular… seems someone has this figured out, maybe in a blog entry or the like.
PipelineParticipantI have tried Google, but in the posts that I read it mainly dealt with how to make it work in a Production environment with EAR file based deployments.
I will continue to search, but if you find anything on your end please do share it.
Thanks,
Cor
P.S. Keep up the good work.
Ivar VasaraMember@Pipeline wrote:
So the bottom-line question is basically how I should configure this so that the developers can simply use the
existing MyEclipse Deployment Manager to deploy/redeploy the projects, without having to jump through hoops in order
for them to use log4j.A decent way to use a common log4j config file ( I *think* that ‘s what you’re trying to do?) is to set an environment variable that points to its location, and refer to that at boot time.
Scott AndersonParticipantIf I want to use log4j
in both my EJB and Web projects, where should I place the log4j jar file and where should I place the log4j properties
file so that both projects can see them?Since you’re not using EAR deployment I’ll have to caveat this with it *should* work, but I must admit that since the EAR spec was introduced all my personal experience has been with enterprise apps delivered in that format since it solves so many problems like this one.
The key here is really gettting the log4j.jar and the .properties files onto the classpaths of the two projects so that they are available at runtime. The easiest way to do this for a web application is to place the log4j.jar file to the WEB-INF/lib directory and put the properties file into one of your source folders at the root level, or placed in the package log4j is searching for it. Since I’m not a personal user of log4j, I’ll have to refer you to their doc to determine exactly how their property lookup mechanism works.
For the EJB project, you can add the log4j.jar file to the root level of it and then add a Class-Path entry in MANIFEST.MF to point to it. For the properties file, you can do the same thing you did with it in the web project so that it can be found.
I’m also moving this topic to Development Projects since it is on-topic for that forum.
-
AuthorPosts