Fehlermeldung (Corba)

Status
Nicht offen für weitere Antworten.

chipmount

Aktives Mitglied
hi
ich habe folgende fehlermeldung (beim ausführen von server programm) weis aber nich wieso und wie ich es bechebe:

Code:
 Exception in thread "main" java.lang.NoClassDefFoundError: org/omg/PortableServer/Servant

meine IDL datei:
Code:
    module Bestellung
{
	interface DB_Manager
{
	string getText();
	long getAnzahl();
};
};

mein Client:
Code:
import Bestellung.*;
import org.omg.CosNaming.*;
//import org.omg.CosNaming.NamingContextPackage.*;
import org.omg.CORBA.*;

public class Client
{
  static DB_Manager DB_ManagerImpl;

  public static void main(String args[])
    {
      try{
        // create and initialize the ORB
	ORB orb = ORB.init(args, null);

        // get the root naming context
        org.omg.CORBA.Object objRef = 
	    orb.resolve_initial_references("NameService");
        // Use NamingContextExt instead of NamingContext. This is 
        // part of the Interoperable naming Service.  
        NamingContextExt ncRef = NamingContextExtHelper.narrow(objRef);
 
        // resolve the Object Reference in Naming
 DB_Manager serverRef = DB_ManagerHelper.narrow(ncRef.resolve_str("DB_Manager"));
 		String text = serverRef.getText();
 		System.out.println(text);
		int zahl = serverRef.getAnzahl();		
        System.out.println("der " + zahl + ". Aufruf");
        

	}
	 catch (Exception e) {
          System.out.println("ERROR : " + e) ;
	  e.printStackTrace(System.out);
	  }
    }

}

mein server:
Code:
import Bestellung.*;
import org.omg.CosNaming.*;
import org.omg.CosNaming.NamingContextPackage.*;
import org.omg.CORBA.*;
import org.omg.PortableServer.*;
import org.omg.PortableServer.POA;
import java.util.Properties;
//import java.sql.*;
//import java.util.*;

class DB_ManagerImpl extends DB_ManagerPOA
{
  
   int zaehler = 0;
   public String getText()
   {
   	return "\nHallo, hier ist der Server\n";
   }
   public int getAnzahl()
   {
   	return ++zaehler;
   }
  }
 
  
public class Server {

  public static void main(String args[]) {
    try{
      // create and initialize the ORB
      ORB orb = ORB.init(args, null);

      // get reference to rootpoa & activate the POAManager
      POA rootpoa = POAHelper.narrow(orb.resolve_initial_references("RootPOA"));
      rootpoa.the_POAManager().activate();

      // create servant and register it with the ORB
      DB_ManagerImpl serverImpl = new DB_ManagerImpl();
      

      // get object reference from the servant
      org.omg.CORBA.Object ref = rootpoa.servant_to_reference(serverImpl);
      DB_Manager sRef = DB_ManagerHelper.narrow(ref);
	  
      // get the root naming context
      org.omg.CORBA.Object objRef =
          orb.resolve_initial_references("NameService");
      // Use NamingContextExt which is part of the Interoperable
      // Naming Service (INS) specification.
      NamingContextExt ncRef = NamingContextExtHelper.narrow(objRef);

      // bind the Object Reference in Naming
      NameComponent path[] = ncRef.to_name( "DB_Manager" );
      ncRef.rebind(path, sRef);
     
      // wait for invocations from clients
      orb.run();
    } 
	
      catch (Exception e) {
        System.err.println("ERROR: " + e);
        e.printStackTrace(System.out);
      }
	  
     }
}

compiliert wird wie folgt:

idlj -fall ...idl
javac Server.java Bestellung\*.java
javac Client.java

ausführung

tnameserv
java Server
java Client
 

Bleiglanz

Gesperrter Benutzer
Du weisst nicht, wie du eine ClassNotFoundException behebst und willst CORBA Programme schreiben :) das wird hart

Such mal im Forum unter "Classpath"
 
M

mehlvogel

Gast
Liegt denn in dem dir gegebenen Classpath auch die Dateien für den org.omg.* Kram? Oder liegt da nur das SDK?
 

chipmount

Aktives Mitglied
ne, da ligt nur sdk

was muss ich noch in die classpath einsetzen??

nach meiner meinung nach findet er doch dass nicht


Code:
 org/omg/[u]PortableServer/Servant [/u]

oder??
 
M

mehlvogel

Gast
Sieht so aus, was denkst du denn was da rein muss, wenn er das net findet? Wo liegt das denn bei dir? Inner jar Datei oder liegt das so im Dateisystem irgendwo rum?
 

chipmount

Aktives Mitglied
ich weis es nicht wo es nach der kompieleirung landet
ich habe nirgendswo in der docu was darüber gelesen das man da was eintragen muss
 

chipmount

Aktives Mitglied
ich verstehe die welt nicht mehr das selbe programm, die selben einstellungen funktioniert mit win 2000 aber nicht mit xp :roll:
 
Status
Nicht offen für weitere Antworten.

Ähnliche Java Themen

Neue Themen


Oben