Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » ServerTools (WTP) » Using exported jars from j2ee module dependency
Using exported jars from j2ee module dependency [message #193463] Tue, 29 May 2007 12:57 Go to next message
Eclipse UserFriend
Originally posted by: pakulat.rostock.zgdv.de

Hi,

I've setup a simple java project (TagLib) for some .jar files that
should be shared among several dynamic web projects. I selected all
those jars for export in the project properties and building the dynamic
web projects which list TagLib as J2EE Module Dependecy works fine (they
use classes from the exported jars). However starting tomcat with these
Web Projects doesn't work, I get a NoClassDefFound exception as it can't
find any of the classes from the jars that are exported in TagLib.

If I look into the
..metadata/.plugins/org.eclipse.wst.server.core/tmp3/webapps /WebModule/WEB-INF/lib/TagLib.jar
file I know why: None of the .jar's are put into TagLib.jar and thus
they can't be found by the jre that starts tomcat.

Is there a way to solve this so that I don't have to add the jars to
each web project individually?

Andreas
Re: Using exported jars from j2ee module dependency [message #193479 is a reply to message #193463] Tue, 29 May 2007 13:16 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: kosta.bea.com

Andreas,

Which version of WTP are you using? This should work on version 2.0, but
will not work on earlier releases.

- Konstantin
Re: Using exported jars from j2ee module dependency [message #193487 is a reply to message #193463] Tue, 29 May 2007 14:00 Go to previous messageGo to next message
Rob Frost is currently offline Rob FrostFriend
Messages: 64
Registered: July 2009
Member
Assuming I'm interpreting your use case correctly (WEB-INF/lib dependency on
a utility project that exports a set of library JARs), you need to ensure
that the "publish/export" classpath entry attribute has been set for each of
these JAR library cp entries (this will ensure that these JARs are packaged
with the published/exported web module).

You can do this via the "quick fix" on the warning that is generated for
each regarding the potential for runtime class resolution issues (using the
quick fix is necessary since the "J2EE Module Dependencies" UI is not
supported for utility projects referenced only by a dynamic web project: see
https://bugs.eclipse.org/bugs/show_bug.cgi?id=184094 for more information)

-Rob

"Andreas Pakulat" <pakulat@rostock.zgdv.de> wrote in message
news:f3h80u$vm3$1@build.eclipse.org...
> Hi,
>
> I've setup a simple java project (TagLib) for some .jar files that should
> be shared among several dynamic web projects. I selected all those jars
> for export in the project properties and building the dynamic web projects
> which list TagLib as J2EE Module Dependecy works fine (they use classes
> from the exported jars). However starting tomcat with these Web Projects
> doesn't work, I get a NoClassDefFound exception as it can't find any of
> the classes from the jars that are exported in TagLib.
>
> If I look into the
> .metadata/.plugins/org.eclipse.wst.server.core/tmp3/webapps/ WebModule/WEB-INF/lib/TagLib.jar
> file I know why: None of the .jar's are put into TagLib.jar and thus they
> can't be found by the jre that starts tomcat.
>
> Is there a way to solve this so that I don't have to add the jars to each
> web project individually?
>
> Andreas
Re: Using exported jars from j2ee module dependency [message #193494 is a reply to message #193479] Tue, 29 May 2007 14:54 Go to previous messageGo to next message
Andreas Pakulat is currently offline Andreas PakulatFriend
Messages: 127
Registered: July 2009
Senior Member
Konstantin Komissarchik wrote:

> Andreas,
>
> Which version of WTP are you using? This should work on version 2.0, but
> will not work on earlier releases.

I'm using 1.5.4 currently. I'll see if I can do an update to 2.0 tomorrow.

Andreas
Re: Using exported jars from j2ee module dependency [message #193510 is a reply to message #193487] Tue, 29 May 2007 15:08 Go to previous messageGo to next message
Rob Frost is currently offline Rob FrostFriend
Messages: 64
Registered: July 2009
Member
note: the functionality I outlined below requires 2.0 M6 or later

"Rob Frost" <rfrost@bea.com> wrote in message
news:f3hbm2$avs$1@build.eclipse.org...
> Assuming I'm interpreting your use case correctly (WEB-INF/lib dependency
> on a utility project that exports a set of library JARs), you need to
> ensure that the "publish/export" classpath entry attribute has been set
> for each of these JAR library cp entries (this will ensure that these JARs
> are packaged with the published/exported web module).
>
> You can do this via the "quick fix" on the warning that is generated for
> each regarding the potential for runtime class resolution issues (using
> the quick fix is necessary since the "J2EE Module Dependencies" UI is not
> supported for utility projects referenced only by a dynamic web project:
> see https://bugs.eclipse.org/bugs/show_bug.cgi?id=184094 for more
> information)
>
> -Rob
>
> "Andreas Pakulat" <pakulat@rostock.zgdv.de> wrote in message
> news:f3h80u$vm3$1@build.eclipse.org...
>> Hi,
>>
>> I've setup a simple java project (TagLib) for some .jar files that should
>> be shared among several dynamic web projects. I selected all those jars
>> for export in the project properties and building the dynamic web
>> projects which list TagLib as J2EE Module Dependecy works fine (they use
>> classes from the exported jars). However starting tomcat with these Web
>> Projects doesn't work, I get a NoClassDefFound exception as it can't find
>> any of the classes from the jars that are exported in TagLib.
>>
>> If I look into the
>> .metadata/.plugins/org.eclipse.wst.server.core/tmp3/webapps/ WebModule/WEB-INF/lib/TagLib.jar
>> file I know why: None of the .jar's are put into TagLib.jar and thus they
>> can't be found by the jre that starts tomcat.
>>
>> Is there a way to solve this so that I don't have to add the jars to each
>> web project individually?
>>
>> Andreas
>
>
Re: Using exported jars from j2ee module dependency [message #193588 is a reply to message #193494] Wed, 30 May 2007 08:37 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: pakulat.rostock.zgdv.de

Andreas Pakulat schrieb:
> Konstantin Komissarchik wrote:
>
>> Andreas,
>>
>> Which version of WTP are you using? This should work on version 2.0, but
>> will not work on earlier releases.
>
> I'm using 1.5.4 currently. I'll see if I can do an update to 2.0 tomorrow.

Too bad, that needs eclipse 3.3 apparently which I can't use yet...
Re: Using exported jars from j2ee module dependency [message #194684 is a reply to message #193487] Tue, 19 June 2007 14:03 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: pakulat.rostock.zgdv.de

Rob Frost schrieb:
> Assuming I'm interpreting your use case correctly (WEB-INF/lib dependency on
> a utility project that exports a set of library JARs), you need to ensure
> that the "publish/export" classpath entry attribute has been set for each of
> these JAR library cp entries (this will ensure that these JARs are packaged
> with the published/exported web module).
>
> You can do this via the "quick fix" on the warning that is generated for
> each regarding the potential for runtime class resolution issues (using the
> quick fix is necessary since the "J2EE Module Dependencies" UI is not
> supported for utility projects referenced only by a dynamic web project: see
> https://bugs.eclipse.org/bugs/show_bug.cgi?id=184094 for more information)

Installed Eclipse 3.3 rc and Webtools rc as well. But I don't see any
warnings that could help here. Let me explain again:

I have project TagLib, which has a few classes (which are properly
exported) and a few jars in it. The jars contain base classes for the
classes in this project. And to ease the use of this TagLib project in
various web applications its a utility module. Now as I said the .jars
inside this utility project are not exported even though I selected them
for importing, this of course creates a problem when using the module in
a webapp.

So what exact warning should I see or what else do I have to do to
resolve this?

Andreas
Re: Using exported jars from j2ee module dependency [message #195145 is a reply to message #194684] Thu, 28 June 2007 21:09 Go to previous message
Rob Frost is currently offline Rob FrostFriend
Messages: 64
Registered: July 2009
Member
"Andreas Pakulat" <pakulat@rostock.zgdv.de> wrote in message
news:f58nov$34o$1@build.eclipse.org...
> Rob Frost schrieb:
>> Assuming I'm interpreting your use case correctly (WEB-INF/lib dependency
>> on a utility project that exports a set of library JARs), you need to
>> ensure that the "publish/export" classpath entry attribute has been set
>> for each of these JAR library cp entries (this will ensure that these
>> JARs are packaged with the published/exported web module).
>>
>> You can do this via the "quick fix" on the warning that is generated for
>> each regarding the potential for runtime class resolution issues (using
>> the quick fix is necessary since the "J2EE Module Dependencies" UI is not
>> supported for utility projects referenced only by a dynamic web project:
>> see https://bugs.eclipse.org/bugs/show_bug.cgi?id=184094 for more
>> information)
>
> Installed Eclipse 3.3 rc and Webtools rc as well. But I don't see any
> warnings that could help here. Let me explain again:
>
> I have project TagLib, which has a few classes (which are properly
> exported) and a few jars in it. The jars contain base classes for the
> classes in this project. And to ease the use of this TagLib project in
> various web applications its a utility module. Now as I said the .jars
> inside this utility project are not exported even though I selected them
> for importing, this of course creates a problem when using the module in a
> webapp.
>
> So what exact warning should I see or what else do I have to do to resolve
> this?

The warning you should see is of the following form:

Classpath entry X will not be exported or published. Runtime
ClassNotFoundExceptions may result.

Note: this warning problem marker is only going to be generated if your
project is a "Utility" project rather than a plain Java project (and the
"Classpath Dependency Validator" is therefore enabled; you can check
Project->Properties->Validation to verify this)

-Rob

>
> Andreas
Previous Topic:mime:multipartRelated not properly serialized?
Next Topic:schema resolver
Goto Forum:
  


Current Time: Fri Mar 29 09:33:58 GMT 2024

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

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

Back to the top