Error in writing custom module in ejabbers XMPP server - erlang

I run a small private group of users on an XMPP server and recently I needed to write a custom module. To start write a custom module, I followed this [tutorial][1].
As I have not written a custom module before and being at an low intermediate level with Erlang I decided to go for the basics - following Jack Moffits mod_sunshine.erl example as well as Anders Conbere's examples.
I am running ejabberd-13.12 community edition on Ubuntu LTS 12.04. For the life of me I can not get mod_sunshine to work or even just a basic skeletal module to work (see below mod_test.erl).
I compile to a beam file, I edit the ejabberd.cfg file (in ejabberd-13.12 it is ejabberd.yml). I restart and get the following error:
gen_mod:start_module:78 Problem starting the module mod_sunshine for
host <<"xmpp1.xxxxx.com">>
options: []
error: undef
I have found very little on the internet resolving this problem. Maybe there are about a half dozen posts out there with the gen_mod:start_module:78 error but no real solutions.
I have wasted 2 days trying to figure this out. Even trying on another server using ejabberd-2.1.10 but no dice.
Below is the barest custom module I've tested but still get the same error.
-module(mod_test).
-behaviour(gen_mod).
-export([start/2, stop/1]).
start(_Host, _Opt) -> ok.
stop(_Host) -> ok.
Can anyone help me please?. Thanks in advance!!

Related

Does HHVM support IMAP?

I have a new ubuntu server running HHVM that I just installed my PHP application on. Everything seems to work fine except one aspect.
I have a button that queries an external e-mail box, and downloads the attachments to the server, however when I run that function I get:
Fatal error: Call to undefined function imap_sort()
I know there's usually a module for it, but I don't know how to check for it on this setup.
Any help is appreciated.
The HHVM documentation for imap_sort very loudly proclaims
NOT SUPPORTED IN HHVM
so no, HHVM does not currently support this function.

Marmalade error download

i tried everything to solve this but since two days i'm blocked.
i need IwNui Api in my application to build interface for my application iOs, but when adding this package to the mkb project with this line 'subproject IwNUI', Visual studio block on this trace error :
Building project: c:/Users/PC/Documents/testaaaa/testaaaa.mkb
1>c:/Users/PC/Documents/testaaaa/testaaaa.mkb(14): warning : filename case does not match the filesystem: c:/marmalade/6.2/modules/IwNUI/IwNUI.mkf
1> Executing: 'c:\marmalade\6.2\s3e\bin\mdev.bat update'
1> Downloading: http://source.madewithmarmalade.com/packages/6.2/Packages
1> Downloading: https://raw.github.com/marmalade/mdev-package-list/master/6.2?1365852339.42
1>CUSTOMBUILD : error : error downloading url: https://raw.github.com/marmalade/mdev-package-list/master/6.2?1365852339.42 (<urlopen error (8, 'EOF occurred in violation of protocol')>)
1>c:/marmalade/6.2/modules/iwutil/iwutil.mkf(19): error : Executing 'c:\marmalade\6.2\s3e\bin\mdev.bat update' failed. (return code 1)
1> FAILED (error code=3)
Even every examples of marmalde launchap which use Iw** api can't be build because the dowload of : https://raw.github.com/marmalade/mdev-package-list/master/6.2?1365852339.42 is not working.
I saw tips on some pages but these not fixed it for me (delete folder in roaming/appdata/marmalade , close firewall, try with old sdk 6.2.1,6.2.0,6.1 etc)
I'm open to every suggestions, my development was going well until i need an UI to going forward. I'm beginner in interface development and if a different and easy way exist for adding a Ios UI i'm also interested in.
Thanks a lot for reading, dams
Marmalade needs the mdev package to function properly, thus you've to download it anyways, there're now way you can skip it. The problem is with your internet connection. Probably it's not accepting HTTPS connections. Try using some other internet provider or check using some friends' wifi. I always get this error when my internet is slow and the download gets timeout. Changing the internet plan is the only thing that might help.
In case it gives the same error on other internet connection, then it might be some issues with how you set up marmalade, Try reinstalling it.

Erlang error codes, need more details

I am trying to use the file:open(....) function in erlang but it doesn't seem to work. I keep getting an {error, eio} exception.
Ive looked into it in the erlang documentation and all i have found is that it is the posix error for input/output... go figure.
The file name im outputting in is in the formation of "C:/directory/file.txt"
Im not sure if this has something to do with it.
Is there anyway i can make erlang give me a more specific explanation to what is wrong?
Thanks,
Jack
Unfortunately I do not know of a way to find out more without peeking inside the Erlang/VM.
If you look in the windows erlang source code there are a bunch of different errors which could cause en eio error. You can find a list of them here. In order to figure out which specific one it is, I would attach with windbg and step through the code as instrumenting and recompiling it on windows is a pain.
You might also be able to use something like Process Monitor to find out which system calls are being made and what they return.

Rabbitmq erlang client build failed due to file paths problems?

I have been able to build rabbitmq server on ubuntu linux. It came already prepackaged and on making, it is able to start as a service. When i got the client source, i failed to make because it appeared like it needed a folder called ./deps/rabbitmq-server. Analysing the code, i find that the author of the client was accessing the same header files as are found in the server, using include_lib("path to rabbit.hrl e.t.c") in his header file called "amqp_client.hrl". I then decided to add rabbitmq_server in the lib dir of erlang so as its paths are automatically added on start up of the vm. But still this didnot help. There is also another folder which the client references called "rabbit_common" for an include folder he assumes would contain all the .hrl files there. Please assist me in building both the client and server on my ubuntu server, for testing.
Also, if anyone has used RabbitMQ server for IMs, please provide some benchmarks and/or your findings on its throughput, speed and number of users. How can it be compared to ejabberd?. How can one create AJAX/Jquery/Javascript clients for Web functionality?
thanks
I hope you had made some progress as far as RabbitMQ and ejabberd are concerned.
Below is a link to an interesting discussion that might be of help.
http://old.nabble.com/AMPQ-vs-XMPP-and-RabbitMQ-vs-ejabberd-td17587109.html

hdf viewer on windows for tables created using pyTables?

viTables only seems to work with python 2.5. I have downloaded HDFView, but when I try to open a table I created following this tutorial, I get the following error message:
Failed to open file C:\tutorial.h5
java.io.IOException: Unsupported fileformat - C:\tutorial.h5
Any ideas for getting HDFView to work?
Is there something I need to do when I'm using pyTables from python to make the format more generic?
Any other good HDF viewers?
Btw, I've just discovered PyTables, and I'm really excited about it.
ViTables works for me with python 2.6 on windows. It is supposed also to work with 2.7.
However the version on the official site did not work for me and crashed. In a mailinglist posting I found the link to the berlios ftp server where I got a version that works like a charm.
Have you seen ViTables?
http://vitables.berlios.de/

Resources