Help needed with visibroker

Help needed with visibroker

Post by debopa » Tue, 12 Oct 2004 18:04:01


i All,
I am developing an application using Visibroker. I have created a IDL as
follows:-
============== Start of IDL ==============
module ciims
{
module idl
{
typedef sequence<octet> Message;
interface UserContext;
/* ------------- Enumerations ------------- */
enum ExecutionMode
{
CIIMS_NORMAL_MODE,
CIIMS_TRAINING_MODE
};

enum LanguageType
{
CIIMS_ENGLISH,
CIIMS_CHINESE
};

enum SessionTerminateOption
{
CIIMS_NORMAL,
CIIMS_IMMEDIATE
};

/* ------------- Structs ------------- */
struct CompletionPacket
{
string version;
string returnCode;
long messageCount;
Message messageText;
};

struct ConnectCompletionPacket
{
string version;
string return_code;
Message message_text;
long maximum_message_size;
long minimum_keep_alive_interval;
long inactive_time_out;
ExecutionMode execution_mode;
LanguageType language_type;
string subsystem_id;
string privilege;
};

struct ConnectOptionPacket
{
string user_id;
string password;
string subsystem_id;
};

struct TerminateOptionPacket
{
string subsystem_id;
SessionTerminateOption terminate_option;
};


/* ------------- Interfaces ------------- */
interface Base
{
short destroy();
};

interface EntryPoint: Base
{
UserContext connect (out ConnectCompletionPacket
messageCompletion,
in ConnectOptionPacket messageOption,
inout Message messageBody);
};

interface UserContext: Base
{
short keepAlive (out CompletionPacket messageCompletion);
short disconnect (out CompletionPacket messageCompletion,
in TerminateOptionPacket messageOption,
inout Message messageBody);
};
};
};
============== End of IDL ==============

Using the above idl, i have generated the classes using idl2java.
Then i have created a server, whose code is as follows:-

============== Start of Server Code ==============
package ciims.rtib.server;

import org.omg.PortableServer.LifespanPolicyValue;
import org.omg.PortableServer.POA;
import org.omg.PortableServer.POAHelper;

public class ServerMain
{
public static void main(String args[])
{
int status = 0;
org.omg.CORBA.ORB orb = null;
try
{
// Initialize the ORB.
orb = org.omg.CORBA.ORB.init(args,null);
status = run(orb);
}
catch(Exception ex)
{
ex.printStackTrace();
status = 1;
}
if(orb != null)
{
try
{
orb.destroy();
}
catch(Exception ex)
{
ex.printStackTrace();
status = 1;
}
}
System.exit(status);
}//main
static int run(org.omg.CORBA.ORB orb) throws
org.omg.CORBA.UserException
{
org.omg.PortableServer.POAManager manager;
POA rootPOA;
org.omg.PortableServer.POA myPOA;
try
{
// get a reference to the root POA
rootPOA
=POAHelper.narrow(orb
 
 
 

Help needed with visibroker

Post by woyn » Wed, 13 Oct 2004 03:55:22

haven't used "out" parameters in ages, but I don't believe you
can attempt to marshall null attributes. It appears that you're
allocating a ConnectCompletionPacket (struct) object, but the
attributes aren't being initialized, as the code is commented-out.
Since uninitialized strings are null in Java, and CORBA doesn't
allow null (primitive) values, this may be causing your problem.

Why don't you try setting the struct string attributes to "".

Mark



"debopam" < XXXX@XXXXX.COM > wrote in message news:< XXXX@XXXXX.COM >...

 
 
 

Help needed with visibroker

Post by luzuli200 » Wed, 13 Oct 2004 16:39:30

eems like some java exception is being thrown on the server side (e.g. NPE)

On the server, set the following property:
vbroker.orb.warn=2

Re-run your application and note the actual exception thrown.

If above property does not help, set following additional props:
vbroker.orb.debug=true
vbroker.orb.logLevel=debug

HTH
LL

"debopam" < XXXX@XXXXX.COM > wrote in message news:< XXXX@XXXXX.COM >...