<div dir="ltr">Good suggestion David. I have raised the issue with XStream (<a href="https://groups.google.com/forum/#!topic/xstream-user/sOHazgzxU2o">https://groups.google.com/forum/#!topic/xstream-user/sOHazgzxU2o</a>)</div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Jan 6, 2017 at 4:58 PM, David M. Lloyd <span dir="ltr"><<a href="mailto:david.lloyd@redhat.com" target="_blank">david.lloyd@redhat.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">I guess the obvious suggestion is, report a bug to XStream and tell them<br>
to use the comparator() method on TreeMap instead of poking the field.<br>
<br>
Reflecting on JDK classes is going to become pretty hard in Java 9<br>
without using Unsafe.<br>
<div><div class="h5"><br>
On 01/05/2017 06:04 AM, Michael Musgrove wrote:<br>
> We have just upgraded our jdk build to 9-ea+149 which has tightened up<br>
> the accessibility rules. The recommendation seems to be to use the<br>
> --add-opens flag to override the rules.<br>
><br>
> I tried export MAVEN_OPTS="--add-opens java.base/java.util=ALL-<wbr>UNNAMED"<br>
> which made no difference. Our jdk 9 FAQ does not provided any hints either.<br>
><br>
> Can anyone provide advice on how to resolve the following maven build error:<br>
><br>
><br>
> [WARNING] Error injecting: org.apache.maven.plugins.war.<wbr>WarMojo<br>
> com.google.inject.<wbr>ProvisionException: Unable to provision, see the<br>
> following errors:<br>
><br>
> 1) Error injecting constructor, java.lang.<wbr>ExceptionInInitializerError<br>
> at org.apache.maven.plugins.war.<wbr>WarMojo.<init>(Unknown Source)<br>
> while locating org.apache.maven.plugins.war.<wbr>WarMojo<br>
><br>
> ...<br>
><br>
> Caused by: java.lang.reflect.<wbr>InaccessibleObjectException: Unable to make<br>
> field private final java.util.Comparator java.util.TreeMap.comparator<br>
> accessible: module java.base does not "opens java.util" to unnamed m<br>
> odule @669f2128<br>
> at<br>
> java.base/jdk.internal.<wbr>reflect.Reflection.<wbr>throwInaccessibleObjectExcepti<wbr>on(Reflection.java:427)<br>
> at<br>
> java.base/java.lang.reflect.<wbr>AccessibleObject.<wbr>checkCanSetAccessible(<wbr>AccessibleObject.java:201)<br>
> at<br>
> java.base/java.lang.reflect.<wbr>Field.checkCanSetAccessible(<wbr>Field.java:171)<br>
> at java.base/java.lang.reflect.<wbr>Field.setAccessible(Field.<wbr>java:165)<br>
> at com.thoughtworks.xstream.core.<wbr>util.Fields.locate(Fields.<wbr>java:40)<br>
> at<br>
> com.thoughtworks.xstream.<wbr>converters.collections.<wbr>TreeMapConverter.<clinit>(<wbr>TreeMapConverter.java:50)<br>
><br>
><br>
> --<br>
> Michael Musgrove<br>
> Transactions Team<br>
</div></div>> e: <a href="mailto:mmusgrov@redhat.com">mmusgrov@redhat.com</a> <mailto:<a href="mailto:mmusgrov@redhat.com">mmusgrov@redhat.com</a>><br>
<span class="im HOEnZb">> t: <a href="tel:%2B44%20191%20243%200870" value="+441912430870">+44 191 243 0870</a><br>
><br>
> Our mission:To be the catalyst in communities of customers,<br>
> contributors, and partners creating better technology the open source way.<br>
><br>
> Registered in England and Wales under Company Registration No. 03798903<br>
> Directors: Michael Cunningham (US), Paul Hickey (Ireland), Matt Parson<br>
> (US), Charles Peters (US)<br>
><br>
> Michael Cunningham (US), Charles Peters (US), Matt Parson (US), Michael<br>
> O'Neill(Ireland)<br>
><br>
><br>
</span><span class="im HOEnZb">> ______________________________<wbr>_________________<br>
> wildfly-dev mailing list<br>
> <a href="mailto:wildfly-dev@lists.jboss.org">wildfly-dev@lists.jboss.org</a><br>
> <a href="https://lists.jboss.org/mailman/listinfo/wildfly-dev" rel="noreferrer" target="_blank">https://lists.jboss.org/<wbr>mailman/listinfo/wildfly-dev</a><br>
><br>
<br>
--<br>
</span><span class="HOEnZb"><font color="#888888">- DML<br>
</font></span><div class="HOEnZb"><div class="h5">______________________________<wbr>_________________<br>
wildfly-dev mailing list<br>
<a href="mailto:wildfly-dev@lists.jboss.org">wildfly-dev@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/wildfly-dev" rel="noreferrer" target="_blank">https://lists.jboss.org/<wbr>mailman/listinfo/wildfly-dev</a><br>
</div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div>Michael Musgrove</div><div>Transactions Team</div><div>e: <a href="mailto:mmusgrov@redhat.com" target="_blank">mmusgrov@redhat.com</a></div><div>t: +44 191 243 0870</div><div><br></div><div>Our mission:To be the catalyst in communities of customers, contributors, and partners creating better technology the open source way. <br></div><div><br></div><div>Registered in England and Wales under Company Registration No. 03798903</div><div>Directors: Michael Cunningham (US), Paul Hickey (Ireland), Matt Parson</div><div>(US), Charles Peters (US)</div><div><br></div><div>Michael Cunningham (US), Charles Peters (US), Matt Parson (US), Michael O'Neill(Ireland)</div></div></div></div></div>
</div>