I test my object.Test Failed, why?
I assumed that the pairs (null, null) are as if equal to each other (according to the laws of logic, so to speak). (null, null) the same value.
Cod:
#Test
fun parseFullNameTest(){
/* skillBranch tests */
assertEquals(null to null, Utils.parseFullName(null))
Error:
junit.framework.AssertionFailedError:
Expected :(null, null)
Actual :(null, null)
<Click to see difference>
at junit.framework.Assert.fail(Assert.java:57)
at junit.framework.Assert.failNotEquals(Assert.java:329)
at junit.framework.Assert.assertEquals(Assert.java:78)
at junit.framework.Assert.assertEquals(Assert.java:86)
at ru.skillbranch.devintensive.UnitTest.parseFullNameTest(UnitTest.kt:35)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
at org.junit.runner.JUnitCore.run(JUnitCore.java:137)
at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:68)
at com.intellij.rt.execution.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:47)
at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:242)
at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:70)
Process finished with exit code -1
how it works?!
What the error message shows is that the string representation (result of calling toString()) of Utils.parseFullName(null) is (null, null). This doesn't mean Utils.parseFullName(null) is actually Pair(null, null); it could be e.g. Pair("null", "null"). Without showing parseFullName's code I don't think it's possible to be more precise.
Related
i am trying to add a udp src dynamically to a running pipeline.
e.g
void addAudioSource(std::string const ip, int const port, int const payloadtype)
{
std::string description = "autoaudiosrc ! queue ! audioconvert ! audio/x-raw,rate=16000 ! avenc_g722 ! rtpg722pay";
audiosrc = Gst::Parse::create_bin(description, true);
pipeline->add(audiosrc);
{
auto srcpad = audiosrc->get_static_pad("src");
auto sinkpad = rtpbin->get_request_pad("send_rtp_sink_1");
srcpad->link(sinkpad);
}
rtpudpsinkAudio->set_property("host", ip);
rtpudpsinkAudio->set_property("port", port);
rtpudpsinkAudio->set_property("sync",true);
rtpudpsinkAudio->set_property("async",false);
pipeline->add(rtpudpsinkAudio);
{
auto srcpad = rtpbin->get_static_pad("send_rtp_src_1");
auto sinkpad = rtpudpsinkAudio->get_static_pad("sink");
srcpad->link(sinkpad);
}
pipeline->set_state(Gst::State::STATE_PLAYING);
}
--- and ---
void addAudioSink(std::string const ip, int const port, int const payloadtype)
{
char const caps[] = "application/x-rtp,media=(string)audio,clock-rate=(int)8000,payload=(int)%d";
char buffer[128] = {0};
sprintf(buffer,caps,payloadtype);
pipeline->add(rtpudpsrcAudio);
rtpudpsrcAudio->set_property("caps",
Gst::Caps::create_from_string(buffer));
{
auto srcpad = rtpudpsrcAudio->get_static_pad("src");
auto sinkpad = rtpbin->get_request_pad("recv_rtp_sink_1");
srcpad->link(sinkpad);
}
pipeline->set_state(Gst::State::STATE_PLAYING);
}
individually when i am not calling the other function the pipeline works fine.
if i try to call addAudioSink some time after addAudioSource , i always get this error when i debug through the application
0:00:18.190302584 [334m 6945 [00m 0x555556669450 [36mINFO [00m [00;01;34m GST_EVENT gstevent.c:814:gst_event_new_caps: [00m creating caps event application/x-rtp, media=(string)audio, clock-rate=(int)8000, payload=(int)9, ssrc=(uint)1388635048
0:00:18.190323116 [334m 6945 [00m 0x555556669450 [36mINFO [00m [00m basesrc gstbasesrc.c:2965:gst_base_src_loop:<rtpudpsrcaudio-AVP-d80367f9-8361-458d-a52d-23db4d185996> [00m pausing after gst_pad_push() = not-linked
0:00:18.190333169 [334m 6945 [00m 0x555556669450 [33;01mWARN [00m [00m basesrc gstbasesrc.c:3055:gst_base_src_loop:<rtpudpsrcaudio-AVP-d80367f9-8361-458d-a52d-23db4d185996> [00m error: Internal data stream error.
0:00:18.190337616 [334m 6945 [00m 0x555556669450 [33;01mWARN [00m [00m basesrc gstbasesrc.c:3055:gst_base_src_loop:<rtpudpsrcaudio-AVP-d80367f9-8361-458d-a52d-23db4d185996> [00m error: streaming stopped, reason not-linked (-1)
0:00:18.190350252 [334m 6945 [00m 0x555556669450 [36mINFO [00m [00;01;31;47m GST_ERROR_SYSTEM gstelement.c:2145:gst_element_message_full_with_details:<rtpudpsrcaudio-AVP-d80367f9-8361-458d-a52d-23db4d185996> [00m posting message: Internal data stream error.
0:00:18.190358717 [334m 6945 [00m 0x555556669450 [36mINFO [00m [00;01;31;47m GST_ERROR_SYSTEM gstelement.c:2172:gst_element_message_full_with_details:<rtpudpsrcaudio-AVP-d80367f9-8361-458d-a52d-23db4d185996> [00m posted error message: Internal data stream error.
the other thing is that this pipeline works most of the time.
i am only hit by this error when i debug through the application and sometimes when on release build.
The only issue that i have been able to find out is.
sometimes it says rtpssrcdemux0:src_2345243 not linked, and then udpsrc fails with gst_pad_push() = not-linked.
there is this issue that i dont understand, that the pipeline works most of the time, it fails for 25 % of time.
please help
In an EB environment I am getting these errors from worker Instances, who access the SQS queues through AWS API to check for new messages. It just started since 4-5 days and comes constantly every hour, Is it due to some network issue from AWS side??
Update#: No Issues in PHD affecting our region where this is deployed.
An exception of type HttpErrorResponseException was handled in ErrorHandler.Amazon.Runtime.Internal.HttpErrorResponseException: The remote server returned an error: (503) Server Unavailable. ---> System.Net.WebException: The remote server returned an error: (503) Server Unavailable.
at System.Net.HttpWebRequest.GetResponse()
at Amazon.Runtime.Internal.HttpRequest.GetResponse() in E:\JenkinsWorkspaces\v3-trebuchet-release\AWSDotNetPublic\sdk\src\Core\Amazon.Runtime\Pipeline\HttpHandler\_bcl\HttpWebRequestFactory.cs:line 106
--- End of inner exception stack trace ---
at Amazon.Runtime.Internal.HttpRequest.GetResponse() in E:\JenkinsWorkspaces\v3-trebuchet-release\AWSDotNetPublic\sdk\src\Core\Amazon.Runtime\Pipeline\HttpHandler\_bcl\HttpWebRequestFactory.cs:line 114
at Amazon.Runtime.Internal.HttpHandler`1.InvokeSync(IExecutionContext executionContext) in E:\JenkinsWorkspaces\v3-trebuchet-release\AWSDotNetPublic\sdk\src\Core\Amazon.Runtime\Pipeline\HttpHandler\HttpHandler.cs:line 85
at Amazon.Runtime.Internal.PipelineHandler.InvokeSync(IExecutionContext executionContext) in E:\JenkinsWorkspaces\v3-trebuchet-release\AWSDotNetPublic\sdk\src\Core\Amazon.Runtime\Pipeline\PipelineHandler.cs:line 55
at Amazon.Runtime.Internal.Unmarshaller.InvokeSync(IExecutionContext executionContext) in E:\JenkinsWorkspaces\v3-trebuchet-release\AWSDotNetPublic\sdk\src\Core\Amazon.Runtime\Pipeline\Handlers\Unmarshaller.cs:line 48
at Amazon.Runtime.Internal.PipelineHandler.InvokeSync(IExecutionContext executionContext) in E:\JenkinsWorkspaces\v3-trebuchet-release\AWSDotNetPublic\sdk\src\Core\Amazon.Runtime\Pipeline\PipelineHandler.cs:line 55
at Amazon.SQS.Internal.ValidationResponseHandler.InvokeSync(IExecutionContext executionContext) in E:\JenkinsWorkspaces\v3-trebuchet-release\AWSDotNetPublic\sdk\src\Services\SQS\Custom\Internal\ValidationResponseHandler.cs:line 28
at Amazon.Runtime.Internal.PipelineHandler.InvokeSync(IExecutionContext executionContext) in E:\JenkinsWorkspaces\v3-trebuchet-release\AWSDotNetPublic\sdk\src\Core\Amazon.Runtime\Pipeline\PipelineHandler.cs:line 55
at Amazon.Runtime.Internal.ErrorHandler.InvokeSync(IExecutionContext executionContext) in E:\JenkinsWorkspaces\v3-trebuchet-release\AWSDotNetPublic\sdk\src\Core\Amazon.Runtime\Pipeline\ErrorHandler\ErrorHandler.cs:line 72
And This:
An exception of type WebException was handled in ErrorHandler.System.Net.WebException: The underlying connection was closed: A connection that was expected to be kept alive was closed by the server. ---> System.IO.IOException: Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host. ---> System.Net.Sockets.SocketException: An existing connection was forcibly closed by the remote host
at System.Net.Sockets.Socket.Receive(Byte[] buffer, Int32 offset, Int32 size, SocketFlags socketFlags)
at System.Net.Sockets.NetworkStream.Read(Byte[] buffer, Int32 offset, Int32 size)
--- End of inner exception stack trace ---
at System.Net.Sockets.NetworkStream.Read(Byte[] buffer, Int32 offset, Int32 size)
at System.Net.FixedSizeReader.ReadPacket(Byte[] buffer, Int32 offset, Int32 count)
at System.Net.Security._SslStream.StartFrameHeader(Byte[] buffer, Int32 offset, Int32 count, AsyncProtocolRequest asyncRequest)
at System.Net.Security._SslStream.StartReading(Byte[] buffer, Int32 offset, Int32 count, AsyncProtocolRequest asyncRequest)
at System.Net.Security._SslStream.ProcessRead(Byte[] buffer, Int32 offset, Int32 count, AsyncProtocolRequest asyncRequest)
at System.Net.TlsStream.Read(Byte[] buffer, Int32 offset, Int32 size)
at System.Net.PooledStream.Read(Byte[] buffer, Int32 offset, Int32 size)
at System.Net.Connection.SyncRead(HttpWebRequest request, Boolean userRetrievedStream, Boolean probeRead)
--- End of inner exception stack trace ---
at System.Net.HttpWebRequest.GetResponse()
at Amazon.Runtime.Internal.HttpRequest.GetResponse() in E:\JenkinsWorkspaces\v3-trebuchet-release\AWSDotNetPublic\sdk\src\Core\Amazon.Runtime\Pipeline\HttpHandler\_bcl\HttpWebRequestFactory.cs:line 118
at Amazon.Runtime.Internal.HttpHandler`1.InvokeSync(IExecutionContext executionContext) in E:\JenkinsWorkspaces\v3-trebuchet-release\AWSDotNetPublic\sdk\src\Core\Amazon.Runtime\Pipeline\HttpHandler\HttpHandler.cs:line 85
at Amazon.Runtime.Internal.PipelineHandler.InvokeSync(IExecutionContext executionContext) in E:\JenkinsWorkspaces\v3-trebuchet-release\AWSDotNetPublic\sdk\src\Core\Amazon.Runtime\Pipeline\PipelineHandler.cs:line 55
at Amazon.Runtime.Internal.Unmarshaller.InvokeSync(IExecutionContext executionContext) in E:\JenkinsWorkspaces\v3-trebuchet-release\AWSDotNetPublic\sdk\src\Core\Amazon.Runtime\Pipeline\Handlers\Unmarshaller.cs:line 48
at Amazon.Runtime.Internal.PipelineHandler.InvokeSync(IExecutionContext executionContext) in E:\JenkinsWorkspaces\v3-trebuchet-release\AWSDotNetPublic\sdk\src\Core\Amazon.Runtime\Pipeline\PipelineHandler.cs:line 55
at Amazon.SQS.Internal.ValidationResponseHandler.InvokeSync(IExecutionContext executionContext) in E:\JenkinsWorkspaces\v3-trebuchet-release\AWSDotNetPublic\sdk\src\Services\SQS\Custom\Internal\ValidationResponseHandler.cs:line 28
at Amazon.Runtime.Internal.PipelineHandler.InvokeSync(IExecutionContext executionContext) in E:\JenkinsWorkspaces\v3-trebuchet-release\AWSDotNetPublic\sdk\src\Core\Amazon.Runtime\Pipeline\PipelineHandler.cs:line 55
at Amazon.Runtime.Internal.ErrorHandler.InvokeSync(IExecutionContext executionContext) in E:\JenkinsWorkspaces\v3-trebuchet-release\AWSDotNetPublic\sdk\src\Core\Amazon.Runtime\Pipeline\ErrorHandler\ErrorHandler.cs:line 72
I am trying to get a Scala program to communicate with a c++ program via zeromq by using the request-reply pattern. The scala program should send a request to the C++ program which replies.
However I see the error
org.zeromq.ZMQException: Operation cannot be accomplished in current state
But all I can find in the docu is that one has to read responses before sending a second request. In my case I am issuing a request, followed by a reading of the response (this is where the exception is thrown).
Code of the server:
#include "zmq.hpp"
#include <string>
#include <iostream>
#include <thread>
int main()
{
zmq::context_t context(1);
zmq::socket_t socket(context, ZMQ_REP);
socket.bind("tcp://*:5555");
while (1) {
zmq::message_t request;
socket.recv(&request);
std::string requ = std::string(static_cast<char*>(request.data()), request.size());
std::cout << requ << std::endl;
// Write response
zmq::message_t req(2);
memcpy((void *)req.data(), "ok", 5);
socket.send(req);
}
}
Code of the client:
import org.zeromq.ZMQ
import org.zeromq.ZMQ.{Context, Socket}
object Adapter {
def main( args: Array[String] ) = {
val context = ZMQ.context(1)
val socket = context.socket(ZMQ.REQ)
println { "Connecting to backend" }
socket.connect("tcp://127.0.0.1:5555")
val request = "1 1 1 1".getBytes()
request(request.length - 1) = 0.toByte
println { "Sending Request" }
if (!socket.send(request, 0))
println{ "could not send"}
println { "Receiving Response" }
val reply = socket.recv(0)
println { "Received reply: " + new String(reply, 0, reply.length - 1) }
}
}
The complete output of sbt:
OpenJDK 64-Bit Server VM warning: You have loaded library /tmp/jna7980154308052950568.tmp which might have disabled stack guard. The VM will try to fix the stack guard now.
It's highly recommended that you fix the library with 'execstack -c <libfile>', or link it with '-z noexecstack'.
Connecting to backend
Sending Request
Receiving Response
[error] (run-main-0) org.zeromq.ZMQException: Operation cannot be accomplished in current state
org.zeromq.ZMQException: Operation cannot be accomplished in current state
at org.zeromq.ZMQ$Socket.raiseZMQException(ZMQ.java:448)
at org.zeromq.ZMQ$Socket.recv(ZMQ.java:368)
at ZeroMQActor$.main(ZeroMQExample.scala:56)
at ZeroMQActor.main(ZeroMQExample.scala)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
[trace] Stack trace suppressed: run last compile:run for the full output.
java.lang.RuntimeException: Nonzero exit code: 1
at scala.sys.package$.error(package.scala:27)
[trace] Stack trace suppressed: run last compile:run for the full output.
[error] (compile:run) Nonzero exit code: 1
[error] Total time: 5 s, completed Jun 16, 2015 4:42:42 PM
Sbt pulls Scala 2.9.1 and akka-zeromq 2.0. I have installed zeromq 3.5 from source but I see the same behavior when I install the ubuntu package libzqm3-dev. One possible work-around is using JeroMQ, a pure java-based implementation of zmq, but I would prefer to depend on one zmq library in my whole stack rather than dealing with interop issues.
Thanks in advance.
I believe
memcpy((void *)req.data(), "ok", 5);
should be
memcpy((void *)req.data(), "ok", 2);
... which could be enough to break message handling.
The play application which we are using, has to be kept always alive. This application is basically a RabbitMQ listener which has an infinite while loop, which keeps listening to capture the messages from Message Queue.
The following code is placed in controller, and this play application has to be kept alive at all times
public class Application extends Controller {
public static Result wanHLPT() {
ckmsg()
return ok();
}
public static Result ckmsg() {
try{
ConnectionFactory factory = new ConnectionFactory();
factory.setHost("localhost");
Connection connection = factory.newConnection();
Channel channel = connection.createChannel();
channel.queueDeclare(QUEUE_NAME, false, false, false, null);
while (true) {
QueueingConsumer.Delivery delivery = consumer.nextDelivery();
String message = new String(delivery.getBody());
// business logic
process()
}
}
}
}
But the play application throws akka exception [AskTimeOut Exception: Timed Out],
Please provide any pointers on how to handle this.
Here is the exception:
! #6f977jo6m - Internal server error, for (GET) [/myapp] ->
play.api.Application$$anon$1: Execution exception[[AskTimeoutException: Timed out]]
at play.api.Application$class.handleError(Application.scala:289) ~ [play_2.10.jar:2.1.0]
at play.api.DefaultApplication.handleError(Application.scala:383) ~[play_2.10.jar:2.1.0]
at play.core.server.netty.PlayDefaultUpstreamHandler$$anon$2$$anonfun$handle$1.apply(PlayDefaultUpstreamHandler.scala:132) ~[play_2.10.jar:2.1.0]
at play.core.server.netty.PlayDefaultUpstreamHandler$$anon$2$$anonfun$handle$1.apply(PlayDefaultUpstreamHandler.scala:128) ~[play_2.10.jar:2.1.0]
at play.api.libs.concurrent.PlayPromise$$anonfun$extend1$1.apply(Promise.scala:113) ~[play_2.10.jar:2.1.0]
at play.api.libs.concurrent.PlayPromise$$anonfun$extend1$1.apply(Promise.scala:113) ~[play_2.10.jar:2.1.0]
at play.api.libs.concurrent.PlayPromise$$anonfun$extend$1$$anonfun$apply$1.apply(Promise.scala:104) ~[play_2.10.jar:2.1.0]
at scala.concurrent.impl.Future$PromiseCompletingRunnable.liftedTree1$1(Future.scala:24) ~[scala-library.jar:na]
at scala.concurrent.impl.Future$PromiseCompletingRunnable.run(Future.scala:24) ~[scala-library.jar:na]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) ~[na:1.7.0]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) ~[na:1.7.0]
at java.lang.Thread.run(Thread.java:781) ~[na:1.7.0]
akka.pattern.AskTimeoutException: Timed out
at akka.pattern.PromiseActorRef$$anonfun$1.apply$mcV$sp(AskSupport.scala:310) ~[akka-actor_2.10.jar:na]
at akka.actor.DefaultScheduler$$anon$8.run(Scheduler.scala:193) ~[akka-actor_2.10.jar:na]
at akka.dispatch.TaskInvocation.run(AbstractDispatcher.scala:137) ~[akka-actor_2.10.jar:na]
at scala.concurrent.forkjoin.ForkJoinTask$AdaptedRunnableAction.exec(ForkJoinTask.java:1417) ~[scala-library.jar:na]
at scala.concurrent.forkjoin.ForkJoinTask.doExec(ForkJoinTask.java:262) ~[scala-library.jar:na]
at scala.concurrent.forkjoin.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:975) ~[scala-library.jar:na]
at scala.concurrent.forkjoin.ForkJoinPool.runWorker(ForkJoinPool.java:1478) ~[scala-library.jar:na]
at scala.concurrent.forkjoin.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:104) ~[scala-library.jar:na]
I'm working on a lib that uses Glib internally to connect to other modules.
This lib has a initialize method that sets up the dbus connection and a terminate method that finalizes all the internal resources (including the dbus connection).
At least it should do this.
However, I can't make dbus calls again after the terminate method gets called (of course I called the initialize method again before calling the dbus methods again).
I'm using C++ mainly (a few used libs are in C).
Here is my internal dbus initializer:
#ifdef __cplusplus
extern "C" {
#endif
#include <dbus/dbus-glib.h>
#include <stdio.h>
#define _DBUS_SERVICE "Removed due to restrictions"
#define _DBUS_PATH "/"
#define _DBUS_INTERFACE "Removed due to restrictions"
static DBusGConnection * my_dbus_conn = NULL;
static DBusGProxy * my_proxy = NULL;
gboolean dbus_init() {
GError *error = NULL;
g_type_init();
my_dbus_conn = dbus_g_bus_get(DBUS_BUS_SESSION, &error);
if (my_dbus_conn == NULL) {
g_printerr("DBUS Connection Error (%s)\n", error->message);
g_error_free(error);
return false;
}
my_proxy = dbus_g_proxy_new_for_name(my_dbus_conn, _DBUS_SERVICE, _DBUS_PATH, _DBUS_INTERFACE);
if (my_proxy == NULL) {
g_printerr("ERROR: DBUS Proxy creation Error (%s)\n", error->message);
g_error_free(error);
return false;
}
return true;
}
DBusGProxy * dbus_get_proxy() {
if (my_proxy == NULL) {
dbus_init();
}
return my_proxy;
}
void dbus_term() {
g_object_unref(G_OBJECT (my_proxy));
dbus_g_connection_unref(my_dbus_conn);
my_dbus_conn = NULL;
}
#ifdef __cplusplus
}
#endif
Here is my calling code:
MY_G_DEBUG("Manager", "Creating Server IPC stub...");
this->m_pDbusServer = get_proxy();
if (this->m_pDbusServer == NULL) {
return;
}
MY_G_DEBUG("Manager", "CheckPoint 1!");
gboolean success;
GError *gerror = NULL;
char **l_pHelloWorldReply;
success = dbus_server_helloworld(this->m_pDbusServer, "Hello World from Manager", &l_pHelloWorldReply, &gerror);
MY_G_DEBUG("Manager", "CheckPoint 2!");
if (success == FALSE) {
MY_G_DEBUG("Manager", "CheckPoint 3!");
if (gerror == NULL) {
MY_G_DEBUG("Manager", "CRITICAL: Hello World call Failed (error not set)");
} else {
MY_G_DEBUG("Manager", "CRITICAL: Hello World call Failed (%s)", gerror->message);
g_error_free(gerror);
gerror = NULL;
}
return;
} else {
MY_G_DEBUG("Manager", "CheckPoint 4!");
for (guint ii = 0; l_pHelloWorldReply[ii] != NULL; ii++) {
MY_G_DEBUG("Manager", "Hello World response %d: %s", ii, l_pHelloWorldReply[ii]);
}
}
MY_G_DEBUG("Manager", "CheckPoint 5!");
Here is the logging output:
(process:24498): Manager-DEBUG: Checkpoint: 1!
(process:24498): Manager-DEBUG: Checkpoint: 2!
(process:24498): Manager-DEBUG: Checkpoint: 3!
(process:24498): Manager-DEBUG: CRITICAL: Hello World call Failed (error not set)
I got an error message everytime I call the dbus_term function, however I couldn't manage to fix it.
(process:24498): GLib-GObject-WARNING **: invalid uninstantiatable type `<invalid>' in cast to `GObject'
(process:24498): GLib-GObject-CRITICAL **: g_object_unref: assertion `G_IS_OBJECT (object)' failed
The first time I try to call methods, everything works well...
I strongly believe that's caused by the dbus_term issue.
Does anyone have any idea why that is happening?
Thanks very much.
It is a bug to drop the last reference to a dbus connection that is still open. One of the problems with the bindings that you are using is that it is difficult to know when the connection actually closes. It is somewhat unsatisfying, but it has been my practice to leave one reference around on connections to a well known bus like the session bus.
Don't use dbus-glib in new code, use GDBus instead.
GDBus is the new dbus api in glib 2.26. Its advantages over dbus-glib include the use of the GIO async patterns (GAsync*, GCancellable), the use of GVariant for variant types and better threading support.
See
http://library.gnome.org/devel/gio/2.28/ch29.html for migrating to GDBus.