Return-Path: Delivered-To: apmail-felix-dev-archive@www.apache.org Received: (qmail 70600 invoked from network); 24 Sep 2009 06:13:39 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 24 Sep 2009 06:13:39 -0000 Received: (qmail 61628 invoked by uid 500); 24 Sep 2009 06:13:39 -0000 Delivered-To: apmail-felix-dev-archive@felix.apache.org Received: (qmail 61553 invoked by uid 500); 24 Sep 2009 06:13:38 -0000 Mailing-List: contact dev-help@felix.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@felix.apache.org Delivered-To: mailing list dev@felix.apache.org Received: (qmail 61327 invoked by uid 99); 24 Sep 2009 06:13:38 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 24 Sep 2009 06:13:38 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.140] (HELO brutus.apache.org) (140.211.11.140) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 24 Sep 2009 06:13:36 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id A94BA234C4AF for ; Wed, 23 Sep 2009 23:13:16 -0700 (PDT) Message-ID: <1451605976.1253772796692.JavaMail.jira@brutus> Date: Wed, 23 Sep 2009 23:13:16 -0700 (PDT) From: "Carsten Ziegeler (JIRA)" To: dev@felix.apache.org Subject: [jira] Resolved: (FELIX-1629) SCR Annotations with Constanst reference may cause NPE In-Reply-To: <1240123039.1253653216910.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/FELIX-1629?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Carsten Ziegeler resolved FELIX-1629. ------------------------------------- Resolution: Fixed Thanks for your patch, Stefan! I've applied it in revision: 818374 > SCR Annotations with Constanst reference may cause NPE > ------------------------------------------------------ > > Key: FELIX-1629 > URL: https://issues.apache.org/jira/browse/FELIX-1629 > Project: Felix > Issue Type: Bug > Components: Maven SCR Plugin > Affects Versions: maven-scr-plugin-1.4.0 > Reporter: Stefan Seifert > Assignee: Carsten Ziegeler > Priority: Minor > Fix For: maven-scr-plugin-1.4.1 > > Attachments: 090922_npe_fix_FELIX-1629.patch > > > under certain circumstances the maven scr plugin throws a NPE like this > java.lang.NullPointerException > at org.apache.felix.scrplugin.tags.annotation.defaulttag.Util.getAnnotationValue(Util.java:362) > at org.apache.felix.scrplugin.tags.annotation.defaulttag.Util.getAnnotationValues(Util.java:399) > at org.apache.felix.scrplugin.tags.annotation.defaulttag.Util.getStringValue(Util.java:277) > at org.cqstone.core.annotationtagprovider.ComponentComponentTag.(ComponentComponentTag.java:31) > at org.cqstone.core.annotationtagprovider.CqstoneAnnotationTagProvider.getTags(CqstoneAnnotationTagProvider.java:31) > at org.apache.felix.scrplugin.tags.annotation.AnnotationTagProviderManager.getTags(AnnotationTagProviderManager.java:105) > at org.apache.felix.scrplugin.tags.annotation.AnnotationTagProviderManager.getTags(AnnotationTagProviderManager.java:90) > at org.apache.felix.scrplugin.tags.annotation.AnnotationTagProviderManager.hasScrPluginAnnotation(AnnotationTagProviderManager.java:118) > at org.apache.felix.scrplugin.tags.JavaClassDescriptorManager.getJavaClassDescription(JavaClassDescriptorManager.java:417) > at org.apache.felix.scrplugin.tags.JavaClassDescriptorManager.getSourceDescriptions(JavaClassDescriptorManager.java:394) > at org.apache.felix.scrplugin.SCRDescriptorMojo.execute(SCRDescriptorMojo.java:167) > at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:490) > at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:694) > at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeStandaloneGoal(DefaultLifecycleExecutor.java:569) > at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:539) > at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:387) > at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:348) > at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:180) > at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:328) > at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:138) > at org.apache.maven.cli.MavenCli.main(MavenCli.java:362) > at org.apache.maven.cli.compat.CompatibleMain.main(CompatibleMain.java:60) > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) > at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) > at java.lang.reflect.Method.invoke(Method.java:597) > at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315) > at org.codehaus.classworlds.Launcher.launch(Launcher.java:255) > at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430) > at org.codehaus.classworlds.Launcher.main(Launcher.java:375) > the reason of the NPE is that the "prescan" which is done in AnnotationTagProviderManager#hasScrPluginAnnotation to check if any annotation is present in a java class at all calls the getTags methods without a "JavaClassDescription" object. but Util.getAnnotationValue depends on this, although this is not needed for the "prescan" check. > the attached patch fixes this problem. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.