Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6085245
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T11:37:04+00:00 2026-05-23T11:37:04+00:00

Im trying to write a gadget inside a jira plugin and I’ve encountered some

  • 0

Im trying to write a gadget inside a jira plugin and I’ve encountered some problems even with a very simple one. Currently I’m trying to get a response from a simple java class i wrote. Following code is located in my gadget.xml:

        Hello Gadget<br />

    #requireResource("com.atlassian.gadgets.publisher:ajs-gadgets")
    #requireResource("com.tngtech.gadgets.jira-complain-gadget-plugin:web-resources")

    #includeResources() 

    #oauth

    <script type="text/javascript">(function () {
var gadget = AJS.Gadget({
    baseUrl: "__ATLASSIAN_BASE_URL__",
    view: {
        onResizeAdjustHeight: true,
        enableReload: true,
        template: function(args) {

            var gadget = this;

            window.alert("1");

            gadget.getView().html(args.hello);

            window.alert("2");

        },
        args: [{
            key: "hello",
            ajaxOptions: function () {
                return {
                    url: "/rest/jira-rest/1.0/ComplainChart/HelloWorld"
                };
            }
        }]
    }
});
})();
    </script>

]]></Content>

The Java class i adress looks like this:

@Path("/ComplainChart")
@AnonymousAllowed
@Produces(MediaType.TEXT_HTML)
public class ComplainChart {

public ComplainChart() {
}

@GET
@Path("/HelloWorld")
@Produces(MediaType.TEXT_HTML)
public Response getVersionsForProject() {
    return Response.ok("Hello Java<br/>").build();
}
}

The URL is probably correct, the firebug output for the get Request looks like this:

throw 1; < don't be evil' >{"http://localhost:1990/jira/rest/jira-rest/1.0/complainChart/HelloWorld?cacheBuster=1308293636385":{"headers":{"set-cookie":["JSESSIONID=5652167D4DADE39719C4FED0C7174A03;Path=/","atlassian.xsrf.token=BV8N-OK2J-IQUQ-YNNK|b52c0f4b28944d7d11561aed079093f767448aca|lin; Path=/jira"]},"body":"Hello Java<br/>","rc":200}}

Even without the gadget.getView part, the alerts aren’t executed (they are without the args part) and I get a huge Stack Trace in my atlas-run terminal

[INFO] [talledLocalContainer] com.atlassian.util.concurrent.LazyReference$InitializationException: com.sun.jersey.api.container.ContainerException: The ResourceConfig instance does not contain any root resource classes.
[INFO] [talledLocalContainer]   at com.atlassian.util.concurrent.LazyReference.getInterruptibly(LazyReference.java:152)
[INFO] [talledLocalContainer]   at com.atlassian.util.concurrent.LazyReference.get(LazyReference.java:115)
[INFO] [talledLocalContainer]   at com.atlassian.plugin.servlet.DefaultServletModuleManager.getFilter(DefaultServletModuleManager.java:358)
[INFO] [talledLocalContainer]   at com.atlassian.plugin.servlet.DefaultServletModuleManager.getFilters(DefaultServletModuleManager.java:212)
.............

Can anyone help me please?

Alex

Edit: Fyi here my pom file, I’m not sure, it’s completely right this way:

<dependencies>
      <dependency> 
        <groupId>com.atlassian.gadgets</groupId> 
        <artifactId>atlassian-gadgets-api</artifactId> 
        <version>3.1.7</version> 
    </dependency>
    <dependency> 
        <groupId>com.atlassian.jira</groupId> 
        <artifactId>atlassian-jira</artifactId> 
        <version>${jira.version}</version> 
        <scope>provided</scope> 
    </dependency> 
    <dependency> 
        <groupId>junit</groupId> 
        <artifactId>junit</artifactId> 
        <version>4.6</version> 
        <scope>test</scope> 
    </dependency> 
    <dependency> 
        <groupId>com.atlassian.jira</groupId> 
        <artifactId>jira-func-tests</artifactId> 
        <version>${jira.version}</version> 
        <scope>test</scope> 
    </dependency> 
    <dependency> 
        <groupId>javax.ws.rs</groupId> 
        <artifactId>jsr311-api</artifactId> 
        <version>1.1.1</version> 
        <scope>provided</scope> 
    </dependency> 
   <dependency> 
        <groupId>com.atlassian.jira</groupId> 
        <artifactId>jira-rest-plugin</artifactId> 
        <version>${jira.version}</version> 
        <scope>provided</scope> 
    </dependency> 
    <dependency> 
        <groupId>javax.xml.bind</groupId> 
        <artifactId>jaxb-api</artifactId> 
        <version>2.1</version> 
        <scope>provided</scope> 
    </dependency> 
    <dependency> 
        <groupId>com.atlassian.plugins.rest</groupId> 
        <artifactId>atlassian-rest-common</artifactId> 
        <version>2.5.0</version> 
        <scope>provided</scope> 
    </dependency> 
    <dependency> 
        <groupId>javax.servlet</groupId> 
        <artifactId>servlet-api</artifactId> 
        <version>2.5</version> 
        <scope>provided</scope> 
    </dependency> 
    <dependency> 
        <groupId>com.atlassian.sal</groupId> 
        <artifactId>sal-api</artifactId> 
        <version>2.1.0.beta1</version> 
    </dependency>
</dependencies>

<build>
    <plugins>
        <plugin>
            <groupId>com.atlassian.maven.plugins</groupId>
            <artifactId>maven-jira-plugin</artifactId>
            <version>3.5-SNAPSHOT</version>
            <extensions>true</extensions>
            <configuration>
                <productVersion>${jira.version}</productVersion>
                <productDataVersion>${jira.data.version}</productDataVersion>
            </configuration>
        </plugin>
        <plugin>
            <artifactId>maven-compiler-plugin</artifactId>
            <configuration>
                <source>1.6</source>
                <target>1.6</target>
            </configuration>
        </plugin>
    </plugins>
</build>

<properties>
    <jira.version>4.3.4</jira.version>
    <jira.data.version>4.3.4</jira.data.version>
</properties>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T11:37:04+00:00Added an answer on May 23, 2026 at 11:37 am

    Found the solution: You need to return an Object of an own class with annotations like these:

        @XmlRootElement
    public static class HelloClass {
        @XmlElement
        String output;
    
        HelloClass() {
            output = "Hello";
        }
    
        HelloClass(String who) {
            output = "Hello " + who;
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Trying to write a simple C# script to copy file to directory one level
I'm trying write a simple perl script that reads some fields from a password
I'm trying to write a blog post which includes a code segment inside a
Im trying to write a simple script that slides the next 'slide' div in
Trying to write a trivial application, But I have stuck into one of the
Trying to write a simple call to google's JSON stock ticker API. I would
Trying to write a simple VCL program for educating purposes (dynamicly created forms, controls
Trying to write some PHP pseudocode for a recruitmentposter to hang at my university.
In trying to write a simple C# ADO.NET application to connect to my database
I'm trying write a query to find records which don't have a matching record

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.