Quantcast
Channel: Active questions tagged atlassian-plugin-sdk - Stack Overflow
Viewing all articles
Browse latest Browse all 282

how to create my own bamboo plugin rest api

$
0
0

I need to create my own rest api in my bamboo plugin. in atlassian-plugin.xml

<rest name="Clix Rest Api" i18n-name-key="clix-rest-api.name" key="clix-rest-api" path="/clixrest" version="1.0">
    <description key="clix-rest-api.description">The Clix Rest API Plugin</description>
  </rest>

in pom.xml

<groupId>com.clix.bamboo</groupId>
<artifactId>testbedavail</artifactId>

the java code

@Path("/testbed")
@Consumes({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })
public class ClixRestApiImpl implements ClixRestApi {

@Override
@GET
@Produces({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })
@Path("/releaseTestbed")
public Response releaseTestbed(@QueryParam("testbedId") Integer testbedId) {

when i try to access the rest,

http://sandbamboo.clix.local/rest/clixrest/1.0/testbed/releaseTestbed?testbedId=3

http://sandbamboo.clix.local/bamboo/rest/clixrest/1.0/testbed/releaseTestbed?testbedId=3

it returns page not found. and when i use the first url, there are some error message in the log:

2020-02-24 22:51:32,070 INFO [http-nio-8085-exec-23] [AccessLogFilter] 192.168.33.121 GET http://sandbamboo.clix.local/rest/clixrest/1.0/feed/releaseTestbed?testbedId=3 173449kb
2020-02-24 22:51:32,339 ERROR [http-nio-8085-exec-23] [DefaultServletModuleManager] Unable to create new reference LazyLoadedFilterReference{descriptor=com.clix.bamboo.testbedavail:clix-rest-api-filter (The Clix Rest API Plugin), filterConfig=com.atlassian.plugin.servlet.filter.PluginFilterConfig@5c72f1b8}
com.atlassian.util.concurrent.LazyReference$InitializationException: java.lang.NoClassDefFoundError: com/clix/bamboo/api/ClixRestApi
        at com.atlassian.util.concurrent.LazyReference.getInterruptibly(LazyReference.java:149)
        at com.atlassian.util.concurrent.LazyReference.get(LazyReference.java:112)
        at com.atlassian.plugin.servlet.DefaultServletModuleManager.getInstance(DefaultServletModuleManager.java:374)
        at com.atlassian.plugin.servlet.DefaultServletModuleManager.getFilter(DefaultServletModuleManager.java:367)
        at com.atlassian.plugin.servlet.DefaultServletModuleManager.getFilters(DefaultServletModuleManager.java:227)

and the ClixRestApi is an interface,not a class

package com.clix.bamboo.api;
import javax.ws.rs.core.Response;

public interface ClixRestApi {
    Response reserveTestbed(String testbedName, String estimationTime, String reason);
    Response releaseTestbed(Integer testbedId);
}

I can't find out where is the problem.or how to debug this?


Viewing all articles
Browse latest Browse all 282

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>