<div dir="ltr">The Amos´s solution is the same related here: <div><br></div><div><a href="http://stackoverflow.com/questions/41265266/how-to-solve-inaccessibleobjectexception-unable-to-make-member-accessible-m/41265267">http://stackoverflow.com/questions/41265266/how-to-solve-inaccessibleobjectexception-unable-to-make-member-accessible-m/41265267</a><br></div><div>....</div><div><div><br></div><div>... the correct fix is to launch the JVM as follows:</div><div><br></div><div># --add-opens has the following syntax: {A}/{package}={B}</div><div>java --add-opens java.base/java.lang=ALL-UNNAMED <<<<<<<<<<<<<<<<<<<<<<<<</div><div><br></div><div><br></div></div></div><div class="gmail_extra"><br><div class="gmail_quote">2017-01-05 12:01 GMT-02:00 Amos Feng <span dir="ltr"><<a href="mailto:zfeng@redhat.com" target="_blank">zfeng@redhat.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi Mike,<br>
<br>
I had tried MAVEN_OPTS="--add-opens java.base/java.util=ALL-<wbr>UNNAMED --add-opens java.base/java.lang.reflect=<wbr>ALL-UNNAMED --add-opens java.base/java.text=ALL-<wbr>UNNAMED --add-opens java.desktop/java.awt.font=<wbr>ALL-UNNAMED" and it works.<br>
<span class="HOEnZb"><font color="#888888"><br>
Amos<br>
</font></span><div class="HOEnZb"><div class="h5"><br>
----- Original Message -----<br>
From: "Michael Musgrove" <<a href="mailto:mmusgrov@redhat.com">mmusgrov@redhat.com</a>><br>
To: "WildFly Dev" <<a href="mailto:wildfly-dev@lists.jboss.org">wildfly-dev@lists.jboss.org</a>><br>
Sent: Thursday, January 5, 2017 8:04:09 PM<br>
Subject: [wildfly-dev] jdk 9 reflection problem<br>
<br>
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.<br>
<br>
I tried export MAVEN_OPTS="--add-opens java.base/java.util=ALL-<wbr>UNNAMED" 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 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 field private final java.util.Comparator java.util.TreeMap.comparator accessible: module java.base does not "opens java.util" to unnamed m<br>
odule @669f2128<br>
at java.base/jdk.internal.<wbr>reflect.Reflection.<wbr>throwInaccessibleObjectExcepti<wbr>on(Reflection.java:427)<br>
at java.base/java.lang.reflect.<wbr>AccessibleObject.<wbr>checkCanSetAccessible(<wbr>AccessibleObject.java:201)<br>
at 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 com.thoughtworks.xstream.<wbr>converters.collections.<wbr>TreeMapConverter.<clinit>(<wbr>TreeMapConverter.java:50)<br>
<br>
<br>
--<br>
Michael Musgrove<br>
Transactions Team<br>
e: <a href="mailto:mmusgrov@redhat.com">mmusgrov@redhat.com</a><br>
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, 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 O'Neill(Ireland)<br>
<br>
</div></div><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>
______________________________<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 dir="ltr"><div dir="ltr"><div><font size="1"><span style="font-family:Arial">________________</span><span style="font-family:Arial">______</span></font><span style="font-family:Arial;font-size:x-small">__</span><span style="font-family:Arial;font-size:x-small">_</span><span style="font-family:Arial;font-size:x-small">_</span><span style="font-family:Arial;font-size:x-small">_</span></div><div><div align="left" style="font-family:Arial"><font size="1">Eduardo Sant'Ana da Silva - Ph.D.</font></div><div style="font-family:Arial"><font face="Arial" size="1">Researcher / IT Consultant<br></font></div><div style="font-family:Arial;font-size:small"><br></div></div></div></div></div></div></div></div>
</div>