Latest Jira 7.x + create-jira-plugin&module with defaults = null uri

Actions:

  1. Fresh installation of Jira 7.1.13.
  2. Server started on port 5555.
  3. atlas-create-jira-plugin.
  4. atlas-create-jira-plugin-module.
  5. atlas-package.
  6. OBR installation.
  7. GET http://localhost:5555/rest/api/1.0/myrestresource/message
    =
This XML file does not appear to have any style information associated with it. The document tree is shown below.
<status>
<status-code>404</status-code>
<message>
null for uri: http://localhost:5555/rest/api/1.0/myrestresource/message
</message>
</status>

How to fix this?

Hi @arthurdnu,

For your reference, in case you haven’t done it - to make your development/debugging easier, you don’t need to deploy your OBR in an actual Jira Server all the time. You can just do atlas-run or atlas-debug (and connect a Remote config if you’re using IntelliJ).

To your problem, is that your custom rest api? Were you able to follow this tutorial for the REST module? You can also verify this by going to Jira Settings → REST API Browser (when you ran atlas-run or atlas-debug)

Cheers,
Anne

1 Like

I am using provided scope for some jars, so I can not use atlas-run or debug, because it requires sometimes a clean build, which will destroy manually added dependencies (I am using them to exclude fat jar licensing problems).

So why I could not access my REST? All steps provided. Coding is not required.

@acalantog --------------

Hi @arthurdnu,

Were you able to follow the REST plugin module tutorial? That 404 message means it cannot find the endpoint /myrestresource/message or it was not defined. Try creating a simple response from your custom endpoint, say ‘Hello World’ without any of your drivers first so you can run atlas-run or atlas-debug. Let’s try to eliminate the problem one at a time. Once you have the endpoint running, then try installing it in your server. Let me know which part of the tutorial you got stuck with or had problems with.

Cheers,
Anne Calantog

1 Like

Hi! @acalantog clean Jira 7 installation + mentioned steps.
http://localhost:8080/rest/api/1.0/myrestresource/message
<status> <status-code>404</status-code> <message> null for uri: http://localhost:8080/rest/api/1.0/myrestresource/message </message> </status>
without extra libs

Does Jira respond outside of the app your developing? Ie / ?

If so, can you post your console and the Atlassian-jira.log output?

1 Like

@acalantog @danielwester here is my project https://drive.google.com/file/d/1ocpnIlW_zrD5Q5eYRMqPIeSMEWA3zCPP/view?usp=sharing

can not access http://localhost:2990/jira/rest/businessObject/1.0/search/t

I tried Named and Scaned, but it can not find bean.

Caused by: org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type [com.atlassian.sal.api.user.UserManager] found for dependency: expected at least 1 bean which qualifies as autowire candidate for this dependency. Dependency annotations: {}

Looks like something missed in pom or in plugin xml, or some files.
Tried with <?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:atlassian-scanner="http://www.atlassian.com/schema/atlassian-scanner" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd http://www.atlassian.com/schema/atlassian-scanner http://www.atlassian.com/schema/atlassian-scanner/atlassian-scanner.xsd"> <atlassian-scanner:scan-indexes/> </beans>
in resources/META-INF/spring/plugin-context.xml - same

Hi @arthurdnu,

Let me have a look.

Cheers,
Anne Calantog

1 Like

@acalantog Thx! Will wait on your response!

Hi @arthurdnu,

Looks like your REST endpoints are already registered. However, there’s a problem injecting dependencies for BusinessObject which was not used in the REST service. If you remove the constructor then you should be able to access your endpoint.

If you’re interested in injecting dependencies in your REST module, see this.

Cheers,
Anne Calantog