Re: Backport for OWB 1.7.x

2018-11-05 Thread Romain Manni-Bucau
Ok I get it now, so this is not *this* commit you want but one before -
likely
https://github.com/apache/openwebbeans/commit/92f94b68ae125d171ac26e6a3cbf26b6a3f54513
- but it was included in the commit you backported ;).

makes sense to include that in 1.7 branch IMHO

Romain Manni-Bucau
@rmannibucau  |  Blog
 | Old Blog
 | Github  |
LinkedIn  | Book



Le lun. 5 nov. 2018 à 19:35, Daniel Cunha  a écrit :

> Of course, the issue happening when I'm using JDK11 :)
>
> Em seg, 5 de nov de 2018 às 15:33, Daniel Cunha 
> escreveu:
>
> > Hi Romain,
> >
> > Well... that change make me possible to continue create my singleton
> > startup like it:
> >
> > import javax.annotation.PostConstruct;
> > import javax.annotation.PreDestroy;
> > import javax.ejb.Singleton;
> > import javax.ejb.Startup;
> >
> > @Singleton
> > @Startup
> > public class KernelShutdownListener {
> >
> > @PostConstruct
> > private void startup() {
> > System.out.println("ALOHA STARTUP");
> > }
> >
> > @PreDestroy
> > private void shutdown() {
> > System.out.println("ALOHA SHUTDOWN");
> > }
> > }
> >
> > It was not possible without that change, as you can see here:
> > Caused by: java.lang.IllegalStateException: Cannot get Unsafe.defineClass
> > at
> >
> org.apache.webbeans.proxy.AbstractProxyFactory$4.run(AbstractProxyFactory.java:812)
> > at
> >
> org.apache.webbeans.proxy.AbstractProxyFactory$4.run(AbstractProxyFactory.java:801)
> > at java.base/java.security.AccessController.doPrivileged(Native
> Method)
> > at
> >
> org.apache.webbeans.proxy.AbstractProxyFactory.initializeUnsafe(AbstractProxyFactory.java:800)
> > at
> >
> org.apache.webbeans.proxy.AbstractProxyFactory.(AbstractProxyFactory.java:91)
> > at
> >
> org.apache.webbeans.proxy.InterceptorDecoratorProxyFactory.(InterceptorDecoratorProxyFactory.java:77)
> > at
> >
> org.apache.webbeans.config.WebBeansContext.(WebBeansContext.java:153)
> > at
> >
> org.apache.webbeans.config.WebBeansContext.(WebBeansContext.java:116)
> > at
> >
> org.apache.openejb.cdi.ThreadSingletonServiceImpl.initialize(ThreadSingletonServiceImpl.java:167)
> > at org.apache.openejb.cdi.CdiBuilder.build(CdiBuilder.java:41)
> > at
> >
> org.apache.openejb.assembler.classic.Assembler.createApplication(Assembler.java:963)
> > ... 17 more
> > Caused by: java.lang.NoSuchMethodException:
> > sun.misc.Unsafe.defineClass(java.lang.String, [B, int, int,
> > java.lang.ClassLoader, java.security.ProtectionDomain)
> > at java.base/java.lang.Class.getDeclaredMethod(Class.java:2476)
> > at
> >
> org.apache.webbeans.proxy.AbstractProxyFactory$4.run(AbstractProxyFactory.java:807)
> > ... 27 more
> >
> > 05-Nov-2018 15:15:33.110 SEVERE [localhost-startStop-2]
> > jdk.internal.reflect.NativeMethodAccessorImpl.invoke Error deploying web
> > application archive [/tmp/apache-tomee-plume-7.0.6-TT.2/webapps/ROOT.war]
> >  java.lang.IllegalStateException: ContainerBase.addChild: start:
> > org.apache.catalina.LifecycleException: Failed to start component
> > [StandardEngine[Catalina].StandardHost[localhost].StandardContext[]]
> > at
> >
> org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:758)
> > at
> > org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:730)
> > at
> > org.apache.catalina.core.StandardHost.addChild(StandardHost.java:734)
> > at
> > org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:985)
> > at
> >
> org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:1857)
> > at
> >
> java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
> > at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
> > at
> >
> java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
> > at
> >
> java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
> > at java.base/java.lang.Thread.run(Thread.java:834)
> >
> >
> > Em seg, 5 de nov de 2018 às 15:24, Romain Manni-Bucau <
> > rmannibu...@gmail.com> escreveu:
> >
> >> Hi Daniel,
> >>
> >> Do you know which part implies the "need", this commit was not suppose
> to
> >> change anything since the code was already supporting java 11, it was
> just
> >> intended to prepare potential change later on.
> >> Did a small change in the behavior was introduced - if so it was not
> >> intended from my part?
> >>
> >> Romain Manni-Bucau
> >> @rmannibucau  |  Blog
> >>  | Old Blog
> >>  | Github <
> >> https://github.com/rmannibucau> |
> >> LinkedIn 

