Results 1 to 3 of 3

Thread: IceV3.11 java client and vc7.0Server : java.lang.NullPointerException?

  1. #1
    zhoubin is offline Registered User
    Name: bin ge
    Organization: proffessional
    Project: partyManage
    Join Date
    Nov 2006
    Location
    beijing
    Posts
    13

    IceV3.11 java client and vc7.0Server : java.lang.NullPointerException?

    I'm a new ICE user,When I did a test.I Met a exception like the title.

    I have a simple interface that looks like this:

    #ifndef _APG_INTERFACE
    #define _APG_INTERFACE

    #include <CommonDef.ice>

    module APG
    {
    struct Strategy
    {
    string id;
    };

    enum Type
    {
    a,
    b,
    c
    };

    struct Test
    {
    string id;
    int n;
    Type camptype;
    Strategy strategyinfo;
    };

    interface APGInterface
    {
    long printftest(Test Campaign);
    };
    };

    I have a test at the java client like below:

    ic = Ice.Util.initialize();
    Ice.ObjectPrx base = ic.stringToProxy(
    "AppGateway:default -h 10.130.16.11 -p 10000");
    APG.APGInterfacePrx apgInerprx = APG.APGInterfacePrxHelper.checkedCast(base);
    Test ts = new Test();
    ts.id ="nihoa";
    ts.n= 3;
    //ts.camptype = Type.a; //ts.strategyinfo = new Strategy();
    apgInerprx.printftest(ts);

    if I don't give value to the enum type "camptype ",or I don't give value to the struct type "strategyinfo ", I met exception like below:
    java.lang.NullPointerException
    at APG.Test.__write(Test.java:112)
    at APG._APGInterfaceDelM.printftest(_APGInterfaceDelM .java:1193)
    at APG.APGInterfacePrxHelper.printftest(APGInterfaceP rxHelper.java:783)
    at APG.APGInterfacePrxHelper.printftest(APGInterfaceP rxHelper.java:769)
    thank you!

  2. #2
    matthew's Avatar
    matthew is offline ZeroC Staff
    Name: Matthew Newhook
    Organization: ZeroC, Inc.
    Project: Internet Communications Engine
    Join Date
    Feb 2003
    Location
    NL, Canada
    Posts
    1,458
    This is expected. See the "Null Parameters" section in the Client-Side Slice-to-Java mapping chapter in the Ice manual.

  3. #3
    zhoubin is offline Registered User
    Name: bin ge
    Organization: proffessional
    Project: partyManage
    Join Date
    Nov 2006
    Location
    beijing
    Posts
    13

    thanks matthew:

    Quote Originally Posted by matthew
    This is expected. See the "Null Parameters" section in the Client-Side Slice-to-Java mapping chapter in the Ice manual.
    thank you,matthew.I will look up the Ice manual.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. NullPointerException Outgoing.java:147
    By MarcinK in forum Help Center
    Replies: 1
    Last Post: 09-28-2010, 09:34 AM
  2. Replies: 6
    Last Post: 01-26-2007, 05:35 AM
  3. java.lang.NullPointerException
    By David in forum Help Center
    Replies: 1
    Last Post: 09-27-2006, 11:02 AM
  4. java.lang.StackOverflowError
    By brian in forum Help Center
    Replies: 1
    Last Post: 03-12-2004, 07:21 AM
  5. java.lang.StackOverflowErrors
    By brian in forum Help Center
    Replies: 1
    Last Post: 10-28-2003, 04:42 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •