Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

How Can This Be!!??!??!?

Options
  • 08-05-2006 9:58pm
    #1
    Closed Accounts Posts: 521 ✭✭✭


    import javax.swing.*;
    import java.awt.*;
    import java.lang.*;
    import Step1.*;
    import org.omg.CORBA.*;
    import org.omg.CosNaming.*;
    import org.omg.CosNaming.NamingContextPackage.*;
    import java.net.*;
    
    public class stepClient{
    	public static void main(String args[]){
    		try{
    
    			ORB orb = ORB.init(args, null);
    
    
    			org.omg.CORBA.Object objRef =	orb.resolve_initial_references("NameService");
    			NamingContext rootCtx = NamingContextHelper.narrow(objRef);
    			NameComponent nc = new NameComponent("Person", "");
    			NameComponent path[] = {nc};
    			signUp signRef = signUpHelper.narrow(rootCtx.resolve(path));
    
    			ClientOps callBackRef = new ClientOps_Tie(new ClientOpsImpl());
    
    
    			
    
    		}//try
    		catch(Exception e){
    			System.out.println("Error"+e);
    			e.printStackTrace(System.out);
    		}//catch
    	}//main
    }//class
    

    Doesnt work ERROR:
    C:\temp\Eoin\Step 1\stepClient.java:23: cannot resolve symbol
    symbol : class ClientOpsImpl
    location: class stepClient
    ClientOps callBackRef = new ClientOps_Tie(new ClientOpsImpl());
    ^
    1 error

    import java.io.*;
    import java.lang.*;
    import org.omg.CORBA.*;
    import HelloCallBack.*;
    import org.omg.CORBA.*;
    import org.omg.CosNaming.*;
    import org.omg.CosNaming.NamingContextPackage.*;
    
    import java.net.*;
    
    
    public class HelloPrimitivesClient
    {
        public static void main(String args[])
        {
    	try{
    	    // create and initialize the ORB
    	    ORB orb = ORB.init(args, null);
    
    
    		org.omg.CORBA.Object objRef =	orb.resolve_initial_references("NameService");
    		NamingContext rootCtx = NamingContextHelper.narrow(objRef);
    		NameComponent nc = new NameComponent("Hello", "");
    		NameComponent path[] = {nc};
    		Hello helloRef = HelloHelper.narrow(rootCtx.resolve(path));
    
    		ClientOps callBackRef = new ClientOps_Tie(new ClientOpsImpl()) ;
    
       		//String returnedString =
       		helloRef.registerCB(callBackRef);
    		//System.out.println(returnedString);
    
    		helloRef.chat("howdy","Eoin");
    
    
    		System.out.println("Client and ClientOps threads joined.");
    		testCall tc = new testCall(helloRef);
    
    		
    		} catch (Exception e) {
    		    System.out.println("ERROR : " + e) ;
    		    e.printStackTrace(System.out);
    			}
    
    	}
    }
    
    
    
    class ClientOpsImpl implements ClientOpsOperations{
    	public void callBack(String message) {
    		System.out.println(message) ;
    
    	}
    }
    
    
    
    
    This one does work...

    What is the difference? Apart from where one says signUp the other says Hello.

    If you need any other pieces of code let me know. Thishas baffaled me for some time now.

    Thank you for any help.


Comments

  • Closed Accounts Posts: 521 ✭✭✭EOA_Mushy


    Well.... Im stupid.
    but im sure every one can come up with a better insult please feel free.:o


  • Registered Users Posts: 137 ✭✭teresasaunt


    Would changing signUp to SignUp change anything? I'd a problem like this before and I think that solved it for some reason...


  • Closed Accounts Posts: 521 ✭✭✭EOA_Mushy


    Nope... just that the 1st code block is missing
    class ClientOpsImpl implements ClientOpsOperations{
    	public void callBack(String message) {
    		System.out.println(message) ;
    


  • Registered Users Posts: 841 ✭✭✭Dr Pepper


    Problem could be that the class ClientOps is in the package HelloCallBack which you have imported in the second example but not in the first ?


Advertisement