Re: Backport for OWB 1.7.x

2018-11-05 Thread Daniel Cunha
Of course, the issue happening when I'm using JDK11 :)

Em seg, 5 de nov de 2018 às 15:33, Daniel Cunha 
escreveu:

> Hi Romain,
>
> Well... that change make me possible to continue create my singleton
> startup like it:
>
> import javax.annotation.PostConstruct;
> import javax.annotation.PreDestroy;
> import javax.ejb.Singleton;
> import javax.ejb.Startup;
>
> @Singleton
> @Startup
> public class KernelShutdownListener {
>
> @PostConstruct
> private void startup() {
> System.out.println("ALOHA STARTUP");
> }
>
> @PreDestroy
> private void shutdown() {
> System.out.println("ALOHA SHUTDOWN");
> }
> }
>
> It was not possible without that change, as you can see here:
> Caused by: java.lang.IllegalStateException: Cannot get Unsafe.defineClass
> at
> org.apache.webbeans.proxy.AbstractProxyFactory$4.run(AbstractProxyFactory.java:812)
> at
> org.apache.webbeans.proxy.AbstractProxyFactory$4.run(AbstractProxyFactory.java:801)
> at java.base/java.security.AccessController.doPrivileged(Native Method)
> at
> org.apache.webbeans.proxy.AbstractProxyFactory.initializeUnsafe(AbstractProxyFactory.java:800)
> at
> org.apache.webbeans.proxy.AbstractProxyFactory.(AbstractProxyFactory.java:91)
> at
> org.apache.webbeans.proxy.InterceptorDecoratorProxyFactory.(InterceptorDecoratorProxyFactory.java:77)
> at
> org.apache.webbeans.config.WebBeansContext.(WebBeansContext.java:153)
> at
> org.apache.webbeans.config.WebBeansContext.(WebBeansContext.java:116)
> at
> org.apache.openejb.cdi.ThreadSingletonServiceImpl.initialize(ThreadSingletonServiceImpl.java:167)
> at org.apache.openejb.cdi.CdiBuilder.build(CdiBuilder.java:41)
> at
> org.apache.openejb.assembler.classic.Assembler.createApplication(Assembler.java:963)
> ... 17 more
> Caused by: java.lang.NoSuchMethodException:
> sun.misc.Unsafe.defineClass(java.lang.String, [B, int, int,
> java.lang.ClassLoader, java.security.ProtectionDomain)
> at java.base/java.lang.Class.getDeclaredMethod(Class.java:2476)
> at
> org.apache.webbeans.proxy.AbstractProxyFactory$4.run(AbstractProxyFactory.java:807)
> ... 27 more
>
> 05-Nov-2018 15:15:33.110 SEVERE [localhost-startStop-2]
> jdk.internal.reflect.NativeMethodAccessorImpl.invoke Error deploying web
> application archive [/tmp/apache-tomee-plume-7.0.6-TT.2/webapps/ROOT.war]
>  java.lang.IllegalStateException: ContainerBase.addChild: start:
> org.apache.catalina.LifecycleException: Failed to start component
> [StandardEngine[Catalina].StandardHost[localhost].StandardContext[]]
> at
> org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:758)
> at
> org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:730)
> at
> org.apache.catalina.core.StandardHost.addChild(StandardHost.java:734)
> at
> org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:985)
> at
> org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:1857)
> at
> java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
> at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
> at
> java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
> at
> java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
> at java.base/java.lang.Thread.run(Thread.java:834)
>
>
> Em seg, 5 de nov de 2018 às 15:24, Romain Manni-Bucau <
> rmannibu...@gmail.com> escreveu:
>
>> Hi Daniel,
>>
>> Do you know which part implies the "need", this commit was not suppose to
>> change anything since the code was already supporting java 11, it was just
>> intended to prepare potential change later on.
>> Did a small change in the behavior was introduced - if so it was not
>> intended from my part?
>>
>> Romain Manni-Bucau
>> @rmannibucau  |  Blog
>>  | Old Blog
>>  | Github <
>> https://github.com/rmannibucau> |
>> LinkedIn  | Book
>> <
>> https://www.packtpub.com/application-development/java-ee-8-high-performance
>> >
>>
>>
>> Le lun. 5 nov. 2018 à 19:20, Daniel Cunha  a
>> écrit :
>>
>> > Hi Folks,
>> >
>> > we got an issue with Java 11 and TomEE 7.0.x and we need the backport
>> for
>> > it:
>> > https://github.com/apache/openwebbeans/pull/13
>> >
>> > Please take a look at those changes and let me know what do you think.
>> >
>> > Thank you.
>> > --
>> > Daniel "soro" Cunha
>> > https://twitter.com/dvlc_
>> >
>>
>
>
> --
> Daniel "soro" Cunha
> https://twitter.com/dvlc_
>


