You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am using the Maven plugin, and my project is a single module project.
What is the smallest, simplest way to reproduce the problem?
A user has a Java 8 application that was attempting to migrate from Java 8 to Java 21. This app was already making use of the Jakarta EE namespace (Jakarta EE 9 supports Java 8), which was resolved by a dependency the app already had configured as a dependency. After running the java upgrade recipes against the app, they started seeing the following error:
[INFO] Compiling 138 source files with javac [debug deprecation release 21] to target\classes
[INFO] -------------------------------------------------------------
[ERROR] COMPILATION ERROR :
[INFO] -------------------------------------------------------------
[ERROR] /C:/MyData/MyWDTWorkspaces/GarageSale/GS-WCA4EJ/garageSale-ee/GarageSaleWSClient/src/main/java/com/ibm/websphere/svt/gs/ccdb/jaxws/client/GarageSaleCCManagerLocal.java:[9,19] package jakarta.jws does not exist
[ERROR] /C:/MyData/MyWDTWorkspaces/GarageSale/GS-WCA4EJ/garageSale-ee/GarageSaleWSClient/src/main/java/com/ibm/websphere/svt/gs/ccdb/jaxws/client/GarageSaleCCManagerLocal.java:[10,19] package jakarta.jws does not exist
[ERROR] /C:/MyData/MyWDTWorkspaces/GarageSale/GS-WCA4EJ/garageSale-ee/GarageSaleWSClient/src/main/java/com/ibm/websphere/svt/gs/ccdb/jaxws/client/GarageSaleCCManagerLocal.java:[11,19] package jakarta.jws does not exist
[ERROR] /C:/MyData/MyWDTWorkspaces/GarageSale/GS-WCA4EJ/garageSale-ee/GarageSaleWSClient/src/main/java/com/ibm/websphere/svt/gs/ccdb/jaxws/client/GarageSaleCCManagerLocal.java:[12,19] package jakarta.jws does not exist
[ERROR] /C:/MyData/MyWDTWorkspaces/GarageSale/GS-WCA4EJ/garageSale-ee/GarageSaleWSClient/src/main/java/com/ibm/websphere/svt/gs/ccdb/jaxws/client/GarageSaleCCManagerLocal.java:[18,2] cannot find symbol
Here is my colleagues assessment of the issue here:
That recipe adds in the jaxws-rt dependency.
I don't have a full understanding of what is happening here, but I think that dependency assumes that the javax namespace is still being used. As per the documentation in the recipe "The resulting dependencies still use the javax namespace, despite the move to the Jakarta artifact."
However, in the case of this application, its already a Jakarta application on Java 8. The jakarta namespace is already in use (from the dependency that it already has: jakarta.xml.ws-api). Adding the new dependency: jaxws-rt in some sense seems to make the jakarta namespace invisible.
If I update the version of the dependency that the recipe adds - from 2.3.7 to the latest, 4.0.3, then it compiles.
Jakarta 9 is compatible with Java SE 8, so we should expect that Java SE 8 application could already be using the jakarta namespace. In which case, it is not always appropriate to add the old version of jaxws-rt- right? That is to say, if the application is already a Jakarta 9 application (on Java SE 8), then this recipe should either not add the 2.3.7 version of jaxws-rt, OR, maybe it should replace the jakarta.xml.ws-api dependency with a newer version of jaxws-rt.
The text was updated successfully, but these errors were encountered:
What version of OpenRewrite are you using?
I am using
How are you running OpenRewrite?
I am using the Maven plugin, and my project is a single module project.
What is the smallest, simplest way to reproduce the problem?
A user has a Java 8 application that was attempting to migrate from Java 8 to Java 21. This app was already making use of the Jakarta EE namespace (Jakarta EE 9 supports Java 8), which was resolved by a dependency the app already had configured as a dependency. After running the java upgrade recipes against the app, they started seeing the following error:
Here is my colleagues assessment of the issue here:
The text was updated successfully, but these errors were encountered: