### Description I recently downloaded kamailio 5.2.3 and tried to install it for investigation purposes. I was trying to include app_java module in order to execute some brief java apps in kamailio. But then I get the same issue wen I compile and when I run kamailio
Thank you for all the help you can give me
### Troubleshooting
I get the same bunch of warnings everytime I try to make all
java_msgobj.c: In function ‘fill_sipmsg_object’: java_msgobj.c:83:27: warning: passing argument 2 of ‘(*env)->SetIntField’ from incompatible pointer type [-Wincompatible-pointer-types] (*env)->SetIntField(env, SipMsgInstance, fid, msg->id); ^~~~~~~~~~~~~~ java_msgobj.c:83:27: note: expected ‘jobject {aka struct _jobject *}’ but argument is of type ‘struct _jobject **’ java_msgobj.c:96:27: warning: passing argument 2 of ‘(*env)->SetIntField’ from incompatible pointer type [-Wincompatible-pointer-types] (*env)->SetIntField(env, SipMsgInstance, fid, msg->pid); ^~~~~~~~~~~~~~ java_msgobj.c:96:27: note: expected ‘jobject {aka struct _jobject *}’ but argument is of type ‘struct _jobject **’ java_msgobj.c:110:30: warning: passing argument 2 of ‘(*env)->SetObjectField’ from incompatible pointer type [-Wincompatible-pointer-types] (*env)->SetObjectField(env, SipMsgInstance, fid, jStrParam); ^~~~~~~~~~~~~~ java_msgobj.c:110:30: note: expected ‘jobject {aka struct _jobject *}’ but argument is of type ‘struct _jobject **’ java_msgobj.c:127:30: warning: passing argument 2 of ‘(*env)->SetObjectField’ from incompatible pointer type [-Wincompatible-pointer-types] (*env)->SetObjectField(env, SipMsgInstance, fid, jStrParam); ^~~~~~~~~~~~~~ java_msgobj.c:127:30: note: expected ‘jobject {aka struct _jobject *}’ but argument is of type ‘struct _jobject **’ java_msgobj.c:142:30: warning: passing argument 2 of ‘(*env)->SetObjectField’ from incompatible pointer type [-Wincompatible-pointer-types] (*env)->SetObjectField(env, SipMsgInstance, fid, jStrParam); ^~~~~~~~~~~~~~ java_msgobj.c:142:30: note: expected ‘jobject {aka struct _jobject *}’ but argument is of type ‘struct _jobject **’ java_msgobj.c:156:27: warning: passing argument 2 of ‘(*env)->SetIntField’ from incompatible pointer type [-Wincompatible-pointer-types] (*env)->SetIntField(env, SipMsgInstance, fid, msg->len); ^~~~~~~~~~~~~~ java_msgobj.c:156:27: note: expected ‘jobject {aka struct _jobject *}’ but argument is of type ‘struct _jobject **’ java_msgobj.c:172:30: warning: passing argument 2 of ‘(*env)->SetObjectField’ from incompatible pointer type [-Wincompatible-pointer-types] (*env)->SetObjectField(env, SipMsgInstance, fid, jStrParam); ^~~~~~~~~~~~~~ java_msgobj.c:172:30: note: expected ‘jobject {aka struct _jobject *}’ but argument is of type ‘struct _jobject **’ java_msgobj.c:189:30: warning: passing argument 2 of ‘(*env)->SetObjectField’ from incompatible pointer type [-Wincompatible-pointer-types] (*env)->SetObjectField(env, SipMsgInstance, fid, jStrParam); ^~~~~~~~~~~~~~ java_msgobj.c:189:30: note: expected ‘jobject {aka struct _jobject *}’ but argument is of type ‘struct _jobject **’ java_msgobj.c:205:27: warning: passing argument 2 of ‘(*env)->SetIntField’ from incompatible pointer type [-Wincompatible-pointer-types] (*env)->SetIntField(env, SipMsgInstance, fid, msg->parsed_orig_ruri_ok); ^~~~~~~~~~~~~~ java_msgobj.c:205:27: note: expected ‘jobject {aka struct _jobject *}’ but argument is of type ‘struct _jobject **’ java_msgobj.c:222:30: warning: passing argument 2 of ‘(*env)->SetObjectField’ from incompatible pointer type [-Wincompatible-pointer-types] (*env)->SetObjectField(env, SipMsgInstance, fid, jStrParam); ^~~~~~~~~~~~~~ java_msgobj.c:222:30: note: expected ‘jobject {aka struct _jobject *}’ but argument is of type ‘struct _jobject **’ java_msgobj.c:237:27: warning: passing argument 2 of ‘(*env)->SetIntField’ from incompatible pointer type [-Wincompatible-pointer-types] (*env)->SetIntField(env, SipMsgInstance, fid, msg->add_to_branch_len); ^~~~~~~~~~~~~~ java_msgobj.c:237:27: note: expected ‘jobject {aka struct _jobject *}’ but argument is of type ‘struct _jobject **’ java_msgobj.c:251:27: warning: passing argument 2 of ‘(*env)->SetIntField’ from incompatible pointer type [-Wincompatible-pointer-types] (*env)->SetIntField(env, SipMsgInstance, fid, msg->hash_index); ^~~~~~~~~~~~~~ java_msgobj.c:251:27: note: expected ‘jobject {aka struct _jobject *}’ but argument is of type ‘struct _jobject **’ java_msgobj.c:265:27: warning: passing argument 2 of ‘(*env)->SetIntField’ from incompatible pointer type [-Wincompatible-pointer-types] (*env)->SetIntField(env, SipMsgInstance, fid, msg->msg_flags); ^~~~~~~~~~~~~~ java_msgobj.c:265:27: note: expected ‘jobject {aka struct _jobject *}’ but argument is of type ‘struct _jobject **’ java_msgobj.c:286:30: warning: passing argument 2 of ‘(*env)->SetObjectField’ from incompatible pointer type [-Wincompatible-pointer-types] (*env)->SetObjectField(env, SipMsgInstance, fid, jStrParam); ^~~~~~~~~~~~~~ java_msgobj.c:286:30: note: expected ‘jobject {aka struct _jobject *}’ but argument is of type ‘struct _jobject **’ java_msgobj.c:306:30: warning: passing argument 2 of ‘(*env)->SetObjectField’ from incompatible pointer type [-Wincompatible-pointer-types] (*env)->SetObjectField(env, SipMsgInstance, fid, jStrParam); ^~~~~~~~~~~~~~ java_msgobj.c:306:30: note: expected ‘jobject {aka struct _jobject *}’ but argument is of type ‘struct _jobject **’ CC (gcc) [M app_java.so] java_support.o CC (gcc) [M app_java.so] java_iface.o java_iface.c: In function ‘java_exec’: java_iface.c:205:53: warning: passing argument 2 of ‘(*_aj_env)->NewLocalRef’ from incompatible pointer type [-Wincompatible-pointer-types] invk_method_ref = (*_aj_env)->NewLocalRef(_aj_env, invk_method); ^~~~~~~~~~~ java_iface.c:205:53: note: expected ‘jobject {aka struct _jobject *}’ but argument is of type ‘jmethodID {aka struct _jmethodID *}’ java_iface.c:205:18: warning: assignment from incompatible pointer type [-Wincompatible-pointer-types] invk_method_ref = (*_aj_env)->NewLocalRef(_aj_env, invk_method); ^ java_iface.c:208:39: warning: passing argument 2 of ‘(*_aj_env)->DeleteLocalRef’ from incompatible pointer type [-Wincompatible-pointer-types] (*_aj_env)->DeleteLocalRef(_aj_env, invk_method_ref); ^~~~~~~~~~~~~~~ java_iface.c:208:39: note: expected ‘jobject {aka struct _jobject *}’ but argument is of type ‘jmethodID {aka struct _jmethodID *}’ java_iface.c:216:40: warning: passing argument 2 of ‘(*_aj_env)->MonitorEnter’ from incompatible pointer type [-Wincompatible-pointer-types] if((*_aj_env)->MonitorEnter(_aj_env, invk_method_ref) != JNI_OK) { ^~~~~~~~~~~~~~~ java_iface.c:216:40: note: expected ‘jobject {aka struct _jobject *}’ but argument is of type ‘jmethodID {aka struct _jmethodID *}’ java_iface.c:234:40: warning: passing argument 2 of ‘(*_aj_env)->DeleteLocalRef’ from incompatible pointer type [-Wincompatible-pointer-types] (*_aj_env)->DeleteLocalRef(_aj_env, invk_method_ref); ^~~~~~~~~~~~~~~ java_iface.c:234:40: note: expected ‘jobject {aka struct _jobject *}’ but argument is of type ‘jmethodID {aka struct _jmethodID *}’ java_iface.c:235:40: warning: passing argument 2 of ‘(*_aj_env)->DeleteLocalRef’ from incompatible pointer type [-Wincompatible-pointer-types] (*_aj_env)->DeleteLocalRef(_aj_env, invk_method); ^~~~~~~~~~~ java_iface.c:235:40: note: expected ‘jobject {aka struct _jobject *}’ but argument is of type ‘jmethodID {aka struct _jmethodID *}’ java_iface.c:258:39: warning: passing argument 2 of ‘(*_aj_env)->DeleteLocalRef’ from incompatible pointer type [-Wincompatible-pointer-types] (*_aj_env)->DeleteLocalRef(_aj_env, invk_method_ref); ^~~~~~~~~~~~~~~ java_iface.c:258:39: note: expected ‘jobject {aka struct _jobject *}’ but argument is of type ‘jmethodID {aka struct _jmethodID *}’ java_iface.c:259:39: warning: passing argument 2 of ‘(*_aj_env)->DeleteLocalRef’ from incompatible pointer type [-Wincompatible-pointer-types] (*_aj_env)->DeleteLocalRef(_aj_env, invk_method); ^~~~~~~~~~~ java_iface.c:259:39: note: expected ‘jobject {aka struct _jobject *}’ but argument is of type ‘jmethodID {aka struct _jmethodID *}’ java_iface.c:266:39: warning: passing argument 2 of ‘(*_aj_env)->MonitorExit’ from incompatible pointer type [-Wincompatible-pointer-types] if((*_aj_env)->MonitorExit(_aj_env, invk_method_ref) != JNI_OK) { ^~~~~~~~~~~~~~~ java_iface.c:266:39: note: expected ‘jobject {aka struct _jobject *}’ but argument is of type ‘jmethodID {aka struct _jmethodID *}’ java_iface.c:272:38: warning: passing argument 2 of ‘(*_aj_env)->DeleteLocalRef’ from incompatible pointer type [-Wincompatible-pointer-types] (*_aj_env)->DeleteLocalRef(_aj_env, invk_method_ref); ^~~~~~~~~~~~~~~ java_iface.c:272:38: note: expected ‘jobject {aka struct _jobject *}’ but argument is of type ‘jmethodID {aka struct _jmethodID *}’ java_iface.c:273:38: warning: passing argument 2 of ‘(*_aj_env)->DeleteLocalRef’ from incompatible pointer type [-Wincompatible-pointer-types] (*_aj_env)->DeleteLocalRef(_aj_env, invk_method); ^~~~~~~~~~~ java_iface.c:273:38: note: expected ‘jobject {aka struct _jobject *}’ but argument is of type ‘jmethodID {aka struct _jmethodID *}’ CC (gcc) [M app_java.so] java_native_methods.o java_native_methods.c: In function ‘Java_org_siprouter_SipMsg_ParseSipMsg’: java_native_methods.c:484:9: warning: return from incompatible pointer type [-Wincompatible-pointer-types] return fill_sipmsg_object(jenv, _aj_msg); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ CC (gcc) [M app_java.so] app_java_mod.o app_java_mod.c: In function ‘child_init’: app_java_mod.c:236:38: warning: passing argument 2 of ‘(*_aj_env)->DeleteLocalRef’ from incompatible pointer type [-Wincompatible-pointer-types] (*_aj_env)->DeleteLocalRef(_aj_env, child_init_id); ^~~~~~~~~~~~~ app_java_mod.c:236:38: note: expected ‘jobject {aka struct _jobject *}’ but argument is of type ‘jmethodID {aka struct _jmethodID *}’
#### Reproduction
1. Download 5.2.3 2. in /usr/local/src/kamailio-5.2.3/ 2.1 make include_modules="app_java" cfg 2.2 make all 2.3 make install 3 kamailo -e -E -ddd
#### Debugging Data
0(18169) ERROR: <core> [core/sr_module.c:498]: load_module(): could not open module </usr/local/lib64/kamailio/modules/app_java.so>: libjvm.so: cannot open shared object file: No such file or directory 0(18169) CRITICAL: <core> [core/cfg.y:3507]: yyerror_at(): parse error in config file /usr/local/etc/kamailio/kamailio.cfg, line 300, column 12-24: failed to load module 0(18169) ERROR: <core> [core/modparam.c:152]: set_mod_param_regex(): No module matching <app_java> found 0(18169) CRITICAL: <core> [core/cfg.y:3510]: yyerror_at(): parse error in config file /usr/local/etc/kamailio/kamailio.cfg, line 306, column 46: Can't set module parameter 0(18169) ERROR: <core> [core/modparam.c:152]: set_mod_param_regex(): No module matching <app_java> found 0(18169) CRITICAL: <core> [core/cfg.y:3510]: yyerror_at(): parse error in config file /usr/local/etc/kamailio/kamailio.cfg, line 307, column 55: Can't set module parameter 0(18169) ERROR: <core> [core/modparam.c:152]: set_mod_param_regex(): No module matching <app_java> found 0(18169) CRITICAL: <core> [core/cfg.y:3510]: yyerror_at(): parse error in config file /usr/local/etc/kamailio/kamailio.cfg, line 308, column 60: Can't set module parameter 0(18169) ERROR: <core> [core/modparam.c:152]: set_mod_param_regex(): No module matching <app_java> found 0(18169) CRITICAL: <core> [core/cfg.y:3510]: yyerror_at(): parse error in config file /usr/local/etc/kamailio/kamailio.cfg, line 309, column 41: Can't set module parameter 0(18169) ERROR: <core> [core/cfg.y:3370]: yyparse(): cfg. parser: failed to find command java_method_exec (params 2) 0(18169) CRITICAL: <core> [core/cfg.y:3510]: yyerror_at(): parse error in config file /usr/local/etc/kamailio/kamailio.cfg, line 483, column 37: unknown command, missing loadmodule?
### Possible Solutions
<!-- If you found a solution or workaround for the issue, describe it. Ideally, provide a pull request with a fix. -->
### Additional Information
* **Kamailio Version** - output of `kamailio -v`
version: kamailio 5.2.3 (x86_64/linux) c36229 flags: STATS: Off, USE_TCP, USE_TLS, USE_SCTP, TLS_HOOKS, USE_RAW_SOCKS, DISABLE_NAGLE, USE_MCAST, DNS_IP_HACK, SHM_MEM, SHM_MMAP, PKG_MALLOC, Q_MALLOC, F_MALLOC, TLSF_MALLOC, DBG_SR_MEMORY, USE_FUTEX, FAST_LOCK-ADAPTIVE_WAIT, USE_DNS_CACHE, USE_DNS_FAILOVER, USE_NAPTR, USE_DST_BLACKLIST, HAVE_RESOLV_RES ADAPTIVE_WAIT_LOOPS=1024, MAX_RECV_BUFFER_SIZE 262144 MAX_URI_SIZE 1024, BUF_SIZE 65535, DEFAULT PKG_SIZE 8MB poll method support: poll, epoll_lt, epoll_et, sigio_rt, select. id: c36229
* **Operating System**:
Ubuntu 18.04
This is what I have in kamailio.cfg
loadmodule "app_java.so" modparam("app_java", "class_name", "Kamailio") modparam("app_java", "child_init_method", "child_init") modparam("app_java", "java_options", "-Djava.compiler=NONE") modparam("app_java", "force_cmd_exec", 0)
This issue is stale because it has been open 6 weeks with no activity. Remove stale label or comment or this will be closed in 2 weeks.
Closed #1984 as completed.