You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by Mark Thomas <ma...@apache.org> on 2022/01/10 16:46:55 UTC

Building all releases with Java 11

I thought it would be a good idea to start a new thread for this.

The previous discussion started here:
https://markmail.org/message/e7rsryympb2cephp

I've done some testing with Tomcat 8.5.x

For the Java 7 to Java 8 transition, the problematic code is 
ConcurrentHashMap.keySet()

To test things I introduced a change to ApplicationContext that would 
trigger this issue on web application stop.

Compile with Java 8, run with Java 7 and the logs fill with the expected 
stack traces on shutdown.

Compile with Java 11 + release=7 and a slightly tweaked build.xml), run 
with Java 7 - everything works.

Therefore, this basic testing confirms that release=7 does what we 
expected it to.

A slight complication is that release=... only works with the public 
API. That means we would need to remove the JmxLifecycleListener since 
that uses classes in sun.rmi.*. This has been deprecated since December 
2019 with a warning it may be removed after 2020-12-31.

So, as a first step, I intend to completely remove the JMXLifecycleListener.

I then want to do a little more testing to see if we can build with Java 
7 or Java 11. However, my concern with that approach is that we'll also 
be able to build with Java 8 - the results of which would be problematic.

To Remy's point, it would be useful to still be able to run the unit 
tests with Java 8. Assuming we can disable building with Java 8, maybe 
we need a special flag that enables building and testing with Java 8 but 
has a name like:
do-not-use-for-release-builds-enable-java-8

I don't think we'll get this all sorted for this release round. We 
should be able to remove the JmxLifecycleListener though.

Mark

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


Re: Building all releases with Java 11

Posted by Mark Thomas <ma...@apache.org>.
On 12/01/2022 19:59, Christopher Schultz wrote:
> Mark,
> 
> On 1/12/22 13:36, Mark Thomas wrote:
>> On 12/01/2022 17:29, Christopher Schultz wrote:
>>> On 1/10/22 11:46, Mark Thomas wrote:
>>
>> <snip/>
>>
>>>> So, as a first step, I intend to completely remove the 
>>>> JMXLifecycleListener.
>>>
>>> Are all those various system properties available in recent releases 
>>> of Java 7? I wouldn't want to trap users of Tomcat 8.5 on Java 7 into 
>>> a situation where they cannot upgrade to Tomcat 8.5.latest because 
>>> they still need the capability to control the JMX ports.
>>
>> Define recent :)
>>
>> If you define recent as "the thing you get when you pay Oracle $$$" or 
>> "the thing you get when you build from the project source" then yes.
>>
>> If you define recent as "the last free version you could get back in 
>> April 2015" then mostly. The com.sun.management.jmxremote.host 
>> property is not supported but all the others are.
>>
>> <snip/>
>>
>>>> I don't think we'll get this all sorted for this release round. We 
>>>> should be able to remove the JmxLifecycleListener though.
>>>
>>> It's been documented to be removed for a long time, but I'd like to 
>>> know if we are "stranding" any users by removing it.
>>
>> Anyone still running Tomcat 8.5.x on Java 7 should be doing so on a 
>> supported JRE which means they'll have access to all those properties.
> 
> Okay, thanks for that data point.
> 
> There needs to be a big warning about it in the changelog, migration 
> guide, etc.

It is in the change log. I can add it to the migration guide.

> Actually... how about we just gut the class and replace it with a bunch 
> of log.info statements saying "This class does nothing". I would be very 
> surprised to have a Tomcat upgrade cause my existing (working) 
> configuration to suddenly no longer allow Tomcat to start.
> 
> Fortunately, it's not in the default configuration so it would only 
> affect people who really need it. Maybe those INFO logs could spit-out 
> the system properties they need to use and even check their Java version 
> to tell them if their JVM is compatible with those properties.
> 
> I know, I'm making more work for you if you are going to do it. I 
> wouldn't mind doing the work as long as I know which versions apply, etc.

No objections if you want to do that for 8.5.x and 9.0.x.

