I have very strange problem.
Im trying to create a rest resource module for jira 5.2 using atlassian sdk 4.1.3
i used to do this many times already, but this time im getting 404 on fresh and clean rest service created by sdk. It is so trivial that i just have no clue what could be wrong.
This is what i did.
1. ran atlas-create-jira-plugin-module
2. chosen option 14 for rest resource module
3. kept all properties at default (hit Enter 4 times)
4. ran atlas-run. server came up without problems.
5. went to /jira/rest/myrestresource/1.0/message. response: 404
huh? i did not change anything, this is sdk code and i did it already many times. Maybe i am missing something in the url?
code created by sdk
atlassian-plugin.xml
<rest name="My Rest Resource" i18n-name-key="my-rest-resource.name" key="my-rest-resource" path="/myrestresource" version="1.0">
<description key="my-rest-resource.description">The My Rest Resource Plugin</description>
</rest>
MyRestResource.java
/**
* A resource of message.
*/
@Path("/message")
public class MyRestResource {
@GET
@AnonymousAllowed
@Produces({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML})
public Response getMessage()
{
return Response.ok(new MyRestResourceModel("Hello World")).build();
}
}
MyRestResourceModel.java
@XmlRootElement(name = "message")
@XmlAccessorType(XmlAccessType.FIELD)
public class MyRestResourceModel {
@XmlElement(name = "value")
private String message;
public MyRestResourceModel() {
}
public MyRestResourceModel(String message) {
this.message = message;
}
public String getMessage() {
return message;
}
public void setMessage(String message) {
this.message = message;
}
}
Im not getting any exceptions or errors. It looks like im using wrong URL. What could be wrong with this?
/jira/rest/myrestresource/1.0/message
I have also verified that My Rest Resource module is deployed and enabled in plugin manager.