[wildfly-dev] jdk 9 reflection problem

Michael Musgrove mmusgrov at redhat.com
Fri Jan 6 13:53:05 EST 2017


Good suggestion David. I have raised the issue with XStream (
https://groups.google.com/forum/#!topic/xstream-user/sOHazgzxU2o)

On Fri, Jan 6, 2017 at 4:58 PM, David M. Lloyd <david.lloyd at redhat.com>
wrote:

> I guess the obvious suggestion is, report a bug to XStream and tell them
> to use the comparator() method on TreeMap instead of poking the field.
>
> Reflecting on JDK classes is going to become pretty hard in Java 9
> without using Unsafe.
>
> On 01/05/2017 06:04 AM, Michael Musgrove wrote:
> > We have just upgraded our jdk build to 9-ea+149 which has tightened up
> > the accessibility rules. The recommendation seems to be to use the
> > --add-opens flag to override the rules.
> >
> > I tried export MAVEN_OPTS="--add-opens java.base/java.util=ALL-UNNAMED"
> > which made no difference. Our jdk 9 FAQ does not provided any hints
> either.
> >
> > Can anyone provide advice on how to resolve the following maven build
> error:
> >
> >
> > [WARNING] Error injecting: org.apache.maven.plugins.war.WarMojo
> > com.google.inject.ProvisionException: Unable to provision, see the
> > following errors:
> >
> > 1) Error injecting constructor, java.lang.ExceptionInInitializerError
> >   at org.apache.maven.plugins.war.WarMojo.<init>(Unknown Source)
> >   while locating org.apache.maven.plugins.war.WarMojo
> >
> > ...
> >
> > Caused by: java.lang.reflect.InaccessibleObjectException: Unable to make
> > field private final java.util.Comparator java.util.TreeMap.comparator
> > accessible: module java.base does not "opens java.util" to unnamed m
> > odule @669f2128
> >         at
> > java.base/jdk.internal.reflect.Reflection.throwInaccessibleObjectExcepti
> on(Reflection.java:427)
> >         at
> > java.base/java.lang.reflect.AccessibleObject.checkCanSetAccessible(
> AccessibleObject.java:201)
> >         at
> > java.base/java.lang.reflect.Field.checkCanSetAccessible(Field.java:171)
> >         at java.base/java.lang.reflect.Field.setAccessible(Field.
> java:165)
> >         at com.thoughtworks.xstream.core.util.Fields.locate(Fields.
> java:40)
> >         at
> > com.thoughtworks.xstream.converters.collections.
> TreeMapConverter.<clinit>(TreeMapConverter.java:50)
> >
> >
> > --
> > Michael Musgrove
> > Transactions Team
> > e: mmusgrov at redhat.com <mailto:mmusgrov at redhat.com>
> > t: +44 191 243 0870
> >
> > Our mission:To be the catalyst in communities of customers,
> > contributors, and partners creating better technology the open source
> way.
> >
> > Registered in England and Wales under Company Registration No. 03798903
> > Directors: Michael Cunningham (US), Paul Hickey (Ireland), Matt Parson
> > (US), Charles Peters (US)
> >
> > Michael Cunningham (US), Charles Peters (US), Matt Parson (US), Michael
> > O'Neill(Ireland)
> >
> >
> > _______________________________________________
> > wildfly-dev mailing list
> > wildfly-dev at lists.jboss.org
> > https://lists.jboss.org/mailman/listinfo/wildfly-dev
> >
>
> --
> - DML
> _______________________________________________
> wildfly-dev mailing list
> wildfly-dev at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/wildfly-dev
>



-- 
Michael Musgrove
Transactions Team
e: mmusgrov at redhat.com
t: +44 191 243 0870

Our mission:To be the catalyst in communities of customers, contributors,
and partners creating better technology the open source way.

Registered in England and Wales under Company Registration No. 03798903
Directors: Michael Cunningham (US), Paul Hickey (Ireland), Matt Parson
(US), Charles Peters (US)

Michael Cunningham (US), Charles Peters (US), Matt Parson (US), Michael
O'Neill(Ireland)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/wildfly-dev/attachments/20170106/1bbd26bc/attachment.html 


More information about the wildfly-dev mailing list