Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Removing global exclusion #775

Merged
merged 2 commits into from
Sep 2, 2014
Merged

Removing global exclusion #775

merged 2 commits into from
Sep 2, 2014

Conversation

Turini
Copy link
Member

@Turini Turini commented Sep 1, 2014

this is a pain in the head! For some reason users like to use util package:
br.com.caelum.vraptor.util for tests, and since CDI 1.1 global activation
our exclusions affects users app, we're always getting this question. Users
shouldn't use vraptor packages, but this is just an simple way to avoid it.

@Turini Turini self-assigned this Sep 1, 2014
@garcia-jj
Copy link
Member

By spec, beans.xml affects only your own jar. So if we declare this exclusion, users can use util package in their app that won't excluded.

But I don't have to link to spec because I'm on cellphone. But I remember to read about this.

I'm not sure right now.

@Turini
Copy link
Member Author

Turini commented Sep 1, 2014

It was changed on CDI 1.1's spec, with beans.xml global activation.

@garcia-jj
Copy link
Member

I think that this pull request is really good because Vetoed is more clear to understand than a xml configuration. So it's too right to merge.

But I'm curious about this behaviour. I didn't see in the spec about global activation, only about "automatically discovery beans". There is no any chapter saying that an exclusion in out beans.xml will propagate to all applications. So I did this exactly test, and works as expected: exclusions in vraptor beans.xml won't propagated to other jars.

But as I said before: I love this pull request, because Vetoed is more beautful than xml config.

@Turini
Copy link
Member Author

Turini commented Sep 2, 2014

I think that this pull request is really good because Vetoed is more
clear to understand than a xml configuration

Indeed. It makes explicitly that the annotated class isn't managed.

There is no any chapter saying that an exclusion in out beans.xml

This is true! I've sent an email (i couldn't find the link right now) and
the answer was that there is a lot of undocumented things in CDI 1.1
that will became clear on CDI 2.0 (manly on events features, etc...)

So I did this exactly test, and works as expected: exclusions in
vraptor beans.xml won't propagated to other jars.

There is kinda 10 issues opened at our online courses saying the
opposite :) but this is because you've tested on app server, right?
Somehow the behaviour change when using an servlet container

Turini added a commit that referenced this pull request Sep 2, 2014
@Turini Turini merged commit 2f39450 into master Sep 2, 2014
@Turini Turini deleted the removingGlobalExclusion branch September 2, 2014 12:34
@garcia-jj
Copy link
Member

This is true! I've sent an email [...]

What the people involved with spec said about the issue? Exclusions are global or not?

And yes, I'm using Wildfly with EAR app. I'm too sad because this is not the first thing that works differently between managed and not managed apps. Too bad.

@Turini
Copy link
Member Author

Turini commented Sep 4, 2014

What the people involved with spec said about the issue? Exclusions are global or not?

I didn't get an answer for this question, just the comment: "there's a lot of undocumented things [...]". At the time I've accepted it as an "yes, this is global". But I didn't know that the behavior was different on app servers. If you want, you can open a new thread on spec mailing list about it

this is not the first thing that works differently between managed and not managed apps

definitively

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants