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 C7745200C5C for ; Thu, 20 Apr 2017 15:43:10 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id C5FE7160B9F; Thu, 20 Apr 2017 13:43:10 +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 1B63F160B91 for ; Thu, 20 Apr 2017 15:43:09 +0200 (CEST) Received: (qmail 72064 invoked by uid 500); 20 Apr 2017 13:43:09 -0000 Mailing-List: contact issues-help@camel.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@camel.apache.org Delivered-To: mailing list issues@camel.apache.org Received: (qmail 72055 invoked by uid 99); 20 Apr 2017 13:43:09 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd3-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 20 Apr 2017 13:43:09 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd3-us-west.apache.org (ASF Mail Server at spamd3-us-west.apache.org) with ESMTP id E2F701813D5 for ; Thu, 20 Apr 2017 13:43:08 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd3-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -100.002 X-Spam-Level: X-Spam-Status: No, score=-100.002 tagged_above=-999 required=6.31 tests=[RP_MATCHES_RCVD=-0.001, SPF_PASS=-0.001, USER_IN_WHITELIST=-100] autolearn=disabled Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd3-us-west.apache.org [10.40.0.10]) (amavisd-new, port 10024) with ESMTP id 5BwR7jt9Wq0O for ; Thu, 20 Apr 2017 13:43:07 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with ESMTP id 643C160DB8 for ; Thu, 20 Apr 2017 13:43:06 +0000 (UTC) Received: from jira-lw-us.apache.org (unknown [207.244.88.139]) by mailrelay1-us-west.apache.org (ASF Mail Server at mailrelay1-us-west.apache.org) with ESMTP id 925E0E0D64 for ; Thu, 20 Apr 2017 13:43:05 +0000 (UTC) Received: from jira-lw-us.apache.org (localhost [127.0.0.1]) by jira-lw-us.apache.org (ASF Mail Server at jira-lw-us.apache.org) with ESMTP id B4BD22400D for ; Thu, 20 Apr 2017 13:43:04 +0000 (UTC) Date: Thu, 20 Apr 2017 13:43:04 +0000 (UTC) From: "Claus Ibsen (JIRA)" To: issues@camel.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (CAMEL-11178) Default method is invisible during Camel Simple evaluation MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Thu, 20 Apr 2017 13:43:11 -0000 [ https://issues.apache.org/jira/browse/CAMEL-11178?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15976707#comment-15976707 ] Claus Ibsen commented on CAMEL-11178: ------------------------------------- Can you try with latest 2.18.3 release as 2.16.x is EOL and no longer supported. > Default method is invisible during Camel Simple evaluation > ---------------------------------------------------------- > > Key: CAMEL-11178 > URL: https://issues.apache.org/jira/browse/CAMEL-11178 > Project: Camel > Issue Type: Bug > Components: camel-core > Affects Versions: 2.16.1 > Reporter: Anton Sulim > > Issue can be reproduced with below unit test, I have not found it in tracker. > Essence: interface A has default method, interface B extends A, default method is invisible during Simple language evaluation. > {code:java} > import org.apache.camel.CamelContext; > import org.apache.camel.Exchange; > import org.apache.camel.builder.RouteBuilder; > import org.apache.camel.impl.DefaultCamelContext; > import org.apache.camel.impl.DefaultExchange; > import org.junit.Assert; > import org.junit.Test; > public class DefaultMethodIsInvisibleTest { > public static interface A { > public default String defaultMethod() { > return "default method result"; > } > } > public static interface B extends A { > } > @Test > public void camelSimpleDoesNotSeeDefaultMethod() throws Exception { > CamelContext context = new DefaultCamelContext(); > context.addRoutes(new RouteBuilder() { > public void configure() { > from("direct:camelSimpleDoesNotSeeDefaultMethod").log("Result of default method invocation is ${exchangeProperty.myObject.defaultMethod}"); > } > }); > context.start(); > Exchange incomingExchange = new DefaultExchange(context); > incomingExchange.setProperty("myObject", new B() { > }); > Exchange result = context.createProducerTemplate().send("direct:camelSimpleDoesNotSeeDefaultMethod", incomingExchange); > Assert.assertNull(result.getException()); > } > } > {code} > Stacktrace: > {code} > Caused by: org.apache.camel.language.bean.RuntimeBeanExpressionException: Failed to invoke method: defaultMethod on null due to: org.apache.camel.component.bean.MethodNotFoundException: Method with name: defaultMethod not found on bean: com.ubs.wma.gfi.tradersbook.subscriber.DefaultMethodIsInvisibleTest$2@5dafbe45 of type: com.ubs.wma.gfi.tradersbook.subscriber.DefaultMethodIsInvisibleTest$2. Exchange[][Message: [Body is null]] > at org.apache.camel.language.bean.BeanExpression$OgnlInvokeProcessor.process(BeanExpression.java:290) > at org.apache.camel.language.bean.BeanExpression.evaluate(BeanExpression.java:114) > ... 46 common frames omitted > Caused by: org.apache.camel.component.bean.MethodNotFoundException: Method with name: defaultMethod not found on bean: com.ubs.wma.gfi.tradersbook.subscriber.DefaultMethodIsInvisibleTest$2@5dafbe45 of type: com.ubs.wma.gfi.tradersbook.subscriber.DefaultMethodIsInvisibleTest$2. Exchange[][Message: [Body is null]] > at org.apache.camel.component.bean.BeanInfo.createInvocation(BeanInfo.java:269) > at org.apache.camel.component.bean.BeanInfo.createInvocation(BeanInfo.java:183) > at org.apache.camel.component.bean.BeanProcessor.process(BeanProcessor.java:159) > {code} -- This message was sent by Atlassian JIRA (v6.3.15#6346)