Erlang Mailing Lists

Author Message

<  Erlang questions mailing list  ~  Problem getting started with Orber

luke at javagroup.org
Posted: Tue Apr 13, 1999 12:20 pm Reply with quote
Guest
Hi all,

I could use a hand with a problem I'm having getting started with
Orber. I'm trying to find a Naming service using an IOR and use it to
lookup another object, however I get the following error when I call
"resolve" on the naming service:

** exited: {{badarg,{gen,call,
[orber_reqno,
#Ref,
{'$gen_call',{<0.281.0>,#Ref},get},
infinity]}},
{gen_server,call,[orber_reqno,get,infinity]}} **

I also get this error when I try looking up another object by IOR and
calling it. I'm not sure what the problem is, the IOR parses
correctly (printing it gives all the right information), but I
invariably get this error when I make a call on an object. I suspect
I'm doing something silly. :-)

The code which is causing the problem is attached. It depends on some
supporting classes, but if there is no obvious problem and it would
have to be run to reproduce this problem, then the dependency could be
easily severed. The ORB at the other end is JavaIDL running on Linux
JDK1.2pre1, and Orber is running on the same machine.

Thanks for any light you could shed on this!

P.S., I'm sorry if the code is ugly, I'm taking my first steps with Erlang.

Cheers,
Luke



Post generated using Mail2Forum (http://m2f.sourceforge.net)
lars at erix.ericsson.se
Posted: Fri Apr 16, 1999 11:50 am Reply with quote
Guest
Hi Luke,
i think the problem is that the Orber application isn't running.

You must first install Orber, the most simple installation is to run
Orber just in one Erlang node.

That installation is done as follows.

First create a mnesia database schema:

mnesia:create_schema([]).

Then install orber (creates some tables in the database):

orber:install([]).

Then every time you start your erlang node, you have to start Orber
prior to
the applications that use it:

orber:start().


This badarg message you get comes from the gen_server module when the
called process doesn't respond (it could be better i agree). The process
in this case is the request number server
which just gives a unique number for the outgoing IIOP requests. This
explains that all your
outgoing IIOP calls failed.


Regards Lars Thorsen

===============================================================
Ericsson Utvecklings AB
Open Telecom Platform

---------------------------------------------------------------
E-mail: lars_at_erix.ericsson.se
Phone: +46 8 719 93 01
Fax: +46 8 719 91 01
Office address: G
luke at javagroup.org
Posted: Fri Apr 16, 1999 1:22 pm Reply with quote
Guest
Lars Thorsen <lars_at_erix.ericsson.se> writes:

> i think the problem is that the Orber application isn't running.

Thanks very much, you're quite right -- I cottoned on to this after
taking a better look at the examples. I think I was trying to run
before I'd learned to walk. :)

I've been playing with Orber a bit today, and I have some new
questions for you.

Firstly, I've noticed that calls to objects which take floats as
parameters strictly require a float to be passed in the erlang code,
and won't coerce an integer. Thus if you have an operation "foo(in
float value)", then calling foo(10) will fail to bind to a marshalling
function because the guard requires a float() -- foo(10.0) must be
used instead. I loosened the guards on the marshalling code from
float() to number() which seems more intuitive to me, does this seem
like a good modification? It doesn't introduce ambiguity because the
fact that it will become a float has already been ascertained from the
typecode, and from my limited testing it seems to work properly.

Also related to the point above, I notice that Orber seems to bypass
marshalling for calls made to objects belonging to the same Orber
application. While this is a good thing, it bypasses the float()
check and thus accepts integers in the place of floats, so there is a
semantic difference between calling local and remote objects. By
making the change above things are made consistent, though.

It's getting late here in Australia, so I'm having to turn in for the
evening without investigating another possible bug -- it seems that
doubles are not being marshalled correctly. When I send a double to a
JavaIDL server, it is received with the wrong value, and then Orber
fails while trying to unmarshal the reply (which is the same value
sent back). I couldn't guarantee that I didn't introduce this problem
while hacking at Orber, I'll take a better look at it tomorrow or on
Sunday, but I thought I'd best check incase it was a known problem or
it was obvious to someone -- I'm just starting out with Erlang and I
can't read the code too fluently (yet!).

On a side note, I was wondering how one can convert an integer to a
float (perhaps to satasfy an overly strict guard)? I didn't see a BIF
for it.

That's all, thanks for your attention.

BTW, I had a chance to learn to use the debugger today, it's very
convenient. Erlang seems to manage to astound me several times a day
- though maybe too much Java has lowered my expectations Wink.

Cheers,
Luke



Post generated using Mail2Forum (http://m2f.sourceforge.net)
tobbe at serc.rmit.edu.au
Posted: Fri Apr 16, 1999 2:19 pm Reply with quote
Guest
> On a side note, I was wondering how one can convert an integer to a
> float (perhaps to satasfy an overly strict guard)? I didn't see a BIF
> for it.

Hm...I should probably also go to bed, but here
is a quick and dirty way to do it:

<Integer> * 1.0

For example: 4 * 1.0 => 4.0

/Tobbe


Post generated using Mail2Forum (http://m2f.sourceforge.net)

Display posts from previous:  

All times are GMT
Page 1 of 1
This forum is locked: you cannot post, reply to, or edit topics.

Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum