Date   

Re: CDI integration

Pavel Bucek
 

consider this as a subthread :)


On 02/06/2017 16:27, Guillermo González de Agüero wrote:

Ad @Stereotype - I'd need to check whether we can easily do that, since it would create a dependency on javax.enterprise.inject. I don't understand the remark about that annotation not being there in the runtime - it will be there, it has retention runtime (otherwise it wouldn't work)

I meant CDI will only be needed at (JAX-RS implementation) compile time. Applications won't need it as annotations not present on the classpath are just erased at runtime. So people using Spring or wathever non-CDI framework won't see any difference. Hope it clearer now?

To be absolutely honest, I'd expect CNFE or something like that. I already wrote a test, which corresponds to what you wrote ;) So thanks for that info, I wasn't aware of this behavior.

There is a little (forward) issue with this - similarly to any other "optional" dependency, there will be issues with this when Java 9 modules are used. Once the dependency on CDI API is declared in JAX-RS API module-info, CDI API will be required on the module path of any JAX-RS enabled app/code (at least for compilation).

Not saying that is a deal breaker, it's just something we need to consider.

Regards,
Pavel


Re: CDI integration

Sergey Beryozkin
 

IMHO it would be a deal breaker, please do not make strong deps on CDI in JAX-RS API.
It will affect non-EE and non-CDI RI, CXF, RestEasy users who will get annoyed and move elsewhere and it is in our interests to ensure it does not happen.
Lets do the best CDI integration ever but avoid losing the 'independence' of the core JAX-RS API.

Cheers, Sergey

On 02/06/17 16:32, Pavel Bucek wrote:

consider this as a subthread :)


On 02/06/2017 16:27, Guillermo González de Agüero wrote:

Ad @Stereotype - I'd need to check whether we can easily do that, since it would create a dependency on javax.enterprise.inject. I don't understand the remark about that annotation not being there in the runtime - it will be there, it has retention runtime (otherwise it wouldn't work)

I meant CDI will only be needed at (JAX-RS implementation) compile time. Applications won't need it as annotations not present on the classpath are just erased at runtime. So people using Spring or wathever non-CDI framework won't see any difference. Hope it clearer now?

To be absolutely honest, I'd expect CNFE or something like that. I already wrote a test, which corresponds to what you wrote ;) So thanks for that info, I wasn't aware of this behavior.

There is a little (forward) issue with this - similarly to any other "optional" dependency, there will be issues with this when Java 9 modules are used. Once the dependency on CDI API is declared in JAX-RS API module-info, CDI API will be required on the module path of any JAX-RS enabled app/code (at least for compilation).

Not saying that is a deal breaker, it's just something we need to consider.

Regards,
Pavel



Re: module-info or not module-info..

 

Looking at all the trouble I had with diverse Java 9 pre-releases in the past months, I really think it would be wise to completely ignore Java 9 for now. At the time of releasing JAX-RS 2.1 current Java SE still will be 8. Target platforms for JAX-RS 2.1 are Java SE 8 and Java EE 8. So I do neither see a need nor any real benefit for prematurely supporting Java SE 9. It would imply a risk, even if a small one, so we should abstain from that.

It think it would be wise also, not to include Java SE 9 support in JAX-RS 2.1.1. Instead, we should plan to provide Java 9 support in JAX-RS 3, but right now start to work on that once JAX-RS 2.1 is released.

-Markus

-----Original Message-----
From: jaxrs-spec@javaee.groups.io [mailto:jaxrs-spec@javaee.groups.io] On Behalf Of Pavel Bucek
Sent: Freitag, 2. Juni 2017 16:38
To: jaxrs-spec@javaee.groups.io
Subject: [jaxrs] module-info or not module-info..

Dear experts,

we originally intended to include compiled module-info to JAX-RS API jar. Original plan was to prepare a release on final or "almost" final Java SE 9 compliant JDK.

As you might know, Java SE 9 was postponed and the JAX-RS release will most likely happen before that date.

Should we include compiled module-info, even when the compilation was done by early access build of JDK 9? I would believe that there won't be any change in the bytecode format, but it could happen..

From my point of view, it might be better to NOT include compiled module-info now and (if demanded), release JAX-RS 2.1.1 (or something like that) with updated API jar.

Any thoughts/comments?

Thanks,
Pavel


Re: CDI integration

 

I would really love to see everything replaced by CDI which is duplicated in any Java EE API. If this means that a JAX-RS implementation has to provide CDI, then we should add this to the specification as being mandatory. For me, CDI is such a fundamental API that I even would love to have it being part of Java SE !

 

From: jaxrs-spec@javaee.groups.io [mailto:jaxrs-spec@javaee.groups.io] On Behalf Of Sergey Beryozkin
Sent: Freitag, 2. Juni 2017 17:34
To: jaxrs-spec@javaee.groups.io
Subject: Re: [jaxrs] CDI integration

 

IMHO it would be a deal breaker, please do not make strong deps on CDI in JAX-RS API.
It will affect non-EE and non-CDI RI, CXF, RestEasy users who will get annoyed and move elsewhere and it is in our interests to ensure it does not happen.
Lets do the best CDI integration ever but avoid losing the 'independence' of the core JAX-RS API.

Cheers, Sergey
On 02/06/17 16:32, Pavel Bucek wrote:

consider this as a subthread :)

 

On 02/06/2017 16:27, Guillermo González de Agüero wrote:

