[omniORB] application attempted to invoke an operation on a nil reference

Wittstruck, Nicholas Nicholas.Wittstruck at student.hpi.uni-potsdam.de
Wed Jun 30 23:15:29 BST 2010


My original entry was: http://www.omniorb-support.com/pipermail/omniorb-list/2010-June/030659.html
I don't know how I messed that up ;)

Yes, the pi(in string id) method is called. The output gets printed, and code within will be executed. But when the execution finishes the program crashes. I'm not using JacORB, I'm using the Sun Orb.

This is just a wild guess, but since I'm not very familiar with the omniORB or C++, this info might help: I removed the String parameter from the pi(in string id) method, changing the idl to:

----
module calculator
{
    interface Functions : Plugin
    {
attribute GuiManager manager;
void pi();
    };
};

----

Without the parameter my code does not crash. But I really can't understand why the code crashes after execution of the method, and furthermore, why removing a parameter helps?!
Does this user: http://www.omniorb-support.com/pipermail/omniorb-list/2002-November/022368.html has the same problem?
Though it seems as if he couldn't figure out a solution as well.


Nicholas




On 30.06.2010, at 21:59, Thomas Lockhart wrote:

> ... I get another error now - regardless wether I
> do anything in the pi method or not, the application crashes after
> its exceution. I've added my IDL file. Do you know why this
> happens?

I've already lost the original email with your code snippets so this is just speculation:

If you are changing your interface definitions make sure that your Java and C++ code have been compiled with the same version of IDL.

If you are really getting the pi() method in your C++ object then you probably have a reference problem. btw, you did not mention which Java ORB you are using. JacORB, right? The ORB delivered with Sun's jre is deficient in some features (or at least was in the past).

> Thank you btw for the book recommendation :) Ordered it right now.

An aside (sort of): the book will recommend against using attributes in IDL. This is the best book I've run across for CORBA (nothing else is close) partly because it does make suggestions and recommendations on what to do or what to use in the standard and what to leave alone.

hth

                              - Tom


----
omniORB: Receive codeset service context and set TCS to (ISO-8859-1,UTF-16)
omniORB: Dispatching remote call 'pi' to: root<0> (active)
manager is not null
00491CC8
omniORB: Invoke 'setText' on remote: key<.........t..................RootPO=
A....
..........>
omniORB: sendChunk: to giop:tcp:192.168.0.102:58808 117 bytes
omniORB:
4749 4f50 0102 0100 6900 0000 0800 0000 GIOP....i.......
0300 0000 0000 0000 3100 0000 afab cb00 ........1.......
0000 0020 8974 e70d 0000 0001 0000 0000 ... .t..........
0000 0001 0000 0008 526f 6f74 504f 4100 ........RootPOA.
0000 0008 0000 0001 0000 0000 1420 3030 ............. 00
0800 0000 7365 7454 6578 7400 0000 0000 ....setText.....
0800 0000 6469 7370 6c61 7900 0500 0000 ....display.....
7465 7874 00                            text.
omniORB: inputMessage: from giop:tcp:192.168.0.102:58808 34 bytes
omniORB:
4749 4f50 0102 0001 0000 0016 0000 0008 GIOP............
0000 0000 0000 0001 4e45 4f00 0000 0002 ........NEO.....
0014                                    ..
omniORB: Return 'setText' on remote: key<.........t..................RootPO=
A....
..........>
omniORB: sendChunk: to giop:tcp:[::ffff:192.168.0.102]:58811 24 bytes
omniORB:
4749 4f50 0102 0101 0c00 0000 0600 0000 GIOP............
0000 0000 0000 0000                     ........
----

idl files:

----=20
#include "gui.idl"
module calculator
{
    interface Functions : Plugin
    {
                attribute GuiManager manager;
                void pi(in string id);
    };
};

module calculator
{
    interface GuiManager
    {
        exception NotSupportedForType
        {
            string reason;
        };

        exception ElementNotFoundException
        {
            string reason;
        };


        void initializeUserInterface(in string xml);
        void insertIntoUserInterface(in string xml, in string id);
        void updateUserInterface(in string xml);

        void setText(in string id, in string text) raises(NotSupportedForTy=
pe, ElementNotFoundException);
        string getText(in string id) raises(NotSupportedForType, ElementNot=
FoundException);
    };


    interface Plugin
    {
        void initializePlugin(in GuiManager manager);
    };
};

---- =

_______________________________________________
omniORB-list mailing list
omniORB-list at omniorb-support.com<mailto:omniORB-list at omniorb-support.com>
http://www.omniorb-support.com/mailman/listinfo/omniorb-list






More information about the omniORB-list mailing list