Re: [g-a-devel]FreeTTS Support in GNOME Speech



Hi Marc,

The reason you're having problems is that there is a null pointer
exception being thrown in Java.

The code you have doesn't allocate the VoiceInfo itself, the
call to "new Voiceinfo[1]" only allocates that array. Also,
because CORBA is not able to pass null pointers across the wire
you will also need to initialize the FULL structure for the VoiceInfo.
Luckily there's a simple conscructor generated...

So you're code should probably read:

    VoiceInfo voices[];
    voices = new VoiceInfo[1];
    voices[0] = new VoiceInfo("default", (short)0,
                              voice_gender.gender_male);
    return voices;

BTW, I made this change and found that similar things seem to
happen later... So there's probably more of these to come :(

Also, in test-speech/test-speech.c you don't check the
for an exception after the return of the getVoices call - which
is really worth doing when using CORBA and would have shown you
the CORBA exception that's occurring here.

The best way I've found to track down bugs when using Java's CORBA
ORB and ORBit2 was to use the debugging capabilities of these
modules.

ORBit2 has the "ORBIT2_DEBUG" environment variable which is enabled
when you configure ORBit2 with the --enable-debug option. It takes
values like:

    traces
    inproc_traces
    timings
    types
    messages
    errors
    objects
    giop
    refs

seperated with a ":" (colon), ie:

	ORBIT2_DEBUG=messages:giop

As for Java there are similar options which can be enabled by setting
the property "com.sun.CORBA.ORBDebug", to a comma seperated subset of:

    transport
    subcontract
    poa
    orbd
    naming
    serviceContext
    transientObjectManager
    giopVersion
    shutdown
    giop

An example of how to do this is :

	java -Dcom.sun.CORBA.ORBDebug=giop,subcontract

NOTE that the GIOP output can be quite verbose, but is probably the
most useful, but sometimes other values can expose something hidden
by the verbosity of the tracing...

Once you've narrowed down the location of the problem in Java, the
best thing to do next is to put a "try / catch" around the whole
method and print out the stacktrace of the exception (if there is one)
using printStackTrace() method of the Exception class...

Hope that this helps,

Darren.


Marc Mulcahy wrote:
Hi All:

I am trying to implement the getAllVoices call in GNOME Speech 0.2 for FreeTTS:

  enum voice_gender {
    gender_male,
    gender_female
  };

  struct VoiceInfo {
    string name;
    short language;
    voice_gender gender;
  };

  typedef sequence<VoiceInfo> VoiceInfoList;
...
VoiceInfoList getAllVoices ();

The Java idl compiler translates this to:

org.GNOME.Speech.VoiceInfo[] getAllVoices ()

So, I'm creating an array of VoiceInfos:

VoiceInfo[] voices;
voices = new VoiceInfo[1];
voices[1] = new VoiceInfo ();
voices[1].name = new String ("deault");
...

And it compiles. What I get back on the ORBit2 client side is a Nill object. Any ideas what I might be doing wrong, or what might be happening here?

Marc

_______________________________________________
Gnome-accessibility-devel mailing list
Gnome-accessibility-devel gnome org
http://mail.gnome.org/mailman/listinfo/gnome-accessibility-devel




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]