[prev in list] [next in list] [prev in thread] [next in thread] 

List:       jacorb-developer
Subject:    [jacorb-developer] (no subject)
From:       "Simone Bortolaso" <bortolaso () softhome ! net>
Date:       2000-10-25 14:26:03
Message-ID: 008801c03e8f$85bebfd0$0f3210ac () lss ! pllb ! it
[Download RAW message or body]

hi all , 

Why each time run the client with    
 
 jaco -DORBInitRef.NameService=corbaloc://pc000450.lss.pllb.it/NameService Trans

it catch the exception: 

Exception in thread "main" java.lang.NullPointerException:
at Trans.main(Trans.java:31)  ????? (The raw 89 is narrow on interpret; 
Namingservice run currenty in remote machine with Tao Orb.)

Thanks for all Simone.


Idl code:


module Translator {

 exception NotFound { string key; };

 interface Interpret {
  typedef sequence<unsigned short> jstring;
  typedef sequence<string> EntryList;
  typedef sequence<wstring> wEntryList;
  typedef sequence<jstring> jEntryList;
  wstring  translate  (in string  key,  in string language) raises (NotFound);
  wEntryList translateList (in EntryList key_list, in string language) raises \
(NotFound);  jstring  jTranslate  (in string  key,  in string language) raises \
(NotFound);  jEntryList jTranslateList (in EntryList key_list, in string language) \
raises (NotFound);  };

};


Trans.java code :

package user_manager; 

import java.io.*;
import Translator.*;
import Translator.InterpretPackage.*;

import javax.swing.*;
import java.awt.*;
import org.omg.CosNaming.*;

public class Trans{
 
 static public Interpret interpret = null; 
 // public static ORB orb;
 
 public static void main(String[] args){
    
  // Initialize the ORB
  
  // Get the Calculator reference from a file
   org.omg.CORBA.Object obj = null;
  
    org.omg.CORBA.ORB orb = org.omg.CORBA.ORB.init(args,null);
    
  try{   
  
    NamingContextExt naming_context_ = \
NamingContextExtHelper.narrow(orb.resolve_initial_references("NameService"));   \
NameComponent nc = new NameComponent("Translator", "");      NameComponent path[] = \
{nc};      
   interpret = InterpretHelper.narrow(naming_context_.resolve(path));
   
  }catch(org.omg.CORBA.ORBPackage.InvalidName e ){System.out.println("Naming context \
not found");}   catch(org.omg.CosNaming.NamingContextPackage.NotFound e \
){System.out.println("Naming context not found");}   \
catch(org.omg.CosNaming.NamingContextPackage.InvalidName e) \
{System.out.println("Invalid name");}     \
catch(org.omg.CosNaming.NamingContextPackage.CannotProceed e) \
{System.out.println("Cannot proceed");}     } 
 

}