-- 
Daniel "soro" Cunha
https://twitter.com/dvlc_


Re: Backport for OWB 1.7.x

2018-11-05 Thread Daniel Cunha
Hi Romain,

Well... that change make me possible to continue create my singleton
startup like it:

import javax.annotation.PostConstruct;
import javax.annotation.PreDestroy;
import javax.ejb.Singleton;
import javax.ejb.Startup;

@Singleton
@Startup
public class KernelShutdownListener {

@PostConstruct
private void startup() {
System.out.println("ALOHA STARTUP");
}

@PreDestroy
private void shutdown() {
System.out.println("ALOHA SHUTDOWN");
}
}

It was not possible without that change, as you can see here:
Caused by: java.lang.IllegalStateException: Cannot get Unsafe.defineClass
at
org.apache.webbeans.proxy.AbstractProxyFactory$4.run(AbstractProxyFactory.java:812)
at
org.apache.webbeans.proxy.AbstractProxyFactory$4.run(AbstractProxyFactory.java:801)
at java.base/java.security.AccessController.doPrivileged(Native Method)
at
org.apache.webbeans.proxy.AbstractProxyFactory.initializeUnsafe(AbstractProxyFactory.java:800)
at
org.apache.webbeans.proxy.AbstractProxyFactory.(AbstractProxyFactory.java:91)
at
org.apache.webbeans.proxy.InterceptorDecoratorProxyFactory.(InterceptorDecoratorProxyFactory.java:77)
at
org.apache.webbeans.config.WebBeansContext.(WebBeansContext.java:153)
at
org.apache.webbeans.config.WebBeansContext.(WebBeansContext.java:116)
at
org.apache.openejb.cdi.ThreadSingletonServiceImpl.initialize(ThreadSingletonServiceImpl.java:167)
at org.apache.openejb.cdi.CdiBuilder.build(CdiBuilder.java:41)
at
org.apache.openejb.assembler.classic.Assembler.createApplication(Assembler.java:963)
... 17 more
Caused by: java.lang.NoSuchMethodException:
sun.misc.Unsafe.defineClass(java.lang.String, [B, int, int,
java.lang.ClassLoader, java.security.ProtectionDomain)
at java.base/java.lang.Class.getDeclaredMethod(Class.java:2476)
at
org.apache.webbeans.proxy.AbstractProxyFactory$4.run(AbstractProxyFactory.java:807)
... 27 more

05-Nov-2018 15:15:33.110 SEVERE [localhost-startStop-2]
jdk.internal.reflect.NativeMethodAccessorImpl.invoke Error deploying web
application archive [/tmp/apache-tomee-plume-7.0.6-TT.2/webapps/ROOT.war]
 java.lang.IllegalStateException: ContainerBase.addChild: start:
org.apache.catalina.LifecycleException: Failed to start component
[StandardEngine[Catalina].StandardHost[localhost].StandardContext[]]
at
org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:758)
at
org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:730)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:734)
at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:985)
at
org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:1857)
at
java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
at
java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
at
java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
at java.base/java.lang.Thread.run(Thread.java:834)


Em seg, 5 de nov de 2018 às 15:24, Romain Manni-Bucau 
escreveu:

> Hi Daniel,
>
> Do you know which part implies the "need", this commit was not suppose to
> change anything since the code was already supporting java 11, it was just
> intended to prepare potential change later on.
> Did a small change in the behavior was introduced - if so it was not
> intended from my part?
>
> Romain Manni-Bucau
> @rmannibucau  |  Blog
>  | Old Blog
>  | Github <
> https://github.com/rmannibucau> |
> LinkedIn  | Book
> <
> https://www.packtpub.com/application-development/java-ee-8-high-performance
> >
>
>
> Le lun. 5 nov. 2018 à 19:20, Daniel Cunha  a écrit
> :
>
> > Hi Folks,
> >
> > we got an issue with Java 11 and TomEE 7.0.x and we need the backport for
> > it:
> > https://github.com/apache/openwebbeans/pull/13
> >
> > Please take a look at those changes and let me know what do you think.
> >
> > Thank you.
> > --
> > Daniel "soro" Cunha
> > https://twitter.com/dvlc_
> >
>


-- 
Daniel "soro" Cunha
https://twitter.com/dvlc_


Re: Backport for OWB 1.7.x

2018-11-05 Thread Romain Manni-Bucau
Hi Daniel,

Do you know which part implies the "need", this commit was not suppose to
change anything since the code was already supporting java 11, it was just
intended to prepare potential change later on.
Did a small change in the behavior was introduced - if so it was not
intended from my part?

Romain Manni-Bucau
@rmannibucau  |  Blog
 | Old Blog
 | Github  |
LinkedIn  | Book



Le lun. 5 nov. 2018 à 19:20, Daniel Cunha  a écrit :

> Hi Folks,
>
> we got an issue with Java 11 and TomEE 7.0.x and we need the backport for
> it:
> https://github.com/apache/openwebbeans/pull/13
>
> Please take a look at those changes and let me know what do you think.
>
> Thank you.
> --
> Daniel "soro" Cunha
> https://twitter.com/dvlc_
>


Backport for OWB 1.7.x

2018-11-05 Thread Daniel Cunha
Hi Folks,

we got an issue with Java 11 and TomEE 7.0.x and we need the backport for
it:
https://github.com/apache/openwebbeans/pull/13

Please take a look at those changes and let me know what do you think.

Thank you.
-- 
Daniel "soro" Cunha
https://twitter.com/dvlc_


[GitHub] openwebbeans pull request #13: Backport: extracting unsafe proxy code in an ...

2018-11-05 Thread danielsoro
GitHub user danielsoro opened a pull request:

https://github.com/apache/openwebbeans/pull/13

Backport: extracting unsafe proxy code in an Unsafe class - no foncti…

…onal change

You can merge this pull request into a Git repository by running:

$ git pull https://github.com/danielsoro/openwebbeans owb_1.7.x-backport

Alternatively you can review and apply these changes as the patch at:

https://github.com/apache/openwebbeans/pull/13.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

This closes #13


commit 31c08f685f0ec21183594923e59e6d1da250e78c
Author: Romain Manni-Bucau 
Date:   2018-10-27T14:27:41Z

Backport: extracting unsafe proxy code in an Unsafe class - no fonctional 
change




---