[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 , </FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>Why each time run the
client with <BR> <BR> jaco
-DORBInitRef.NameService=corbaloc://pc000450.lss.pllb.it/NameService
Trans</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2>it catch the exception: </FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </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)
?????</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> </DIV>
<DIV><FONT face=Arial size=2>Thanks for all Simone.</FONT></DIV>
<DIV> </DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2>
<DIV><FONT face=Arial size=2>Idl code:</FONT></DIV>
<DIV> </DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2>module Translator {</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2> exception NotFound { string key;
};</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2> interface Interpret {<BR> typedef
sequence<unsigned short> jstring;<BR> typedef
sequence<string> EntryList;<BR> typedef
sequence<wstring> wEntryList;<BR> typedef
sequence<jstring> jEntryList;<BR> wstring translate (in \
string key, in string language) raises
(NotFound);<BR> wEntryList translateList (in
EntryList key_list, in string language) raises
(NotFound);<BR> jstring jTranslate (in
string key, in string language) raises
(NotFound);<BR> jEntryList jTranslateList (in
EntryList key_list, in string language) raises
(NotFound);<BR> };</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2>};</FONT></DIV>
<DIV> </DIV></FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2>Trans.java code :</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2>package user_manager; </FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2>import java.io.*;<BR>import Translator.*;<BR>import
Translator.InterpretPackage.*;</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2>import javax.swing.*;<BR>import
java.awt.*;<BR>import org.omg.CosNaming.*;</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2>public class Trans{<BR> <BR> static
public Interpret interpret = null; <BR> // public static ORB
orb;<BR> <BR> public static void main(String[]
args){<BR> <BR> // Initialize the
ORB<BR> <BR> // Get the Calculator reference from a
file<BR> org.omg.CORBA.Object obj =
null;<BR> </FONT></DIV>
<DIV><FONT face=Arial size=2> org.omg.CORBA.ORB orb =
org.omg.CORBA.ORB.init(args,null);<BR> <BR> try{
<BR> <BR> NamingContextExt
naming_context_ =
NamingContextExtHelper.narrow(orb.resolve_initial_references("NameService")); <BR> NameComponent \
nc = new NameComponent("Translator",
""); <BR> NameComponent path[] =
{nc}; <BR> <BR> interpret
=
InterpretHelper.narrow(naming_context_.resolve(path));<BR> <BR> }catch(org.omg.CORBA.ORBPackage.InvalidName \
e ){System.out.println("Naming context not
found");} <BR> catch(org.omg.CosNaming.NamingContextPackage.NotFound
e ){System.out.println("Naming context not
found");} <BR> catch(org.omg.CosNaming.NamingContextPackage.InvalidName \
e) {System.out.println("Invalid name");}
<BR> catch(org.omg.CosNaming.NamingContextPackage.CannotProceed e)
{System.out.println("Cannot proceed");}
<BR> } <BR> </FONT></DIV>
<DIV><FONT face=Arial size=2><BR>}</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV></BODY></HTML>
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic