[ 
https://issues.apache.org/jira/browse/CXF-8407?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Andriy Redko updated CXF-8407:
------------------------------
    Description: 
JEP-396 introduces stronger encapsulation of JDK internals by default. In CXF, 
we are using a number of tricks to access JDK internals, including but not 
limited to:
 * -AutomaticWorkQueueImpl uses private ThreadPoolExecutor::addWorker: needs 
--add-opens java.base/java.util.concurrent=ALL-UNNAMED-
 * -EasyMock: needs --add-opens java.base/java.lang=ALL-UNNAMED- (fixed in 
EasyMock 5.0.1 by moving off to ByteBuddy)
 * CgLib (Spring AOP): needs --add-opens java.base/java.lang=ALL-UNNAMED

{noformat}
Caused by: org.springframework.cglib.core.CodeGenerationException: 
java.lang.reflect.InaccessibleObjectException-->Unable to make protected final 
java.lang.Class 
java.lang.ClassLoader.defineClass(java.lang.String,byte[],int,int,java.security.ProtectionDomain)
 throws java.lang.ClassFormatError accessible: module java.base does not "opens 
java.lang" to unnamed module @1e67b872
        at 
org.springframework.cglib.core.ReflectUtils.defineClass(ReflectUtils.java:549) 
{noformat}
 * -ImportRepairTest uses XSImplementationImpl: --add-exports 
java.xml/com.sun.org.apache.xerces.internal.impl.xs=ALL-UNNAMED --add-exports 
java.xml/com.sun.org.apache.xerces.internal.impl.xs.util=ALL-UNNAMED-
 * -ReferencingAuthenticator (method tryWith): needs --add-opens 
java.base/java.net=ALL-UNNAMED-
 * -stax.WriterTest: needs- -add-opens 
java.xml/com.sun.org.apache.xerces.internal.jaxp=ALL-UNNAMED-
 * {color:#172b4d}-johnzon-jsonb: needs --add-opens 
java.base/java.util=ALL-UNNAMED-{color}
 * *SOAPRpcLitClientTypeTest* with xercesImpl: needs --add-opens 
java.xml/javax.xml.namespace=ALL-UNNAMED (see please 
[https://github.com/javaee/jaxb-v2/issues/1184])
 * .{-}*JAXRSLDAPUserTest*{-}: (fixed by CXF-8809)
 - apacheds needs \{-}-{-}add-opens java.base/sun.security.x509=ALL-UNNAMED 
-{-}add-opens java.base/sun.security.util=ALL-UNNAMED{-} 
 - -org.springframework.ldap needs -add-opens 
java.naming/com.sun.jndi.ldap=ALL-UNNAMED- (fixed in 2.3.4.RELEASE)
 * *JsFrontEndServletTest* & {*}JSClientServerTest{*}: need --add-opens 
java.xml/com.sun.org.apache.xerces.internal.dom=ALL-UNNAMED (saaj-impl 1.5.3 
SOAPDocumentImpl::createDocument() instantiates 
`com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderFactoryImpl`)
 * *JAXRSClientServerBookTest* & {*}JAXRSHttpsBookTest{*}: need --add-opens 
java.base/java.net=ALL-UNNAMED --add-opens 
java.base/sun.net.[www.protocol.https=ALL-UNNAMED|http://www.protocol.https=all-unnamed/]
 (setting custom HTTP method fe RETRIEVE in 
URLConnectionHTTPConduit::setupConnection using reflection)

We should migrate from using those to the means provided by standard library.

[1] [https://openjdk.java.net/jeps/396]

[2] [https://cr.openjdk.java.net/~mr/jigsaw/jdk8-packages-denied-by-default]

  was:
JEP-396 introduces stronger encapsulation of JDK internals by default. In CXF, 
we are using a number of tricks to access JDK internals, including but not 
limited to:
 * -AutomaticWorkQueueImpl uses private ThreadPoolExecutor::addWorker: needs 
--add-opens java.base/java.util.concurrent=ALL-UNNAMED-
 * -EasyMock: needs --add-opens java.base/java.lang=ALL-UNNAMED- (fixed in 
EasyMock 5.0.1 by moving off to ByteBuddy)
 * CgLib (Spring AOP): needs --add-opens java.base/java.lang=ALL-UNNAMED

{noformat}
Caused by: org.springframework.cglib.core.CodeGenerationException: 
java.lang.reflect.InaccessibleObjectException-->Unable to make protected final 
java.lang.Class 
java.lang.ClassLoader.defineClass(java.lang.String,byte[],int,int,java.security.ProtectionDomain)
 throws java.lang.ClassFormatError accessible: module java.base does not "opens 
java.lang" to unnamed module @1e67b872
        at 
org.springframework.cglib.core.ReflectUtils.defineClass(ReflectUtils.java:549) 
{noformat}
 * -ImportRepairTest uses XSImplementationImpl: --add-exports 
java.xml/com.sun.org.apache.xerces.internal.impl.xs=ALL-UNNAMED --add-exports 
java.xml/com.sun.org.apache.xerces.internal.impl.xs.util=ALL-UNNAMED-
 * -ReferencingAuthenticator (method tryWith): needs --add-opens 
java.base/java.net=ALL-UNNAMED-
 * -stax.WriterTest: needs- -add-opens 
java.xml/com.sun.org.apache.xerces.internal.jaxp=ALL-UNNAMED-
 * {color:#172b4d}-johnzon-jsonb: needs --add-opens 
java.base/java.util=ALL-UNNAMED-{color}
 * *SOAPRpcLitClientTypeTest* with xercesImpl: needs --add-opens 
java.xml/javax.xml.namespace=ALL-UNNAMED (see please 
[https://github.com/javaee/jaxb-v2/issues/1184])
 * .{-}*JAXRSLDAPUserTest*{-}: (fixed by CXF-8809)
 -{-}- apacheds needs{-} -{-}add-opens java.base/sun.security.x509=ALL-UNNAMED 
--add-opens java.base/sun.security.util=ALL-UNNAMED{-} 
 - -org.springframework.ldap needs -add-opens 
java.naming/com.sun.jndi.ldap=ALL-UNNAMED- (fixed in 2.3.4.RELEASE)
 * *JsFrontEndServletTest* & {*}JSClientServerTest{*}: need --add-opens 
java.xml/com.sun.org.apache.xerces.internal.dom=ALL-UNNAMED (saaj-impl 1.5.3 
SOAPDocumentImpl::createDocument() instantiates 
`com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderFactoryImpl`)
 * *JAXRSClientServerBookTest* & {*}JAXRSHttpsBookTest{*}: need --add-opens 
java.base/java.net=ALL-UNNAMED --add-opens 
java.base/sun.net.[www.protocol.https=ALL-UNNAMED|http://www.protocol.https=all-unnamed/]
 (setting custom HTTP method fe RETRIEVE in 
URLConnectionHTTPConduit::setupConnection using reflection)

We should migrate from using those to the means provided by standard library.

[1] [https://openjdk.java.net/jeps/396]

[2] [https://cr.openjdk.java.net/~mr/jigsaw/jdk8-packages-denied-by-default]


> Incorporate changes caused by JEP-396 integration into JDK-16+
> --------------------------------------------------------------
>
>                 Key: CXF-8407
>                 URL: https://issues.apache.org/jira/browse/CXF-8407
>             Project: CXF
>          Issue Type: Bug
>    Affects Versions: 3.4.2
>            Reporter: Andriy Redko
>            Assignee: Andriy Redko
>            Priority: Major
>              Labels: jdk16
>
> JEP-396 introduces stronger encapsulation of JDK internals by default. In 
> CXF, we are using a number of tricks to access JDK internals, including but 
> not limited to:
>  * -AutomaticWorkQueueImpl uses private ThreadPoolExecutor::addWorker: needs 
> --add-opens java.base/java.util.concurrent=ALL-UNNAMED-
>  * -EasyMock: needs --add-opens java.base/java.lang=ALL-UNNAMED- (fixed in 
> EasyMock 5.0.1 by moving off to ByteBuddy)
>  * CgLib (Spring AOP): needs --add-opens java.base/java.lang=ALL-UNNAMED
> {noformat}
> Caused by: org.springframework.cglib.core.CodeGenerationException: 
> java.lang.reflect.InaccessibleObjectException-->Unable to make protected 
> final java.lang.Class 
> java.lang.ClassLoader.defineClass(java.lang.String,byte[],int,int,java.security.ProtectionDomain)
>  throws java.lang.ClassFormatError accessible: module java.base does not 
> "opens java.lang" to unnamed module @1e67b872
>       at 
> org.springframework.cglib.core.ReflectUtils.defineClass(ReflectUtils.java:549)
>  {noformat}
>  * -ImportRepairTest uses XSImplementationImpl: --add-exports 
> java.xml/com.sun.org.apache.xerces.internal.impl.xs=ALL-UNNAMED --add-exports 
> java.xml/com.sun.org.apache.xerces.internal.impl.xs.util=ALL-UNNAMED-
>  * -ReferencingAuthenticator (method tryWith): needs --add-opens 
> java.base/java.net=ALL-UNNAMED-
>  * -stax.WriterTest: needs- -add-opens 
> java.xml/com.sun.org.apache.xerces.internal.jaxp=ALL-UNNAMED-
>  * {color:#172b4d}-johnzon-jsonb: needs --add-opens 
> java.base/java.util=ALL-UNNAMED-{color}
>  * *SOAPRpcLitClientTypeTest* with xercesImpl: needs --add-opens 
> java.xml/javax.xml.namespace=ALL-UNNAMED (see please 
> [https://github.com/javaee/jaxb-v2/issues/1184])
>  * .{-}*JAXRSLDAPUserTest*{-}: (fixed by CXF-8809)
>  - apacheds needs \{-}-{-}add-opens java.base/sun.security.x509=ALL-UNNAMED 
> -{-}add-opens java.base/sun.security.util=ALL-UNNAMED{-} 
>  - -org.springframework.ldap needs -add-opens 
> java.naming/com.sun.jndi.ldap=ALL-UNNAMED- (fixed in 2.3.4.RELEASE)
>  * *JsFrontEndServletTest* & {*}JSClientServerTest{*}: need --add-opens 
> java.xml/com.sun.org.apache.xerces.internal.dom=ALL-UNNAMED (saaj-impl 1.5.3 
> SOAPDocumentImpl::createDocument() instantiates 
> `com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderFactoryImpl`)
>  * *JAXRSClientServerBookTest* & {*}JAXRSHttpsBookTest{*}: need --add-opens 
> java.base/java.net=ALL-UNNAMED --add-opens 
> java.base/sun.net.[www.protocol.https=ALL-UNNAMED|http://www.protocol.https=all-unnamed/]
>  (setting custom HTTP method fe RETRIEVE in 
> URLConnectionHTTPConduit::setupConnection using reflection)
> We should migrate from using those to the means provided by standard library.
> [1] [https://openjdk.java.net/jeps/396]
> [2] [https://cr.openjdk.java.net/~mr/jigsaw/jdk8-packages-denied-by-default]



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to