Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Java 11 and javax.rmi.PortableRemoteObject

I'm using Payara 5.29.0 enterprise server which support Jakarta EE 8.

I'm trying to port the code for Java 11.

When I compile there comes error:

    cannot find symbol
    [ERROR]   symbol:   variable PortableRemoteObject

The code contains javax.rmi.PortableRemoteObject.narrow which was used before EJB3.

Is javax.rmi.PortableRemoteObject in some library so I could add it to the maven pom.xml?

I tried dependency

    <dependency>
        <groupId>jakarta.ejb</groupId>
        <artifactId>jakarta.ejb-api</artifactId>
        <version>3.2.6</version>
    </dependency>

but I got still same error.

I could port the code to the EJB3, but I wonder is it possible to handle this only adding the maven dependency?

like image 625
George Avatar asked Nov 17 '25 04:11

George


1 Answers

javax.rmi.PortableRemoteObject was part of the JDK itself up until JDK10. It was removed in JDK11. Everything rmi was removed in 11 if I understand https://openjdk.org/jeps/320 correctly.

like image 53
Johannes Hahn Avatar answered Nov 18 '25 20:11

Johannes Hahn



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!