[Attachment #3 (text/html)]

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META content="text/html; charset=iso-8859-1" http-equiv=Content-Type>
<META content="MSHTML 5.00.2919.6307" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#c0dcc0>
<DIV><FONT face=Arial size=2>hi all ,&nbsp;</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>Why each time&nbsp;run the 
client&nbsp;with&nbsp;&nbsp;&nbsp;&nbsp;<BR>&nbsp;<BR> jaco 
-DORBInitRef.NameService=corbaloc://pc000450.lss.pllb.it/NameService 
Trans</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>it catch the exception: </FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>Exception in thread "main" 
java.lang.NullPointerException:</FONT></DIV>
<DIV><FONT face=Arial size=2>at Trans.main(Trans.java:31)&nbsp; 
?????</FONT><FONT face=Arial size=2> (The raw 89 is narrow on interpret; 
<DIV><FONT face=Arial size=2>Namingservice run currenty in remote machine with 
Tao Orb.)</FONT></DIV></FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>Thanks for all Simone.</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>
<DIV><FONT face=Arial size=2>Idl code:</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>module Translator {</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>&nbsp;exception NotFound { string key; 
};</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>&nbsp;interface Interpret {<BR>&nbsp;&nbsp;typedef 
sequence&lt;unsigned short&gt; jstring;<BR>&nbsp;&nbsp;typedef 
sequence&lt;string&gt;&nbsp;EntryList;<BR>&nbsp;&nbsp;typedef 
sequence&lt;wstring&gt;&nbsp;wEntryList;<BR>&nbsp;&nbsp;typedef 
sequence&lt;jstring&gt;&nbsp;jEntryList;<BR>&nbsp;&nbsp;wstring&nbsp;&nbsp;translate&nbsp;&nbsp;(in \
 string&nbsp;&nbsp;key,&nbsp;&nbsp;in string language)&nbsp;raises 
(NotFound);<BR>&nbsp;&nbsp;wEntryList&nbsp;translateList&nbsp;(in 
EntryList&nbsp;key_list,&nbsp;in string language)&nbsp;raises 
(NotFound);<BR>&nbsp;&nbsp;jstring&nbsp;&nbsp;jTranslate&nbsp;&nbsp;(in 
string&nbsp;&nbsp;key,&nbsp;&nbsp;in string language)&nbsp;raises 
(NotFound);<BR>&nbsp;&nbsp;jEntryList&nbsp;jTranslateList&nbsp;(in 
EntryList&nbsp;key_list,&nbsp;in string language)&nbsp;raises 
(NotFound);<BR>&nbsp;};</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>};</FONT></DIV>
<DIV>&nbsp;</DIV></FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>Trans.java code :</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>package user_manager; </FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>import java.io.*;<BR>import Translator.*;<BR>import 
Translator.InterpretPackage.*;</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>import javax.swing.*;<BR>import 
java.awt.*;<BR>import org.omg.CosNaming.*;</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>public class Trans{<BR>&nbsp;<BR>&nbsp;static 
public Interpret interpret = null; <BR>&nbsp;//&nbsp;public static ORB 
orb;<BR>&nbsp;<BR>&nbsp;public static void main(String[] 
args){<BR>&nbsp;&nbsp;&nbsp;&nbsp;<BR>&nbsp;&nbsp;// Initialize the 
ORB<BR>&nbsp;&nbsp;<BR>&nbsp;&nbsp;// Get the Calculator reference from a 
file<BR>&nbsp; &nbsp;org.omg.CORBA.Object obj = 
null;<BR>&nbsp;&nbsp;</FONT></DIV>
<DIV><FONT face=Arial size=2>&nbsp;&nbsp;&nbsp; org.omg.CORBA.ORB orb = 
org.omg.CORBA.ORB.init(args,null);<BR>&nbsp;&nbsp;&nbsp; <BR>&nbsp;&nbsp;try{ 
&nbsp;&nbsp;<BR>&nbsp;&nbsp;<BR>&nbsp;&nbsp;&nbsp; NamingContextExt 
naming_context_ = 
NamingContextExtHelper.narrow(orb.resolve_initial_references("NameService"));&nbsp;<BR>&nbsp;&nbsp;&nbsp;NameComponent \
 nc = new NameComponent("Translator", 
"");&nbsp;&nbsp;&nbsp;&nbsp;<BR>&nbsp;&nbsp;&nbsp;NameComponent path[] = 
{nc};&nbsp;&nbsp;&nbsp;&nbsp;<BR>&nbsp;&nbsp;&nbsp;<BR>&nbsp;&nbsp;&nbsp;interpret 
= 
InterpretHelper.narrow(naming_context_.resolve(path));<BR>&nbsp;&nbsp;&nbsp;<BR>&nbsp;&nbsp;}catch(org.omg.CORBA.ORBPackage.InvalidName \
 e ){System.out.println("Naming context not 
found");}&nbsp;<BR>&nbsp;&nbsp;catch(org.omg.CosNaming.NamingContextPackage.NotFound 
e ){System.out.println("Naming context not 
found");}&nbsp;<BR>&nbsp;&nbsp;catch(org.omg.CosNaming.NamingContextPackage.InvalidName \
 e) {System.out.println("Invalid name");}&nbsp;&nbsp; 
<BR>&nbsp;&nbsp;catch(org.omg.CosNaming.NamingContextPackage.CannotProceed e) 
{System.out.println("Cannot proceed");}&nbsp;&nbsp; 
<BR>&nbsp;}&nbsp;<BR>&nbsp;</FONT></DIV>
<DIV><FONT face=Arial size=2><BR>}</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV></BODY></HTML>



[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic