Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Web Tools Project (WTP) » How to properly include external projects/jars in Dynamic Web Project
How to properly include external projects/jars in Dynamic Web Project [message #184308] Mon, 11 December 2006 03:12 Go to next message
Eclipse User
Originally posted by: mike.intelliware.ca

Good evening all,

I have been working on getting some re-usable code together, and have
started putting it all into projects within Eclipse.

I started small, and wanted to get a Tapestry "Hello World" example
running, which I was able to do. I had created a new Dynamic Web Project,
dumped the required Tapestry jars into WEB-INF/lib, and tied it to a
Tomcat instance. Fired it up, everything is happy.

Now, I want to remove the Tapestry jars from the DWP, and dump them into
their own project. I created a new project (call it foo for now), added a
"lib" dir at the top level and dumped the Tapestry jars into it. I added
all of the jars to the build path of the "foo" project, and exported them.

After having deleted the Tapestry jars from my DWP, I added the J2EE
Module Dependency on to the "foo" project from the DWP. Everything builds
fine, but when I try to deploy and start the Tomcat server, I get the
ClassNotFoundException:

SEVERE: Exception starting filter redirect
java.lang.ClassNotFoundException: org.apache.tapestry.RedirectFilter

I have the latest WTP installed, and thought I was doing this the proper
way from what I have read so far from what other people have done.
Obviously this is not the case.

Is this the correct way to do this? My reasons for wanting to have the
technologies in their own separate projects is so that we can swap the
technologies in and out via a project dependency, rather than trying to
make sure we have all the right versions of jars, etc each time we want to
upgrade/switch/support a different technology.

Ideally, we would be able to swap in a different DB layer (for example) by
changing a project, and the appropriate dependency. Tapestry for Struts
or vice versa.

I hope I have properly explained this. I have tried a bunch of different
things and was hoping that the WTP is now to the stage where this sort of
thing was supported. I definitely want to avoid dumping all of my
necessary jars into one project, and if I have to do custom build/deploy
ant scripts, so be it. I was hoping for something a little less manual...

Thanks,

-mike
Re: How to properly include external projects/jars in Dynamic Web Project [message #184350 is a reply to message #184308] Mon, 11 December 2006 13:53 Go to previous messageGo to next message
Larry Isaacs is currently offline Larry Isaacs
Messages: 1305
Registered: July 2009
Senior Member
To accomplish what you want, return to the J2EE Module Dependencies and
uncheck project foo. Then click the Add JARs button and navigate to
foo's lib directory. Select the jars you want included as dependencies.
Selecting a project as a J2EE dependency means "combine the compiled
classes in that project into a jar and include that jar as a dependency".

Cheers,
Larry

Michael Melvin wrote:
> Good evening all,
>
> I have been working on getting some re-usable code together, and have
> started putting it all into projects within Eclipse.
> I started small, and wanted to get a Tapestry "Hello World" example
> running, which I was able to do. I had created a new Dynamic Web
> Project, dumped the required Tapestry jars into WEB-INF/lib, and tied it
> to a Tomcat instance. Fired it up, everything is happy.
>
> Now, I want to remove the Tapestry jars from the DWP, and dump them into
> their own project. I created a new project (call it foo for now), added
> a "lib" dir at the top level and dumped the Tapestry jars into it. I
> added all of the jars to the build path of the "foo" project, and
> exported them.
>
> After having deleted the Tapestry jars from my DWP, I added the J2EE
> Module Dependency on to the "foo" project from the DWP. Everything
> builds fine, but when I try to deploy and start the Tomcat server, I get
> the ClassNotFoundException:
>
> SEVERE: Exception starting filter redirect
> java.lang.ClassNotFoundException: org.apache.tapestry.RedirectFilter
>
> I have the latest WTP installed, and thought I was doing this the proper
> way from what I have read so far from what other people have done.
> Obviously this is not the case.
>
> Is this the correct way to do this? My reasons for wanting to have the
> technologies in their own separate projects is so that we can swap the
> technologies in and out via a project dependency, rather than trying to
> make sure we have all the right versions of jars, etc each time we want
> to upgrade/switch/support a different technology.
>
> Ideally, we would be able to swap in a different DB layer (for example)
> by changing a project, and the appropriate dependency. Tapestry for
> Struts or vice versa.
>
> I hope I have properly explained this. I have tried a bunch of
> different things and was hoping that the WTP is now to the stage where
> this sort of thing was supported. I definitely want to avoid dumping
> all of my necessary jars into one project, and if I have to do custom
> build/deploy ant scripts, so be it. I was hoping for something a little
> less manual...
>
> Thanks,
>
> -mike
>
Re: How to properly include external projects/jars in Dynamic Web Project [message #184747 is a reply to message #184350] Thu, 14 December 2006 15:45 Go to previous messageGo to next message
Fabio Da Soghe is currently offline Fabio Da Soghe
Messages: 20
Registered: July 2009
Junior Member
Hello.

I'm experimenting exactly same issue as Michael, with same expectations:
I need to change (update) my technology libraries quite often, so I
would like to keep all my jars out of the WEB-INF/lib folder of my web
module.

I thought the J2EE Module Dependencies was for this, and knowing that it
is only "combine the compiled classes in that project into a jar and
include that jar as a dependency" is quite disappointing. It would be
perfect (in my opinion) to have the J2EE Module Dependencies including
the exported libraries as well: this would let you to organize, for
example, all required jars and libraries into Eclipse's User Libraries
or using Eclipse's Classpath Variables, and when you needs to change
library, all you have to do is to change jars in the User Library.

With actual implementation of the J2EE Module Dependencies, you have to
update manually every jar in the WEB-INF/lib: very annoying and much
error prone (to debug class dependencies at runtime is a real pain, in
my experience, with all libraries one have to use today).

Is there any hope to have this implemented in WTP, sooner or later? I'll
dig into bugzilla for something related...

Anyway, thank you for your support.

Cheers,
Fabio

Larry Isaacs wrote:
> To accomplish what you want, return to the J2EE Module Dependencies and
> uncheck project foo. Then click the Add JARs button and navigate to
> foo's lib directory. Select the jars you want included as dependencies.
> Selecting a project as a J2EE dependency means "combine the compiled
> classes in that project into a jar and include that jar as a dependency".
>
> Cheers,
> Larry
>
> Michael Melvin wrote:
>> Good evening all,
>>
>> I have been working on getting some re-usable code together, and have
>> started putting it all into projects within Eclipse. I started small,
>> and wanted to get a Tapestry "Hello World" example running, which I
>> was able to do. I had created a new Dynamic Web Project, dumped the
>> required Tapestry jars into WEB-INF/lib, and tied it to a Tomcat
>> instance. Fired it up, everything is happy.
>>
>> Now, I want to remove the Tapestry jars from the DWP, and dump them
>> into their own project. I created a new project (call it foo for
>> now), added a "lib" dir at the top level and dumped the Tapestry jars
>> into it. I added all of the jars to the build path of the "foo"
>> project, and exported them.
>>
>> After having deleted the Tapestry jars from my DWP, I added the J2EE
>> Module Dependency on to the "foo" project from the DWP. Everything
>> builds fine, but when I try to deploy and start the Tomcat server, I
>> get the ClassNotFoundException:
>>
>> SEVERE: Exception starting filter redirect
>> java.lang.ClassNotFoundException: org.apache.tapestry.RedirectFilter
>>
>> I have the latest WTP installed, and thought I was doing this the
>> proper way from what I have read so far from what other people have
>> done. Obviously this is not the case.
>>
>> Is this the correct way to do this? My reasons for wanting to have
>> the technologies in their own separate projects is so that we can swap
>> the technologies in and out via a project dependency, rather than
>> trying to make sure we have all the right versions of jars, etc each
>> time we want to upgrade/switch/support a different technology.
>>
>> Ideally, we would be able to swap in a different DB layer (for
>> example) by changing a project, and the appropriate dependency.
>> Tapestry for Struts or vice versa.
>>
>> I hope I have properly explained this. I have tried a bunch of
>> different things and was hoping that the WTP is now to the stage where
>> this sort of thing was supported. I definitely want to avoid dumping
>> all of my necessary jars into one project, and if I have to do custom
>> build/deploy ant scripts, so be it. I was hoping for something a
>> little less manual...
>>
>> Thanks,
>>
>> -mike
>>
Re: How to properly include external projects/jars in Dynamic Web Project [message #184810 is a reply to message #184747] Thu, 14 December 2006 16:32 Go to previous messageGo to next message
Larry Isaacs is currently offline Larry Isaacs
Messages: 1305
Registered: July 2009
Senior Member
Fabio Da Soghe wrote:
> Hello.
>
> I'm experimenting exactly same issue as Michael, with same expectations:
> I need to change (update) my technology libraries quite often, so I
> would like to keep all my jars out of the WEB-INF/lib folder of my web
> module.
>
> I thought the J2EE Module Dependencies was for this, and knowing that it
> is only "combine the compiled classes in that project into a jar and
> include that jar as a dependency" is quite disappointing. It would be
> perfect (in my opinion) to have the J2EE Module Dependencies including
> the exported libraries as well: this would let you to organize, for
> example, all required jars and libraries into Eclipse's User Libraries
> or using Eclipse's Classpath Variables, and when you needs to change
> library, all you have to do is to change jars in the User Library.
>
> With actual implementation of the J2EE Module Dependencies, you have to
> update manually every jar in the WEB-INF/lib: very annoying and much
> error prone (to debug class dependencies at runtime is a real pain, in
> my experience, with all libraries one have to use today).
>
> Is there any hope to have this implemented in WTP, sooner or later? I'll
> dig into bugzilla for something related...

You might want to keep an eye on:

https://bugs.eclipse.org/bugs/show_bug.cgi?id=128851

Cheers,
Larry

>
> Anyway, thank you for your support.
>
> Cheers,
> Fabio
>
Re: How to properly include external projects/jars in Dynamic Web Project [message #184816 is a reply to message #184810] Thu, 14 December 2006 16:43 Go to previous messageGo to next message
Eclipse User
Originally posted by: kosta.bea.com

We are working on supporting this use case for the 2.0, which is due out
Summer of 07. Keep an eye out on the bug that Larry mentioned for
updates on progress.

Thanks for using WTP!

- Konstantin
Re: How to properly include external projects/jars in Dynamic Web Project [message #184832 is a reply to message #184810] Thu, 14 December 2006 16:53 Go to previous messageGo to next message
Fabio Da Soghe is currently offline Fabio Da Soghe
Messages: 20
Registered: July 2009
Junior Member
Larry Isaacs wrote:

> Fabio Da Soghe wrote:
>> Hello.
>>
>> I'm experimenting exactly same issue as Michael, with same
>> expectations: I need to change (update) my technology libraries quite
>> often, so I would like to keep all my jars out of the WEB-INF/lib
>> folder of my web module.
>>
>> I thought the J2EE Module Dependencies was for this, and knowing that
>> it is only "combine the compiled classes in that project into a jar
>> and include that jar as a dependency" is quite disappointing. It would
>> be perfect (in my opinion) to have the J2EE Module Dependencies
>> including the exported libraries as well: this would let you to
>> organize, for example, all required jars and libraries into Eclipse's
>> User Libraries or using Eclipse's Classpath Variables, and when you
>> needs to change library, all you have to do is to change jars in the
>> User Library.
>>
>> With actual implementation of the J2EE Module Dependencies, you have
>> to update manually every jar in the WEB-INF/lib: very annoying and
>> much error prone (to debug class dependencies at runtime is a real
>> pain, in my experience, with all libraries one have to use today).
>>
>> Is there any hope to have this implemented in WTP, sooner or later?
>> I'll dig into bugzilla for something related...
>
> You might want to keep an eye on:
>
> https://bugs.eclipse.org/bugs/show_bug.cgi?id=128851
>
> Cheers,
> Larry
>

Yes, thank you so much!

Cheers,
Fabio
Re: How to properly include external projects/jars in Dynamic Web Project [message #184916 is a reply to message #184832] Fri, 15 December 2006 02:58 Go to previous message
Eclipse User
Originally posted by: mike.intelliware.ca

Yes, thank you all. I will keep an eye on that bug, and wait with
anticipation for WTP 2.0 :)

- mike
Previous Topic:jsp Hello World
Next Topic:Tomcat republishing does not work
Goto Forum:
  


Current Time: Sat Sep 20 04:13:05 GMT 2014

Powered by FUDForum. Page generated in 0.03874 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software