Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Corba error by invoke an remote Method

2 views
Skip to first unread message

brunhilde

unread,
Feb 5, 2002, 3:16:46 AM2/5/02
to
Hi,

I am new in the Corba world and I develop my first
Client/Server Application via visibroker ORB.

I have the following idl declaration:
....
interface RemoteCall {

typedef sequence<string> string_array;

string_array getAllLibGroups(in long long sessionid);

...

What I do:
1. idl2java for generating the remote stuff
2. I implementing the Class ApplicationImpl extends ApplicationPOA and
have implemented the getAllLibGroups(in long long sessionid);- Methode
In Java it looks so:
public String[] getAllLibGroups(long sessionid){
String[] libGroups = null;
int i = 0;
String getsessionid = null;
getsessionid = new Long(getsessionid).toString();
System.out.println("Huuu bin in RemoteCallImpl!");
this.session = new srs.Session(getsessionid);
if (session == null) return null;
srs.LibGroupList groups = session.groups();
if (groups == null) return null;
srs.StrList libGrpNamesList = groups.names();
Vector group_vector = libGrpNamesList.getAll();
for (Enumeration e = group_vector.elements() ; e.hasMoreElements() ;) {
System.out.println((String)e.nextElement());
//libGroups[i] = (String)e.nextElement();
i++;
}
return libGroups;
}

3. I implemented the Server class.
4. I implemented the Client class.

Now when I start the Client I have the following error:
org.omg.CORBA.UNKNOWN: minor code: 0 completed: No
at java.lang.Class.newInstance0(Native Method)
at java.lang.Class.newInstance(Class.java:237)
at com.inprise.vbroker.orb.SE.read(SE.java:28)
at com.inprise.vbroker.orb.DelegateImpl.handleReply(DelegateImpl.java:711)
at com.inprise.vbroker.orb.DelegateImpl.invoke(DelegateImpl.java:606)
at org.omg.CORBA.portable.ObjectImpl._invoke(ObjectImpl.java:459)
at srsproxy._RemoteCallStub.getAllLibGroups(_RemoteCallStub.java:90)
at Client.main(Client.java:54)

Know anyone what is wrong or have anyone an idea what it can be?????

Thanks,
Brunhilde

dspublic-REMOVE THIS AND HYPENS-

unread,
Feb 6, 2002, 1:16:04 AM2/6/02
to
An Unknown usually means the server process raised an exception that
was not handled, since your method getAllLibGroups(*) did not raise an
exception, any exception that occurs in that method will raise an
unknown. My recommendation is you put a try catch in the method, and
log any failures. The best to do is to raise an exception if any of
the calls inside that method could fail (db access..). This will be a
cleaner implementation
Don Stacy
Enron

Erik Post

unread,
Feb 6, 2002, 4:13:08 AM2/6/02
to
brunhilde wrote:
> Hi,
>
> I am new in the Corba world and I develop my first
> Client/Server Application via visibroker ORB.
>
> I have the following idl declaration:
> .....

> interface RemoteCall {
>
> typedef sequence<string> string_array;
>
> string_array getAllLibGroups(in long long sessionid);
>
> ....

>
> What I do:
> 1. idl2java for generating the remote stuff
> 2. I implementing the Class ApplicationImpl extends ApplicationPOA and
> have implemented the getAllLibGroups(in long long sessionid);- Methode
> In Java it looks so:
> public String[] getAllLibGroups(long sessionid){
> String[] libGroups = null;
[snip]

> if (session == null) return null;
[snip]

> if (groups == null) return null;
[snip]
> return libGroups;
> }

You have to return a valid value from your getAllLibGroups operation. In
your implementation, you return a null value. Null values, however, are
only allowed for object references (and some other types), but are not
valid for other IDL defined types.

In your case, if you want to return 'nothing', you have to return an
empty sequence of strings:

String[] libGroups = new String[0];
return libGroups;

Also, a Java hint: if you want to convert a vector that contains objects
of the same type to an array, you can use the toArray method:

Vector v = // v contains String objects
String[] arr = (String[]) v.toArray(new String[v.size()]);

--
Erik Post
erikpost at eml dot cc

0 new messages