Ad @Stereotype - I'd need to check whether we can easily do that, since it would create a dependency on javax.enterprise.inject. I don't understand the remark about that annotation not being there in the runtime - it will be there, it has retention runtime (otherwise it wouldn't work)

I meant CDI will only be needed at (JAX-RS implementation) compile time. Applications won't need it as annotations not present on the classpath are just erased at runtime. So people using Spring or wathever non-CDI framework won't see any difference. Hope it clearer now?


To be absolutely honest, I'd expect CNFE or something like that. I already wrote a test, which corresponds to what you wrote ;) So thanks for that info, I wasn't aware of this behavior.

There is a little (forward) issue with this - similarly to any other "optional" dependency, there will be issues with this when Java 9 modules are used. Once the dependency on CDI API is declared in JAX-RS API module-info, CDI API will be required on the module path of any JAX-RS enabled app/code (at least for compilation).

Not saying that is a deal breaker, it's just something we need to consider.

Regards,
Pavel

 


Re: CDI integration

Sergey Beryozkin
 

So lets us just break everything and be happy, how inspiring...

On 02/06/17 17:29, Markus KARG wrote:

I would really love to see everything replaced by CDI which is duplicated in any Java EE API. If this means that a JAX-RS implementation has to provide CDI, then we should add this to the specification as being mandatory. For me, CDI is such a fundamental API that I even would love to have it being part of Java SE !

 

From: jaxrs-spec@javaee.groups.io [mailto:jaxrs-spec@javaee.groups.io] On Behalf Of Sergey Beryozkin
Sent: Freitag, 2. Juni 2017 17:34
To: jaxrs-spec@javaee.groups.io
Subject: Re: [jaxrs] CDI integration

 

IMHO it would be a deal breaker, please do not make strong deps on CDI in JAX-RS API.
It will affect non-EE and non-CDI RI, CXF, RestEasy users who will get annoyed and move elsewhere and it is in our interests to ensure it does not happen.
Lets do the best CDI integration ever but avoid losing the 'independence' of the core JAX-RS API.

Cheers, Sergey
On 02/06/17 16:32, Pavel Bucek wrote:

consider this as a subthread :)

 

On 02/06/2017 16:27, Guillermo González de Agüero wrote:

Ad @Stereotype - I'd need to check whether we can easily do that, since it would create a dependency on javax.enterprise.inject. I don't understand the remark about that annotation not being there in the runtime - it will be there, it has retention runtime (otherwise it wouldn't work)

I meant CDI will only be needed at (JAX-RS implementation) compile time. Applications won't need it as annotations not present on the classpath are just erased at runtime. So people using Spring or wathever non-CDI framework won't see any difference. Hope it clearer now?


To be absolutely honest, I'd expect CNFE or something like that. I already wrote a test, which corresponds to what you wrote ;) So thanks for that info, I wasn't aware of this behavior.

There is a little (forward) issue with this - similarly to any other "optional" dependency, there will be issues with this when Java 9 modules are used. Once the dependency on CDI API is declared in JAX-RS API module-info, CDI API will be required on the module path of any JAX-RS enabled app/code (at least for compilation).

Not saying that is a deal breaker, it's just something we need to consider.

Regards,
Pavel

 



Re: CDI integration

 

I do not say we have to break everything. I said we should mandate to _bundle_ CDI if needed. This does not break anything, it provides additional features.

 

Also please remember that JAXB became conditional, which also means to break things in some cases!

 

You can still support the old annotations to keep old code running on JAX-RS 2.x, but we should allow to write new applications using latest technology, and we should push people into using latest stuff by _deprecating_ old annotations starting with JAX-RS 3.x.

 

From: jaxrs-spec@javaee.groups.io [mailto:jaxrs-spec@javaee.groups.io] On Behalf Of Sergey Beryozkin
Sent: Freitag, 2. Juni 2017 18:31
To: jaxrs-spec@javaee.groups.io
Subject: Re: [jaxrs] CDI integration

 

So lets us just break everything and be happy, how inspiring...
On 02/06/17 17:29, Markus KARG wrote:

I would really love to see everything replaced by CDI which is duplicated in any Java EE API. If this means that a JAX-RS implementation has to provide CDI, then we should add this to the specification as being mandatory. For me, CDI is such a fundamental API that I even would love to have it being part of Java SE !

 

From: jaxrs-spec@javaee.groups.io [mailto:jaxrs-spec@javaee.groups.io] On Behalf Of Sergey Beryozkin
Sent: Freitag, 2. Juni 2017 17:34
To: jaxrs-spec@javaee.groups.io
Subject: Re: [jaxrs] CDI integration

 

IMHO it would be a deal breaker, please do not make strong deps on CDI in JAX-RS API.
It will affect non-EE and non-CDI RI, CXF, RestEasy users who will get annoyed and move elsewhere and it is in our interests to ensure it does not happen.
Lets do the best CDI integration ever but avoid losing the 'independence' of the core JAX-RS API.

Cheers, Sergey
On 02/06/17 16:32, Pavel Bucek wrote:

consider this as a subthread :)

 

On 02/06/2017 16:27, Guillermo González de Agüero wrote:

