Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » ServerTools (WTP) » JEE 5 lib folder in EAR's
JEE 5 lib folder in EAR's [message #223377] Mon, 03 November 2008 18:03 Go to next message
Eclipse UserFriend
Originally posted by: max.andersen.redhat.com

Hi,

I'm being hit by https://bugs.eclipse.org/bugs/show_bug.cgi?id=241335 and
related bugs.

It seems that Ganymede introduced support for JEE 5's automatic pickup of
jar's in a lib folder by moving/copying
jars around instead of simply having users create a lib folder and put the
jars they would like to have in there.

And that (in my view natural use case) is actually causing problems with
how it is implemented in Ganymede
and my previous projects from 3.3 is being mangled by this.

What i'm looking for is if someone could tell me *how* the JEE 5 lib
folder as implemented in Ganymede
is *supposed* to work because I cannot make it to work....

Anyone with info on it ?

Thanks,
Max
Re: JEE 5 lib folder in EAR's [message #223605 is a reply to message #223377] Thu, 06 November 2008 18:37 Go to previous messageGo to next message
Kaloyan Raev is currently offline Kaloyan RaevFriend
Messages: 201
Registered: July 2009
Location: Sofia, Bulgaria
Senior Member
Hi Max,

Bug 241335 is fixed in WTP 3.0.3 RC3 that will be declared at the end of
this week.

The EAR's lib directory support that was introduced in Ganymede sticks to
the concept of how projects and JARs refer each other in WTP. I admit that
there are some use cases that do not work properly (like in the cited bug),
but we are looking to fix them.

Your comments/questions here and in Bugzilla would be better understood if
there is less emotions and more fact support: step to reproduce, exceptions,
etc.

Greetings,
Kaloyan

"Max Rydahl Andersen" <max.andersen@redhat.com> wrote in message
news:op.uj11svr7w1tq5a@max-pc...
> Hi,
>
> I'm being hit by https://bugs.eclipse.org/bugs/show_bug.cgi?id=241335 and
> related bugs.
>
> It seems that Ganymede introduced support for JEE 5's automatic pickup of
> jar's in a lib folder by moving/copying
> jars around instead of simply having users create a lib folder and put the
> jars they would like to have in there.
>
> And that (in my view natural use case) is actually causing problems with
> how it is implemented in Ganymede
> and my previous projects from 3.3 is being mangled by this.
>
> What i'm looking for is if someone could tell me *how* the JEE 5 lib
> folder as implemented in Ganymede
> is *supposed* to work because I cannot make it to work....
>
> Anyone with info on it ?
>
> Thanks,
> Max
Re: JEE 5 lib folder in EAR's [message #223631 is a reply to message #223605] Fri, 07 November 2008 09:08 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: max.andersen.redhat.com

The problem is that projects that worked in WTP 2.x is not working for me
in WTP 3.x
(one such is attached to the bug report)

What i'm looking for is an explanation how the current ear/lib support is
supposed
to work ?

You say it does like it does in WTP, but then my question is how is that
supposed to work ?

As far as I understand it listens to the manifest.mf and application.xml
which for JEE 5
is irellevant when you have a lib/ directory.

Thus I do not understand what the lib functionallity in WTP 3.0 is
supposed to do if
not just follow the JEE spec and pick up the jar's inside a lib/ directory
in your EarContents folder ?

Could you give me an example of EAR/EJB/WAR triaged project that utilizes
the lib/ directory folder
in WTP 3.0 ?

/max

> Hi Max,
>
> Bug 241335 is fixed in WTP 3.0.3 RC3 that will be declared at the end of
> this week.
>
> The EAR's lib directory support that was introduced in Ganymede sticks to
> the concept of how projects and JARs refer each other in WTP. I admit
> that
> there are some use cases that do not work properly (like in the cited
> bug),
> but we are looking to fix them.
>
> Your comments/questions here and in Bugzilla would be better understood
> if
> there is less emotions and more fact support: step to reproduce,
> exceptions,
> etc.
>
> Greetings,
> Kaloyan
>
> "Max Rydahl Andersen" <max.andersen@redhat.com> wrote in message
> news:op.uj11svr7w1tq5a@max-pc...
>> Hi,
>>
>> I'm being hit by https://bugs.eclipse.org/bugs/show_bug.cgi?id=241335
>> and
>> related bugs.
>>
>> It seems that Ganymede introduced support for JEE 5's automatic pickup
>> of
>> jar's in a lib folder by moving/copying
>> jars around instead of simply having users create a lib folder and put
>> the
>> jars they would like to have in there.
>>
>> And that (in my view natural use case) is actually causing problems with
>> how it is implemented in Ganymede
>> and my previous projects from 3.3 is being mangled by this.
>>
>> What i'm looking for is if someone could tell me *how* the JEE 5 lib
>> folder as implemented in Ganymede
>> is *supposed* to work because I cannot make it to work....
>>
>> Anyone with info on it ?
>>
>> Thanks,
>> Max
>
>



--
Using Opera's revolutionary e-mail client: http://www.opera.com/mail/
Re: JEE 5 lib folder in EAR's [message #223671 is a reply to message #223631] Mon, 10 November 2008 14:23 Go to previous messageGo to next message
Kaloyan Raev is currently offline Kaloyan RaevFriend
Messages: 201
Registered: July 2009
Location: Sofia, Bulgaria
Senior Member
I think we covered this topic (or at least most of it) in bug 241335 after
comment #34.


"Max Rydahl Andersen" <max.andersen@redhat.com> wrote in message
news:op.uj8rnoxow1tq5a@max-pc...
> The problem is that projects that worked in WTP 2.x is not working for me
> in WTP 3.x
> (one such is attached to the bug report)
>
> What i'm looking for is an explanation how the current ear/lib support is
> supposed
> to work ?
>
> You say it does like it does in WTP, but then my question is how is that
> supposed to work ?
>
> As far as I understand it listens to the manifest.mf and application.xml
> which for JEE 5
> is irellevant when you have a lib/ directory.
>
> Thus I do not understand what the lib functionallity in WTP 3.0 is
> supposed to do if
> not just follow the JEE spec and pick up the jar's inside a lib/ directory
> in your EarContents folder ?
>
> Could you give me an example of EAR/EJB/WAR triaged project that utilizes
> the lib/ directory folder
> in WTP 3.0 ?
>
> /max
>
>> Hi Max,
>>
>> Bug 241335 is fixed in WTP 3.0.3 RC3 that will be declared at the end of
>> this week.
>>
>> The EAR's lib directory support that was introduced in Ganymede sticks to
>> the concept of how projects and JARs refer each other in WTP. I admit
>> that
>> there are some use cases that do not work properly (like in the cited
>> bug),
>> but we are looking to fix them.
>>
>> Your comments/questions here and in Bugzilla would be better understood
>> if
>> there is less emotions and more fact support: step to reproduce,
>> exceptions,
>> etc.
>>
>> Greetings,
>> Kaloyan
>>
>> "Max Rydahl Andersen" <max.andersen@redhat.com> wrote in message
>> news:op.uj11svr7w1tq5a@max-pc...
>>> Hi,
>>>
>>> I'm being hit by https://bugs.eclipse.org/bugs/show_bug.cgi?id=241335
>>> and
>>> related bugs.
>>>
>>> It seems that Ganymede introduced support for JEE 5's automatic pickup
>>> of
>>> jar's in a lib folder by moving/copying
>>> jars around instead of simply having users create a lib folder and put
>>> the
>>> jars they would like to have in there.
>>>
>>> And that (in my view natural use case) is actually causing problems with
>>> how it is implemented in Ganymede
>>> and my previous projects from 3.3 is being mangled by this.
>>>
>>> What i'm looking for is if someone could tell me *how* the JEE 5 lib
>>> folder as implemented in Ganymede
>>> is *supposed* to work because I cannot make it to work....
>>>
>>> Anyone with info on it ?
>>>
>>> Thanks,
>>> Max
>>
>>
>
>
>
> --
> Using Opera's revolutionary e-mail client: http://www.opera.com/mail/
Re: JEE 5 lib folder in EAR's [message #223895 is a reply to message #223671] Tue, 18 November 2008 11:30 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: kariem_h.hotmail.com

