Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 3627C200D34 for ; Fri, 20 Oct 2017 06:27:23 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 2B463160BEC; Fri, 20 Oct 2017 04:27:23 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 4BF4E1609EE for ; Fri, 20 Oct 2017 06:27:22 +0200 (CEST) Received: (qmail 84389 invoked by uid 500); 20 Oct 2017 04:27:21 -0000 Mailing-List: contact users-help@activemq.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@activemq.apache.org Delivered-To: mailing list users@activemq.apache.org Received: (qmail 84370 invoked by uid 99); 20 Oct 2017 04:27:20 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd2-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 20 Oct 2017 04:27:20 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd2-us-west.apache.org (ASF Mail Server at spamd2-us-west.apache.org) with ESMTP id 0D95E1A0FCE for ; Fri, 20 Oct 2017 04:27:20 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd2-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 2.73 X-Spam-Level: ** X-Spam-Status: No, score=2.73 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, FREEMAIL_ENVFROM_END_DIGIT=0.25, HEADER_FROM_DIFFERENT_DOMAINS=0.001, HTML_MESSAGE=2, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, RCVD_IN_SORBS_SPAM=0.5, SPF_PASS=-0.001] autolearn=disabled Authentication-Results: spamd2-us-west.apache.org (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.com Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd2-us-west.apache.org [10.40.0.9]) (amavisd-new, port 10024) with ESMTP id pDR948hzKokx for ; Fri, 20 Oct 2017 04:27:17 +0000 (UTC) Received: from mail-it0-f52.google.com (mail-it0-f52.google.com [209.85.214.52]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with ESMTPS id 7ACF05FB0B for ; Fri, 20 Oct 2017 04:27:17 +0000 (UTC) Received: by mail-it0-f52.google.com with SMTP id c3so12715329itc.3 for ; Thu, 19 Oct 2017 21:27:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to; bh=RqI4OXu5jaFIIOr+h3gvPh9IR4GqtxcyJq8S1RW1Ucs=; b=BuwGFSgzPMUgcPzs3CNQ+B0/AAhM0Za94r7zhBh7dsbf/Z99qdUan843plA5crGkDU TyvHshskdtD4uKLV//Br0RNIF1z+w0j/WIKnFnbb8IFNvikaMyTLFgc7Q+LbgESo8M2+ Ru/j6JjKRA7pTcVDwMGkUV01TFVImoBhoYKpHr8AuuSLj76e1WOOSfbQbPCh4VU1o5fs 3nclbCQe9OTyyDCthdokugzCrKAM/FkbYMx9vMjs9XYfOY9y8kG0a3BMl02fHY3rhHGf XNSDZVpQrAg0QqTkPwqGs0+21S8i+bX7OeODTmP1fxEav0e/gmXyOH7Tl4JQewjXKDQX NXrw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to; bh=RqI4OXu5jaFIIOr+h3gvPh9IR4GqtxcyJq8S1RW1Ucs=; b=Yqg7Lcsy0wDRDJje1+8UaO4rIm6vLPt5TKSvLZhlLFHCr8A+A/hrkgwSv0/YRR6jB9 AUikHvDSZpeUYj5dmDs4OvXMgZKPlK/HZFfXLW1CKgCvNErkSQfLUi9arod8Gpol6jC7 QVJPnyWv7Ch0RZCQHqvWvVFl1Ld6HiT61Kha29qOA2syP4pK5O7A5dpmTfKbuI4c864Q x9w2H6ztk1H9b9Sj6gNj+OUFp66UVYKB54CbONMYTELmKfPcjmoCQa2M2EIY7mtiBtlb awX+RAzjw6vmknLPhRVesWcH5ItH519+3T1zTjdZhbz7+/8N2oBbkTN6OyftwDTTJTZE yRgg== X-Gm-Message-State: AMCzsaXWYB6YmhCT2a20to8CTxIQuf+I5UE8XHzmSnMRj7l+bJVrVofm rJClOq2Yrf5YrrGQ2X/LDFK1gs+0x+T/djvXzKY= X-Google-Smtp-Source: ABhQp+Td7DL4NnCPCpiqg1Dp0qBe1uFwrxKYLWF4dYLBUv0Ms9UbJMsDFG+M3P5TpSkD2PVg9NVfEW3N3iSk1N2HSM4= X-Received: by 10.36.20.81 with SMTP id 78mr746030itg.127.1508473631144; Thu, 19 Oct 2017 21:27:11 -0700 (PDT) MIME-Version: 1.0 Sender: tbain98@gmail.com Received: by 10.2.102.30 with HTTP; Thu, 19 Oct 2017 21:26:50 -0700 (PDT) In-Reply-To: <1508420682195-0.post@n4.nabble.com> References: <1508420682195-0.post@n4.nabble.com> From: Tim Bain Date: Thu, 19 Oct 2017 22:26:50 -0600 X-Google-Sender-Auth: Pt-z2HF11ZMrbC4aa1kXvjDWH5A Message-ID: Subject: Re: ActiveMQMessageConsumer dispatch To: ActiveMQ Users Content-Type: multipart/alternative; boundary="001a1143e66ceffe27055bf2e24e" archived-at: Fri, 20 Oct 2017 04:27:23 -0000 --001a1143e66ceffe27055bf2e24e Content-Type: text/plain; charset="UTF-8" > > java.lang.RuntimeException: Failed to invoke > public org.apache.activemq.command.ActiveMQDestination() with no args > java.lang.RuntimeException: Failed to invoke public > org.apache.activemq.command.ActiveMQDestination() with no args > This error message means that Gson is trying to deserialize an ActiveMQDestination object but doesn't know how to because it doesn't have a constructor that takes no arguments. Of course, your code isn't supposed to be deserializing objects of that time, so the real question is why that's happening. at > com.google.gson.internal.ConstructorConstructor$3.construct( > ConstructorConstructor.java:111) > at > com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$Adapter.read( > ReflectiveTypeAdapterFactory.java:206) > at > com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$1.read( > ReflectiveTypeAdapterFactory.java:116) > at > com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$Adapter.read( > ReflectiveTypeAdapterFactory.java:216) > at com.google.gson.Gson.fromJson(Gson.java:879) > at com.google.gson.Gson.fromJson(Gson.java:844) > at com.google.gson.Gson.fromJson(Gson.java:793) > at com.google.gson.Gson.fromJson(Gson.java:765) > Gson code is being invoked. Did you manually configure a serializer/unserializer? (In Jackson, you'd make an ObjectMapper that knew how to serialize and deserialize, but I've not used Gson so I'm not sure how it works.) If so, might you have configured something about it incorrectly? > at > de.mannheim.wifo2.fesas.sasStructure.data.adaptationLogic.knowledge. > KnowledgeRecord.getData(KnowledgeRecord.java:61) > Is this your code, or at least code to which you have the source? What is it doing? Also, what text is being passed to Gson.fromJson()? If you have this source, you can use a debugger to answer that question; if not, set a breakpoint on the fromJson() method (for which the source code is definitely available) and look at the value of the passed argument. I suspect you'll find it contains more content than just the JSON you listed below. > at logicElements.monitor.Monitor.callLogic(Monitor.java:130) > at logicElements.monitor.Monitor$3.onMessage(Monitor.java:211) > How about these two methods? Are they yours? What are they doing? How are they turning an ActiveMQMessage into text that is getting passed to the Gson.fromJson() method? > at > org.apache.activemq.ActiveMQMessageConsumer.dispatch( > ActiveMQMessageConsumer.java:967) > at > org.apache.activemq.ActiveMQSessionExecutor.dispatch( > ActiveMQSessionExecutor.java:122) > at > org.apache.activemq.ActiveMQSessionExecutor.iterate( > ActiveMQSessionExecutor.java:192) > at > org.apache.activemq.thread.PooledTaskRunner.runTask( > PooledTaskRunner.java:122) > at > org.apache.activemq.thread.PooledTaskRunner$1.run( > PooledTaskRunner.java:43) > at > java.util.concurrent.ThreadPoolExecutor.runWorker( > ThreadPoolExecutor.java:1142) > at > java.util.concurrent.ThreadPoolExecutor$Worker.run( > ThreadPoolExecutor.java:617) > at java.lang.Thread.run(Thread.java:745) > Caused by: java.lang.InstantiationException > at > sun.reflect.InstantiationExceptionConstructorAccessorImpl.newInstance( > InstantiationExceptionConstructorAccessorImpl.java:48) > at java.lang.reflect.Constructor.newInstance(Constructor.java:423) > at > com.google.gson.internal.ConstructorConstructor$3.construct( > ConstructorConstructor.java:108) > ... 18 more > None of the code in this final block is relevant to your problem. > The String das is sent is similar to this: > > {"Tulips_1":{"Zone":"Tulips","PresenceSensor":false," > Thermometer":289,"Illuminance":1146,"CO2-Level":400,"CO- > Level":440,"FloodSensor":true},"Roses_1":{"Zone":"Roses"," > PresenceSensor":true,"Thermometer":290,"Illuminance" > :214,"CO2-Level":300,"CO-Level":430,"FloodSensor":true}} > What do you get when you call Gson.fromJson() on this input string? Tim --001a1143e66ceffe27055bf2e24e--