[
https://issues.apache.org/jira/browse/CXF-8173?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17010739#comment-17010739
]
Freeman Yue Fang commented on CXF-8173:
---------------------------------------
I checked the code, we do need to use the reflection way to access a private
field(java.util.concurrent.ThreadPoolExecutor.mainLock) in a private package in
jigsaw module, to gain good performance.
This isn't like the fix in CXF-7838, where in latest JDK version, the
java.net.Authenticator introduce a new public method
{code}
public static Authenticator getDefault() {
{code}
which means we needn't to use reflection to access the private field.
We can always use JVM option like --add-open to get rid of this kind of
warning(even in future JDK version when "All illegal access operations will be
denied" by default).
We can revisit this issue in the future, to see if future JDK can offer us
better solution.
> Illegal reflective access to field
> java.util.concurrent.ThreadPoolExecutor.mainLock
> -----------------------------------------------------------------------------------
>
> Key: CXF-8173
> URL: https://issues.apache.org/jira/browse/CXF-8173
> Project: CXF
> Issue Type: Bug
> Affects Versions: 3.3.4
> Reporter: Jimmy Praet
> Assignee: Freeman Yue Fang
> Priority: Major
> Fix For: 3.4.0, 3.3.5
>
>
> I get the following warning on JDK 11:
> {code:java}
> WARNING: An illegal reflective access operation has occurred
> WARNING: Illegal reflective access by
> org.apache.cxf.common.util.ReflectionUtil$11
> (file:/D:/mvn_repo/org/apache/cxf/cxf-core/3.3.4/cxf-core-3.3.4.jar) to field
> java.util.concurrent.ThreadPoolExecutor.mainLock
> WARNING: Please consider reporting this to the maintainers of
> org.apache.cxf.common.util.ReflectionUtil$11
> WARNING: Use --illegal-access=warn to enable warnings of further illegal
> reflective access operations
> WARNING: All illegal access operations will be denied in a future
> release{code}
> With --illegal-access=debug:
> {code:java}
> WARNING: Illegal reflective access by
> org.apache.cxf.common.util.ReflectionUtil$11
> (file:/D:/mvn_repo/org/apache/cxf/cxf-core/3.3.4/cxf-core-3.3.4.jar) to field
> java.util.concurrent.ThreadPoolExecutor.mainLock
> at org.apache.cxf.common.util.ReflectionUtil$11.run(ReflectionUtil.java:184)
> at org.apache.cxf.common.util.ReflectionUtil$11.run(ReflectionUtil.java:182)
> at java.base/java.security.AccessController.doPrivileged(Native Method)
> at
> org.apache.cxf.common.util.ReflectionUtil.setAccessible(ReflectionUtil.java:182)
> at
> org.apache.cxf.workqueue.AutomaticWorkQueueImpl.getExecutor(AutomaticWorkQueueImpl.java:206)
> at
> org.apache.cxf.workqueue.AutomaticWorkQueueImpl.execute(AutomaticWorkQueueImpl.java:425)
> at
> org.apache.cxf.workqueue.AutomaticWorkQueueImpl.execute(AutomaticWorkQueueImpl.java:455)
> at
> org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponseOnWorkqueue(HTTPConduit.java:1233)
> at
> org.apache.cxf.transport.http.URLConnectionHTTPConduit$URLConnectionWrappedOutputStream.handleResponseAsync(URLConnectionHTTPConduit.java:333)
> at
> org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponse(HTTPConduit.java:1572)
> at
> org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.close(HTTPConduit.java:1371)
> at
> org.apache.cxf.ext.logging.LoggingOutputStream.postClose(LoggingOutputStream.java:53)
> at org.apache.cxf.io.CachedOutputStream.close(CachedOutputStream.java:228)
> at org.apache.cxf.transport.AbstractConduit.close(AbstractConduit.java:56)
> at org.apache.cxf.transport.http.HTTPConduit.close(HTTPConduit.java:671)
> at
> org.apache.cxf.interceptor.MessageSenderInterceptor$MessageSenderEndingInterceptor.handleMessage(MessageSenderInterceptor.java:63)
> at
> org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:308)
> at org.apache.cxf.endpoint.ClientImpl.doInvoke(ClientImpl.java:530)
> at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:434)
> at org.apache.camel.component.cxf.CxfProducer.process(CxfProducer.java:117)
> at
> be.fgov.kszbcss.camel.support.component.soap.SoapCallProducer.process(SoapCallProducer.java:93)
> at org.apache.camel.processor.SendProcessor.process(SendProcessor.java:134)
> at
> org.apache.camel.processor.errorhandler.RedeliveryErrorHandler$RedeliveryState.run(RedeliveryErrorHandler.java:476)
> at
> org.apache.camel.impl.engine.DefaultReactiveExecutor$Worker.schedule(DefaultReactiveExecutor.java:185)
> at
> org.apache.camel.impl.engine.DefaultReactiveExecutor.scheduleMain(DefaultReactiveExecutor.java:59)
> at org.apache.camel.processor.Pipeline.process(Pipeline.java:87)
> at
> org.apache.camel.processor.CamelInternalProcessor.process(CamelInternalProcessor.java:228)
> at
> org.apache.camel.component.cxf.CxfConsumer$CxfConsumerInvoker.asyncInvoke(CxfConsumer.java:182)
> at
> org.apache.camel.component.cxf.CxfConsumer$CxfConsumerInvoker.invoke(CxfConsumer.java:158)
> at
> org.apache.cxf.interceptor.ServiceInvokerInterceptor$1.run(ServiceInvokerInterceptor.java:59)
> at
> java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
> at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
> {code}
>
--
This message was sent by Atlassian Jira
(v8.3.4#803005)