Hi,

Being a little bit late to this discussion, I fully understand the point
Max made previously. Some kind of example project (or article/tutorial)
in webtool's community space on eclipse.org [1] would be really nice.
Most of this stuff although old is still relevant, but something on how
to effectively use the EAR/lib folder would be interesting.

I hope you don't mind me hijacking this thread for a similar question.

How are dependencies automatically added to the /lib folder of the EAR file?

Developing mostly with maven I usually play a lot with the
org.eclipse.wst.common.component file in the .settings directory of the
ear project. This is the underlying model for the "Java EE Module
Dependencies" project preference page if I understood correctly.

As the maven plugin I currently use [2] does not provide dependency
information to the ear project, I have to add dependencies manually to
this org.eclipse.wst.common.component file. The following example shows
a very small project with a dependency on spring:

<?xml version="1.0" encoding="UTF-8"?>
<project-modules id="moduleCoreId" project-version="1.5.0">
<wb-module deploy-name="amp-ear">
<wb-resource deploy-path="/" source-path="/EarContent"/>
<dependent-module deploy-path="/" handle="module:/resource/amp/amp">
<dependency-type>uses</dependency-type>
</dependent-module>
<dependent-module deploy-path="/lib"
handle="module:/classpath/var/M2_REPO/<path_to_spring>/spring-2.5.5.jar ">
<dependency-type>uses</dependency-type>
</dependent-module>
<!-- other dependencies -->
...
</project-modules>

(M2_REPO is a variable that points to the maven repository)

In this setup, the amp-ear project includes the EJB project amp and a
dependency on spring. This works just as expected: the spring.jar is
copied into the amp.ear/lib folder and found by the application server's
EAR classloader as soon as the application requests a corresponding class:

amp.ear
/lib
spring-2.5.5.jar
amp.jar

The problem is that I cannot add projects from the workspace directly
this way:

On the preference page it is possible to select the JAR/Module
corresponding to the project to be included in the dependencies of the
application. The last column is a checkbox to include this module in the
lib directory ("/lib"). This results in the following entry in
org.eclipse.wst.common.component:

<dependent-module archiveName="dep.jar" deploy-path="/lib"
handle="module:/resource/dep/dep">
<dependency-type>uses</dependency-type>
</dependent-module>

Where "dep" is the name of the project this application depends on.
Looks good, but in the resulting EAR file, the dep.jar is just dropped
into the root folder

amp.ear
/lib
spring-2.5.5.jar
amp.jar
dep.jar

I have tried different possibilities (archiveName="/lib/dep.jar",
deploy-path="/lib/dep.jar" ...), but none of them resulted in what I
expected.

Now, there are two options which are both not very helpful:

a) add dep.jar to the application's manifest
b) build dep.jar outside of eclipse and put it somewhere to be included
in /lib (the method discussed in this thread)


I hope I could explain my point. For me this seems like a bug, but I
could not find any references so I preferred asking here.


Thank you,
Kariem


[1] http://www.eclipse.org/webtools/community
[2] http://m2eclipse.codehaus.org/
Re: JEE 5 lib folder in EAR's [message #224094 is a reply to message #223895] Fri, 21 November 2008 09:24 Go to previous message
Kaloyan Raev is currently offline Kaloyan RaevFriend
Messages: 201
Registered: July 2009
Location: Sofia, Bulgaria
Senior Member
Hello Kariem,

It seems you do it the right way, but unfortunately you hit some bugs like:
https://bugs.eclipse.org/bugs/show_bug.cgi?id=241466
https://bugs.eclipse.org/bugs/show_bug.cgi?id=241332
https://bugs.eclipse.org/bugs/show_bug.cgi?id=254992

