|
|
Re: runtime classpath question [message #164243 is a reply to message #164217] |
Fri, 17 March 2006 16:56 |
Eclipse User |
|
|
|
Originally posted by: kc.baltz.yahoo.com
Jars should go in the WEB-INF/lib directory of your web root.
Resources like log4j.xml that are found at runtime via the classpath should
be placed in a Source Folder. This can be your /src/main/java folder or
another like /src/main/resources. I don't recommend having a
WEB-INF/classes directory that is part of your source. It should always be
generated as part of your build process.
K.C.
"ffred" <ffred59@gmail.com> wrote in message
news:13721222.1142602617106.JavaMail.root@cp1.javalobby.org...
> hlo,
> the more i read about that the less I understand how it works ...
> Let's take an example : suppose I want to use log4j for loggins purpose
> (good idea isn't it ;)
> I first need to add the log4j.jar to my compilation classpath, and create
> its xml configuration. Nothing interesting to do with that...
> It gets a little more complicated when I tried to tell it to my tomcat
> runtime. there are many ways to do that but no one did work ! :
> - Simply run the server without carring about runtime cp : of course it
> didn't work and ends in an classnotfound exception.
> - Create a user library, add the jar to it and the user lib to project :
> that work for compilation but still no result at runtime.
> - Tweaking directly tomcat's runtime classpath, using the "run" dialog or
> by selecting "open launch configuration" in the server's properties page :
> still cnf exception
> - Create a new java project "dependencies", add the jar to it and add the
> dependencies project to the main one using the "j2ee dependency" page in
> project's properties : still the same cnf exception
> - Put directly the jar to the WEB-INF/lib directory : no more cnf but what
> do I have to do with that stupid log4j.xml config file ? in
> WEB-INF/classes ? that does not work either ...
>
> My example was about log4j but we really got dozens of that sort of
> libraries and i just can't imagine adding them one by one to the
> WEB-INF/lib directory ...
>
> Explain me please : did I miss something important ?
> what is "the best way" to add jar and "in-classpath" config file to a
> tomcat runtime ?
> Glad it's thursday, I'm out of idea for now :)
> Thanks in advance !
|
|
|
|
Re: runtime classpath question [message #164413 is a reply to message #164341] |
Mon, 20 March 2006 18:21 |
Eclipse User |
|
|
|
Originally posted by: kc.baltz.yahoo.com
What I described is kind of the manual solution. Personally, I'm using
Maven2 and it placess whatever JARs I need into WEB-INF/lib at build time.
I don't think I would rely on Eclipse as the tool for building my production
deployables. I only use it for development.
K.C.
"ffred" <ffred59@gmail.com> wrote in message
news:10701089.1142845590794.JavaMail.root@cp1.javalobby.org...
>I agree with that as a kind of solution.
> But not the best one i think!
> For example, i work actually with web-services using wtp again. I never
> had to deploy any axis* jar manually, the plugin automatically populate
> the WEB-INF directory with the necessary libs he knows and that works well
> !
> I just imagine this type of "automatic deployment" could also be used by
> user defined libs, mainly the build-path ones which are already referenced
> by eclipse or simply "user library" already defined elsewhere too. Am i a
> fool ?
> Isn't it the purpose of something like the j2ee module dependencies tool ?
|
|
|
Powered by
FUDForum. Page generated in 0.02837 seconds