Ad @Stereotype - I'd need to check whether we can easily do that, since it would create a dependency on javax.enterprise.inject. I don't understand the remark about that annotation not being there in the runtime - it will be there, it has retention runtime (otherwise it wouldn't work)

I meant CDI will only be needed at (JAX-RS implementation) compile time. Applications won't need it as annotations not present on the classpath are just erased at runtime. So people using Spring or wathever non-CDI framework won't see any difference. Hope it clearer now?


To be absolutely honest, I'd expect CNFE or something like that. I already wrote a test, which corresponds to what you wrote ;) So thanks for that info, I wasn't aware of this behavior.

There is a little (forward) issue with this - similarly to any other "optional" dependency, there will be issues with this when Java 9 modules are used. Once the dependency on CDI API is declared in JAX-RS API module-info, CDI API will be required on the module path of any JAX-RS enabled app/code (at least for compilation).

Not saying that is a deal breaker, it's just something we need to consider.

Regards,
Pavel

 

 


Re: module-info or not module-info..

Andy McCright
 

I agree that we should not ship the module-info in 2.1.
 
I do think it is important that JAX-RS 2.1 should function in Java 9 out-of-the-box though.  So, I would advise a wait-and-see approach for whether to include a module-info for a 2.1.1 maintenance release.  If JPMS is on by default when Java 9 ships, I would be in favor of including it in the maintenance release.
 
Thanks,
 
Andy

J. Andrew McCright
IBM WebSphere Development
+1 507 253 7448
TL 553-7448
andymc@...
 
 

----- Original message -----
From: "Markus KARG" <markus@...>
Sent by: jaxrs-spec@javaee.groups.io
To: jaxrs-spec@javaee.groups.io
Cc:
Subject: Re: [jaxrs] module-info or not module-info..
Date: Fri, Jun 2, 2017 11:26 AM
 
Looking at all the trouble I had with diverse Java 9 pre-releases in the past months, I really think it would be wise to completely ignore Java 9 for now. At the time of releasing JAX-RS 2.1 current Java SE still will be 8. Target platforms for JAX-RS 2.1 are Java SE 8 and Java EE 8. So I do neither see a need nor any real benefit for prematurely supporting Java SE 9. It would imply a risk, even if a small one, so we should abstain from that.

It think it would be wise also, not to include Java SE 9 support in JAX-RS 2.1.1. Instead, we should plan to provide Java 9 support in JAX-RS 3, but right now start to work on that once JAX-RS 2.1 is released.

-Markus

-----Original Message-----
From: jaxrs-spec@javaee.groups.io [mailto:jaxrs-spec@javaee.groups.io] On Behalf Of Pavel Bucek
Sent: Freitag, 2. Juni 2017 16:38
To: jaxrs-spec@javaee.groups.io
Subject: [jaxrs] module-info or not module-info..

Dear experts,

we originally intended to include compiled module-info to JAX-RS API jar. Original plan was to prepare a release on final or "almost" final Java SE 9 compliant JDK.

As you might know, Java SE 9 was postponed and the JAX-RS release will most likely happen before that date.

Should we include compiled module-info, even when the compilation was done by early access build of JDK 9? I would believe that there won't be any change in the bytecode format, but it could happen..

 From my point of view, it might be better to NOT include compiled module-info now and (if demanded), release JAX-RS 2.1.1 (or something like that) with updated API jar.

Any thoughts/comments?

Thanks,
Pavel







 
 


Re: CDI integration

Sergey Beryozkin
 

Makes sense as long as CDI is not mandatory for 2.1.

I'm not sure you've heard what I was trying to say about the importance of keeping the core JAX-RS as neutral as possible, I see some won't have a problem at all if JAX-RS becomes owned truly and finally by EE only, I'm not going to keep spending my time any longer on this argument

On 02/06/17 17:43, Markus KARG wrote:

I do not say we have to break everything. I said we should mandate to _bundle_ CDI if needed. This does not break anything, it provides additional features.

 

Also please remember that JAXB became conditional, which also means to break things in some cases!

 

You can still support the old annotations to keep old code running on JAX-RS 2.x, but we should allow to write new applications using latest technology, and we should push people into using latest stuff by _deprecating_ old annotations starting with JAX-RS 3.x.

 

From: jaxrs-spec@javaee.groups.io [mailto:jaxrs-spec@javaee.groups.io] On Behalf Of Sergey Beryozkin
Sent: Freitag, 2. Juni 2017 18:31
To: jaxrs-spec@javaee.groups.io
Subject: Re: [jaxrs] CDI integration

 

So lets us just break everything and be happy, how inspiring...
On 02/06/17 17:29, Markus KARG wrote:

I would really love to see everything replaced by CDI which is duplicated in any Java EE API. If this means that a JAX-RS implementation has to provide CDI, then we should add this to the specification as being mandatory. For me, CDI is such a fundamental API that I even would love to have it being part of Java SE !

 

From: jaxrs-spec@javaee.groups.io [mailto:jaxrs-spec@javaee.groups.io] On Behalf Of Sergey Beryozkin
Sent: Freitag, 2. Juni 2017 17:34
To: jaxrs-spec@javaee.groups.io
Subject: Re: [jaxrs] CDI integration

 

IMHO it would be a deal breaker, please do not make strong deps on CDI in JAX-RS API.
It will affect non-EE and non-CDI RI, CXF, RestEasy users who will get annoyed and move elsewhere and it is in our interests to ensure it does not happen.
Lets do the best CDI integration ever but avoid losing the 'independence' of the core JAX-RS API.

Cheers, Sergey
On 02/06/17 16:32, Pavel Bucek wrote:

consider this as a subthread :)

 

On 02/06/2017 16:27, Guillermo González de Agüero wrote:

Ad @Stereotype - I'd need to check whether we can easily do that, since it would create a dependency on javax.enterprise.inject. I don't understand the remark about that annotation not being there in the runtime - it will be there, it has retention runtime (otherwise it wouldn't work)

I meant CDI will only be needed at (JAX-RS implementation) compile time. Applications won't need it as annotations not present on the classpath are just erased at runtime. So people using Spring or wathever non-CDI framework won't see any difference. Hope it clearer now?


To be absolutely honest, I'd expect CNFE or something like that. I already wrote a test, which corresponds to what you wrote ;) So thanks for that info, I wasn't aware of this behavior.

There is a little (forward) issue with this - similarly to any other "optional" dependency, there will be issues with this when Java 9 modules are used. Once the dependency on CDI API is declared in JAX-RS API module-info, CDI API will be required on the module path of any JAX-RS enabled app/code (at least for compilation).

Not saying that is a deal breaker, it's just something we need to consider.

Regards,
Pavel

 

 



Re: CDI integration

Guillermo González de Agüero
 

Hi,

I've checked it and adding a new bean with CDI 2.0 is just as simple as creating an extension like this (taken from http://www.next-presso.com/2017/02/nobody-expects-the-cdi-portable-extensions/):

public class JaxRsExtension implements Extension {
   
    public void addClasses(@Observes BeforeBeanDiscovery bbd) {
        bbd.addAnnotatedType(RestResource.class, RestResource.class.getName()).
                add(RequestScoped.Literal.INSTANCE);
    }
}


The only caveat is that the implementation will need to know the classes by that point, which is before ServletContainerInitializer is fired (I'm not sure that's a problem; just stating so implementers may comment on it). That prevents the hard dependency on CDI, making everyone happy.

Thoughts?


Regards,

Guillermo González de Agüero


On Fri, Jun 2, 2017 at 5:32 PM, Pavel Bucek <pavel.bucek@...> wrote:

consider this as a subthread :)


