Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exception When started jaxrs-analyzer-maven-plugin:0.12:analyze-jaxrs #28

Closed
subktageen opened this issue Jan 13, 2017 · 15 comments
Closed

Comments

@subktageen
Copy link

Hello, sdaschner
I couldn't able to build the my code on my local windows environment. I got this error.
But the same code if I will run on my dev server on Linux it's build properly without any problem.

Can you let me know the reason why I am not able to build it on my local windows environment?

Jan 13, 2017 2:08:30 PM org.sonatype.guice.bean.reflect.Logs$JULSink warn
WARNING: Error injecting: com.sebastian_daschner.jaxrs_analyzer.maven.JAXRSAnalyzerMojo
com.google.inject.ProvisionException: Guice provision errors:

  1. No implementation for org.eclipse.aether.RepositorySystem was bound.
    while locating com.sebastian_daschner.jaxrs_analyzer.maven.JAXRSAnalyzerMojo

1 error
at com.google.inject.internal.InjectorImpl$3.get(InjectorImpl.java:974)
at com.google.inject.internal.InjectorImpl.getInstance(InjectorImpl.java:1000)
at org.sonatype.guice.bean.reflect.AbstractDeferredClass.get(AbstractDeferredClass.java:45)
at com.google.inject.internal.ProviderInternalFactory.provision(ProviderInternalFactory.java:84)
at com.google.inject.internal.InternalFactoryToInitializableAdapter.provision(InternalFactoryToInitializableAdapter.java:52)
at com.google.inject.internal.ProviderInternalFactory$1.call(ProviderInternalFactory.java:70)
at com.google.inject.internal.ProvisionListenerStackCallback$Provision.provision(ProvisionListenerStackCallback.java:100)
at org.sonatype.guice.plexus.lifecycles.PlexusLifecycleManager.onProvision(PlexusLifecycleManager.java:138)
at com.google.inject.internal.ProvisionListenerStackCallback$Provision.provision(ProvisionListenerStackCallback.java:108)
at com.google.inject.internal.ProvisionListenerStackCallback.provision(ProvisionListenerStackCallback.java:55)
at com.google.inject.internal.ProviderInternalFactory.circularGet(ProviderInternalFactory.java:68)
at com.google.inject.internal.InternalFactoryToInitializableAdapter.get(InternalFactoryToInitializableAdapter.java:45)
at com.google.inject.internal.InjectorImpl$3$1.call(InjectorImpl.java:965)
at com.google.inject.internal.InjectorImpl.callInContext(InjectorImpl.java:1011)
at com.google.inject.internal.InjectorImpl$3.get(InjectorImpl.java:961)
at com.google.inject.Scopes$1$1.get(Scopes.java:59)
at org.sonatype.guice.bean.locators.LazyBeanEntry.getValue(LazyBeanEntry.java:83)
at org.sonatype.guice.plexus.locators.LazyPlexusBean.getValue(LazyPlexusBean.java:49)
at org.codehaus.plexus.DefaultPlexusContainer.lookup(DefaultPlexusContainer.java:253)
at org.codehaus.plexus.DefaultPlexusContainer.lookup(DefaultPlexusContainer.java:245)
at org.apache.maven.plugin.internal.DefaultMavenPluginManager.getConfiguredMojo(DefaultMavenPluginManager.java:455)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:92)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:209)
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:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
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)


BUILD FAILURE

Total time: 3.175s
Finished at: Fri Jan 13 14:08:31 JST 2017
Final Memory: 20M/220M

Failed to execute goal com.sebastian-daschner:jaxrs-analyzer-maven-plugin:0.12:analyze-jaxrs (default) on project communication-api: Execution default of goal com.sebastian-daschner:jaxrs-analyzer-maven-plugin:0.12:analyze-jaxrs failed: Unable to load the mojo 'analyze-jaxrs' (or one of its required components) from the plugin 'com.sebastian-daschner:jaxrs-analyzer-maven-plugin:0.12': com.google.inject.ProvisionException: Guice provision errors:

  1. No implementation for org.eclipse.aether.RepositorySystem was bound.
    while locating com.sebastian_daschner.jaxrs_analyzer.maven.JAXRSAnalyzerMojo
    at ClassRealm[plugin>com.sebastian-daschner:jaxrs-analyzer-maven-plugin:0.12, parent: sun.misc.Launcher$AppClassLoader@70dea4e]
    while locating org.apache.maven.plugin.Mojo annotated with @com.google.inject.name.Named(value=com.sebastian-daschner:jaxrs-analyzer-maven-plugin:0.12:analyze-jaxrs)

1 error
role: org.apache.maven.plugin.Mojo
roleHint: com.sebastian-daschner:jaxrs-analyzer-maven-plugin:0.12:analyze-jaxrs

@sdaschner
Copy link
Owner

Hi :) Which Maven version are you using?

If it's a recent one (3.3.9 or similar), then this might be related to #18

@subktageen
Copy link
Author

subktageen commented Jan 13, 2017

Hi,
Thank you for your quick reply.
I have the same maven version 3.2.3 for both environments.
I am not able to build the code on my local windows environment (Windows 7 Enterprise 64 bit Operating System) but the same code build properly on my dev environment (Linux 2.6.32-431.el6.x86_64 x86_64).

Looking forward to hearing back from you soon.

Regards,
Subktageen

@litts
Copy link

litts commented Jan 15, 2017

Also have the same error on windows 10

@subktageen
Copy link
Author

Hello, @sdaschner
how are you?
Any solution or any fix for this error?

Regards,
Shan

@subktageen
Copy link
Author

Hello,
If I have removed this line
goal analyze-jaxrs goal from the pom.xml file then it's build successfully.
But it doesn't create the folder "jaxrs-analyzer" under the target folder

Regards,
Shan

@sdaschner
Copy link
Owner

Hi, yes when you remove the goal invocation the plugin doesn't run anymore. I'll try to find some time soon to tackle that problem. It has something to do with the internal class loading, the Analyzer now seem to mix classes from your project with it's internals (as it has to load them for analysis). Related to #18.

These days are pretty packed, hope to find some time soon.

@subktageen
Copy link
Author

Hi,
Hopefully you will get the some time to fix this issue.
I am very interested to use this plugin. If you fix this issue then It will be very useful for me.
Looking forward to hearing back from you soon.

@sdaschner
Copy link
Owner

Hi there,

could you retry using the 0.13-SNAPSHOT version (please add the Maven central snapshot repositories)?

@subktageen
Copy link
Author

Hi,
I am not able to use the 0.13-SNAPSHOT version
I am getting this error
Plugin com.sebastian-daschner:jaxrs-analyzer-maven-plugin:0.13-SNAPSHOT or one of its dependencies could not be resolved: Failed to read artifact descriptor for com.sebastian-daschner:jaxrs-analyzer-maven-plugin:jar:0.13-SNAPSHOT: Could not find artifact com.sebastian-daschner:jaxrs-analyzer-maven-plugin:pom:0.13-SNAPSHOT -> [Help 1]

I am trying to add in the pom.xml version

Let me correct If i am doing something wrong

@sdaschner
Copy link
Owner

You have to add the Maven central snapshot repositories for that:

<pluginRepositories>
  <pluginRepository>
    <id>ossrh-snapshots</id>
    <url>https://oss.sonatype.org/content/repositories/snapshots/\</url>
    <releases>
      <enabled>false</enabled>
    </releases>
    <snapshots>
      <enabled>true</enabled>
    </snapshots>
  </pluginRepository>
</pluginRepositories>

@subktageen
Copy link
Author

I have added the maven central snapshot repositories and then try to build on my local development environment. Still, I am not able to build it. This is the exception I am getting now

--- jaxrs-analyzer-maven-plugin:0.13-SNAPSHOT:analyze-jaxrs (default) @ communication-api ---
Feb 13, 2017 12:16:20 PM org.sonatype.guice.bean.reflect.Logs$JULSink warn
WARNING: Error injecting: com.sebastian_daschner.jaxrs_analyzer.maven.JAXRSAnalyzerMojo
com.google.inject.ProvisionException: Guice provision errors:

  1. No implementation for org.eclipse.aether.RepositorySystem was bound.
    while locating com.sebastian_daschner.jaxrs_analyzer.maven.JAXRSAnalyzerMojo

1 error
at com.google.inject.internal.InjectorImpl$3.get(InjectorImpl.java:974)
at com.google.inject.internal.InjectorImpl.getInstance(InjectorImpl.java:1000)
at org.sonatype.guice.bean.reflect.AbstractDeferredClass.get(AbstractDeferredClass.java:45)
at com.google.inject.internal.ProviderInternalFactory.provision(ProviderInternalFactory.java:84)
at com.google.inject.internal.InternalFactoryToInitializableAdapter.provision(InternalFactoryToInitializableAdapter.java:52)
at com.google.inject.internal.ProviderInternalFactory$1.call(ProviderInternalFactory.java:70)
at com.google.inject.internal.ProvisionListenerStackCallback$Provision.provision(ProvisionListenerStackCallback.java:100)
at org.sonatype.guice.plexus.lifecycles.PlexusLifecycleManager.onProvision(PlexusLifecycleManager.java:138)
at com.google.inject.internal.ProvisionListenerStackCallback$Provision.provision(ProvisionListenerStackCallback.java:108)
at com.google.inject.internal.ProvisionListenerStackCallback.provision(ProvisionListenerStackCallback.java:55)
at com.google.inject.internal.ProviderInternalFactory.circularGet(ProviderInternalFactory.java:68)
at com.google.inject.internal.InternalFactoryToInitializableAdapter.get(InternalFactoryToInitializableAdapter.java:45)
at com.google.inject.internal.InjectorImpl$3$1.call(InjectorImpl.java:965)
at com.google.inject.internal.InjectorImpl.callInContext(InjectorImpl.java:1011)
at com.google.inject.internal.InjectorImpl$3.get(InjectorImpl.java:961)
at com.google.inject.Scopes$1$1.get(Scopes.java:59)
at org.sonatype.guice.bean.locators.LazyBeanEntry.getValue(LazyBeanEntry.java:83)
at org.sonatype.guice.plexus.locators.LazyPlexusBean.getValue(LazyPlexusBean.java:49)
at org.codehaus.plexus.DefaultPlexusContainer.lookup(DefaultPlexusContainer.java:253)
at org.codehaus.plexus.DefaultPlexusContainer.lookup(DefaultPlexusContainer.java:245)
at org.apache.maven.plugin.internal.DefaultMavenPluginManager.getConfiguredMojo(DefaultMavenPluginManager.java:455)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:92)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:209)
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:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
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)


BUILD FAILURE

Total time: 2.288s
Finished at: Mon Feb 13 12:16:20 JST 2017
Final Memory: 19M/220M

Failed to execute goal com.sebastian-daschner:jaxrs-analyzer-maven-plugin:0.13-SNAPSHOT:analyze-jaxrs (default) on project communication-api: Execution default of goal com.sebastian-daschner:jaxrs-analyzer-maven-plugin:0.13-SNAPSHOT:analyze-jaxrs failed: Unable to load the mojo 'analyze-jaxrs' (or one of its required components) from the plugin 'com.sebastian-daschner:jaxrs-analyzer-maven-plugin:0.13-SNAPSHOT': com.google.inject.ProvisionException: Guice provision errors:

  1. No implementation for org.eclipse.aether.RepositorySystem was bound.
    while locating com.sebastian_daschner.jaxrs_analyzer.maven.JAXRSAnalyzerMojo
    at ClassRealm[plugin>com.sebastian-daschner:jaxrs-analyzer-maven-plugin:0.13-SNAPSHOT, parent: sun.misc.Launcher$AppClassLoader@70dea4e]
    while locating org.apache.maven.plugin.Mojo annotated with @com.google.inject.name.Named(value=com.sebastian-daschner:jaxrs-analyzer-maven-plugin:0.13-SNAPSHOT:analyze-jaxrs)

1 error
role: org.apache.maven.plugin.Mojo
roleHint: com.sebastian-daschner:jaxrs-analyzer-maven-plugin:0.13-SNAPSHOT:analyze-jaxrs
-> [Help 1]

To see the full stack trace of the errors, re-run Maven with the -e switch.
Re-run Maven using the -X switch to enable full debug logging.

For more information about the errors and possible solutions, please read the following articles:
[Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginContainerException

@sdaschner
Copy link
Owner

Could you please try using the recent Maven 3.3.9 version?

@subktageen
Copy link
Author

Hello, Thank you for your quick response.
I have updated the maven version 3.3.9
Now the project builds successfully and create the swagger.json file under the target folder
But still, it's giving these errors in the output.

  1. Could not access static property file
  2. unmappable character for encoding windows-1252 (May be I am using the Japanese characters in the code files)

--- jaxrs-analyzer-maven-plugin:0.13-SNAPSHOT:analyze-jaxrs (default) @ communication-api ---
[INFO] analyzing JAX-RS resources, using Swagger backend
[ERROR] Could not access static property, reason: communication.api.resource.FollowResource
[ERROR] Could not access static property, reason: communication.api.resource.FollowResource
api\src\main\java\jp\co\communication\api\resource\CommentResource.java:115: error: unmappable character for encoding windows-1252
// 通知対象者ID▒?▒対▒?▒▒?▒UNIQ処▒?▒
C:\communication-api\src\main\java\jp\co\communication\api\resource\CommentResource.java:115: error: unmappable character for encoding windows-1252
// 通知対象者ID▒?▒対▒?▒▒?▒UNIQ処▒?▒

@sdaschner
Copy link
Owner

Ok great, the static property is a know error, you can ignore that for now.

Have a look at #27, you should be able to set the encoding properly.

@hawkbase4git
Copy link

hawkbase4git commented Jun 18, 2019

Hi Sdaschner, I am getting Build Unstable with error

"Could not access static property" for many modules. I am using Maven 3.59 with Jaxrs Maven Plugin 0.17 version with Swagger as the backend. Please guide.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants