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

Visibroker OBV Example doesnt run, please Help

1 view
Skip to first unread message

Shankar

unread,
Jun 5, 2003, 1:35:59 PM6/5/03
to
Hi,
I have been trying for quite some time now, to use the CORBA
Objects By Value feature.I am using Visibroker 4.0 with Java 1.3 on
Solaris.
I have taken very simple objects and tried to pass them across
from the Server to the Client. As part of this, I took the simple
example that comes with Visibroker and tried to compile it. It did not
get compiled. The class that didnt get compiled, I have pasted below.


public class PointDefaultFactory implements
org.omg.CORBA.portable.ValueFactory {
public java.io.Serializable read_value
(org.omg.CORBA.portable.InputStream is) {
java.io.Serializable val = new PointImpl();
// create and initialize value
val = ((org.omg.CORBA_2_3.portable.InputStream)is).read_value(val);
return val;
}
}

And the code with the change that I had to make to compile is,
pasted below.

public class PointDefaultFactory implements
org.omg.CORBA.portable.ValueFactory {
public java.io.Serializable
read_value(org.omg.CORBA_2_3.portable.InputStream is)
{
java.io.Serializable val = new PointImpl();
val = ((org.omg.CORBA_2_3.portable.InputStream)is).read_value(val);
return val;
}
}

After I made these changes, the code gets compiled, but the Client
still does throws a runtime error, which is pasted below.


phoenix{avi31: vbj Server &
[1] 15669
phoenix{avi32:
phoenix{avi32: PointManagerImpl@47b00c is ready.

phoenix{avi32: vbj Client
Command-->?
USAGE INFORMATION
createbase <label>
createderived <label>
connect <label>
destroy <label>
get <label>
list <num copies of each>
quit
Command-->createbase Tarzan
Exception in thread "main" java.lang.NoSuchMethodError
at com.inprise.vbroker.orb.CDRInputStream.doReadValue(CDRInputStream.java:3493)
at com.inprise.vbroker.orb.CDRInputStream.read_value(CDRInputStream.java:3403)
at Map.PointHelper.read(PointHelper.java:31)
at Map._PointManagerStub.create_point(_PointManagerStub.java:100)
at Client.main(Client.java:68)
phoenix{avi33:

Here is the IDL of the example.

//IDL for the Point Example
module Map{

valuetype Point {
public long x;
public long y;
public string label;

void print();
}; interface PointManager {

string get_name();

Point create_point(in long x, in long y, in Label lab,
in boolean connectable)
raises(DuplicatePoint, InvalidPoint);

Point get_point(in Label lab)
raises(UnknownPoint, InvalidPoint);

void destroy_point(in Label lab)
raises(UnknownPoint, InvalidPoint);

void connect_point(in Label lab,
in LabelSeq connectTo)
raises(UnknownPoint, InvalidPoint);

// returns 'scaling_factor' number of copies of
// every created point.
PointSeq list_points(in unsigned long scaling_factor);

};
};// end of Map

//End of IDL for Point Example

The line where it throws the error, line # 68 in the Client program
happens to be,

//Code for Client program

public class Client {

//
..........
..........
public static void main(String[] args) {
// Initialize the ORB and other stuff...
........
........

Point point = pointManager.create_point(x++, y++, lab,
false);<<<---ERROR here
if (point != null) {
point.print();
}
else {
System.out.println("Point is [nil]");
}

.........
.........

}//end of main

} // end

I have written quite a bit of code already and all the other files
run fine.
Just before posting this message I ran some other examples that come
with Visibroker, and they run fine too.Here are the Visibroker related
environment variables that I have set. please let me know if I am
missing something in the environment settings.

path /opt/local/visibroker/bin
MANPATH /opt/local/visibroker/bin:
VBROKER_ADM /opt/local/visibroker/adm
OSAGENT_PORT 15555

I hope given enough details. Can someone please tell me what the
problem is. I expected that the example that came with Visibroker to
run, when that did not happen, I do not know where else to look for.
Thanks in advance.
Shankar.

lqqchen

unread,
Aug 4, 2003, 5:35:30 AM8/4/03
to
Hi,

Maybe try to use JDK1.2 with VisiBroker 4.0

Good luck!

lqqchen


"Shankar" <luvzo...@yahoo.com> wrote in message
news:816a4295.03060...@posting.google.com...

0 new messages