Having trouble with make_jid

Hi All,

I am trying to use jlib:make_jid and I keep getting the following error:

=ERROR REPORT==== 22-Oct-2008::20:57:29 ===
Error in process <0.49.0> with exit value: {badarg,[{erlang,port_control,[stringprep_port,2,"sjelinek"]},{stringprep,control,2},{jlib,nodeprep,1},{jlib,make_jid,3},{facebook_dca,start_facebook,5}]}

Server = "re.clynetic.com",
        Resource = "",
        Jid = jlib:make_jid(User, Server, Resource),

I have:

-include("ejabberd.hrl").
-include("facebook.hrl").

As well.

I am not clear as to why it says the user name, in this case, "sjelinek" is a bad arg. I am running this erlang code from the erl emulator. I have successfully run other code that I have written from this, for testing purposes with no issues.

Any help is appreciated.

Regards,
sarah

Having trouble with make_jid-more data

So, I tried to just populate my own jid record with:

Resource = "facebookdca",
        case jlib:nodeprep(User) of
            LUser ->
                case jlib:nameprep(Server) of
                    LServer ->
                        case jlib:resourceprep(Resource) of
                            LResource ->
                                #jid{user = User,
                                     server = Server,
                                     resource = Resource,
                                     luser = LUser,
                                     lserver = LServer,
                                     lresource = LResource}
                        end
                end
        end,

And, I get the same error:
sjelinek@re.clynetic)2>
=ERROR REPORT==== 23-Oct-2008::19:01:49 ===
Error in process <0.55.0> on node 'sjelinek@re.clynetic' with exit value: {badarg,[{erlang,port_control,[stringprep_port,2,"sarah_jelinek"]},{stringprep,control,2},{jlib,nodeprep,1},{facebook_dca,get_data,7},{lists,foreach,2}]}

In googling this error it looks like the a possible cause is the port not being started? I cannot imagine it really is a badarg with "sarah_jelinek". Any ideas? Is there something I need to specifically start before I try to do this? I am able to write xml data to the ejabberd server so I know the server is operating.

thanks,
sarah

Hi, is ejabberd running or

Hi,
is ejabberd running or you are running your code standalone?
If running standalone, you would need to start the stringprep process to being able to use nodeprep/1.

Try starting the supervisor:
stringprep_sup:start_link(),

well.. that seems to have fixed it

I ran stringprep_sup:start_link(). as the first command in the erl emulator, then ran my test code and I was able to make the jid, using nodeprep, etc... The ejabberd server is running. The only difference is I am running my test code, which calls in to the erlang code that is trying to use make_jid via the erl emulator. Must be something in the way this runs in that environment that is for some reason not getting the stringprep_sup started.

Thank you for the help.

sarah

Syndicate content