[jira] [Commented] (FELIX-3739) scr-plugin: "Annotated method {0} not found"

2012-11-28 Thread Carsten Ziegeler (JIRA)

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

Carsten Ziegeler commented on FELIX-3739:
-

Thanks for your patch, Robert - i've applied your tests

I've also added a fix which just checks whether the name of the method is 
"" to detect a constructor - not sure if this is the best solution, 
however tests pass now :)

> 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
>
> Attachments: FELIX-3739-its.diff
>
>
> I run in to that[1] problem.
> The method that is not found looks like that:
> > @Nonnull public static  Entry 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.Cla

[jira] [Commented] (FELIX-3739) scr-plugin: "Annotated method {0} not found"

2012-11-26 Thread Robert Munteanu (JIRA)

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

Robert Munteanu commented on FELIX-3739:


Since I feel a bit shy about diving deep in the internals of the 
maven-scr-plugin without a safety net I added a couple of ITs using the 
maven-invoker-plugin.

- basic-build-it which contains a single annotated DS component . This IT 
passes.
- external-annotations-it which contains a single annotated DS component which 
also contains an external annotation on a constructor. This IT fails.

To make it easy to review patches, I'm submitting this first and then I will 
start work on actually fixing the bug.

> 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
>
> Attachments: FELIX-3739-its.diff
>
>
> I run in to that[1] problem.
> The method that is not found looks like that:
> > @Nonnull public static  Entry 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:

[jira] [Commented] (FELIX-3739) scr-plugin: "Annotated method {0} not found"

2012-11-21 Thread Johannes Schneider (JIRA)

[ 
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  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  Entry 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)
>  

[jira] [Commented] (FELIX-3739) scr-plugin: "Annotated method {0} not found"

2012-11-02 Thread Carsten Ziegeler (JIRA)

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

Carsten Ziegeler commented on FELIX-3739:
-

It's the right place but I forgot to deploy the snapshots...now they're up

> 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  Entry 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.SCR

[jira] [Commented] (FELIX-3739) scr-plugin: "Annotated method {0} not found"

2012-11-01 Thread Johannes Schneider (JIRA)

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

Johannes Schneider commented on FELIX-3739:
---

Can u give me a hint where the SNAPSHOTS are deployed to?

https://repository.apache.org/content/groups/snapshots/org/apache/felix/maven-scr-plugin/
 seems to be the wrong place

> 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  Entry 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.S

[jira] [Commented] (FELIX-3739) scr-plugin: "Annotated method {0} not found"

2012-10-29 Thread Carsten Ziegeler (JIRA)

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

Carsten Ziegeler commented on FELIX-3739:
-

Thanks for the report, I'Ve just committed a fix, could you please give it a 
try?

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