Git Product home page Git Product logo

Comments (10)

jbrisbin avatar jbrisbin commented on May 17, 2024

supervisor2.erl isn't included in amqp_client, but is used in the code. You can work around this by putting a copy of supervisor2.erl (it's in nearly every project these days, but is in the rabbitmq source tree and can be pulled out from Github...just look at it in the browser in the "raw" format and download it to your project).

I think I took that out because it was causing compilation warnings/errors. I can't remember exactly. It really should be included one way or the other, I just think most people have supervisor2 already in their path somewhere so it's usually not an issue.

I think what I'll do is put in a modified version that does some ifdef stuff to get around the warnings.

from amqp_client.

CrazyPathFinder avatar CrazyPathFinder commented on May 17, 2024

thank you for answer

i have supervisor2.erl in "rabbit_common", now i put that file in my project folder and catch next error

=ERROR REPORT==== 26-Apr-2012::21:21:10 ===
** Generic server <0.39.0> terminating
** Last message in was connect
** When Server state == {state,amqp_network_connection,
{state,undefined,undefined,undefined,undefined,
undefined,false},
<0.38.0>,undefined,
{amqp_params_network,<<"guest">>,<<"guest">>,
<<"/">>,"localhost",5672,0,0,0,infinity,none,
[#Fun<amqp_auth_mechanisms.plain.3>,
#Fun<amqp_auth_mechanisms.amqplain.3>],
[],[]},
undefined,undefined,
#Fun<amqp_connection_sup.0.39273983>,
#Fun<amqp_connection_sup.2.54430129>,false}
** Reason for termination ==
** {'module could not be loaded',
[{rabbit_net,send,[#Port<0.726>,<<65,77,81,80,0,0,9,1>>]},
{amqp_network_connection,handshake,4},
{amqp_network_connection,try_handshake,4},
{amqp_gen_connection,handle_call,3},
{gen_server,handle_msg,5},
{proc_lib,init_p_do_apply,3}]}
** exception exit: {{undef,[{rabbit_net,send,
[#Port<0.726>,<<65,77,81,80,0,0,9,1>>]},
{amqp_network_connection,handshake,4},
{amqp_network_connection,try_handshake,4},
{amqp_gen_connection,handle_call,3},
{gen_server,handle_msg,5},
{proc_lib,init_p_do_apply,3}]},
{gen_server,call,[<0.39.0>,connect,infinity]}}
in function gen_server:call/3
in call from userlog_app:test/0

but now i have gen_server2.erl in rabbit_common

from amqp_client.

jbrisbin avatar jbrisbin commented on May 17, 2024

Looks like it's definitely not seeing the stuff in rabbit_common. supervisor2.erl and rabbit_net.erl are both in there.

Maybe your "erl -pa" settings need to be adjusted so that it finds "rabbit_common/ebin". It appears that it's not at the moment.

from amqp_client.

CrazyPathFinder avatar CrazyPathFinder commented on May 17, 2024

i misunderstand.
folder amqp_connect visible in project and all lib (files) working ok.
but folder rabbit_common not visible and files don't in path.

Maybe i do somthing wron.
i try erl and erl -pa but the same error.
when i put supervisor2 in project from deps folder, that file worked when i remove it from project error again.
is i need to put all files in project folder?
Other libraries work from deps folder ok, but this?

from amqp_client.

jbrisbin avatar jbrisbin commented on May 17, 2024

It depends on how you're starting your Erlang VM, but I usually test using a command line like (running this in the project home):

erl -pa deps/*/ebin -pa ebin -config test -s test_app

...or equivalent. This makes sure I have all my dependencies (located in rebar's default dependency folder "deps") in the path. The "-pa" switch is what tells Erlang about my rabbit_common, amqp_client, or whatever.

Sometimes it's even necessary to add dependencies of dependencies (erlv8 is one such beast):

erl -pa deps//ebin -pa deps/erlv8/deps//ebin -pa ebin

...etc.

How are you starting this test? What's your command line look like?

from amqp_client.

CrazyPathFinder avatar CrazyPathFinder commented on May 17, 2024

this is my folders struct
project
-- apps
----userlog
------src
------ebin
--rel
--deps
----amqp_client
----rabbit_common
----epgsql
----etc.
How i can correct start VM for testing

thank you

from amqp_client.

jbrisbin avatar jbrisbin commented on May 17, 2024

First make sure "deps/*/ebin" actually has .beam files in it. :)

Without building a rel, which would give you different paths, you'll need something like (on *NIXs, Mac, etc...):

erl -pa deps/*/ebin -pa apps/userlog/ebin ...

from amqp_client.

jbrisbin avatar jbrisbin commented on May 17, 2024

Is that just a typo in the comment here where "rabbit_common" [sic] only has one "t"?

from amqp_client.

CrazyPathFinder avatar CrazyPathFinder commented on May 17, 2024

thwnk you.

from amqp_client.

radetsky avatar radetsky commented on May 17, 2024

Information for people that uses rebar.
I included amqp_client and rabbit_common in myproject/rels/project/reltool.config and amqp_connection just works fine.

Thank you, jbrisbin.

from amqp_client.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.