Skip to content

apicurio-registry-maven-plugin:register fails with 405 response #686

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

Closed
mswiderski opened this issue Jul 6, 2020 · 3 comments
Closed

apicurio-registry-maven-plugin:register fails with 405 response #686

mswiderski opened this issue Jul 6, 2020 · 3 comments
Labels
triage/invalid This doesn't seem right

Comments

@mswiderski
Copy link

While using apicurio-registry-maven-plugin maven plugin with register goal, it fails with 405 response code while it should return 404 - as the OpenApi is for the first time registered.

Here is a plugin configuration

     <plugin>
        <groupId>io.apicurio</groupId>
        <artifactId>apicurio-registry-maven-plugin</artifactId>
        <version>1.2.2.Final</version>
        <executions>
          <execution>
            <phase>package</phase>
            <goals>
              <goal>register</goal>
            </goals>
            <configuration>
              <registryUrl>http://localhost:8080</registryUrl>
              <artifactType>OPENAPI</artifactType>
              <artifacts>
                <product-info-api>${project.build.directory}/swagger.json</product-info-api>
              </artifacts>
            </configuration>
          </execution>
        </executions>
      </plugin>

Exactly same file (swagger.json) can be successfully added via UI.

Here is complete info from maven build

[INFO] --- apicurio-registry-maven-plugin:1.2.2.Final:register (default) @ individual-product-service ---
jul 06, 2020 9:40:13 FM org.jboss.resteasy.microprofile.client.ProxyInvocationHandler getBeanManager
WARN: CDI container is not available - interceptor bindings declared on ArtifactsResource will be ignored
[ERROR] Exception while registering id [product-info-api]
java.lang.IllegalStateException: Error [Unknown error, status code 405] retrieving artifact: product-info-api
    at io.apicurio.registry.maven.RegisterRegistryMojo.register (RegisterRegistryMojo.java:58)
    at io.apicurio.registry.maven.RegisterRegistryMojo.executeInternal (RegisterRegistryMojo.java:82)
    at io.apicurio.registry.maven.AbstractRegistryMojo.execute (AbstractRegistryMojo.java:58)
    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:137)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:210)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:156)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:148)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
    at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)

In addition, I tried to register it first so it will only update it but it fails exactly the same way.

I use locally deployed apicurio-registry as runner jar.

@mswiderski
Copy link
Author

this turned out to be wrong url given for repository URL

it must be suffixed with /api otherwise the server responds with 405

I guess this guide should be updated https://access.redhat.com/documentation/en-us/red_hat_integration/2020-04/pdf/getting_started_with_service_registry/Red_Hat_Integration-2020-04-Getting_Started_with_Service_Registry-en-US.pdf as it references only host without the api suffix.

@EricWittmann
Copy link
Member

Glad you figured this out. @smccarthy-ie I assume the link above is to the Tech Preview documentation? If yes, then that URL was correct at the time but was changed from the TP to the GA release.

@EricWittmann
Copy link
Member

I'm pretty confident of my assessment so I'm going to close this issue. But if I'm wrong let's open this back up!

@EricWittmann EricWittmann added the triage/invalid This doesn't seem right label Jul 28, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
triage/invalid This doesn't seem right
Projects
None yet
Development

No branches or pull requests

2 participants