I try to run the following Code:
package exampleApp;
import org.omg.CORBA.ORB;
import org.omg.CosNaming.NameComponent;
import org.omg.CosNaming.NamingContextExt;
import org.omg.CosNaming.NamingContextExtHelper;
import org.omg.PortableServer.POA;
import org.omg.PortableServer.POAHelper;
public class Server {
public static void main(String[] args) {
try {
// create and initialize the ORB //// get reference to rootpoa & activate
// the POAManager
ORB orb = ORB.init(args, null);
POA rootpoa = POAHelper.narrow(orb.resolve_initial_references("RootPOA"));
rootpoa.the_POAManager().activate();
// create servant and register it with the ORB
TpImpl my = new TpImpl();
my.setORB(orb);
// get object reference from the servant
org.omg.CORBA.Object ref = rootpoa.servant_to_reference(my);
tp href = tpHelper.narrow(ref);
org.omg.CORBA.Object objRef = orb.resolve_initial_references("NameService");
NamingContextExt ncRef = NamingContextExtHelper.narrow(objRef);
NameComponent path[] = ncRef.to_name("ABC");
ncRef.rebind(path, href);
System.out.println("Server Run now !! ...");
// wait for invocations from clients
for (;;) {
orb.run();
}
}
catch (Exception e) {
System.err.println("ERROR: " + e);
e.printStackTrace(System.out);
}
}
}
Unfortunately I get the following Error:
java.lang.ClassNotFoundException: org.jacorb.orb.ORB
at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:641)
at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:188)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:525)
at java.base/java.lang.Class.forName0(Native Method)
at java.base/java.lang.Class.forName(Class.java:375)
at org.omg.CORBA.ORB.create(ORB.java:94)
at org.omg.CORBA.ORB.init(ORB.java:63)
at exampleApp.Server.main(Server.java:16)
ERROR: org.omg.CORBA.INITIALIZE: Could not instantiate ORB implementation: org.jacorb.orb.ORB
org.omg.CORBA.INITIALIZE: Could not instantiate ORB implementation: org.jacorb.orb.ORB
at org.omg.CORBA.ORB.create(ORB.java:99)
at org.omg.CORBA.ORB.init(ORB.java:63)
at exampleApp.Server.main(Server.java:16)
I have no idea how to fix that. I Am using java 1.8 and I am bascially just following a youtube tutorial: https://www.youtube.com/watch?v=cxINElSCk3w. I checked multiple times that i did everything like it was shown in the video.
Thanks for your help