Details
-
Enhancement
-
Resolution: Unresolved
-
Major
-
None
-
4.24.0.Final
-
None
-
---
Description
I had this code in a JSP file:
<%@ page language="java"
contentType="text/html; charset=ISO-8859-1"
pageEncoding="ISO-8859-1"
import="..., javax.naming.*, javax.rmi.PortableRemoteObject"
%>
<%InitialContext initialContext = new InitialContext();
Object myBeanRef = initialContext.lookup ("java:comp/env/ejb/MyEjb");
MyEjbRemote myEjb = (MyEjbRemote) PortableRemoteObject.narrow(myBeanRef , MyEjbRemote.class);
{{%>
This does not compile with Java 11: "The import javax.rmi.PortableRemoteObject cannot be resolved"
The reason seems to be JEP 320: https://openjdk.org/jeps/320
Workaround: add a reference to "wildfly-26.0.0.Final\modules\system\layers\base\javax\orb\api\main\openjdk-orb-8.1.7.Final.jar".
Actually, the "PortableRemoteObject.narrow" is not necessary, but it is old code . So, for backwards compatibility, it would be helpful to have this jar file in the reference list of the server runtime. What do you think?