Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HelloWorld running issue #22

Open
catalinolteanu opened this issue Jun 16, 2021 · 12 comments
Open

HelloWorld running issue #22

catalinolteanu opened this issue Jun 16, 2021 · 12 comments

Comments

@catalinolteanu
Copy link

catalinolteanu commented Jun 16, 2021

Hi,

I've built the HelloWorld(described in the wiki), for vsomeip3. After a small change in CMakeLists(for linking with vsomeip3 and some generated cpp file name), I managed to have two binaries(HelloWorldClient and HelloWorldService).

I've configured the /etc/commonapi.ini to something like:
[default]
binding=someip

[logging]
console = true
file = ./mylog.log
dlt = false
level = verbose

Now, I have this output, that shows missing the test library and configuration module:
@catalin-virt:/sources/genivi/project/build$ [CAPI][INFO] Loading configuration file '/etc/commonapi.ini'
[CAPI][INFO] Using default binding 'someip'
[CAPI][INFO] Using default shared library folder '/usr/local/lib/commonapi'
[CAPI][DEBUG] Added address mapping: local:commonapi.HelloWorld:v1_0:test <--> [1234.5678(1.0)]
[CAPI][INFO] Registering function for creating "commonapi.HelloWorld:v1_0" stub adapter.
[CAPI][DEBUG] Loading library for local:commonapi.HelloWorld:v1_0:test stub.
[CAPI][DEBUG] Loading interface library "liblocal__commonapi_HelloWorld:v1_0__test.so" failed (liblocal__commonapi_HelloWorld:v1_0__test.so: cannot open shared object file: No such file or directory)
[CAPI][INFO] Registering stub for "local:commonapi.HelloWorld:v1_0:test"
Configuration module could not be loaded!

What should I do now to make the sample to communicate between client and service ?

Thank you !

@catalinolteanu
Copy link
Author

export LD_LIBRARY_PATH to build folder fixed the issue.

Because there is nobody to install the samples in there linux systems, I think should be specified somewhere in the wiki that LD_LIBRARY_PATH setting.

@Pixelfahnder
Copy link

Pixelfahnder commented Aug 13, 2021

@catalinolteanu I experience the same issue but for me the "export hack" doesn't work. Any other more detailed remarks on this? I went to the build folder and exported the path but this doesn't change anything. If I spare out the commonapi.ini file the whole server will be run on dbus (which is the default as far as I understand) and therefore doesn't cause the error. So it seems to be something within the someip-tools stack that causes this which can't be solved by the "hack".

@Pixelfahnder
Copy link

The weird thing though is, that the code still works, but the message is irritating and maybe there may be a way of getting rid of it?

@nonalcogolic
Copy link

nonalcogolic commented Mar 30, 2022

You probably had to add next lines into your ini files:

[stub]

local:commonapi.HelloWorld:v1_0:test=/path/to/your/library/v1_0__test.so

local:commonapi.HelloWorld:v1_0:test
v1_0__test.so is the library which is being build from generated code.

@memoryleake
Copy link

I meet the issue too, I don't know the correct path where v1_0__test.so is located , I searched all files but not found v_1__test.so anywhere. Could you help it ?

@stefanoltean1
Copy link

Same issue from my side. Is there a more comprehensive guide to solve this?

@goncaloalmeida
Copy link
Contributor

hello,
@stefanoltean1 / @memoryleake please use the last release of all projects.
this issue is still occurring with the last release?

@wangzhangjun
Copy link

I know how to fix , we need config commonapi.ini file's [stub] and [proxy].
for example:

local:commonapi.HelloWorld:v1_0:test=xxx-someip.so

and this path is from your generate code xxxSomeIPproxy.cpp:
for example:

void initializeHelloWorldSomeIPProxy() {
    CommonAPI::SomeIP::AddressTranslator::get()->insert(
        "local:commonapi.HelloWorld:v1_0:test",   // this is we need
        0x1234, 0x5678, 1, 0);
    CommonAPI::SomeIP::Factory::get()->registerProxyCreateMethod(
        "commonapi.HelloWorld:v1_0",
        &createHelloWorldSomeIPProxy);
}

@wzc81614
Copy link

@goncaloalmeida Newest version also has this issue, I have this issue as well.

@wzc81614
Copy link

wzc81614 commented Nov 21, 2023

I know how to fix , we need config commonapi.ini file's [stub] and [proxy]. for example:

local:commonapi.HelloWorld:v1_0:test=xxx-someip.so

and this path is from your generate code xxxSomeIPproxy.cpp: for example:

void initializeHelloWorldSomeIPProxy() {
    CommonAPI::SomeIP::AddressTranslator::get()->insert(
        "local:commonapi.HelloWorld:v1_0:test",   // this is we need
        0x1234, 0x5678, 1, 0);
    CommonAPI::SomeIP::Factory::get()->registerProxyCreateMethod(
        "commonapi.HelloWorld:v1_0",
        &createHelloWorldSomeIPProxy);
}

How do you fix this issue? As your comment, I add one line in commonapi.ini
local:commonapi.HelloWorld:v1_0:test=HelloWorld-someip.so
it seems the issue still there, do you have any suggestion, thanks.
@wangzhangjun

@tenta4
Copy link

tenta4 commented Dec 8, 2023

According to CommonAPI's source code, name of binding library to be searched is configurable.
By default it's liblocal__<namespace>_<service>:<version>.so

But you can change it by setting the property for your service (directly in cpp code)

CommonAPI::Runtime::setProperty("LibraryBase", "<service>");

Then it will be <service>-someip.so (or DBus; it depends on used binding)

Here is responsible snippet

    library = getProperty("LibraryBase");
    if (library != "") {
#ifdef _WIN32
        library = library + "-" + defaultBinding_;
#else
        library = "lib" + library + "-" + defaultBinding_;
#endif
    } else {
        library = "lib" + _domain + "__" + _interface + "__" + _instance;
        std::replace(library.begin(), library.end(), '.', '_');
    }

@dibpinto
Copy link
Collaborator

dibpinto commented Feb 8, 2024

The CMakeLists.txt file was updated and a new line was added: "set(PRJ_NAME HelloWorld)".
Please verify if it's now working as expected. Otherwise please indicate all the changes you have done in CMakeLists.txt.

@Gustavo1515 @goncaloalmeida

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

10 participants