Thread: [Cppcms-users] web does not display
Brought to you by:
artyom-beilis
From: Eric J. <jan...@gm...> - 2018-05-01 11:54:51
|
Hi, I compiled the source code with clang++ under FreeBSD 11. I generated skin in library form: libcpp_defskin.so This is the content of the config.json: > { > > "Website" : { > > "root" : "", > > "host" : "localhost:8080", > > "locdomain" : "localhost" > > }, > > "service" : { > > "api" : "http", > > "port" : 8080 > > }, > > "http" : { > > "script" : "/mb.fcgi", > > "rewrite" : [ > > { "regex" : "/assets(/.+)", "pattern" : "$1" }, > > { "regex" : ".*", "pattern" : "/mb.fcgi$0" } > > ] > > }, > > "views" : { > > "default_skin" : "defskin", > > "paths" : [ "./" ], > > "skins" : [ "cpp_defskin" ] > > }, > > "file_server" : { > > "enable" : true, > > "listing" : true, > > "document_root" : "./assets" > > } > > } > > When I tried to load the app: ./WebApp -c config.js, it has this error: 2018-05-01 19:18:53; cppcms, error: Caught exception > [cppcms::views::generator: an attempt to use content of invalid type] > 0x800c9ca86: booster::stack_trace::trace(void**, int) + 0x26 in > /usr/local/lib/libbooster.so.0 > 0x8009096c1: booster::backtrace::backtrace(unsigned long) + 0x61 in > /usr/local/lib/libcppcms.so.1 > 0x80380b7a6: > booster::runtime_error::runtime_error(std::__1::basic_string<char, > booster::runtime_error::runtime_error::char_traits<char>, > booster::runtime_error::runtime_error::allocator<char> > const&) + 0x46 in > .//libcpp_defskin.so > 0x803809af7: > cppcms::cppcms_error::cppcms_error(std::__1::basic_string<char, > cppcms::cppcms_error::cppcms_error::char_traits<char>, > cppcms::cppcms_error::cppcms_error::allocator<char> > const&) + 0x27 in > .//libcpp_defskin.so > 0x80380de2b: std::__1::auto_ptr<cppcms::base_view> > cppcms::views::generator::view_builder<defskin::Index, > Content::Index>(cppcms::views::generator::view_builder<defskin::Index, > Content::Index>::basic_ostream<char, > cppcms::views::generator::view_builder<defskin::Index, > Content::Index>::char_traits<char> >&, cppcms::base_content*) + 0x5eb in > .//libcpp_defskin.so > 0x800948b51: cppcms::views::pool::create_view(std::__1::basic_string<char, > cppcms::views::pool::create_view::char_traits<char>, > cppcms::views::pool::create_view::allocator<char> > const&, > std::__1::basic_string<char, > cppcms::views::pool::create_view::char_traits<char>, > cppcms::views::pool::create_view::allocator<char> > const, > cppcms::views::pool::create_view::basic_ostream<char, > cppcms::views::pool::create_view::char_traits>&, cppcms::base_content&) + > 0x81 in /usr/local/lib/libcppcms.so.1 > 0x80094919d: cppcms::views::pool::render(std::__1::basic_string<char, > cppcms::views::pool::render::char_traits<char>, > cppcms::views::pool::render::allocator<char> > const&, > std::__1::basic_string<char, > cppcms::views::pool::render::char_traits<char>, > cppcms::views::pool::render::allocator<char> > const, > cppcms::views::pool::render::basic_ostream<char, > cppcms::views::pool::render::char_traits>&, cppcms::base_content&) + 0x3d > in /usr/local/lib/libcppcms.so.1 > 0x800930469: cppcms::application::render(std::__1::basic_string<char, > cppcms::application::render::char_traits<char>, > cppcms::application::render::allocator<char> >, cppcms::base_content&) + > 0x89 in /usr/local/lib/libcppcms.so.1 > 0x4173f6: ??? + 0x4173f6 in /usr/home/eric/www/eric_jansen_id/output/WebApp > 0x43e4d2: ??? + 0x43e4d2 in /usr/home/eric/www/eric_jansen_id/output/WebApp > 0x43e2d5: ??? + 0x43e2d5 in /usr/home/eric/www/eric_jansen_id/output/WebApp > 0x80093a850: booster::function<void()(std::__1::basic_string<char, > std::__1::char_traits<char>, std::__1::allocator<char> > >)>::operator()(std::__1::basic_string<char, std::__1::char_traits<char>, > std::__1::allocator<char> >) const + 0x30 in /usr/local/lib/libcppcms.so.1 > 0x800937206: cppcms::url_dispatcher::setup_stream(cppcms::application&, > std::__1::basic_istream<char, cppcms::application&::char_traits<char> >&) + > 0xd36 in /usr/local/lib/libcppcms.so.1 > 0x800932be0: cppcms::url_dispatcher::dispatch(std::__1::basic_string<char, > cppcms::url_dispatcher::dispatch::char_traits<char>, > cppcms::url_dispatcher::dispatch::allocator<char> >) + 0xd0 in > /usr/local/lib/libcppcms.so.1 > 0x80093014f: cppcms::application::main(std::__1::basic_string<char, > cppcms::application::main::char_traits<char>, > cppcms::application::main::allocator<char> >) + 0x2f in > /usr/local/lib/libcppcms.so.1 > 0x408101: ??? + 0x408101 in /usr/home/eric/www/eric_jansen_id/output/WebApp > 0x800928ce1: > cppcms::http::context::dispatch(booster::intrusive_ptr<cppcms::application> > const&, std::__1::basic_string<char, > booster::intrusive_ptr<cppcms::application> const&::char_traits<char>, > booster::intrusive_ptr<cppcms::application> const&::allocator<char> > > const&, bool) + 0x1b1 in /usr/local/lib/libcppcms.so.1 > 0x8009291f9: > cppcms::http::context::dispatch(booster::shared_ptr<cppcms::application_specific_pool> > const&, booster<cppcms::http::context> const&, std::__1::basic_string<char, > booster<cppcms::http::context> const&::char_traits<char>, > booster<cppcms::http::context> const&::allocator<char> > const&) + 0x99 in > /usr/local/lib/libcppcms.so.1 > 0x80092bc05: cppcms::impl::thread_pool::worker(void) + 0xd5 in > /usr/local/lib/libcppcms.so.1 > 0x800ce7b1a: bool + 0x1a in /usr/local/lib/libbooster.so.0 > 0x80228abc5: operator-> + 0x925 in /lib/libthr.so.3 > (http_context.cpp:336) What could be the solution? Thank you *ERIC JANSEN* C/C++ Software Engineer |
From: Joerg S. <jo...@be...> - 2018-05-01 14:31:50
|
On Tue, May 01, 2018 at 07:54:22PM +0800, Eric Jansen wrote: > I compiled the source code with clang++ under FreeBSD 11. Are you using -rdynamic or -Wl,--export-dynamic when linking? Joerg |
From: Eric J. <jan...@gm...> - 2018-05-02 03:04:23
|
Is it an additional parameters for compilation? Thanks Eric > On 1 May 2018, at 8:43 PM, Joerg Sonnenberger <jo...@be...> wrote: > >> On Tue, May 01, 2018 at 07:54:22PM +0800, Eric Jansen wrote: >> I compiled the source code with clang++ under FreeBSD 11. > > Are you using -rdynamic or -Wl,--export-dynamic when linking? > > Joerg > > ------------------------------------------------------------------------------ > Check out the vibrant tech community on one of the world's most > engaging tech sites, Slashdot.org! http://sdm.link/slashdot > _______________________________________________ > Cppcms-users mailing list > Cpp...@li... > https://lists.sourceforge.net/lists/listinfo/cppcms-users |
From: Joerg S. <jo...@be...> - 2018-05-02 09:50:10
|
On Wed, May 02, 2018 at 11:04:12AM +0800, Eric Jansen wrote: > Is it an additional parameters for compilation? > Thanks It's necessary for linking the main executable. Joerg |
From: Eric J. <jan...@gm...> - 2018-05-02 12:24:24
|
Hi Joerg, Thank you it's successful! This is how I did: > clang++ -rdynamic main.cpp -lcppcms -o WebApp -I /usr/local/include -L > /usr/local/lib -std=c++11 -lbooster *ERIC JANSEN* Sr. C/C++ Software Engineer On Wed, May 2, 2018 at 5:49 PM, Joerg Sonnenberger <jo...@be...> wrote: > On Wed, May 02, 2018 at 11:04:12AM +0800, Eric Jansen wrote: > > Is it an additional parameters for compilation? > > Thanks > > It's necessary for linking the main executable. > > Joerg > > ------------------------------------------------------------ > ------------------ > Check out the vibrant tech community on one of the world's most > engaging tech sites, Slashdot.org! http://sdm.link/slashdot > _______________________________________________ > Cppcms-users mailing list > Cpp...@li... > https://lists.sourceforge.net/lists/listinfo/cppcms-users > |
From: Nazım C. B. <naz...@ne...> - 2018-05-01 16:54:16
|
Hi, In addition to Joerg's suggestion, could you please verify that the type of content variable you are passing to render(...) function matches to the content type declared in view template. CppCMS uses single base class (base_content) and relies on dynamic_cast for conversion. Regards, Nazim Can. On 01/05/18 15:43, Joerg Sonnenberger wrote: > On Tue, May 01, 2018 at 07:54:22PM +0800, Eric Jansen wrote: >> I compiled the source code with clang++ under FreeBSD 11. > Are you using -rdynamic or -Wl,--export-dynamic when linking? > > Joerg > > ------------------------------------------------------------------------------ > Check out the vibrant tech community on one of the world's most > engaging tech sites, Slashdot.org! http://sdm.link/slashdot > _______________________________________________ > Cppcms-users mailing list > Cpp...@li... > https://lists.sourceforge.net/lists/listinfo/cppcms-users |
From: Eric J. <jan...@gm...> - 2018-05-03 11:45:56
|
Hi, Yes it's matched. Thanks Nazim *ERIC JANSEN* Sr. C/C++ Software Engineer On Wed, May 2, 2018 at 12:31 AM, Nazım Can Bedir <naz...@ne... > wrote: > Hi, > > In addition to Joerg's suggestion, could you please verify that the type > of content variable you are passing to render(...) function matches to the > content type declared in view template. CppCMS uses single base class > (base_content) and relies on dynamic_cast for conversion. > > Regards, > Nazim Can. > > > > On 01/05/18 15:43, Joerg Sonnenberger wrote: > >> On Tue, May 01, 2018 at 07:54:22PM +0800, Eric Jansen wrote: >> >>> I compiled the source code with clang++ under FreeBSD 11. >>> >> Are you using -rdynamic or -Wl,--export-dynamic when linking? >> >> Joerg >> >> ------------------------------------------------------------ >> ------------------ >> Check out the vibrant tech community on one of the world's most >> engaging tech sites, Slashdot.org! http://sdm.link/slashdot >> _______________________________________________ >> Cppcms-users mailing list >> Cpp...@li... >> https://lists.sourceforge.net/lists/listinfo/cppcms-users >> > > > ------------------------------------------------------------ > ------------------ > Check out the vibrant tech community on one of the world's most > engaging tech sites, Slashdot.org! http://sdm.link/slashdot > _______________________________________________ > Cppcms-users mailing list > Cpp...@li... > https://lists.sourceforge.net/lists/listinfo/cppcms-users > |