On 02/06/2017 16:27, Guillermo González de Agüero wrote:

Ad @Stereotype - I'd need to check whether we can easily do that, since it would create a dependency on javax.enterprise.inject. I don't understand the remark about that annotation not being there in the runtime - it will be there, it has retention runtime (otherwise it wouldn't work)

I meant CDI will only be needed at (JAX-RS implementation) compile time. Applications won't need it as annotations not present on the classpath are just erased at runtime. So people using Spring or wathever non-CDI framework won't see any difference. Hope it clearer now?

To be absolutely honest, I'd expect CNFE or something like that. I already wrote a test, which corresponds to what you wrote ;) So thanks for that info, I wasn't aware of this behavior.

There is a little (forward) issue with this - similarly to any other "optional" dependency, there will be issues with this when Java 9 modules are used. Once the dependency on CDI API is declared in JAX-RS API module-info, CDI API will be required on the module path of any JAX-RS enabled app/code (at least for compilation).

Not saying that is a deal breaker, it's just something we need to consider.

Regards,
Pavel



Re: CDI integration

Arjan Tijms
 

Hi,

On Fri, Jun 2, 2017 at 7:03 PM, Sergey Beryozkin <sberyozkin@...> wrote:
Makes sense as long as CDI is not mandatory for 2.1.

IMHO it would be best to just commit and make CDI mandatory. This is exactly what we've been in doing in JSF as well. There's a transition period, sure, but in the end things should be a lot better.

We deprecated @ManagedBean for JSF 2.3, and I hope to be able and given permission to totally prune it in a future release. JSF is already big enough and should concentrate on the web framework and UI components part without being slowed down and bloated by also having to maintain its own DI engine.

I can't imagine the same wouldn't hold for JAX-RS to some degree. Why maintain an entire independent DI engine if there's one in the platform that you can just use, or outside the platform can just bundle?

Kind regards,
Arjan Tijms



 

I'm not sure you've heard what I was trying to say about the importance of keeping the core JAX-RS as neutral as possible, I see some won't have a problem at all if JAX-RS becomes owned truly and finally by EE only, I'm not going to keep spending my time any longer on this argument

On 02/06/17 17:43, Markus KARG wrote:

I do not say we have to break everything. I said we should mandate to _bundle_ CDI if needed. This does not break anything, it provides additional features.

 

Also please remember that JAXB became conditional, which also means to break things in some cases!

 

You can still support the old annotations to keep old code running on JAX-RS 2.x, but we should allow to write new applications using latest technology, and we should push people into using latest stuff by _deprecating_ old annotations starting with JAX-RS 3.x.

 

From: jaxrs-spec@javaee.groups.io [mailto:jaxrs-spec@javaee.groups.io] On Behalf Of Sergey Beryozkin
Sent: Freitag, 2. Juni 2017 18:31
To: jaxrs-spec@javaee.groups.io
Subject: Re: [jaxrs] CDI integration

 

So lets us just break everything and be happy, how inspiring...
On 02/06/17 17:29, Markus KARG wrote:

I would really love to see everything replaced by CDI which is duplicated in any Java EE API. If this means that a JAX-RS implementation has to provide CDI, then we should add this to the specification as being mandatory. For me, CDI is such a fundamental API that I even would love to have it being part of Java SE !

 

From: jaxrs-spec@javaee.groups.io [mailto:jaxrs-spec@javaee.groups.io] On Behalf Of Sergey Beryozkin
Sent: Freitag, 2. Juni 2017 17:34
To: jaxrs-spec@javaee.groups.io
Subject: Re: [jaxrs] CDI integration

 

IMHO it would be a deal breaker, please do not make strong deps on CDI in JAX-RS API.
It will affect non-EE and non-CDI RI, CXF, RestEasy users who will get annoyed and move elsewhere and it is in our interests to ensure it does not happen.
Lets do the best CDI integration ever but avoid losing the 'independence' of the core JAX-RS API.

Cheers, Sergey
On 02/06/17 16:32, Pavel Bucek wrote:

consider this as a subthread :)

 

On 02/06/2017 16:27, Guillermo González de Agüero wrote:

Ad @Stereotype - I'd need to check whether we can easily do that, since it would create a dependency on javax.enterprise.inject. I don't understand the remark about that annotation not being there in the runtime - it will be there, it has retention runtime (otherwise it wouldn't work)

I meant CDI will only be needed at (JAX-RS implementation) compile time. Applications won't need it as annotations not present on the classpath are just erased at runtime. So people using Spring or wathever non-CDI framework won't see any difference. Hope it clearer now?


To be absolutely honest, I'd expect CNFE or something like that. I already wrote a test, which corresponds to what you wrote ;) So thanks for that info, I wasn't aware of this behavior.

There is a little (forward) issue with this - similarly to any other "optional" dependency, there will be issues with this when Java 9 modules are used. Once the dependency on CDI API is declared in JAX-RS API module-info, CDI API will be required on the module path of any JAX-RS enabled app/code (at least for compilation).

Not saying that is a deal breaker, it's just something we need to consider.

Regards,
Pavel

 

 




Re: CDI integration

Sergey Beryozkin
 

-1

On 02/06/17 20:16, Arjan Tijms wrote:
Hi,

On Fri, Jun 2, 2017 at 7:03 PM, Sergey Beryozkin <sberyozkin@...> wrote:
Makes sense as long as CDI is not mandatory for 2.1.

IMHO it would be best to just commit and make CDI mandatory. This is exactly what we've been in doing in JSF as well. There's a transition period, sure, but in the end things should be a lot better.

We deprecated @ManagedBean for JSF 2.3, and I hope to be able and given permission to totally prune it in a future release. JSF is already big enough and should concentrate on the web framework and UI components part without being slowed down and bloated by also having to maintain its own DI engine.

I can't imagine the same wouldn't hold for JAX-RS to some degree. Why maintain an entire independent DI engine if there's one in the platform that you can just use, or outside the platform can just bundle?

Kind regards,
Arjan Tijms



 

I'm not sure you've heard what I was trying to say about the importance of keeping the core JAX-RS as neutral as possible, I see some won't have a problem at all if JAX-RS becomes owned truly and finally by EE only, I'm not going to keep spending my time any longer on this argument

On 02/06/17 17:43, Markus KARG wrote:

I do not say we have to break everything. I said we should mandate to _bundle_ CDI if needed. This does not break anything, it provides additional features.

 

Also please remember that JAXB became conditional, which also means to break things in some cases!

 

You can still support the old annotations to keep old code running on JAX-RS 2.x, but we should allow to write new applications using latest technology, and we should push people into using latest stuff by _deprecating_ old annotations starting with JAX-RS 3.x.

 

From: jaxrs-spec@javaee.groups.io [mailto:jaxrs-spec@javaee.groups.io] On Behalf Of Sergey Beryozkin
Sent: Freitag, 2. Juni 2017 18:31
To: jaxrs-spec@javaee.groups.io
Subject: Re: [jaxrs] CDI integration

 

So lets us just break everything and be happy, how inspiring...
On 02/06/17 17:29, Markus KARG wrote:

I would really love to see everything replaced by CDI which is duplicated in any Java EE API. If this means that a JAX-RS implementation has to provide CDI, then we should add this to the specification as being mandatory. For me, CDI is such a fundamental API that I even would love to have it being part of Java SE !

 

From: jaxrs-spec@javaee.groups.io [mailto:jaxrs-spec@javaee.groups.io] On Behalf Of Sergey Beryozkin
Sent: Freitag, 2. Juni 2017 17:34
To: jaxrs-spec@javaee.groups.io
Subject: Re: [jaxrs] CDI integration

 

IMHO it would be a deal breaker, please do not make strong deps on CDI in JAX-RS API.
It will affect non-EE and non-CDI RI, CXF, RestEasy users who will get annoyed and move elsewhere and it is in our interests to ensure it does not happen.
Lets do the best CDI integration ever but avoid losing the 'independence' of the core JAX-RS API.

Cheers, Sergey
On 02/06/17 16:32, Pavel Bucek wrote:

consider this as a subthread :)

 

On 02/06/2017 16:27, Guillermo González de Agüero wrote:

Ad @Stereotype - I'd need to check whether we can easily do that, since it would create a dependency on javax.enterprise.inject. I don't understand the remark about that annotation not being there in the runtime - it will be there, it has retention runtime (otherwise it wouldn't work)

I meant CDI will only be needed at (JAX-RS implementation) compile time. Applications won't need it as annotations not present on the classpath are just erased at runtime. So people using Spring or wathever non-CDI framework won't see any difference. Hope it clearer now?


To be absolutely honest, I'd expect CNFE or something like that. I already wrote a test, which corresponds to what you wrote ;) So thanks for that info, I wasn't aware of this behavior.

There is a little (forward) issue with this - similarly to any other "optional" dependency, there will be issues with this when Java 9 modules are used. Once the dependency on CDI API is declared in JAX-RS API module-info, CDI API will be required on the module path of any JAX-RS enabled app/code (at least for compilation).

Not saying that is a deal breaker, it's just something we need to consider.

Regards,
Pavel

 

 





Re: CDI integration

Arjan Tijms
 

-1
Can you give me any good reason why we should keep @ManagedBean? It has been deprecated already and everything in and around it has been superseded by CDI. Also remember that pruning is a multi release process, so if we announce it to be pruned for JSF 2.4 (or whatever the new version will be), it will not be actually made optional until JSF 2.5.


Re: CDI integration

Sergey Beryozkin
 

Why are we talking about JSF ? All JAX-RS stacks have been doing very well so far as far taking care of their users, and somehow they have managed to do it without CDI being a required dependency. I know many do use CDI with CXF, RI for sure, and very likely RestEasy, which I'm happy with. This relentless push to get CDI as a required dep won't help with the cause of spreading JAX-RS beyond EE boundaries. I've no more energy left to continue this discussion, sorry, glad I'm away for the next week and a bit

Have fun
Sergey  


On 02/06/17 22:12, Arjan Tijms wrote:
-1
Can you give me any good reason why we should keep @ManagedBean? It has been deprecated already and everything in and around it has been superseded by CDI. Also remember that pruning is a multi release process, so if we announce it to be pruned for JSF 2.4 (or whatever the new version will be), it will not be actually made optional until JSF 2.5.



Re: CDI integration

Arjan Tijms
 

Hi,

On Fri, Jun 2, 2017 at 11:32 PM, Sergey Beryozkin <sberyozkin@...> wrote:
Why are we talking about JSF?

Because it's another Java EE spec that had its own DI engine and gave it up for the platform one.

I'm really not sure why the REST API of Java EE should have its own DI engine.

Does Spring MVC also has its own DI engine, separate from the Spring platform's bean container? If not, why should Java EE have that?

And if JAX-RS needs to have its own DI engine, why should JSF not have its own? And then Servlet its own? And JPA its own? Does every spec in Java EE need its own and totally different Di engine? 

 
All JAX-RS stacks have been doing very well so far as far taking care of their users, and somehow they have managed to do it without CDI being a required dependency.

Imagine how well JAX-RS could do -with- CDI. I absolutely love JAX-RS and so do many people, but I've rarely heard of anyone going for JAX-RS just because of it's fabulous own DI engine.

 
I know many do use CDI with CXF, RI for sure, and very likely RestEasy, which I'm happy with. This relentless push to get CDI as a required dep won't help with the cause of spreading JAX-RS beyond EE boundaries.

Is Spring trying to spread Spring MVC beyond EE boundaries? Is Microsoft trying to spread ASP.NET Web API beyond the .NET boundaries? Is Ruby On Rails trying to spread its REST API beyond RoR boundaries? Or are they all trying to integrate it in their framework as well as they possibly can?

Kind regards,
Arjan Tijms





 
I've no more energy left to continue this discussion, sorry, glad I'm away for the next week and a bit

Have fun
Sergey  


On 02/06/17 22:12, Arjan Tijms wrote:
-1
Can you give me any good reason why we should keep @ManagedBean? It has been deprecated already and everything in and around it has been superseded by CDI. Also remember that pruning is a multi release process, so if we announce it to be pruned for JSF 2.4 (or whatever the new version will be), it will not be actually made optional until JSF 2.5.




Re: CDI integration

Sebastian Daschner
 

Fully agree that we should try to align JAX-RS into Java EE (i.e. CDI here) as much as possible. IMO one of the biggest advantages of EE is how the different specs integrate with eachother.

That said CDI / JSR 330 is (and IMO should be) the way of how to @Inject any managed objects into anywhere the developers like. JSF is a good example. Another one is @EJB vs @Inject.

Cheers,
Sebastian
   

On 06/03/2017 06:56 AM, Arjan Tijms wrote:
Hi,

On Fri, Jun 2, 2017 at 11:32 PM, Sergey Beryozkin <sberyozkin@...> wrote:
Why are we talking about JSF?

Because it's another Java EE spec that had its own DI engine and gave it up for the platform one.

I'm really not sure why the REST API of Java EE should have its own DI engine.

Does Spring MVC also has its own DI engine, separate from the Spring platform's bean container? If not, why should Java EE have that?

And if JAX-RS needs to have its own DI engine, why should JSF not have its own? And then Servlet its own? And JPA its own? Does every spec in Java EE need its own and totally different Di engine? 

 
All JAX-RS stacks have been doing very well so far as far taking care of their users, and somehow they have managed to do it without CDI being a required dependency.

Imagine how well JAX-RS could do -with- CDI. I absolutely love JAX-RS and so do many people, but I've rarely heard of anyone going for JAX-RS just because of it's fabulous own DI engine.

 
I know many do use CDI with CXF, RI for sure, and very likely RestEasy, which I'm happy with. This relentless push to get CDI as a required dep won't help with the cause of spreading JAX-RS beyond EE boundaries.

Is Spring trying to spread Spring MVC beyond EE boundaries? Is Microsoft trying to spread ASP.NET Web API beyond the .NET boundaries? Is Ruby On Rails trying to spread its REST API beyond RoR boundaries? Or are they all trying to integrate it in their framework as well as they possibly can?

Kind regards,
Arjan Tijms





 
I've no more energy left to continue this discussion, sorry, glad I'm away for the next week and a bit

Have fun
Sergey  


On 02/06/17 22:12, Arjan Tijms wrote:
-1
Can you give me any good reason why we should keep @ManagedBean? It has been deprecated already and everything in and around it has been superseded by CDI. Also remember that pruning is a multi release process, so if we announce it to be pruned for JSF 2.4 (or whatever the new version will be), it will not be actually made optional until JSF 2.5.





Re: module-info or not module-info..

Ivar Grimstad
 

As I recall there were some discussion on the javaee-spec mailinglist (java.net) in May regarding standardzing the module names for the Java EE specs in Java EE 9.
So it may be a bit premature to include it now as it may change then depending on how that goes.

Ivar

On Fri, Jun 2, 2017 at 6:55 PM Andy McCright <andymc@...> wrote:
I agree that we should not ship the module-info in 2.1.
 
I do think it is important that JAX-RS 2.1 should function in Java 9 out-of-the-box though.  So, I would advise a wait-and-see approach for whether to include a module-info for a 2.1.1 maintenance release.  If JPMS is on by default when Java 9 ships, I would be in favor of including it in the maintenance release.
 
Thanks,
 
Andy

J. Andrew McCright
IBM WebSphere Development
+1 507 253 7448
TL 553-7448
andymc@...
 
 
----- Original message -----
From: "Markus KARG" <markus@...>
Sent by: jaxrs-spec@javaee.groups.io
To: jaxrs-spec@javaee.groups.io
Cc:
Subject: Re: [jaxrs] module-info or not module-info..
Date: Fri, Jun 2, 2017 11:26 AM
 
Looking at all the trouble I had with diverse Java 9 pre-releases in the past months, I really think it would be wise to completely ignore Java 9 for now. At the time of releasing JAX-RS 2.1 current Java SE still will be 8. Target platforms for JAX-RS 2.1 are Java SE 8 and Java EE 8. So I do neither see a need nor any real benefit for prematurely supporting Java SE 9. It would imply a risk, even if a small one, so we should abstain from that.

It think it would be wise also, not to include Java SE 9 support in JAX-RS 2.1.1. Instead, we should plan to provide Java 9 support in JAX-RS 3, but right now start to work on that once JAX-RS 2.1 is released.

-Markus

-----Original Message-----
From: jaxrs-spec@javaee.groups.io [mailto:jaxrs-spec@javaee.groups.io] On Behalf Of Pavel Bucek
Sent: Freitag, 2. Juni 2017 16:38
To: jaxrs-spec@javaee.groups.io
Subject: [jaxrs] module-info or not module-info..

Dear experts,

we originally intended to include compiled module-info to JAX-RS API jar. Original plan was to prepare a release on final or "almost" final Java SE 9 compliant JDK.

As you might know, Java SE 9 was postponed and the JAX-RS release will most likely happen before that date.

Should we include compiled module-info, even when the compilation was done by early access build of JDK 9? I would believe that there won't be any change in the bytecode format, but it could happen..

 From my point of view, it might be better to NOT include compiled module-info now and (if demanded), release JAX-RS 2.1.1 (or something like that) with updated API jar.

Any thoughts/comments?

Thanks,
Pavel







 
 

--

Java Champion, JCP EC/EG Member, JUG Leader


Re: module-info or not module-info..

 

I fully agree to the comments already posted. Including a compiled module-info now seems to be too risky. JAX-RS should wait for some recommendation from the umbrella spec before integrating module-info.

Christian

2017-06-03 8:11 GMT+02:00 Ivar Grimstad <ivar.grimstad@...>:

As I recall there were some discussion on the javaee-spec mailinglist (java.net) in May regarding standardzing the module names for the Java EE specs in Java EE 9.
So it may be a bit premature to include it now as it may change then depending on how that goes.

Ivar

On Fri, Jun 2, 2017 at 6:55 PM Andy McCright <andymc@...> wrote:
I agree that we should not ship the module-info in 2.1.
 
I do think it is important that JAX-RS 2.1 should function in Java 9 out-of-the-box though.  So, I would advise a wait-and-see approach for whether to include a module-info for a 2.1.1 maintenance release.  If JPMS is on by default when Java 9 ships, I would be in favor of including it in the maintenance release.
 
Thanks,
 
Andy

J. Andrew McCright
IBM WebSphere Development
+1 507 253 7448
TL 553-7448
andymc@...
 
 
----- Original message -----
From: "Markus KARG" <markus@...>
Sent by: jaxrs-spec@javaee.groups.io
To: jaxrs-spec@javaee.groups.io
Cc:
Subject: Re: [jaxrs] module-info or not module-info..
Date: Fri, Jun 2, 2017 11:26 AM
 
Looking at all the trouble I had with diverse Java 9 pre-releases in the past months, I really think it would be wise to completely ignore Java 9 for now. At the time of releasing JAX-RS 2.1 current Java SE still will be 8. Target platforms for JAX-RS 2.1 are Java SE 8 and Java EE 8. So I do neither see a need nor any real benefit for prematurely supporting Java SE 9. It would imply a risk, even if a small one, so we should abstain from that.

It think it would be wise also, not to include Java SE 9 support in JAX-RS 2.1.1. Instead, we should plan to provide Java 9 support in JAX-RS 3, but right now start to work on that once JAX-RS 2.1 is released.

-Markus

-----Original Message-----
From: jaxrs-spec@javaee.groups.io [mailto:jaxrs-spec@javaee.groups.io] On Behalf Of Pavel Bucek
Sent: Freitag, 2. Juni 2017 16:38
To: jaxrs-spec@javaee.groups.io
Subject: [jaxrs] module-info or not module-info..

Dear experts,

we originally intended to include compiled module-info to JAX-RS API jar. Original plan was to prepare a release on final or "almost" final Java SE 9 compliant JDK.

As you might know, Java SE 9 was postponed and the JAX-RS release will most likely happen before that date.

Should we include compiled module-info, even when the compilation was done by early access build of JDK 9? I would believe that there won't be any change in the bytecode format, but it could happen..

 From my point of view, it might be better to NOT include compiled module-info now and (if demanded), release JAX-RS 2.1.1 (or something like that) with updated API jar.

Any thoughts/comments?

Thanks,
Pavel







 
 

--

Java Champion, JCP EC/EG Member, JUG Leader





Re: Status update

Dennis Kieselhorst
 

Hi Pavel,

could you merge my PR before the next milestone release? https://github.com/jax-rs/api/pull/555

Cheers
Dennis


Re: CDI integration

 

CDI must not be mandatory for the application programmer (so old code does not break), but it is OK for me to make it mandatory to be provided by the container (so new code can safely use it on both Java SE 8 and Java EE 8).

 

From: jaxrs-spec@javaee.groups.io [mailto:jaxrs-spec@javaee.groups.io] On Behalf Of Sergey Beryozkin
Sent: Freitag, 2. Juni 2017 19:04
To: jaxrs-spec@javaee.groups.io
Subject: Re: [jaxrs] CDI integration

 

Makes sense as long as CDI is not mandatory for 2.1.

I'm not sure you've heard what I was trying to say about the importance of keeping the core JAX-RS as neutral as possible, I see some won't have a problem at all if JAX-RS becomes owned truly and finally by EE only, I'm not going to keep spending my time any longer on this argument

On 02/06/17 17:43, Markus KARG wrote:

I do not say we have to break everything. I said we should mandate to _bundle_ CDI if needed. This does not break anything, it provides additional features.

 

Also please remember that JAXB became conditional, which also means to break things in some cases!

 

You can still support the old annotations to keep old code running on JAX-RS 2.x, but we should allow to write new applications using latest technology, and we should push people into using latest stuff by _deprecating_ old annotations starting with JAX-RS 3.x.

 

From: jaxrs-spec@javaee.groups.io [mailto:jaxrs-spec@javaee.groups.io] On Behalf Of Sergey Beryozkin
Sent: Freitag, 2. Juni 2017 18:31
To: jaxrs-spec@javaee.groups.io
Subject: Re: [jaxrs] CDI integration

 

So lets us just break everything and be happy, how inspiring...
On 02/06/17 17:29, Markus KARG wrote:

I would really love to see everything replaced by CDI which is duplicated in any Java EE API. If this means that a JAX-RS implementation has to provide CDI, then we should add this to the specification as being mandatory. For me, CDI is such a fundamental API that I even would love to have it being part of Java SE !

 

From: jaxrs-spec@javaee.groups.io [mailto:jaxrs-spec@javaee.groups.io] On Behalf Of Sergey Beryozkin
Sent: Freitag, 2. Juni 2017 17:34
To: jaxrs-spec@javaee.groups.io
Subject: Re: [jaxrs] CDI integration

 

IMHO it would be a deal breaker, please do not make strong deps on CDI in JAX-RS API.
It will affect non-EE and non-CDI RI, CXF, RestEasy users who will get annoyed and move elsewhere and it is in our interests to ensure it does not happen.
Lets do the best CDI integration ever but avoid losing the 'independence' of the core JAX-RS API.

Cheers, Sergey
On 02/06/17 16:32, Pavel Bucek wrote:

consider this as a subthread :)

 