Mark

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


Re: Building all releases with Java 11

Posted by Christopher Schultz <ch...@christopherschultz.net>.
Mark,

On 1/12/22 13:36, Mark Thomas wrote:
> On 12/01/2022 17:29, Christopher Schultz wrote:
>> On 1/10/22 11:46, Mark Thomas wrote:
> 
> <snip/>
> 
>>> So, as a first step, I intend to completely remove the 
>>> JMXLifecycleListener.
>>
>> Are all those various system properties available in recent releases 
>> of Java 7? I wouldn't want to trap users of Tomcat 8.5 on Java 7 into 
>> a situation where they cannot upgrade to Tomcat 8.5.latest because 
>> they still need the capability to control the JMX ports.
> 
> Define recent :)
> 
> If you define recent as "the thing you get when you pay Oracle $$$" or 
> "the thing you get when you build from the project source" then yes.
> 
> If you define recent as "the last free version you could get back in 
> April 2015" then mostly. The com.sun.management.jmxremote.host property 
> is not supported but all the others are.
> 
> <snip/>
> 
>>> I don't think we'll get this all sorted for this release round. We 
>>> should be able to remove the JmxLifecycleListener though.
>>
>> It's been documented to be removed for a long time, but I'd like to 
>> know if we are "stranding" any users by removing it.
> 
> Anyone still running Tomcat 8.5.x on Java 7 should be doing so on a 
> supported JRE which means they'll have access to all those properties.

Okay, thanks for that data point.

There needs to be a big warning about it in the changelog, migration 
guide, etc.

Actually... how about we just gut the class and replace it with a bunch 
of log.info statements saying "This class does nothing". I would be very 
surprised to have a Tomcat upgrade cause my existing (working) 
configuration to suddenly no longer allow Tomcat to start.

Fortunately, it's not in the default configuration so it would only 
affect people who really need it. Maybe those INFO logs could spit-out 
the system properties they need to use and even check their Java version 
to tell them if their JVM is compatible with those properties.

I know, I'm making more work for you if you are going to do it. I 
wouldn't mind doing the work as long as I know which versions apply, etc.

-chris

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


Re: Building all releases with Java 11

Posted by Mark Thomas <ma...@apache.org>.
On 12/01/2022 17:29, Christopher Schultz wrote:
> On 1/10/22 11:46, Mark Thomas wrote:

<snip/>

>> So, as a first step, I intend to completely remove the 
>> JMXLifecycleListener.
> 
> Are all those various system properties available in recent releases of 
> Java 7? I wouldn't want to trap users of Tomcat 8.5 on Java 7 into a 
> situation where they cannot upgrade to Tomcat 8.5.latest because they 
> still need the capability to control the JMX ports.

Define recent :)

If you define recent as "the thing you get when you pay Oracle $$$" or 
"the thing you get when you build from the project source" then yes.

If you define recent as "the last free version you could get back in 
April 2015" then mostly. The com.sun.management.jmxremote.host property 
is not supported but all the others are.

<snip/>

>> I don't think we'll get this all sorted for this release round. We 
>> should be able to remove the JmxLifecycleListener though.
> 
> It's been documented to be removed for a long time, but I'd like to know 
> if we are "stranding" any users by removing it.

Anyone still running Tomcat 8.5.x on Java 7 should be doing so on a 
supported JRE which means they'll have access to all those properties.

Mark

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


Re: Building all releases with Java 11

Posted by Christopher Schultz <ch...@christopherschultz.net>.
Mark,

