Return-Path: X-Original-To: apmail-camel-issues-archive@minotaur.apache.org Delivered-To: apmail-camel-issues-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 0002D17F12 for ; Sun, 19 Apr 2015 00:20:58 +0000 (UTC) Received: (qmail 38028 invoked by uid 500); 19 Apr 2015 00:20:58 -0000 Delivered-To: apmail-camel-issues-archive@camel.apache.org Received: (qmail 37983 invoked by uid 500); 19 Apr 2015 00:20:58 -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 37974 invoked by uid 99); 19 Apr 2015 00:20:58 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 19 Apr 2015 00:20:58 +0000 Date: Sun, 19 Apr 2015 00:20:58 +0000 (UTC) From: "Chris Love (JIRA)" To: issues@camel.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (CAMEL-8667) java.lang.NullPointerException CamelSpringTestContextLoader.java:174 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/CAMEL-8667?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14501641#comment-14501641 ] Chris Love commented on CAMEL-8667: ----------------------------------- I am tracing this back to {code:java} return CamelSpringTestHelper.getTestClass(); // Line 472 CamelSpringTestContextLoader {code} Is coming back as a null. {code:java} private static ThreadLocal> testClazz = new ThreadLocal>(); public static Class getTestClass() { return testClazz.get(); // returning null } {code} Thanks Chris > java.lang.NullPointerException CamelSpringTestContextLoader.java:174 > -------------------------------------------------------------------- > > Key: CAMEL-8667 > URL: https://issues.apache.org/jira/browse/CAMEL-8667 > Project: Camel > Issue Type: Bug > Components: camel-spring > Affects Versions: 2.15.1 > Reporter: Chris Love > > I am getting a NPE with camel spring unit testing. I am trying to convert https://github.com/apache/camel/blob/master/components/camel-bindy/src/test/java/org/apache/camel/dataformat/bindy/fixed/unmarshall/simple/trim/BindySimpleFixedLengthUnmarshallTest.java to pure annotations ... and I am getting a NPE ... > I am using: > {code:java} > @ContextConfiguration() > @RunWith(SpringJUnit4ClassRunner.class) > @BoostrapWith(CamelTestContextBootstrapper.class) > {code} > Here is my stack trace. > {code:java} > Caused by: java.lang.NullPointerException: null > at org.apache.camel.test.spring.CamelSpringTestContextLoader.cleanup(CamelSpringTestContextLoader.java:174) > at org.apache.camel.test.spring.CamelSpringTestContextLoader.loadContext(CamelSpringTestContextLoader.java:86) > at org.springframework.test.context.DefaultCacheAwareContextLoaderDelegate.loadContextInternal(DefaultCacheAwareContextLoaderDelegate.java:68) > at org.springframework.test.context.DefaultCacheAwareContextLoaderDelegate.loadContext(DefaultCacheAwareContextLoaderDelegate.java:86) > at org.springframework.test.context.DefaultTestContext.getApplicationContext(DefaultTestContext.java:72) > {code} > I will update will the code from my unit test when I can get on to my dev server. -- This message was sent by Atlassian JIRA (v6.3.4#6332)