felix-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Johannes Schneider (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (FELIX-3739) scr-plugin: "Annotated method {0} not found"
Date Wed, 21 Nov 2012 15:19:58 GMT

    [ https://issues.apache.org/jira/browse/FELIX-3739?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13502037#comment-13502037
] 

Johannes Schneider commented on FELIX-3739:
-------------------------------------------

The same problem occurs when there is a constructor that is annotated:


 @Inject
  public DefaultSerializationService(@Nonnull EntryDescriptorProviderService entryDescriptorProviderService)
{


results in: "Annoated method <init> not found."


--> 1.8.1-SNAPSHOT does *not* fix this issue.

I strongly suggest that this is viewed as blocker since the plugin fails for methods that
are not annoated with scr-annotations. 
And I suggest that the plugin does *not* fail if a method could not be found. Instead a warning
should be enough to notify the user that there might be a problem.

Any ideas when the 1.8.1 release could happen?


                
> scr-plugin: "Annotated method {0} not found"
> --------------------------------------------
>
>                 Key: FELIX-3739
>                 URL: https://issues.apache.org/jira/browse/FELIX-3739
>             Project: Felix
>          Issue Type: Bug
>          Components: Maven SCR Plugin
>    Affects Versions: maven-scr-plugin-1.8.0, scr ant task 1.2.0, scr generator 1.2.0
>         Environment: Linux, Maven 3, Java 7
>            Reporter: Johannes Schneider
>            Assignee: Carsten Ziegeler
>             Fix For: maven-scr-plugin-1.8.2, scr ant task 1.2.2, scr generator 1.2.2
>
>
> I run in to that[1] problem.
> The method that is not found looks like that:
> > @Nonnull public static <T> Entry<? extends T> create( @Nonnull T
> > object,
> @Nonnull >byte[] expected ) {
> > }
> I have debugged this and it comes to that:
> in ClassScanner#237 parameters are compared. The second parameter of
> my method (byte[]) has a strange difference here:
> parameterTypeName: [B
> signature[index].getClassName(): byte[]
> So I think this might be related to the asm usage
> I *think* instead of "signature[index].getClassName()" there should be
> called
> signature[index].getDescriptor()
> Any idea how I could work around that problem (without changing my
> method's signature)?
> Thanks,
> Johannes
> [1]
> [ERROR] Failed to execute goal
> org.apache.felix:maven-scr-plugin:1.8.0:scr
> (generate-scr-scrdescriptor) on project test-utils:
> com.cedarsoft.serialization.test.utils.AbstractSerializerTest2 :
> Annotated method create not found. -> [Help 1]
> org.apache.maven.lifecycle.LifecycleExecutionException: Failed to
> execute goal org.apache.felix:maven-scr-plugin:1.8.0:scr
> (generate-scr-scrdescriptor) on project test-utils:
> com.cedarsoft.serialization.test.utils.AbstractSerializerTest2 :
> Annotated method create not found.
> 	at
> org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:217)
> 	at
> org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
> 	at
> org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
> 	at
> org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:84)
> 	at
> org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:59)
> 	at
> org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183)
> 	at
> org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161)
> 	at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:320)
> 	at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156)
> 	at org.apache.maven.cli.MavenCli.execute(MavenCli.java:537)
> 	at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:196)
> 	at org.apache.maven.cli.MavenCli.main(MavenCli.java:141)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> 	at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
> 	at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
> 	at java.lang.reflect.Method.invoke(Method.java:601)
> 	at
> org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:290)
> 	at
> org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:230)
> 	at
> org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:409)
> 	at
> org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:352)
> Caused by: org.apache.maven.plugin.MojoExecutionException:
> com.cedarsoft.serialization.test.utils.AbstractSerializerTest2 :
> Annotated method create not found.
> 	at
> org.apache.felix.scrplugin.mojo.SCRDescriptorMojo.execute(SCRDescriptorMojo.java:222)
> 	at
> org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:101)
> 	at
> org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:209)
> 	... 19 more
> Caused by: org.apache.felix.scrplugin.SCRDescriptorException:
> Annotated method create not found.
> 	at
> org.apache.felix.scrplugin.helper.ClassScanner.extractAnnotation(ClassScanner.java:249)
> 	at
> org.apache.felix.scrplugin.helper.ClassScanner.processClass(ClassScanner.java:180)
> 	at
> org.apache.felix.scrplugin.helper.ClassScanner.scanSources(ClassScanner.java:143)
> 	at
> org.apache.felix.scrplugin.SCRDescriptorGenerator.execute(SCRDescriptorGenerator.java:154)
> 	at
> org.apache.felix.scrplugin.mojo.SCRDescriptorMojo.execute(SCRDescriptorMojo.java:217)
> 	... 21 more

--
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

Mime
View raw message