On 1/10/22 11:46, Mark Thomas wrote:
> I thought it would be a good idea to start a new thread for this.
> 
> The previous discussion started here:
> https://markmail.org/message/e7rsryympb2cephp
> 
> I've done some testing with Tomcat 8.5.x
> 
> For the Java 7 to Java 8 transition, the problematic code is 
> ConcurrentHashMap.keySet()
> 
> To test things I introduced a change to ApplicationContext that would 
> trigger this issue on web application stop.
> 
> Compile with Java 8, run with Java 7 and the logs fill with the expected 
> stack traces on shutdown.
> 
> Compile with Java 11 + release=7 and a slightly tweaked build.xml), run 
> with Java 7 - everything works.
> 
> Therefore, this basic testing confirms that release=7 does what we 
> expected it to.
> 
> A slight complication is that release=... only works with the public 
> API. That means we would need to remove the JmxLifecycleListener since 
> that uses classes in sun.rmi.*. This has been deprecated since December 
> 2019 with a warning it may be removed after 2020-12-31.
> 
> So, as a first step, I intend to completely remove the 
> JMXLifecycleListener.

Are all those various system properties available in recent releases of 
Java 7? I wouldn't want to trap users of Tomcat 8.5 on Java 7 into a 
situation where they cannot upgrade to Tomcat 8.5.latest because they 
still need the capability to control the JMX ports.

> I then want to do a little more testing to see if we can build with Java 
> 7 or Java 11. However, my concern with that approach is that we'll also 
> be able to build with Java 8 - the results of which would be problematic.
> 
> To Remy's point, it would be useful to still be able to run the unit 
> tests with Java 8. Assuming we can disable building with Java 8, maybe 
> we need a special flag that enables building and testing with Java 8 but 
> has a name like:
> do-not-use-for-release-builds-enable-java-8

It's also possible to have an ant target which doesn't show up in 
-projecthelp.

> I don't think we'll get this all sorted for this release round. We 
> should be able to remove the JmxLifecycleListener though.

It's been documented to be removed for a long time, but I'd like to know 
if we are "stranding" any users by removing it.

-chris


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


Re: Building all releases with Java 11

Posted by Rémy Maucherat <re...@apache.org>.
On Wed, Jan 12, 2022 at 7:00 PM Mark Thomas <ma...@apache.org> wrote:
>
> On 11/01/2022 10:34, Michael Osipov wrote:
> > Am 2022-01-10 um 17:46 schrieb Mark Thomas:
> >> [...]
> >
> > Is this because of EJC going Java 11?
>
> No.
>
> > Has anyone reached out to them?
>
> No. Having read the thread I don't think anything we could say would
> cause them to reverse their decision.
>
> > Why 11?
>
> Because that is the version we use for 10.1.x. We could use any Java
> version >=11 that supports release=7.
>
> > I assume that 8 will outlive 11 for some time. Java 8 still
> > seems like a good baseline.
>
> 8 doesn't work for Tomcat 8.x. Tomcat 8.x needs to be built against the
> Java 7 API. Java 8 can't do that. Java 9+ can. Since we need Java 11 for
> Tomcat 10.1.x, that seemed like the natural choice.

So +1, this is definitely worth trying.

Rémy

> Mark
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: dev-help@tomcat.apache.org
>

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


Re: Building all releases with Java 11

Posted by Mark Thomas <ma...@apache.org>.
On 11/01/2022 10:34, Michael Osipov wrote:
> Am 2022-01-10 um 17:46 schrieb Mark Thomas:
>> [...]
> 
> Is this because of EJC going Java 11?

No.

> Has anyone reached out to them?

No. Having read the thread I don't think anything we could say would 
cause them to reverse their decision.

> Why 11?

Because that is the version we use for 10.1.x. We could use any Java 
version >=11 that supports release=7.

> I assume that 8 will outlive 11 for some time. Java 8 still 
> seems like a good baseline.

8 doesn't work for Tomcat 8.x. Tomcat 8.x needs to be built against the 
Java 7 API. Java 8 can't do that. Java 9+ can. Since we need Java 11 for 
Tomcat 10.1.x, that seemed like the natural choice.

Mark

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


Re: Building all releases with Java 11

Posted by Michael Osipov <mi...@apache.org>.
Am 2022-01-10 um 17:46 schrieb Mark Thomas:
> [...]

Is this because of EJC going Java 11? Has anyone reached out to them?
Why 11? I assume that 8 will outlive 11 for some time. Java 8 still 
seems like a good baseline.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org