开发者

Mochiweb mnesia requests

I'm trying to link Mochiweb with my ejabb开发者_StackOverflow社区erd mnesia db and am unable to do any mnesia transactions in my controllers. I test my controllers without the mnesia transactions and they work fine. I am using application:start(mnesia) inside the start function.

On the browser, I see "Internal server error" and on Mochiweb's log I see, "=ERROR REPORT=== function_clause". I'd like to know how to either 1.) get mnesia to work with Mochiweb or 2.) what a good framework I could plugin to ejabberd's web server is.

Thanks!


Do you have the rest of the error message from Mochiweb's log - the bit after "function_clause" if it has it?


This must be an error within your code. Last time I checked the mochiweb source it wrapped your "loop" function within a try catch. If it caught an exception, it printed the type of that exception to the error log; in your case you have a function_clause exception.

Either try calling your loop function manually, or wrap your code in yet another try catch to be able to see the whole exception. If you can't decipher it, paste it to your question please.


You know, I think I was doing it all wrong... I was thinking it would work like PHP/SQL and Rails/SQL, but it seems the best way to do this is calling methods from the Mochiweb node to the ejabberd node.

Also I noticed that when I started Mochiweb connected to the same mnesia database as ejabberd, it tried to "repair" some of my tables - basically erasing everything.

If anyone has any input on this (or if I'm totally off) please let me know. Thanks!

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