Return-Path: X-Original-To: apmail-activemq-dev-archive@www.apache.org Delivered-To: apmail-activemq-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 5CFF810236 for ; Wed, 7 Aug 2013 19:13:59 +0000 (UTC) Received: (qmail 62708 invoked by uid 500); 7 Aug 2013 19:13:56 -0000 Delivered-To: apmail-activemq-dev-archive@activemq.apache.org Received: (qmail 59645 invoked by uid 500); 7 Aug 2013 19:13:51 -0000 Mailing-List: contact dev-help@activemq.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@activemq.apache.org Delivered-To: mailing list dev@activemq.apache.org Received: (qmail 59458 invoked by uid 99); 7 Aug 2013 19:13:48 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 07 Aug 2013 19:13:48 +0000 Date: Wed, 7 Aug 2013 19:13:47 +0000 (UTC) From: "Kevin Schmidt (JIRA)" To: dev@activemq.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Created] (AMQ-4673) Application that uses activemq-camel fails deploying to GlassFish v4 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 Kevin Schmidt created AMQ-4673: ---------------------------------- Summary: Application that uses activemq-camel fails deploying to GlassFish v4 Key: AMQ-4673 URL: https://issues.apache.org/jira/browse/AMQ-4673 Project: ActiveMQ Issue Type: Bug Components: activemq-camel Affects Versions: 5.6.0 Environment: Mac OS X, Java 1.7.0_25, GlassFish v4 Reporter: Kevin Schmidt Attachments: CamelEndpointLoader.patch I have an application that uses activemq-camel and deploys/works fine with GlassFish v3. I tried to deploy the same application on GlassFish v4 and get this error: remote failure: Error occurred during deployment: Exception while deploying the app [appname] : The lifecycle method [afterPropertiesSet] must not throw a checked exception. Related annotation information: annotation [@javax.annotation.PostConstruct()] on annotated element [public void org.apache.activemq.camel.component.CamelEndpointLoader.afterPropertiesSet() throws java.lang.Exception] of type [METHOD]. Please see server.log for more details. Command deploy failed. It appears that CamelEndpointLoader has a @PostConstruct method that throws an Exception and per the Java EE spec that isn't allowed. Apparently GlassFish v3 was lenient but v4 is not. Looking at the code, it is easy to fix. The afterPropertiesSet method just needs to catch the exceptions from addQueue/addTopic and log them at the end of the method like it does earlier in the method. If a failure to add these during the method should actually be considered a failure, then something like IllegalStateException or another unchecked exception should be thrown instead. This fix has been tested and verified to get past the problem. -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira