You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomee.apache.org by Alex The Rocker <al...@gmail.com> on 2018/08/17 11:35:32 UTC

Re: [1/3] tomee git commit: jdk 11 compatibility

Hello Jon,

I'd like to give a try to TomEE 7.0.5 with an "as small as possible"
patch that solves this Java 11 compatibility trick. Is there a way I
could download "just the modified .jar" ?

Thanks,
Alexandre

Le jeu. 16 août 2018 à 11:59, <jg...@apache.org> a écrit :
>
> Repository: tomee
> Updated Branches:
>   refs/heads/master ef64d7dd2 -> 2e3a856b0
>
>
> jdk 11 compatibility
>
>
> Project: http://git-wip-us.apache.org/repos/asf/tomee/repo
> Commit: http://git-wip-us.apache.org/repos/asf/tomee/commit/d2943704
> Tree: http://git-wip-us.apache.org/repos/asf/tomee/tree/d2943704
> Diff: http://git-wip-us.apache.org/repos/asf/tomee/diff/d2943704
>
> Branch: refs/heads/master
> Commit: d294370439cf0f3a3af939c09c4b7272a7f2460a
> Parents: d4c5089
> Author: Vicente Rossello <vr...@travelcompositor.com>
> Authored: Wed Aug 15 23:55:01 2018 +0200
> Committer: Vicente Rossello <vr...@travelcompositor.com>
> Committed: Wed Aug 15 23:55:01 2018 +0200
>
> ----------------------------------------------------------------------
>  .../util/proxy/LocalBeanProxyFactory.java       | 37 +++++++++++++++++---
>  1 file changed, 33 insertions(+), 4 deletions(-)
> ----------------------------------------------------------------------
>
>
> http://git-wip-us.apache.org/repos/asf/tomee/blob/d2943704/container/openejb-core/src/main/java/org/apache/openejb/util/proxy/LocalBeanProxyFactory.java
> ----------------------------------------------------------------------
> diff --git a/container/openejb-core/src/main/java/org/apache/openejb/util/proxy/LocalBeanProxyFactory.java b/container/openejb-core/src/main/java/org/apache/openejb/util/proxy/LocalBeanProxyFactory.java
> index 8a0dd8a..a36f7b8 100644
> --- a/container/openejb-core/src/main/java/org/apache/openejb/util/proxy/LocalBeanProxyFactory.java
> +++ b/container/openejb-core/src/main/java/org/apache/openejb/util/proxy/LocalBeanProxyFactory.java
> @@ -17,6 +17,9 @@
>
>  package org.apache.openejb.util.proxy;
>
> +
> +import org.apache.openejb.util.LogCategory;
> +import org.apache.openejb.util.Logger;
>  import org.apache.openejb.util.Debug;
>  import org.apache.xbean.asm6.ClassWriter;
>  import org.apache.xbean.asm6.Label;
> @@ -47,6 +50,8 @@ import java.util.concurrent.locks.ReentrantLock;
>
>  public class LocalBeanProxyFactory implements Opcodes {
>
> +    private static final Logger LOGGER = Logger.getInstance(LogCategory.OPENEJB, QueryProxy.class);
> +
>      public static final InvocationHandler NON_BUSINESS_HANDLER = new NonBusinessHandler();
>
>      private static final String BUSSINESS_HANDLER_NAME = "businessHandler";
> @@ -700,7 +705,7 @@ public class LocalBeanProxyFactory implements Opcodes {
>
>          // sun.misc.Unsafe
>          private static final Object unsafe;
> -        private static final Method defineClass;
> +        private static final Method unsafeDefineClass;
>          private static final Method allocateInstance;
>          private static final Method putObject;
>          private static final Method objectFieldOffset;
> @@ -774,7 +779,7 @@ public class LocalBeanProxyFactory implements Opcodes {
>                      }
>                  }
>              });
> -            defineClass = AccessController.doPrivileged(new PrivilegedAction<Method>() {
> +            unsafeDefineClass = AccessController.doPrivileged(new PrivilegedAction<Method>() {
>                  @Override
>                  public Method run() {
>                      try {
> @@ -782,7 +787,8 @@ public class LocalBeanProxyFactory implements Opcodes {
>                          mtd.setAccessible(true);
>                          return mtd;
>                      } catch (final Exception e) {
> -                        throw new IllegalStateException("Cannot get sun.misc.Unsafe.defineClass", e);
> +                        LOGGER.debug("Unsafe's defineClass not available, will use classloader's defineClass");
> +                        return null;
>                      }
>                  }
>              });
> @@ -816,8 +822,31 @@ public class LocalBeanProxyFactory implements Opcodes {
>
>          // it is super important to pass a classloader as first parameter otherwise if API class is in a "permanent" classloader then it will leak
>          public static Class defineClass(final ClassLoader loader, final Class<?> clsToProxy, final String proxyName, final byte[] proxyBytes) throws IllegalAccessException, InvocationTargetException {
> -            return (Class<?>) defineClass.invoke(unsafe, proxyName, proxyBytes, 0, proxyBytes.length, loader, clsToProxy.getProtectionDomain());
> +            if (unsafeDefineClass != null) {
> +                return (Class<?>) unsafeDefineClass.invoke(unsafe, proxyName, proxyBytes, 0, proxyBytes.length, loader, clsToProxy.getProtectionDomain());
> +            } else {
> +                return (Class) getClassLoaderDefineClassMethod(loader).invoke(loader, proxyName, proxyBytes, 0, proxyBytes.length, clsToProxy.getProtectionDomain());
> +            }
> +        }
> +
> +        private static Method getClassLoaderDefineClassMethod(ClassLoader classLoader) {
> +            Class<?> clazz = classLoader.getClass();
> +            Method defineClassMethod = null;
> +            do {
> +                try {
> +                    defineClassMethod = clazz.getDeclaredMethod("defineClass", String.class, byte[].class, int.class, int.class, ProtectionDomain.class);
> +                } catch (NoSuchMethodException e) {
> +                    // do nothing, we need to search the superclass
> +                }
> +                clazz = clazz.getSuperclass();
> +            } while (defineClassMethod == null && clazz != Object.class);
> +
> +            if (defineClassMethod != null && !defineClassMethod.isAccessible()) {
> +                defineClassMethod.setAccessible(true);
> +            }
> +            return defineClassMethod;
>          }
> +
>      }
>
>      @Target(ElementType.TYPE)
>

Re: [1/3] tomee git commit: jdk 11 compatibility

Posted by Romain Manni-Bucau <rm...@gmail.com>.
We upload to nexus but it got some issues lately so some builds can have
failed

Romain Manni-Bucau
@rmannibucau <https://twitter.com/rmannibucau> |  Blog
<https://rmannibucau.metawerx.net/> | Old Blog
<http://rmannibucau.wordpress.com> | Github <https://github.com/rmannibucau> |
LinkedIn <https://www.linkedin.com/in/rmannibucau> | Book
<https://www.packtpub.com/application-development/java-ee-8-high-performance>


Le mar. 21 août 2018 à 14:16, Matthew Broadhead
<ma...@nbmlaw.co.uk.invalid> a écrit :

> is it not connecting to the archiva maven repo to upload the new snapshots?
>
> On 20/08/18 18:14, Matthew Broadhead wrote:
> > meant to paste this
> > [ERROR] Failed to execute goal
> > org.apache.maven.plugins:maven-deploy-plugin:2.8.2:deploy
> > (default-deploy) on project tomee-project: Failed to retrieve remote
> > metadata
> > org.apache.tomee:tomee-project:7.0.6-SNAPSHOT/maven-metadata.xml:
> > Could not transfer metadata
> > org.apache.tomee:tomee-project:7.0.6-SNAPSHOT/maven-metadata.xml
> > from/to apache.snapshots.https
> > (https://repository.apache.org/content/repositories/snapshots):
> > Connect to repository.apache.org:443
> > [repository.apache.org/207.244.88.140] failed: Connection timed out
> > (Connection timed out) -> [Help 1]
> > [ERROR] Failed to execute goal
> > org.apache.maven.plugins:maven-deploy-plugin:2.8.2:deploy
> > (default-deploy) on project container: Failed to retrieve remote
> > metadata org.apache.tomee:container:7.0.6-SNAPSHOT/maven-metadata.xml:
> > Could not transfer metadata
> > org.apache.tomee:container:7.0.6-SNAPSHOT/maven-metadata.xml from/to
> > apache.snapshots.https
> > (https://repository.apache.org/content/repositories/snapshots):
> > Connect to repository.apache.org:443
> > [repository.apache.org/207.244.88.140] failed: Connection timed out
> > (Connection timed out) -> [Help 1]
> > [ERROR] Failed to execute goal
> > org.apache.maven.plugins:maven-deploy-plugin:2.8.2:deploy
> > (default-deploy) on project openejb-loader: Failed to retrieve remote
> > metadata
> > org.apache.tomee:openejb-loader:7.0.6-SNAPSHOT/maven-metadata.xml:
> > Could not transfer metadata
> > org.apache.tomee:openejb-loader:7.0.6-SNAPSHOT/maven-metadata.xml
> > from/to apache.snapshots.https
> > (https://repository.apache.org/content/repositories/snapshots):
> > Connect to repository.apache.org:443
> > [repository.apache.org/207.244.88.140] failed: Connection timed out
> > (Connection timed out) -> [Help 1]
> > [ERROR] Failed to execute goal
> > org.apache.maven.plugins:maven-deploy-plugin:2.8.2:deploy
> > (default-deploy) on project mbean-annotation-api: Failed to retrieve
> > remote metadata
> > org.apache.tomee:mbean-annotation-api:7.0.6-SNAPSHOT/maven-metadata.xml:
> > Could not transfer metadata
> > org.apache.tomee:mbean-annotation-api:7.0.6-SNAPSHOT/maven-metadata.xml
> > from/to apache.snapshots.https
> > (https://repository.apache.org/content/repositories/snapshots):
> > Connect to repository.apache.org:443
> > [repository.apache.org/207.244.88.140] failed: Connection timed out
> > (Connection timed out) -> [Help 1]
> > [ERROR] Failed to execute goal
> > org.apache.maven.plugins:maven-deploy-plugin:2.8.2:deploy
> > (default-deploy) on project openejb-jpa-integration: Failed to
> > retrieve remote metadata
> >
> org.apache.tomee:openejb-jpa-integration:7.0.6-SNAPSHOT/maven-metadata.xml:
> > Could not transfer metadata
> >
> org.apache.tomee:openejb-jpa-integration:7.0.6-SNAPSHOT/maven-metadata.xml
> > from/to apache.snapshots.https
> > (https://repository.apache.org/content/repositories/snapshots):
> > Connect to repository.apache.org:443
> > [repository.apache.org/207.244.88.140] failed: Connection timed out
> > (Connection timed out) -> [Help 1]
> >
> > On 20/08/18 15:41, Jonathan Gallimore wrote:
> >> Snapshot (openejb-core) should be available when this build finishes:
> >> https://ci.apache.org/builders/tomee-7.0.x-deploy/builds/4
> >>
> >> Jon
> >>
> >> On Mon, Aug 20, 2018 at 2:01 PM, Jonathan Gallimore <
> >> jonathan.gallimore@gmail.com> wrote:
> >>
> >>> I haven't been able to do that yet - I'll drop a note here when I have.
> >>>
> >>> Jon
> >>>
> >>> On Mon, Aug 20, 2018 at 1:24 PM, Alex The Rocker <alex.m3tal@gmail.com
> >
> >>> wrote:
> >>>
> >>>> Hi Jon,
> >>>>
> >>>> Is the TomEE 7.0.x snapshot compatible with Java 11 available today?
> >>>> If yes then what's the URL to download it?
> >>>>
> >>>> Thanks,
> >>>> Alexandre
> >>>>
> >>>>
> >>>> Le ven. 17 août 2018 à 15:51, Jonathan Gallimore <
> >>>> jonathan.gallimore@gmail.com> a écrit :
> >>>>
> >>>>> I'm suspecting that too, but it'll be fun to try it and see how we
> >>>>> get
> >>>> on.
> >>>>> 😀
> >>>>>
> >>>>> On Fri, 17 Aug 2018, 14:08 cocorossello, <co...@gmail.com>
> >>>> wrote:
> >>>>>> I think you will also need to release openwebbeans, jdk 11 patch
> >>>> there is
> >>>>>> not
> >>>>>> in any release yet.
> >>>>>>
> >>>>>>
> >>>>>>
> >>>>>> --
> >>>>>> Sent from:
> >>>>>> http://tomee-openejb.979440.n4.nabble.com/TomEE-Dev-f982480.html
> >>>>>>
> >>>
> >
>
>

Re: [1/3] tomee git commit: jdk 11 compatibility

Posted by Matthew Broadhead <ma...@nbmlaw.co.uk.INVALID>.
is it not connecting to the archiva maven repo to upload the new snapshots?

On 20/08/18 18:14, Matthew Broadhead wrote:
> meant to paste this
> [ERROR] Failed to execute goal 
> org.apache.maven.plugins:maven-deploy-plugin:2.8.2:deploy 
> (default-deploy) on project tomee-project: Failed to retrieve remote 
> metadata 
> org.apache.tomee:tomee-project:7.0.6-SNAPSHOT/maven-metadata.xml: 
> Could not transfer metadata 
> org.apache.tomee:tomee-project:7.0.6-SNAPSHOT/maven-metadata.xml 
> from/to apache.snapshots.https 
> (https://repository.apache.org/content/repositories/snapshots): 
> Connect to repository.apache.org:443 
> [repository.apache.org/207.244.88.140] failed: Connection timed out 
> (Connection timed out) -> [Help 1]
> [ERROR] Failed to execute goal 
> org.apache.maven.plugins:maven-deploy-plugin:2.8.2:deploy 
> (default-deploy) on project container: Failed to retrieve remote 
> metadata org.apache.tomee:container:7.0.6-SNAPSHOT/maven-metadata.xml: 
> Could not transfer metadata 
> org.apache.tomee:container:7.0.6-SNAPSHOT/maven-metadata.xml from/to 
> apache.snapshots.https 
> (https://repository.apache.org/content/repositories/snapshots): 
> Connect to repository.apache.org:443 
> [repository.apache.org/207.244.88.140] failed: Connection timed out 
> (Connection timed out) -> [Help 1]
> [ERROR] Failed to execute goal 
> org.apache.maven.plugins:maven-deploy-plugin:2.8.2:deploy 
> (default-deploy) on project openejb-loader: Failed to retrieve remote 
> metadata 
> org.apache.tomee:openejb-loader:7.0.6-SNAPSHOT/maven-metadata.xml: 
> Could not transfer metadata 
> org.apache.tomee:openejb-loader:7.0.6-SNAPSHOT/maven-metadata.xml 
> from/to apache.snapshots.https 
> (https://repository.apache.org/content/repositories/snapshots): 
> Connect to repository.apache.org:443 
> [repository.apache.org/207.244.88.140] failed: Connection timed out 
> (Connection timed out) -> [Help 1]
> [ERROR] Failed to execute goal 
> org.apache.maven.plugins:maven-deploy-plugin:2.8.2:deploy 
> (default-deploy) on project mbean-annotation-api: Failed to retrieve 
> remote metadata 
> org.apache.tomee:mbean-annotation-api:7.0.6-SNAPSHOT/maven-metadata.xml: 
> Could not transfer metadata 
> org.apache.tomee:mbean-annotation-api:7.0.6-SNAPSHOT/maven-metadata.xml 
> from/to apache.snapshots.https 
> (https://repository.apache.org/content/repositories/snapshots): 
> Connect to repository.apache.org:443 
> [repository.apache.org/207.244.88.140] failed: Connection timed out 
> (Connection timed out) -> [Help 1]
> [ERROR] Failed to execute goal 
> org.apache.maven.plugins:maven-deploy-plugin:2.8.2:deploy 
> (default-deploy) on project openejb-jpa-integration: Failed to 
> retrieve remote metadata 
> org.apache.tomee:openejb-jpa-integration:7.0.6-SNAPSHOT/maven-metadata.xml: 
> Could not transfer metadata 
> org.apache.tomee:openejb-jpa-integration:7.0.6-SNAPSHOT/maven-metadata.xml 
> from/to apache.snapshots.https 
> (https://repository.apache.org/content/repositories/snapshots): 
> Connect to repository.apache.org:443 
> [repository.apache.org/207.244.88.140] failed: Connection timed out 
> (Connection timed out) -> [Help 1]
>
> On 20/08/18 15:41, Jonathan Gallimore wrote:
>> Snapshot (openejb-core) should be available when this build finishes:
>> https://ci.apache.org/builders/tomee-7.0.x-deploy/builds/4
>>
>> Jon
>>
>> On Mon, Aug 20, 2018 at 2:01 PM, Jonathan Gallimore <
>> jonathan.gallimore@gmail.com> wrote:
>>
>>> I haven't been able to do that yet - I'll drop a note here when I have.
>>>
>>> Jon
>>>
>>> On Mon, Aug 20, 2018 at 1:24 PM, Alex The Rocker <al...@gmail.com>
>>> wrote:
>>>
>>>> Hi Jon,
>>>>
>>>> Is the TomEE 7.0.x snapshot compatible with Java 11 available today?
>>>> If yes then what's the URL to download it?
>>>>
>>>> Thanks,
>>>> Alexandre
>>>>
>>>>
>>>> Le ven. 17 août 2018 à 15:51, Jonathan Gallimore <
>>>> jonathan.gallimore@gmail.com> a écrit :
>>>>
>>>>> I'm suspecting that too, but it'll be fun to try it and see how we 
>>>>> get
>>>> on.
>>>>> 😀
>>>>>
>>>>> On Fri, 17 Aug 2018, 14:08 cocorossello, <co...@gmail.com>
>>>> wrote:
>>>>>> I think you will also need to release openwebbeans, jdk 11 patch
>>>> there is
>>>>>> not
>>>>>> in any release yet.
>>>>>>
>>>>>>
>>>>>>
>>>>>> -- 
>>>>>> Sent from:
>>>>>> http://tomee-openejb.979440.n4.nabble.com/TomEE-Dev-f982480.html
>>>>>>
>>>
>


Re: [1/3] tomee git commit: jdk 11 compatibility

Posted by Matthew Broadhead <ma...@nbmlaw.co.uk.INVALID>.
meant to paste this
[ERROR] Failed to execute goal 
org.apache.maven.plugins:maven-deploy-plugin:2.8.2:deploy 
(default-deploy) on project tomee-project: Failed to retrieve remote 
metadata 
org.apache.tomee:tomee-project:7.0.6-SNAPSHOT/maven-metadata.xml: Could 
not transfer metadata 
org.apache.tomee:tomee-project:7.0.6-SNAPSHOT/maven-metadata.xml from/to 
apache.snapshots.https 
(https://repository.apache.org/content/repositories/snapshots): Connect 
to repository.apache.org:443 [repository.apache.org/207.244.88.140] 
failed: Connection timed out (Connection timed out) -> [Help 1]
[ERROR] Failed to execute goal 
org.apache.maven.plugins:maven-deploy-plugin:2.8.2:deploy 
(default-deploy) on project container: Failed to retrieve remote 
metadata org.apache.tomee:container:7.0.6-SNAPSHOT/maven-metadata.xml: 
Could not transfer metadata 
org.apache.tomee:container:7.0.6-SNAPSHOT/maven-metadata.xml from/to 
apache.snapshots.https 
(https://repository.apache.org/content/repositories/snapshots): Connect 
to repository.apache.org:443 [repository.apache.org/207.244.88.140] 
failed: Connection timed out (Connection timed out) -> [Help 1]
[ERROR] Failed to execute goal 
org.apache.maven.plugins:maven-deploy-plugin:2.8.2:deploy 
(default-deploy) on project openejb-loader: Failed to retrieve remote 
metadata 
org.apache.tomee:openejb-loader:7.0.6-SNAPSHOT/maven-metadata.xml: Could 
not transfer metadata 
org.apache.tomee:openejb-loader:7.0.6-SNAPSHOT/maven-metadata.xml 
from/to apache.snapshots.https 
(https://repository.apache.org/content/repositories/snapshots): Connect 
to repository.apache.org:443 [repository.apache.org/207.244.88.140] 
failed: Connection timed out (Connection timed out) -> [Help 1]
[ERROR] Failed to execute goal 
org.apache.maven.plugins:maven-deploy-plugin:2.8.2:deploy 
(default-deploy) on project mbean-annotation-api: Failed to retrieve 
remote metadata 
org.apache.tomee:mbean-annotation-api:7.0.6-SNAPSHOT/maven-metadata.xml: 
Could not transfer metadata 
org.apache.tomee:mbean-annotation-api:7.0.6-SNAPSHOT/maven-metadata.xml 
from/to apache.snapshots.https 
(https://repository.apache.org/content/repositories/snapshots): Connect 
to repository.apache.org:443 [repository.apache.org/207.244.88.140] 
failed: Connection timed out (Connection timed out) -> [Help 1]
[ERROR] Failed to execute goal 
org.apache.maven.plugins:maven-deploy-plugin:2.8.2:deploy 
(default-deploy) on project openejb-jpa-integration: Failed to retrieve 
remote metadata 
org.apache.tomee:openejb-jpa-integration:7.0.6-SNAPSHOT/maven-metadata.xml: 
Could not transfer metadata 
org.apache.tomee:openejb-jpa-integration:7.0.6-SNAPSHOT/maven-metadata.xml 
from/to apache.snapshots.https 
(https://repository.apache.org/content/repositories/snapshots): Connect 
to repository.apache.org:443 [repository.apache.org/207.244.88.140] 
failed: Connection timed out (Connection timed out) -> [Help 1]

On 20/08/18 15:41, Jonathan Gallimore wrote:
> Snapshot (openejb-core) should be available when this build finishes:
> https://ci.apache.org/builders/tomee-7.0.x-deploy/builds/4
>
> Jon
>
> On Mon, Aug 20, 2018 at 2:01 PM, Jonathan Gallimore <
> jonathan.gallimore@gmail.com> wrote:
>
>> I haven't been able to do that yet - I'll drop a note here when I have.
>>
>> Jon
>>
>> On Mon, Aug 20, 2018 at 1:24 PM, Alex The Rocker <al...@gmail.com>
>> wrote:
>>
>>> Hi Jon,
>>>
>>> Is the TomEE 7.0.x snapshot compatible with Java 11 available today?
>>> If yes then what's the URL to download it?
>>>
>>> Thanks,
>>> Alexandre
>>>
>>>
>>> Le ven. 17 août 2018 à 15:51, Jonathan Gallimore <
>>> jonathan.gallimore@gmail.com> a écrit :
>>>
>>>> I'm suspecting that too, but it'll be fun to try it and see how we get
>>> on.
>>>> 😀
>>>>
>>>> On Fri, 17 Aug 2018, 14:08 cocorossello, <co...@gmail.com>
>>> wrote:
>>>>> I think you will also need to release openwebbeans, jdk 11 patch
>>> there is
>>>>> not
>>>>> in any release yet.
>>>>>
>>>>>
>>>>>
>>>>> --
>>>>> Sent from:
>>>>> http://tomee-openejb.979440.n4.nabble.com/TomEE-Dev-f982480.html
>>>>>
>>


Re: [1/3] tomee git commit: jdk 11 compatibility

Posted by Alex The Rocker <al...@gmail.com>.
Hello,

I just opened https://issues.apache.org/jira/browse/TOMEE-2226 JIRA to
track the WARN messages about 'Illegal reflective access' with Java 11
(probably this is also reproducible with Java 9).

I also want to mention that apart from these messages, my applications work
fine with TomEE+ 7.0.6 snapshot of the 22th of August with Java 11 EA 25 on
CentOS 7, and this includes the embedded ActiveMQ service in TomEE, Jedis,
Shiro and of course our JAX-RS web services.

I will have in 2 weeks from now a way greater scope of tests, stay tuned
and thanks a lot for the great work with TomEE+ !

Buy the way, shouldn't https://issues.apache.org/jira/browse/TOMEE-2200 be
closed, since with latest TomEE+ 7.0.6 snapshot the blocking issue that
used TomEE from starting with Java 11 is solved?

Thanks,
Alexandre



Le mer. 22 août 2018 à 16:05, Jonathan Gallimore <
jonathan.gallimore@gmail.com> a écrit :

> Thanks for the update, and yes please for the Jira.
>
> Thanks
>
> Jon
>
> On Wed, 22 Aug 2018, 13:39 Alex The Rocker, <al...@gmail.com> wrote:
>
> > Hello,
> >
> > Just to report that my first attempt with TomEE 7.0.6 snapshot (using
> > apache-tomee-7.0.6-20180822.044606-8-plus.tar.gz) with Java 11 (EA build
> > 25) gives me strange warnings in catalina.out:
> >
> > catalina.2018-08-22.log:22-Aug-2018 12:20:41.687 WARNING
> > [localhost-startStop-1]
> > org.apache.catalina.util.SessionIdGeneratorBase.createSecureRandom
> Creation
> > of SecureRandom instance for session ID generation using [SHA1PRNG] took
> > [29,399] milliseconds.
> > catalina.out:WARNING: An illegal reflective access operation has occurred
> > catalina.out:WARNING: Illegal reflective access by
> > org.apache.tomee.catalina.ServerListener
> > (file:/usr/local/tomee/lib/tomee-catalina-7.0.6-SNAPSHOT.jar) to field
> > java.lang.reflect.Field.modifiers
> > catalina.out:WARNING: Please consider reporting this to the maintainers
> of
> > org.apache.tomee.catalina.ServerListener
> > catalina.out:WARNING: Use --illegal-access=warn to enable warnings of
> > further illegal reflective access operations
> > catalina.out:WARNING: All illegal access operations will be denied in a
> > future release
> > catalina.out:22-Aug-2018 12:20:41.687 WARNING [localhost-startStop-1]
> > org.apache.catalina.util.SessionIdGeneratorBase.createSecureRandom
> Creation
> > of SecureRandom instance for session ID generation using [SHA1PRNG] took
> > [29,399] milliseconds.
> >
> > For the way too slow secure random I guess I can tweak
> > jdk/conf/security/java.security and replace /dev/random by /dev/urandom,
> > but how about the "Illegal reflective access by
> > org.apache.tomee.catalina.ServerListener" ?
> >
> > Should I fill a JIRA for this one?
> >
> > Thanks
> > Alexandre
> >
> >
> > Le mar. 21 août 2018 à 15:33, Jonathan Gallimore <
> > jonathan.gallimore@gmail.com> a écrit :
> >
> > > Hopefully this one will do the trick:
> > > openejb-core-7.0.6-20180821.130440-7.jar
> > > <
> > >
> >
> https://repository.apache.org/content/groups/snapshots/org/apache/tomee/openejb-core/7.0.6-SNAPSHOT/openejb-core-7.0.6-20180821.130440-7.jar
> > > >
> > > -
> > > I deployed manually from here. Seems there is an issue with buildbot
> > doing
> > > it. Sorry about that.
> > >
> > > Jon
> > >
> > > On Mon, Aug 20, 2018 at 2:41 PM Jonathan Gallimore <
> > > jonathan.gallimore@gmail.com> wrote:
> > >
> > > > Snapshot (openejb-core) should be available when this build finishes:
> > > > https://ci.apache.org/builders/tomee-7.0.x-deploy/builds/4
> > > >
> > > > Jon
> > > >
> > > > On Mon, Aug 20, 2018 at 2:01 PM, Jonathan Gallimore <
> > > > jonathan.gallimore@gmail.com> wrote:
> > > >
> > > >> I haven't been able to do that yet - I'll drop a note here when I
> > have.
> > > >>
> > > >> Jon
> > > >>
> > > >> On Mon, Aug 20, 2018 at 1:24 PM, Alex The Rocker <
> > alex.m3tal@gmail.com>
> > > >> wrote:
> > > >>
> > > >>> Hi Jon,
> > > >>>
> > > >>> Is the TomEE 7.0.x snapshot compatible with Java 11 available
> today?
> > > >>> If yes then what's the URL to download it?
> > > >>>
> > > >>> Thanks,
> > > >>> Alexandre
> > > >>>
> > > >>>
> > > >>> Le ven. 17 août 2018 à 15:51, Jonathan Gallimore <
> > > >>> jonathan.gallimore@gmail.com> a écrit :
> > > >>>
> > > >>> > I'm suspecting that too, but it'll be fun to try it and see how
> we
> > > get
> > > >>> on.
> > > >>> > 😀
> > > >>> >
> > > >>> > On Fri, 17 Aug 2018, 14:08 cocorossello, <cocorossello@gmail.com
> >
> > > >>> wrote:
> > > >>> >
> > > >>> > > I think you will also need to release openwebbeans, jdk 11
> patch
> > > >>> there is
> > > >>> > > not
> > > >>> > > in any release yet.
> > > >>> > >
> > > >>> > >
> > > >>> > >
> > > >>> > > --
> > > >>> > > Sent from:
> > > >>> > >
> http://tomee-openejb.979440.n4.nabble.com/TomEE-Dev-f982480.html
> > > >>> > >
> > > >>> >
> > > >>>
> > > >>
> > > >>
> > > >
> > >
> >
>

Re: [1/3] tomee git commit: jdk 11 compatibility

Posted by Jonathan Gallimore <jo...@gmail.com>.
Thanks for the update, and yes please for the Jira.

Thanks

Jon

On Wed, 22 Aug 2018, 13:39 Alex The Rocker, <al...@gmail.com> wrote:

> Hello,
>
> Just to report that my first attempt with TomEE 7.0.6 snapshot (using
> apache-tomee-7.0.6-20180822.044606-8-plus.tar.gz) with Java 11 (EA build
> 25) gives me strange warnings in catalina.out:
>
> catalina.2018-08-22.log:22-Aug-2018 12:20:41.687 WARNING
> [localhost-startStop-1]
> org.apache.catalina.util.SessionIdGeneratorBase.createSecureRandom Creation
> of SecureRandom instance for session ID generation using [SHA1PRNG] took
> [29,399] milliseconds.
> catalina.out:WARNING: An illegal reflective access operation has occurred
> catalina.out:WARNING: Illegal reflective access by
> org.apache.tomee.catalina.ServerListener
> (file:/usr/local/tomee/lib/tomee-catalina-7.0.6-SNAPSHOT.jar) to field
> java.lang.reflect.Field.modifiers
> catalina.out:WARNING: Please consider reporting this to the maintainers of
> org.apache.tomee.catalina.ServerListener
> catalina.out:WARNING: Use --illegal-access=warn to enable warnings of
> further illegal reflective access operations
> catalina.out:WARNING: All illegal access operations will be denied in a
> future release
> catalina.out:22-Aug-2018 12:20:41.687 WARNING [localhost-startStop-1]
> org.apache.catalina.util.SessionIdGeneratorBase.createSecureRandom Creation
> of SecureRandom instance for session ID generation using [SHA1PRNG] took
> [29,399] milliseconds.
>
> For the way too slow secure random I guess I can tweak
> jdk/conf/security/java.security and replace /dev/random by /dev/urandom,
> but how about the "Illegal reflective access by
> org.apache.tomee.catalina.ServerListener" ?
>
> Should I fill a JIRA for this one?
>
> Thanks
> Alexandre
>
>
> Le mar. 21 août 2018 à 15:33, Jonathan Gallimore <
> jonathan.gallimore@gmail.com> a écrit :
>
> > Hopefully this one will do the trick:
> > openejb-core-7.0.6-20180821.130440-7.jar
> > <
> >
> https://repository.apache.org/content/groups/snapshots/org/apache/tomee/openejb-core/7.0.6-SNAPSHOT/openejb-core-7.0.6-20180821.130440-7.jar
> > >
> > -
> > I deployed manually from here. Seems there is an issue with buildbot
> doing
> > it. Sorry about that.
> >
> > Jon
> >
> > On Mon, Aug 20, 2018 at 2:41 PM Jonathan Gallimore <
> > jonathan.gallimore@gmail.com> wrote:
> >
> > > Snapshot (openejb-core) should be available when this build finishes:
> > > https://ci.apache.org/builders/tomee-7.0.x-deploy/builds/4
> > >
> > > Jon
> > >
> > > On Mon, Aug 20, 2018 at 2:01 PM, Jonathan Gallimore <
> > > jonathan.gallimore@gmail.com> wrote:
> > >
> > >> I haven't been able to do that yet - I'll drop a note here when I
> have.
> > >>
> > >> Jon
> > >>
> > >> On Mon, Aug 20, 2018 at 1:24 PM, Alex The Rocker <
> alex.m3tal@gmail.com>
> > >> wrote:
> > >>
> > >>> Hi Jon,
> > >>>
> > >>> Is the TomEE 7.0.x snapshot compatible with Java 11 available today?
> > >>> If yes then what's the URL to download it?
> > >>>
> > >>> Thanks,
> > >>> Alexandre
> > >>>
> > >>>
> > >>> Le ven. 17 août 2018 à 15:51, Jonathan Gallimore <
> > >>> jonathan.gallimore@gmail.com> a écrit :
> > >>>
> > >>> > I'm suspecting that too, but it'll be fun to try it and see how we
> > get
> > >>> on.
> > >>> > 😀
> > >>> >
> > >>> > On Fri, 17 Aug 2018, 14:08 cocorossello, <co...@gmail.com>
> > >>> wrote:
> > >>> >
> > >>> > > I think you will also need to release openwebbeans, jdk 11 patch
> > >>> there is
> > >>> > > not
> > >>> > > in any release yet.
> > >>> > >
> > >>> > >
> > >>> > >
> > >>> > > --
> > >>> > > Sent from:
> > >>> > > http://tomee-openejb.979440.n4.nabble.com/TomEE-Dev-f982480.html
> > >>> > >
> > >>> >
> > >>>
> > >>
> > >>
> > >
> >
>

Re: [1/3] tomee git commit: jdk 11 compatibility

Posted by Alex The Rocker <al...@gmail.com>.
Hello,

Just to report that my first attempt with TomEE 7.0.6 snapshot (using
apache-tomee-7.0.6-20180822.044606-8-plus.tar.gz) with Java 11 (EA build
25) gives me strange warnings in catalina.out:

catalina.2018-08-22.log:22-Aug-2018 12:20:41.687 WARNING
[localhost-startStop-1]
org.apache.catalina.util.SessionIdGeneratorBase.createSecureRandom Creation
of SecureRandom instance for session ID generation using [SHA1PRNG] took
[29,399] milliseconds.
catalina.out:WARNING: An illegal reflective access operation has occurred
catalina.out:WARNING: Illegal reflective access by
org.apache.tomee.catalina.ServerListener
(file:/usr/local/tomee/lib/tomee-catalina-7.0.6-SNAPSHOT.jar) to field
java.lang.reflect.Field.modifiers
catalina.out:WARNING: Please consider reporting this to the maintainers of
org.apache.tomee.catalina.ServerListener
catalina.out:WARNING: Use --illegal-access=warn to enable warnings of
further illegal reflective access operations
catalina.out:WARNING: All illegal access operations will be denied in a
future release
catalina.out:22-Aug-2018 12:20:41.687 WARNING [localhost-startStop-1]
org.apache.catalina.util.SessionIdGeneratorBase.createSecureRandom Creation
of SecureRandom instance for session ID generation using [SHA1PRNG] took
[29,399] milliseconds.

For the way too slow secure random I guess I can tweak
jdk/conf/security/java.security and replace /dev/random by /dev/urandom,
but how about the "Illegal reflective access by
org.apache.tomee.catalina.ServerListener" ?

Should I fill a JIRA for this one?

Thanks
Alexandre


Le mar. 21 août 2018 à 15:33, Jonathan Gallimore <
jonathan.gallimore@gmail.com> a écrit :

> Hopefully this one will do the trick:
> openejb-core-7.0.6-20180821.130440-7.jar
> <
> https://repository.apache.org/content/groups/snapshots/org/apache/tomee/openejb-core/7.0.6-SNAPSHOT/openejb-core-7.0.6-20180821.130440-7.jar
> >
> -
> I deployed manually from here. Seems there is an issue with buildbot doing
> it. Sorry about that.
>
> Jon
>
> On Mon, Aug 20, 2018 at 2:41 PM Jonathan Gallimore <
> jonathan.gallimore@gmail.com> wrote:
>
> > Snapshot (openejb-core) should be available when this build finishes:
> > https://ci.apache.org/builders/tomee-7.0.x-deploy/builds/4
> >
> > Jon
> >
> > On Mon, Aug 20, 2018 at 2:01 PM, Jonathan Gallimore <
> > jonathan.gallimore@gmail.com> wrote:
> >
> >> I haven't been able to do that yet - I'll drop a note here when I have.
> >>
> >> Jon
> >>
> >> On Mon, Aug 20, 2018 at 1:24 PM, Alex The Rocker <al...@gmail.com>
> >> wrote:
> >>
> >>> Hi Jon,
> >>>
> >>> Is the TomEE 7.0.x snapshot compatible with Java 11 available today?
> >>> If yes then what's the URL to download it?
> >>>
> >>> Thanks,
> >>> Alexandre
> >>>
> >>>
> >>> Le ven. 17 août 2018 à 15:51, Jonathan Gallimore <
> >>> jonathan.gallimore@gmail.com> a écrit :
> >>>
> >>> > I'm suspecting that too, but it'll be fun to try it and see how we
> get
> >>> on.
> >>> > 😀
> >>> >
> >>> > On Fri, 17 Aug 2018, 14:08 cocorossello, <co...@gmail.com>
> >>> wrote:
> >>> >
> >>> > > I think you will also need to release openwebbeans, jdk 11 patch
> >>> there is
> >>> > > not
> >>> > > in any release yet.
> >>> > >
> >>> > >
> >>> > >
> >>> > > --
> >>> > > Sent from:
> >>> > > http://tomee-openejb.979440.n4.nabble.com/TomEE-Dev-f982480.html
> >>> > >
> >>> >
> >>>
> >>
> >>
> >
>

Re: [1/3] tomee git commit: jdk 11 compatibility

Posted by Jonathan Gallimore <jo...@gmail.com>.
Hopefully this one will do the trick:
openejb-core-7.0.6-20180821.130440-7.jar
<https://repository.apache.org/content/groups/snapshots/org/apache/tomee/openejb-core/7.0.6-SNAPSHOT/openejb-core-7.0.6-20180821.130440-7.jar>
-
I deployed manually from here. Seems there is an issue with buildbot doing
it. Sorry about that.

Jon

On Mon, Aug 20, 2018 at 2:41 PM Jonathan Gallimore <
jonathan.gallimore@gmail.com> wrote:

> Snapshot (openejb-core) should be available when this build finishes:
> https://ci.apache.org/builders/tomee-7.0.x-deploy/builds/4
>
> Jon
>
> On Mon, Aug 20, 2018 at 2:01 PM, Jonathan Gallimore <
> jonathan.gallimore@gmail.com> wrote:
>
>> I haven't been able to do that yet - I'll drop a note here when I have.
>>
>> Jon
>>
>> On Mon, Aug 20, 2018 at 1:24 PM, Alex The Rocker <al...@gmail.com>
>> wrote:
>>
>>> Hi Jon,
>>>
>>> Is the TomEE 7.0.x snapshot compatible with Java 11 available today?
>>> If yes then what's the URL to download it?
>>>
>>> Thanks,
>>> Alexandre
>>>
>>>
>>> Le ven. 17 août 2018 à 15:51, Jonathan Gallimore <
>>> jonathan.gallimore@gmail.com> a écrit :
>>>
>>> > I'm suspecting that too, but it'll be fun to try it and see how we get
>>> on.
>>> > 😀
>>> >
>>> > On Fri, 17 Aug 2018, 14:08 cocorossello, <co...@gmail.com>
>>> wrote:
>>> >
>>> > > I think you will also need to release openwebbeans, jdk 11 patch
>>> there is
>>> > > not
>>> > > in any release yet.
>>> > >
>>> > >
>>> > >
>>> > > --
>>> > > Sent from:
>>> > > http://tomee-openejb.979440.n4.nabble.com/TomEE-Dev-f982480.html
>>> > >
>>> >
>>>
>>
>>
>

Re: [1/3] tomee git commit: jdk 11 compatibility

Posted by Matthew Broadhead <ma...@nbmlaw.co.uk.INVALID>.
it says build successful but if i scroll to the bottom of the stdio 
there are errors.  is that normal?

On 20/08/18 15:41, Jonathan Gallimore wrote:
> Snapshot (openejb-core) should be available when this build finishes:
> https://ci.apache.org/builders/tomee-7.0.x-deploy/builds/4
>
> Jon
>
> On Mon, Aug 20, 2018 at 2:01 PM, Jonathan Gallimore <
> jonathan.gallimore@gmail.com> wrote:
>
>> I haven't been able to do that yet - I'll drop a note here when I have.
>>
>> Jon
>>
>> On Mon, Aug 20, 2018 at 1:24 PM, Alex The Rocker <al...@gmail.com>
>> wrote:
>>
>>> Hi Jon,
>>>
>>> Is the TomEE 7.0.x snapshot compatible with Java 11 available today?
>>> If yes then what's the URL to download it?
>>>
>>> Thanks,
>>> Alexandre
>>>
>>>
>>> Le ven. 17 août 2018 à 15:51, Jonathan Gallimore <
>>> jonathan.gallimore@gmail.com> a écrit :
>>>
>>>> I'm suspecting that too, but it'll be fun to try it and see how we get
>>> on.
>>>> 😀
>>>>
>>>> On Fri, 17 Aug 2018, 14:08 cocorossello, <co...@gmail.com>
>>> wrote:
>>>>> I think you will also need to release openwebbeans, jdk 11 patch
>>> there is
>>>>> not
>>>>> in any release yet.
>>>>>
>>>>>
>>>>>
>>>>> --
>>>>> Sent from:
>>>>> http://tomee-openejb.979440.n4.nabble.com/TomEE-Dev-f982480.html
>>>>>
>>


Re: [1/3] tomee git commit: jdk 11 compatibility

Posted by Jonathan Gallimore <jo...@gmail.com>.
Snapshot (openejb-core) should be available when this build finishes:
https://ci.apache.org/builders/tomee-7.0.x-deploy/builds/4

Jon

On Mon, Aug 20, 2018 at 2:01 PM, Jonathan Gallimore <
jonathan.gallimore@gmail.com> wrote:

> I haven't been able to do that yet - I'll drop a note here when I have.
>
> Jon
>
> On Mon, Aug 20, 2018 at 1:24 PM, Alex The Rocker <al...@gmail.com>
> wrote:
>
>> Hi Jon,
>>
>> Is the TomEE 7.0.x snapshot compatible with Java 11 available today?
>> If yes then what's the URL to download it?
>>
>> Thanks,
>> Alexandre
>>
>>
>> Le ven. 17 août 2018 à 15:51, Jonathan Gallimore <
>> jonathan.gallimore@gmail.com> a écrit :
>>
>> > I'm suspecting that too, but it'll be fun to try it and see how we get
>> on.
>> > 😀
>> >
>> > On Fri, 17 Aug 2018, 14:08 cocorossello, <co...@gmail.com>
>> wrote:
>> >
>> > > I think you will also need to release openwebbeans, jdk 11 patch
>> there is
>> > > not
>> > > in any release yet.
>> > >
>> > >
>> > >
>> > > --
>> > > Sent from:
>> > > http://tomee-openejb.979440.n4.nabble.com/TomEE-Dev-f982480.html
>> > >
>> >
>>
>
>

Re: [1/3] tomee git commit: jdk 11 compatibility

Posted by Jonathan Gallimore <jo...@gmail.com>.
I haven't been able to do that yet - I'll drop a note here when I have.

Jon

On Mon, Aug 20, 2018 at 1:24 PM, Alex The Rocker <al...@gmail.com>
wrote:

> Hi Jon,
>
> Is the TomEE 7.0.x snapshot compatible with Java 11 available today?
> If yes then what's the URL to download it?
>
> Thanks,
> Alexandre
>
>
> Le ven. 17 août 2018 à 15:51, Jonathan Gallimore <
> jonathan.gallimore@gmail.com> a écrit :
>
> > I'm suspecting that too, but it'll be fun to try it and see how we get
> on.
> > 😀
> >
> > On Fri, 17 Aug 2018, 14:08 cocorossello, <co...@gmail.com> wrote:
> >
> > > I think you will also need to release openwebbeans, jdk 11 patch there
> is
> > > not
> > > in any release yet.
> > >
> > >
> > >
> > > --
> > > Sent from:
> > > http://tomee-openejb.979440.n4.nabble.com/TomEE-Dev-f982480.html
> > >
> >
>

Re: [1/3] tomee git commit: jdk 11 compatibility

Posted by Alex The Rocker <al...@gmail.com>.
Hi Jon,

Is the TomEE 7.0.x snapshot compatible with Java 11 available today?
If yes then what's the URL to download it?

Thanks,
Alexandre


Le ven. 17 août 2018 à 15:51, Jonathan Gallimore <
jonathan.gallimore@gmail.com> a écrit :

> I'm suspecting that too, but it'll be fun to try it and see how we get on.
> 😀
>
> On Fri, 17 Aug 2018, 14:08 cocorossello, <co...@gmail.com> wrote:
>
> > I think you will also need to release openwebbeans, jdk 11 patch there is
> > not
> > in any release yet.
> >
> >
> >
> > --
> > Sent from:
> > http://tomee-openejb.979440.n4.nabble.com/TomEE-Dev-f982480.html
> >
>

Re: [1/3] tomee git commit: jdk 11 compatibility

Posted by Jonathan Gallimore <jo...@gmail.com>.
I'm suspecting that too, but it'll be fun to try it and see how we get on.
😀

On Fri, 17 Aug 2018, 14:08 cocorossello, <co...@gmail.com> wrote:

> I think you will also need to release openwebbeans, jdk 11 patch there is
> not
> in any release yet.
>
>
>
> --
> Sent from:
> http://tomee-openejb.979440.n4.nabble.com/TomEE-Dev-f982480.html
>

Re: [1/3] tomee git commit: jdk 11 compatibility

Posted by cocorossello <co...@gmail.com>.
I think you will also need to release openwebbeans, jdk 11 patch there is not
in any release yet.



--
Sent from: http://tomee-openejb.979440.n4.nabble.com/TomEE-Dev-f982480.html

Re: [1/3] tomee git commit: jdk 11 compatibility

Posted by Alex The Rocker <al...@gmail.com>.
Hi Jon,

Monday would be indeed great for a TomEE 7.x snapshot including this
Java 11 fix!

Thanks,
Alexandre
Le ven. 17 août 2018 à 14:20, Jonathan Gallimore
<jo...@gmail.com> a écrit :
>
> Im on leave today, but I'll backport it and publish a snapshot on Monday,
> unless someone beats me to it. My guess is you'll need to replace owb and
> some others as well.
>
> The testing is appreciated, thank you!
>
> Jon
>
> On Fri, 17 Aug 2018, 12:35 Alex The Rocker, <al...@gmail.com> wrote:
>
> > Hello Jon,
> >
> > I'd like to give a try to TomEE 7.0.5 with an "as small as possible"
> > patch that solves this Java 11 compatibility trick. Is there a way I
> > could download "just the modified .jar" ?
> >
> > Thanks,
> > Alexandre
> >
> > Le jeu. 16 août 2018 à 11:59, <jg...@apache.org> a écrit :
> > >
> > > Repository: tomee
> > > Updated Branches:
> > >   refs/heads/master ef64d7dd2 -> 2e3a856b0
> > >
> > >
> > > jdk 11 compatibility
> > >
> > >
> > > Project: http://git-wip-us.apache.org/repos/asf/tomee/repo
> > > Commit: http://git-wip-us.apache.org/repos/asf/tomee/commit/d2943704
> > > Tree: http://git-wip-us.apache.org/repos/asf/tomee/tree/d2943704
> > > Diff: http://git-wip-us.apache.org/repos/asf/tomee/diff/d2943704
> > >
> > > Branch: refs/heads/master
> > > Commit: d294370439cf0f3a3af939c09c4b7272a7f2460a
> > > Parents: d4c5089
> > > Author: Vicente Rossello <vr...@travelcompositor.com>
> > > Authored: Wed Aug 15 23:55:01 2018 +0200
> > > Committer: Vicente Rossello <vr...@travelcompositor.com>
> > > Committed: Wed Aug 15 23:55:01 2018 +0200
> > >
> > > ----------------------------------------------------------------------
> > >  .../util/proxy/LocalBeanProxyFactory.java       | 37
> > +++++++++++++++++---
> > >  1 file changed, 33 insertions(+), 4 deletions(-)
> > > ----------------------------------------------------------------------
> > >
> > >
> > >
> > http://git-wip-us.apache.org/repos/asf/tomee/blob/d2943704/container/openejb-core/src/main/java/org/apache/openejb/util/proxy/LocalBeanProxyFactory.java
> > > ----------------------------------------------------------------------
> > > diff --git
> > a/container/openejb-core/src/main/java/org/apache/openejb/util/proxy/LocalBeanProxyFactory.java
> > b/container/openejb-core/src/main/java/org/apache/openejb/util/proxy/LocalBeanProxyFactory.java
> > > index 8a0dd8a..a36f7b8 100644
> > > ---
> > a/container/openejb-core/src/main/java/org/apache/openejb/util/proxy/LocalBeanProxyFactory.java
> > > +++
> > b/container/openejb-core/src/main/java/org/apache/openejb/util/proxy/LocalBeanProxyFactory.java
> > > @@ -17,6 +17,9 @@
> > >
> > >  package org.apache.openejb.util.proxy;
> > >
> > > +
> > > +import org.apache.openejb.util.LogCategory;
> > > +import org.apache.openejb.util.Logger;
> > >  import org.apache.openejb.util.Debug;
> > >  import org.apache.xbean.asm6.ClassWriter;
> > >  import org.apache.xbean.asm6.Label;
> > > @@ -47,6 +50,8 @@ import java.util.concurrent.locks.ReentrantLock;
> > >
> > >  public class LocalBeanProxyFactory implements Opcodes {
> > >
> > > +    private static final Logger LOGGER =
> > Logger.getInstance(LogCategory.OPENEJB, QueryProxy.class);
> > > +
> > >      public static final InvocationHandler NON_BUSINESS_HANDLER = new
> > NonBusinessHandler();
> > >
> > >      private static final String BUSSINESS_HANDLER_NAME =
> > "businessHandler";
> > > @@ -700,7 +705,7 @@ public class LocalBeanProxyFactory implements
> > Opcodes {
> > >
> > >          // sun.misc.Unsafe
> > >          private static final Object unsafe;
> > > -        private static final Method defineClass;
> > > +        private static final Method unsafeDefineClass;
> > >          private static final Method allocateInstance;
> > >          private static final Method putObject;
> > >          private static final Method objectFieldOffset;
> > > @@ -774,7 +779,7 @@ public class LocalBeanProxyFactory implements
> > Opcodes {
> > >                      }
> > >                  }
> > >              });
> > > -            defineClass = AccessController.doPrivileged(new
> > PrivilegedAction<Method>() {
> > > +            unsafeDefineClass = AccessController.doPrivileged(new
> > PrivilegedAction<Method>() {
> > >                  @Override
> > >                  public Method run() {
> > >                      try {
> > > @@ -782,7 +787,8 @@ public class LocalBeanProxyFactory implements
> > Opcodes {
> > >                          mtd.setAccessible(true);
> > >                          return mtd;
> > >                      } catch (final Exception e) {
> > > -                        throw new IllegalStateException("Cannot get
> > sun.misc.Unsafe.defineClass", e);
> > > +                        LOGGER.debug("Unsafe's defineClass not
> > available, will use classloader's defineClass");
> > > +                        return null;
> > >                      }
> > >                  }
> > >              });
> > > @@ -816,8 +822,31 @@ public class LocalBeanProxyFactory implements
> > Opcodes {
> > >
> > >          // it is super important to pass a classloader as first
> > parameter otherwise if API class is in a "permanent" classloader then it
> > will leak
> > >          public static Class defineClass(final ClassLoader loader, final
> > Class<?> clsToProxy, final String proxyName, final byte[] proxyBytes)
> > throws IllegalAccessException, InvocationTargetException {
> > > -            return (Class<?>) defineClass.invoke(unsafe, proxyName,
> > proxyBytes, 0, proxyBytes.length, loader, clsToProxy.getProtectionDomain());
> > > +            if (unsafeDefineClass != null) {
> > > +                return (Class<?>) unsafeDefineClass.invoke(unsafe,
> > proxyName, proxyBytes, 0, proxyBytes.length, loader,
> > clsToProxy.getProtectionDomain());
> > > +            } else {
> > > +                return (Class)
> > getClassLoaderDefineClassMethod(loader).invoke(loader, proxyName,
> > proxyBytes, 0, proxyBytes.length, clsToProxy.getProtectionDomain());
> > > +            }
> > > +        }
> > > +
> > > +        private static Method
> > getClassLoaderDefineClassMethod(ClassLoader classLoader) {
> > > +            Class<?> clazz = classLoader.getClass();
> > > +            Method defineClassMethod = null;
> > > +            do {
> > > +                try {
> > > +                    defineClassMethod =
> > clazz.getDeclaredMethod("defineClass", String.class, byte[].class,
> > int.class, int.class, ProtectionDomain.class);
> > > +                } catch (NoSuchMethodException e) {
> > > +                    // do nothing, we need to search the superclass
> > > +                }
> > > +                clazz = clazz.getSuperclass();
> > > +            } while (defineClassMethod == null && clazz !=
> > Object.class);
> > > +
> > > +            if (defineClassMethod != null &&
> > !defineClassMethod.isAccessible()) {
> > > +                defineClassMethod.setAccessible(true);
> > > +            }
> > > +            return defineClassMethod;
> > >          }
> > > +
> > >      }
> > >
> > >      @Target(ElementType.TYPE)
> > >
> >

Re: [1/3] tomee git commit: jdk 11 compatibility

Posted by Jonathan Gallimore <jo...@gmail.com>.
Im on leave today, but I'll backport it and publish a snapshot on Monday,
unless someone beats me to it. My guess is you'll need to replace owb and
some others as well.

The testing is appreciated, thank you!

Jon

On Fri, 17 Aug 2018, 12:35 Alex The Rocker, <al...@gmail.com> wrote:

> Hello Jon,
>
> I'd like to give a try to TomEE 7.0.5 with an "as small as possible"
> patch that solves this Java 11 compatibility trick. Is there a way I
> could download "just the modified .jar" ?
>
> Thanks,
> Alexandre
>
> Le jeu. 16 août 2018 à 11:59, <jg...@apache.org> a écrit :
> >
> > Repository: tomee
> > Updated Branches:
> >   refs/heads/master ef64d7dd2 -> 2e3a856b0
> >
> >
> > jdk 11 compatibility
> >
> >
> > Project: http://git-wip-us.apache.org/repos/asf/tomee/repo
> > Commit: http://git-wip-us.apache.org/repos/asf/tomee/commit/d2943704
> > Tree: http://git-wip-us.apache.org/repos/asf/tomee/tree/d2943704
> > Diff: http://git-wip-us.apache.org/repos/asf/tomee/diff/d2943704
> >
> > Branch: refs/heads/master
> > Commit: d294370439cf0f3a3af939c09c4b7272a7f2460a
> > Parents: d4c5089
> > Author: Vicente Rossello <vr...@travelcompositor.com>
> > Authored: Wed Aug 15 23:55:01 2018 +0200
> > Committer: Vicente Rossello <vr...@travelcompositor.com>
> > Committed: Wed Aug 15 23:55:01 2018 +0200
> >
> > ----------------------------------------------------------------------
> >  .../util/proxy/LocalBeanProxyFactory.java       | 37
> +++++++++++++++++---
> >  1 file changed, 33 insertions(+), 4 deletions(-)
> > ----------------------------------------------------------------------
> >
> >
> >
> http://git-wip-us.apache.org/repos/asf/tomee/blob/d2943704/container/openejb-core/src/main/java/org/apache/openejb/util/proxy/LocalBeanProxyFactory.java
> > ----------------------------------------------------------------------
> > diff --git
> a/container/openejb-core/src/main/java/org/apache/openejb/util/proxy/LocalBeanProxyFactory.java
> b/container/openejb-core/src/main/java/org/apache/openejb/util/proxy/LocalBeanProxyFactory.java
> > index 8a0dd8a..a36f7b8 100644
> > ---
> a/container/openejb-core/src/main/java/org/apache/openejb/util/proxy/LocalBeanProxyFactory.java
> > +++
> b/container/openejb-core/src/main/java/org/apache/openejb/util/proxy/LocalBeanProxyFactory.java
> > @@ -17,6 +17,9 @@
> >
> >  package org.apache.openejb.util.proxy;
> >
> > +
> > +import org.apache.openejb.util.LogCategory;
> > +import org.apache.openejb.util.Logger;
> >  import org.apache.openejb.util.Debug;
> >  import org.apache.xbean.asm6.ClassWriter;
> >  import org.apache.xbean.asm6.Label;
> > @@ -47,6 +50,8 @@ import java.util.concurrent.locks.ReentrantLock;
> >
> >  public class LocalBeanProxyFactory implements Opcodes {
> >
> > +    private static final Logger LOGGER =
> Logger.getInstance(LogCategory.OPENEJB, QueryProxy.class);
> > +
> >      public static final InvocationHandler NON_BUSINESS_HANDLER = new
> NonBusinessHandler();
> >
> >      private static final String BUSSINESS_HANDLER_NAME =
> "businessHandler";
> > @@ -700,7 +705,7 @@ public class LocalBeanProxyFactory implements
> Opcodes {
> >
> >          // sun.misc.Unsafe
> >          private static final Object unsafe;
> > -        private static final Method defineClass;
> > +        private static final Method unsafeDefineClass;
> >          private static final Method allocateInstance;
> >          private static final Method putObject;
> >          private static final Method objectFieldOffset;
> > @@ -774,7 +779,7 @@ public class LocalBeanProxyFactory implements
> Opcodes {
> >                      }
> >                  }
> >              });
> > -            defineClass = AccessController.doPrivileged(new
> PrivilegedAction<Method>() {
> > +            unsafeDefineClass = AccessController.doPrivileged(new
> PrivilegedAction<Method>() {
> >                  @Override
> >                  public Method run() {
> >                      try {
> > @@ -782,7 +787,8 @@ public class LocalBeanProxyFactory implements
> Opcodes {
> >                          mtd.setAccessible(true);
> >                          return mtd;
> >                      } catch (final Exception e) {
> > -                        throw new IllegalStateException("Cannot get
> sun.misc.Unsafe.defineClass", e);
> > +                        LOGGER.debug("Unsafe's defineClass not
> available, will use classloader's defineClass");
> > +                        return null;
> >                      }
> >                  }
> >              });
> > @@ -816,8 +822,31 @@ public class LocalBeanProxyFactory implements
> Opcodes {
> >
> >          // it is super important to pass a classloader as first
> parameter otherwise if API class is in a "permanent" classloader then it
> will leak
> >          public static Class defineClass(final ClassLoader loader, final
> Class<?> clsToProxy, final String proxyName, final byte[] proxyBytes)
> throws IllegalAccessException, InvocationTargetException {
> > -            return (Class<?>) defineClass.invoke(unsafe, proxyName,
> proxyBytes, 0, proxyBytes.length, loader, clsToProxy.getProtectionDomain());
> > +            if (unsafeDefineClass != null) {
> > +                return (Class<?>) unsafeDefineClass.invoke(unsafe,
> proxyName, proxyBytes, 0, proxyBytes.length, loader,
> clsToProxy.getProtectionDomain());
> > +            } else {
> > +                return (Class)
> getClassLoaderDefineClassMethod(loader).invoke(loader, proxyName,
> proxyBytes, 0, proxyBytes.length, clsToProxy.getProtectionDomain());
> > +            }
> > +        }
> > +
> > +        private static Method
> getClassLoaderDefineClassMethod(ClassLoader classLoader) {
> > +            Class<?> clazz = classLoader.getClass();
> > +            Method defineClassMethod = null;
> > +            do {
> > +                try {
> > +                    defineClassMethod =
> clazz.getDeclaredMethod("defineClass", String.class, byte[].class,
> int.class, int.class, ProtectionDomain.class);
> > +                } catch (NoSuchMethodException e) {
> > +                    // do nothing, we need to search the superclass
> > +                }
> > +                clazz = clazz.getSuperclass();
> > +            } while (defineClassMethod == null && clazz !=
> Object.class);
> > +
> > +            if (defineClassMethod != null &&
> !defineClassMethod.isAccessible()) {
> > +                defineClassMethod.setAccessible(true);
> > +            }
> > +            return defineClassMethod;
> >          }
> > +
> >      }
> >
> >      @Target(ElementType.TYPE)
> >
>