If you upgrade to WTP 3.0.3 that was released few days ago, your EAR should
*export* properly. But this might not be true for the *publishing*
(deployment). The generic server adapter in WTP uses different logic for
publishing than the logic for export and publishing has the above mentioned
problems. Therefore all server adapter that extend the generic one should
have the problem you describe.

Greetings,
Kaloyan

"Kariem Hussein" <kariem_h@hotmail.com> wrote in message
news:gfu91d$sae$1@build.eclipse.org...
> Hi,
>
> Being a little bit late to this discussion, I fully understand the point
> Max made previously. Some kind of example project (or article/tutorial) in
> webtool's community space on eclipse.org [1] would be really nice. Most of
> this stuff although old is still relevant, but something on how to
> effectively use the EAR/lib folder would be interesting.
>
> I hope you don't mind me hijacking this thread for a similar question.
>
> How are dependencies automatically added to the /lib folder of the EAR
> file?
>
> Developing mostly with maven I usually play a lot with the
> org.eclipse.wst.common.component file in the .settings directory of the
> ear project. This is the underlying model for the "Java EE Module
> Dependencies" project preference page if I understood correctly.
>
> As the maven plugin I currently use [2] does not provide dependency
> information to the ear project, I have to add dependencies manually to
> this org.eclipse.wst.common.component file. The following example shows a
> very small project with a dependency on spring:
>
> <?xml version="1.0" encoding="UTF-8"?>
> <project-modules id="moduleCoreId" project-version="1.5.0">
> <wb-module deploy-name="amp-ear">
> <wb-resource deploy-path="/" source-path="/EarContent"/>
> <dependent-module deploy-path="/" handle="module:/resource/amp/amp">
> <dependency-type>uses</dependency-type>
> </dependent-module>
> <dependent-module deploy-path="/lib"
> handle="module:/classpath/var/M2_REPO/<path_to_spring>/spring-2.5.5.jar ">
> <dependency-type>uses</dependency-type>
> </dependent-module>
> <!-- other dependencies -->
> ...
> </project-modules>
>
> (M2_REPO is a variable that points to the maven repository)
>
> In this setup, the amp-ear project includes the EJB project amp and a
> dependency on spring. This works just as expected: the spring.jar is
> copied into the amp.ear/lib folder and found by the application server's
> EAR classloader as soon as the application requests a corresponding class:
>
> amp.ear
> /lib
> spring-2.5.5.jar
> amp.jar
>
> The problem is that I cannot add projects from the workspace directly this
> way:
>
> On the preference page it is possible to select the JAR/Module
> corresponding to the project to be included in the dependencies of the
> application. The last column is a checkbox to include this module in the
> lib directory ("/lib"). This results in the following entry in
> org.eclipse.wst.common.component:
>
> <dependent-module archiveName="dep.jar" deploy-path="/lib"
> handle="module:/resource/dep/dep">
> <dependency-type>uses</dependency-type>
> </dependent-module>
>
> Where "dep" is the name of the project this application depends on. Looks
> good, but in the resulting EAR file, the dep.jar is just dropped into the
> root folder
>
> amp.ear
> /lib
> spring-2.5.5.jar
> amp.jar
> dep.jar
>
> I have tried different possibilities (archiveName="/lib/dep.jar",
> deploy-path="/lib/dep.jar" ...), but none of them resulted in what I
> expected.
>
> Now, there are two options which are both not very helpful:
>
> a) add dep.jar to the application's manifest
> b) build dep.jar outside of eclipse and put it somewhere to be included in
> /lib (the method discussed in this thread)
>
>
> I hope I could explain my point. For me this seems like a bug, but I could
> not find any references so I preferred asking here.
>
>
> Thank you,
> Kariem
>
>
> [1] http://www.eclipse.org/webtools/community
> [2] http://m2eclipse.codehaus.org/
Previous Topic:Problems creating Web Services Client
Next Topic:Content of .settings directory
Goto Forum:
  


Current Time: Fri Apr 19 22:02:16 GMT 2024

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

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

Back to the top