Archived

This forum has been archived. Please start a new discussion on GitHub.

UserException but catches Ice.UnmarshalOutOfBoundsException

I want to throw a UserExaption (defined in the Slice), but I get a Ice.UnmarshalOutOfBoundsException.
I have Client and Server on the same Windows 2000 machine. I'm using Ice-3.0.1. Everthing works except the exception throwing.


my slice is:

module server {
exception CSAException {
string reason;
};

interface CommServer {
nonmutating AllSliceChecksumDict getAllSliceChecksums() throws CSAException;
};
};

my CommServerI class:

public Map[] getAllSliceChecksums(Current __current) throws CSAException {
// my java code
if(true){
throw new CSAException("test my CSAException");
}
return allCkecksums;
}

On the client I get following Stacktrace:

Ice.UnmarshalOutOfBoundsException
reason = (null)
at IceInternal.BasicStream.readSize(BasicStream.java:552)
at IceInternal.BasicStream.readString(BasicStream.java:1068)
at IceInternal.BasicStream.throwException(BasicStream.java:1433)
at server.server._CommServerDelM.getAllSliceChecksums(_CommServerDelM.java:32)
at server.server.CommServerPrxHelper.getAllSliceChecksums(CommServerPrxHelper.java:35)
at server.server.CommServerPrxHelper.getAllSliceChecksums(CommServerPrxHelper.java:20)
at ControllerMain.<init>(ControllerMain.java:65)
at ControllerMain.getInstance(ControllerMain.java:37)
at ControllerMain.controllerStart(ControllerMain.java:168)
at ControllerMain.main(ControllerMain.java:230)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at com.intellij.rt.execution.application.AppMain.main(AppMain.java:90)


Could it be the 2 Object write to the BasicStream? Even though I'm using one thread only.

Any ideas?
thanks

Comments

  • mes
    mes California
    Welcome to the forum.

    Please update your signature as described in this announcement regarding our support policies on this forum.

    Also, if you search the forum for "UnmarshalOutOfBoundsException", you might find the answer to your problem. For example, see this post.

    Take care,
    - Mark
  • Hi got the same Issue when...

    Hiiiii!!!
    I got the same Issue when I am trying to extract data from my Server...

    Ice.UnmarshalOutOfBoundsException
    reason = (null)
    at IceInternal.BasicStream.readTypeId(BasicStream.java:608)
    at IceInternal.BasicStream.readObject(BasicStream.java:1332)
    at EGMInterface.XStructSeqHelper.read(XStructSeqHelper.java:42)
    at EGMInterface._EGMConDelM.GetEGMData(_EGMConDelM.java:48)
    at EGMInterface.EGMConPrxHelper.GetEGMData(EGMConPrxHelper.java:49)
    at EGMInterface.EGMConPrxHelper.GetEGMData(EGMConPrxHelper.java:20)
    at client.main(client.java:25)

    Looks like I have got this error when
    I am calling a method, but right now I am not too sure about what is happening...
    :D
    I am searching 4 it, but Ice is a little new to me... (just 2 days seen it... XD) i am little lost in the maze... but I am sure that I'll find a way... But if you have any idea about when I got this error message, thats gonna help me a lot...
  • Well my Isse began here...

    @SuppressWarnings(&quot;unchecked")
    private IXSeriesEgmData[]
    GetEGMData(short[] IDs, java.util.Map<String, String> __ctx, boolean __explicitCtx)
    {
    for (int i=0;i<IDs.length;i++)
    System.out.println(IDs); //IDs are short type reference to projects structure
    //that have the data...
    if(__explicitCtx && __ctx == null)
    {
    __ctx = _emptyContext;
    }
    int __cnt = 0;
    while(true)
    {
    Ice._ObjectDel __delBase = null;
    try
    {
    __checkTwowayOnly("GetEGMData");
    __delBase = __getDelegate();
    _EGMConDel __del = (_EGMConDel)__delBase;
    System.out.println("Here other call!!!");
    return __del.GetEGMData(IDs, __ctx); /In this return is the error :o
    /*
    IXSeriesEgmData[] GetEGMData(short[] IDs, java.util.Map<String, String> __ctx) throws IceInternal.LocalExceptionWrapper;
    This function is called...
    But here i lost the sequence... T_T
    */
    }
    catch(IceInternal.LocalExceptionWrapper __ex)
    {
    __handleExceptionWrapper(__delBase, __ex);
    }
    catch(Ice.LocalException __ex)
    {
    __cnt = __handleException(__delBase, __ex, __cnt);
    }
    }
    }

    Basically an iterface named _EGMConDel is called... then well... Polymorphism but with whom.. XD... Searching searching!!! :rolleyes:
  • benoit
    benoit Rennes, France
    Hi,

    Are you using the [noparse]["java:package"][/noparse] metadata in your Slice definitions? If you do, then as Mark explained in this post, the most likely reason is that you're not setting the Ice.Default.Package or Ice.Package.[module] property. See here for more information.

    Cheers,
    Benoit.
  • :) I'm gonna check it...

    Thanks Benoit!!!

    I'll read all the info... :D

    Thanks a lot!!!
  • Yataaa!!!

    :cool: :cool:
    Victory!!!

    You was right Benoit!!! It was what you say and some error that I made in the Servant Class.
    :)

    Now I have to fix some exception, but thats other story... XD
    When the game is over I'll give you a free pass... lol

    Well thanks a lot...