[jira] [Commented] (WICKET-6913) Java 17 compatibility

2021-08-21 Thread ASF subversion and git services (Jira)


[ 
https://issues.apache.org/jira/browse/WICKET-6913?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17402688#comment-17402688
 ] 

ASF subversion and git services commented on WICKET-6913:
-

Commit 7b3b938c065a224d3762179d42fc5cd5d3be7084 in wicket's branch 
refs/heads/jmx-standardmbean-instead-proxy from Sven Meier
[ https://gitbox.apache.org/repos/asf?p=wicket.git;h=7b3b938 ]

WICKET-6913 replace proxies with StandardMBean


> Java 17 compatibility
> -
>
> Key: WICKET-6913
> URL: https://issues.apache.org/jira/browse/WICKET-6913
> Project: Wicket
>  Issue Type: Bug
>  Components: wicket-spring
>Affects Versions: 9.4.0
>Reporter: Robert Bain
>Priority: Major
> Fix For: 10.0.0
>
>
> Wicket's use of cglib means that as of Java 16, you need to specify 
> --illegal-access=permit. As of Java 17, this is no longer possible, which 
> I've verified using a JDK 17 Early-Access Build.
> See [https://github.com/cglib/cglib/issues/191]
> See 
> [https://stackoverflow.com/questions/66974846/java-lang-exceptionininitializererror-with-java-16-j-l-classformaterror-access]
>  
> {code}
> Caused by: java.lang.NoClassDefFoundError: Could not initialize class 
> net.sf.cglib.proxy.EnhancerCaused by: java.lang.NoClassDefFoundError: Could 
> not initialize class net.sf.cglib.proxy.Enhancer at 
> org.apache.wicket.proxy.LazyInitProxyFactory.createProxy(LazyInitProxyFactory.java:182)
>  at 
> org.apache.wicket.spring.injection.annot.AnnotProxyFieldValueFactory.getFieldValue(AnnotProxyFieldValueFactory.java:166)
>  at org.apache.wicket.injection.Injector.inject(Injector.java:111) at 
> org.apache.wicket.spring.injection.annot.SpringComponentInjector.inject(SpringComponentInjector.java:124)
>  at 
> org.apache.wicket.spring.injection.annot.SpringComponentInjector.onInstantiation(SpringComponentInjector.java:130)
>  at 
> org.apache.wicket.application.ComponentInstantiationListenerCollection$1.notify(ComponentInstantiationListenerCollection.java:38)
>  at 
> org.apache.wicket.application.ComponentInstantiationListenerCollection$1.notify(ComponentInstantiationListenerCollection.java:34)
>  at 
> org.apache.wicket.util.listener.ListenerCollection.notify(ListenerCollection.java:80)
>  at 
> org.apache.wicket.application.ComponentInstantiationListenerCollection.onInstantiation(ComponentInstantiationListenerCollection.java:33)
>  at org.apache.wicket.Component.(Component.java:690) at 
> org.apache.wicket.MarkupContainer.(MarkupContainer.java:179) at 
> org.apache.wicket.Page.(Page.java:171) at 
> org.apache.wicket.Page.(Page.java:135) at 
> org.apache.wicket.markup.html.WebPage.(WebPage.java:74)
> {code}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[wicket] branch jmx-standardmbean-instead-proxy updated (c776f4d -> 7b3b938)

2021-08-21 Thread svenmeier
This is an automated email from the ASF dual-hosted git repository.

svenmeier pushed a change to branch jmx-standardmbean-instead-proxy
in repository https://gitbox.apache.org/repos/asf/wicket.git.


 discard c776f4d  WICKET-6913 replace proxies with StandardMBean
 new 7b3b938  WICKET-6913 replace proxies with StandardMBean

This update added new revisions after undoing existing revisions.
That is to say, some revisions that were in the old version of the
branch are not in the new version.  This situation occurs
when a user --force pushes a change and generates a repository
containing something like this:

 * -- * -- B -- O -- O -- O   (c776f4d)
\
 N -- N -- N   refs/heads/jmx-standardmbean-instead-proxy (7b3b938)

You should already have received notification emails for all of the O
revisions, and so the following emails describe only the N revisions
from the common base, B.

Any revisions marked "omit" are not gone; other references still
refer to them.  Any revisions marked "discard" are gone forever.

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 wicket-jmx/pom.xml| 8 
 wicket-jmx/src/main/java/module-info.java | 1 -
 2 files changed, 9 deletions(-)


[wicket] 01/01: WICKET-6913 replace proxies with StandardMBean

2021-08-21 Thread svenmeier
This is an automated email from the ASF dual-hosted git repository.

svenmeier pushed a commit to branch jmx-standardmbean-instead-proxy
in repository https://gitbox.apache.org/repos/asf/wicket.git

commit 7b3b938c065a224d3762179d42fc5cd5d3be7084
Author: Sven Meier 
AuthorDate: Fri Aug 20 19:34:33 2021 +0200

WICKET-6913 replace proxies with StandardMBean
---
 wicket-jmx/pom.xml |   8 --
 wicket-jmx/src/main/java/module-info.java  |   1 -
 .../java/org/apache/wicket/jmx/Initializer.java| 160 +++--
 3 files changed, 54 insertions(+), 115 deletions(-)

diff --git a/wicket-jmx/pom.xml b/wicket-jmx/pom.xml
index 67303ae..5fa7d4b 100644
--- a/wicket-jmx/pom.xml
+++ b/wicket-jmx/pom.xml
@@ -30,16 +30,8 @@
 


-   net.bytebuddy
-   byte-buddy
-   
-   
org.apache.wicket
wicket-core

-   
-   org.ow2.asm
-   asm
-   

 
diff --git a/wicket-jmx/src/main/java/module-info.java 
b/wicket-jmx/src/main/java/module-info.java
index a0366f8..b646aaf 100644
--- a/wicket-jmx/src/main/java/module-info.java
+++ b/wicket-jmx/src/main/java/module-info.java
@@ -20,7 +20,6 @@ module org.apache.wicket.jmx {
 requires org.apache.wicket.util;
 requires org.apache.wicket.core;
 requires org.slf4j;
-requires net.bytebuddy;
 
 provides org.apache.wicket.IInitializer with 
org.apache.wicket.jmx.Initializer;
 exports org.apache.wicket.jmx;
diff --git a/wicket-jmx/src/main/java/org/apache/wicket/jmx/Initializer.java 
b/wicket-jmx/src/main/java/org/apache/wicket/jmx/Initializer.java
index 181f293..bb89f78 100644
--- a/wicket-jmx/src/main/java/org/apache/wicket/jmx/Initializer.java
+++ b/wicket-jmx/src/main/java/org/apache/wicket/jmx/Initializer.java
@@ -17,11 +17,11 @@
 package org.apache.wicket.jmx;
 
 import java.lang.management.ManagementFactory;
-import java.lang.reflect.InvocationTargetException;
-import java.lang.reflect.Method;
 import java.util.ArrayList;
 import java.util.List;
 
+import javax.management.Attribute;
+import javax.management.AttributeList;
 import javax.management.InstanceAlreadyExistsException;
 import javax.management.InstanceNotFoundException;
 import javax.management.MBeanRegistrationException;
@@ -30,17 +30,7 @@ import javax.management.MBeanServerFactory;
 import javax.management.MalformedObjectNameException;
 import javax.management.NotCompliantMBeanException;
 import javax.management.ObjectName;
-
-import net.bytebuddy.ByteBuddy;
-import net.bytebuddy.NamingStrategy;
-import net.bytebuddy.TypeCache;
-import net.bytebuddy.description.type.TypeDescription;
-import net.bytebuddy.dynamic.loading.ClassLoadingStrategy;
-import net.bytebuddy.implementation.MethodDelegation;
-import net.bytebuddy.implementation.bind.annotation.AllArguments;
-import net.bytebuddy.implementation.bind.annotation.Origin;
-import net.bytebuddy.implementation.bind.annotation.RuntimeType;
-import net.bytebuddy.matcher.ElementMatchers;
+import javax.management.StandardMBean;
 
 import org.apache.wicket.IInitializer;
 import org.apache.wicket.ThreadContext;
@@ -78,15 +68,6 @@ public class Initializer implements IInitializer
 {
private static final Logger LOG = 
LoggerFactory.getLogger(Initializer.class);
 
-   /**
-* A cache used to store the dynamically generated classes by ByteBuddy.
-* Without this cache a new class will be generated for each proxy 
creation
-* and this will fill up the metaspace
-*/
-   private static final TypeCache DYNAMIC_CLASS_CACHE 
= new TypeCache.WithInlineExpunction<>(TypeCache.Sort.SOFT);
-
-   private static final ByteBuddy BYTE_BUDDY = new ByteBuddy();
-   
// It's best to store a reference to the MBeanServer rather than 
getting it
// over and over
private MBeanServer mbeanServer = null;
@@ -246,102 +227,69 @@ public class Initializer implements IInitializer
 * @throws MBeanRegistrationException
 * @throws InstanceAlreadyExistsException
 */
-   private void register(final org.apache.wicket.Application application, 
final Object o,
+   private  void register(final org.apache.wicket.Application 
application, final T o,
final ObjectName objectName) throws 
InstanceAlreadyExistsException,
MBeanRegistrationException, NotCompliantMBeanException
{
-   Object proxy = createProxy(application, o);
-   mbeanServer.registerMBean(proxy, objectName);
-   registered.add(objectName);
-   }
-
-   // must be public to prevent JMX Server throwing:
-   // failed to access class org.apache.wicket.jmx.Initializer$Interceptor 
from class org.apache.wicket.jmx.Application
-   public static class Interceptor
-   {
-