On 02/06/2017 16:27, Guillermo González de Agüero wrote:

Ad @Stereotype - I'd need to check whether we can easily do that, since it would create a dependency on javax.enterprise.inject. I don't understand the remark about that annotation not being there in the runtime - it will be there, it has retention runtime (otherwise it wouldn't work)

I meant CDI will only be needed at (JAX-RS implementation) compile time. Applications won't need it as annotations not present on the classpath are just erased at runtime. So people using Spring or wathever non-CDI framework won't see any difference. Hope it clearer now?


To be absolutely honest, I'd expect CNFE or something like that. I already wrote a test, which corresponds to what you wrote ;) So thanks for that info, I wasn't aware of this behavior.

There is a little (forward) issue with this - similarly to any other "optional" dependency, there will be issues with this when Java 9 modules are used. Once the dependency on CDI API is declared in JAX-RS API module-info, CDI API will be required on the module path of any JAX-RS enabled app/code (at least for compilation).

Not saying that is a deal breaker, it's just something we need to consider.

Regards,
Pavel

 

 

 


Re: CDI integration

 

I think this all is a question of the time frame so application programmers and container providers can plan the migration.

 

Proposal:

 

* JAX-RS 2.1: Container MAY provide CDI, but MUST be 100% backwards compatible.

* JAX-RS 2.2: Container SHOULD provide CDI, but MUST be 100% backwards compatible.

* JAX-RS 2.3: Container MUST provide CDI, but MUST be 100% backwards compatible; Old DI is marked as deprecated.

* JAX-RS 2.4: Container MUST provide CDI, but MAY still provide old annotations; Old DI is marked as deprecated and pruning date is told (JAX-RS 3.0).

* JAX-RS 3.0: Container MUST provide CDI, but SHOULD NOT still provide old annotations; Old DI is officially pruned.

* JAX-RS 3.1: Container MUST provide CDI, but MUST NOT still provide old annotations; Old DI is finally gone.

 

-Markus

 

From: jaxrs-spec@javaee.groups.io [mailto:jaxrs-spec@javaee.groups.io] On Behalf Of Arjan Tijms
Sent: Freitag, 2. Juni 2017 21:17
To: jaxrs-spec@javaee.groups.io
Subject: Re: [jaxrs] CDI integration

 

Hi,

 

On Fri, Jun 2, 2017 at 7:03 PM, Sergey Beryozkin <sberyozkin@...> wrote:

Makes sense as long as CDI is not mandatory for 2.1.

 

IMHO it would be best to just commit and make CDI mandatory. This is exactly what we've been in doing in JSF as well. There's a transition period, sure, but in the end things should be a lot better.

 

We deprecated @ManagedBean for JSF 2.3, and I hope to be able and given permission to totally prune it in a future release. JSF is already big enough and should concentrate on the web framework and UI components part without being slowed down and bloated by also having to maintain its own DI engine.

 

I can't imagine the same wouldn't hold for JAX-RS to some degree. Why maintain an entire independent DI engine if there's one in the platform that you can just use, or outside the platform can just bundle?

 

Kind regards,

Arjan Tijms

 

 

 

 


I'm not sure you've heard what I was trying to say about the importance of keeping the core JAX-RS as neutral as possible, I see some won't have a problem at all if JAX-RS becomes owned truly and finally by EE only, I'm not going to keep spending my time any longer on this argument


On 02/06/17 17:43, Markus KARG wrote:

I do not say we have to break everything. I said we should mandate to _bundle_ CDI if needed. This does not break anything, it provides additional features.

 

Also please remember that JAXB became conditional, which also means to break things in some cases!

 

You can still support the old annotations to keep old code running on JAX-RS 2.x, but we should allow to write new applications using latest technology, and we should push people into using latest stuff by _deprecating_ old annotations starting with JAX-RS 3.x.

 

From: jaxrs-spec@javaee.groups.io [mailto:jaxrs-spec@javaee.groups.io] On Behalf Of Sergey Beryozkin
Sent: Freitag, 2. Juni 2017 18:31
To: jaxrs-spec@javaee.groups.io
Subject: Re: [jaxrs] CDI integration

 

So lets us just break everything and be happy, how inspiring...
On 02/06/17 17:29, Markus KARG wrote:

I would really love to see everything replaced by CDI which is duplicated in any Java EE API. If this means that a JAX-RS implementation has to provide CDI, then we should add this to the specification as being mandatory. For me, CDI is such a fundamental API that I even would love to have it being part of Java SE !

 

From: jaxrs-spec@javaee.groups.io [mailto:jaxrs-spec@javaee.groups.io] On Behalf Of Sergey Beryozkin
Sent: Freitag, 2. Juni 2017 17:34
To: jaxrs-spec@javaee.groups.io
Subject: Re: [jaxrs] CDI integration

 

IMHO it would be a deal breaker, please do not make strong deps on CDI in JAX-RS API.
It will affect non-EE and non-CDI RI, CXF, RestEasy users who will get annoyed and move elsewhere and it is in our interests to ensure it does not happen.
Lets do the best CDI integration ever but avoid losing the 'independence' of the core JAX-RS API.

Cheers, Sergey
On 02/06/17 16:32, Pavel Bucek wrote:

consider this as a subthread :)

 

On 02/06/2017 16:27, Guillermo González de Agüero wrote:

Ad @Stereotype - I'd need to check whether we can easily do that, since it would create a dependency on javax.enterprise.inject. I don't understand the remark about that annotation not being there in the runtime - it will be there, it has retention runtime (otherwise it wouldn't work)

I meant CDI will only be needed at (JAX-RS implementation) compile time. Applications won't need it as annotations not present on the classpath are just erased at runtime. So people using Spring or wathever non-CDI framework won't see any difference. Hope it clearer now?


To be absolutely honest, I'd expect CNFE or something like that. I already wrote a test, which corresponds to what you wrote ;) So thanks for that info, I wasn't aware of this behavior.

There is a little (forward) issue with this - similarly to any other "optional" dependency, there will be issues with this when Java 9 modules are used. Once the dependency on CDI API is declared in JAX-RS API module-info, CDI API will be required on the module path of any JAX-RS enabled app/code (at least for compilation).

Not saying that is a deal breaker, it's just something we need to consider.

Regards,
Pavel