1

My goal is to migrate a Web Services application that currently works with Java 8 to Java 11. Because the JAXB and JAX-WS components have been removed from JDK11, it is necessary to add the appropriate libraries, either using Maven or Jar libraries.

There is a wide variety of recommendations and suggestions from others who have encountered similar issues, but I am not able to find a combination that does not have errors.

pom.xml

<dependency>
    <groupId>org.openjfx</groupId>
    <artifactId>javafx-controls</artifactId>
    <version>11.0.2</version>
</dependency>
<dependency>
    <groupId>org.openjfx</groupId>
    <artifactId>javafx-fxml</artifactId>
    <version>11.0.2</version>
</dependency>
<dependency>
    <groupId>org.glassfish.jaxb</groupId>
    <artifactId>jaxb-runtime</artifactId>
    <version>2.3.0</version>
</dependency>
<!-- JAXWS for Java 11 -->
<dependency>
    <groupId>com.sun.xml.ws</groupId>
    <artifactId>rt</artifactId>
    <version>2.3.1</version>
</dependency>

modules-info.java

module org.openfx.gustfx {
    requires javafx.controls;
    requires javafx.fxml;
    requires transitive javafx.graphics;
    requires java.xml.bind;
    requires java.xml.ws;
    requires javax.jws;

    opens com.agile.ws.schema.common.v1.jaxws to javafx.fxml;
    opens org.openfx.gustfx to javafx.fxml;
    exports org.openfx.gustfx;
}

Running the code produces this error:

Unable to make field protected java.lang.String  
 com.agile.ws.schema.common.v1.jaxws.AgileUserUserGroupIdentifierType.classIdentifier accessible: module org.openfx.gustfx does not "opens com.agile.ws.schema.common.v1.jaxws" to unnamed module @4860d8d7

How could I find this unnamed module ?

skomisa
  • 16,436
  • 7
  • 61
  • 102
Des Albert
  • 281
  • 2
  • 5
  • 17
  • 1
    Can you expand the question to include some of the stack trace? It's otherwise impossible to tell what code is trying to access the member of the class in your module. – Alan Bateman May 13 '19 at 21:10
  • [This accepted answer](https://stackoverflow.com/a/48204154/2985643) to the SO question _"Replacements for deprecated JPMS modules with Java EE APIs"_ proposes entries in **pom.xml** for both JAXB and JAX-WS. The ``for JAX-WS differs from the one in the OP. – skomisa May 14 '19 at 01:59
  • @skomisa As stated in the question, I have tried many combinations of pom.xml entries for both JAXB and JAX-WS including the many suggestions in that answer "Replacements for deprecated JPMS modules with Java EE APIs" and found that there was always some issue. The combination in my question is the only one I have found work. I have posted a comment in response to that article – Des Albert May 15 '19 at 00:18

1 Answers1

2

I was able to solve this problem by adding

opens com.agile.ws.schema.common.v1.jaxws;
opens com.agile.ws.schema.project.v1.jaxws;
opens com.agile.ws.schema.search.v1.jaxws;
opens com.agile.ws.schema.collaboration.v1.jaxws;

to the module-info.java. The error message suggested that the 'opens' should be to a specific module but apparently this is not required

Des Albert
  • 281
  • 2
  • 5
  • 17