This is an automated email from the ASF dual-hosted git repository.

pnoltes pushed a commit to branch 
feature/add_log_statement_for_bnd_act_without_symbols
in repository https://gitbox.apache.org/repos/asf/celix.git

commit 44dd36ffddb985bf944bd0a3c5cabb5d07a9e6c2
Author: Pepijn Noltes <[email protected]>
AuthorDate: Mon May 22 23:02:42 2023 +0200

    Add log statement for bundles with an act lib, but no symbols
---
 documents/patterns.md                                    | 1 +
 examples/celix-examples/readme_c_examples/CMakeLists.txt | 3 ++-
 libs/framework/src/framework.c                           | 6 +++++-
 3 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/documents/patterns.md b/documents/patterns.md
index fbb4bbc0..fe80db1c 100644
--- a/documents/patterns.md
+++ b/documents/patterns.md
@@ -112,6 +112,7 @@ add_celix_container(extender_pattern_example_container # 
<----------------------
         Celix::http_admin
         http_admin_extendee_bundle
 )
+target_link_libraries(extender_pattern_example_container PRIVATE 
civetweb::civetweb)
 ```
 
 When the `extender_pattern_example_container` executable is running the web 
address `http://localhost:8080/hello`
diff --git a/examples/celix-examples/readme_c_examples/CMakeLists.txt 
b/examples/celix-examples/readme_c_examples/CMakeLists.txt
index 6ea7c06d..75592a52 100644
--- a/examples/celix-examples/readme_c_examples/CMakeLists.txt
+++ b/examples/celix-examples/readme_c_examples/CMakeLists.txt
@@ -103,4 +103,5 @@ add_celix_container(extender_pattern_example_container # 
<----------------------
     BUNDLES
         Celix::http_admin
         http_admin_extendee_bundle
-)
\ No newline at end of file
+)
+target_link_libraries(extender_pattern_example_container PRIVATE 
civetweb::civetweb)
\ No newline at end of file
diff --git a/libs/framework/src/framework.c b/libs/framework/src/framework.c
index 44662850..6544c873 100644
--- a/libs/framework/src/framework.c
+++ b/libs/framework/src/framework.c
@@ -2163,13 +2163,17 @@ celix_status_t 
celix_framework_startBundleEntry(celix_framework_t* framework, ce
                     status = CELIX_ENOMEM;
                 } else {
                     void* userData = NULL;
-                    void* bundleHandle = bundle_getHandle(bndEntry->bnd);
+                    void* bundleHandle = 
celix_module_getBundleActivatorHandler(module);
 
                     activator->create = 
celix_libloader_findBundleActivatorCreate(bundleHandle);
                     activator->start = 
celix_libloader_findBundleActivatorStart(bundleHandle);
                     activator->stop = 
celix_libloader_findBundleActivatorStop(bundleHandle);
                     activator->destroy = 
celix_libloader_findBundleActivatorDestroy(bundleHandle);
 
+                    if (bundleHandle != NULL && activator->create == NULL && 
activator->start == NULL && activator->stop == NULL && activator->destroy == 
NULL) {
+                        fw_log(framework->logger, CELIX_LOG_LEVEL_WARNING, 
"Bundle %s [%li] has an activator library, but no activator symbols", name, 
bndEntry->bndId);
+                    }
+
                     status = CELIX_DO_IF(status, 
bundle_setActivator(bndEntry->bnd, activator));
 
                     status = CELIX_DO_IF(status, 
bundle_setState(bndEntry->bnd, CELIX_BUNDLE_STATE_STARTING));

Reply via email to