I am trying to make a simple HelloWorld add-on using atlassian-connect-play-java :

My Controller :
package controllers;
import views.html.*;
import com.atlassian.connect.play.java.controllers.AcController;
import com.google.common.base.Supplier;
import play.mvc.Controller;
import play.mvc.Result;
public class Application extends Controller {
public static Result index()
{
return AcController.index(home(), descriptor());
}
private static Supplier<Result> descriptor()
{
return new Supplier<Result>()
{
@Override
public Result get()
{
return AcController.descriptor();
}
};
}
private static Supplier<Result> home()
{
return new Supplier<Result>()
{
@Override
public Result get()
{
return ok(index.render("Hello"));
}
};
}
}
My routes file :
GET / controllers.Application.index()
GET /assets/*file controllers.Assets.at(path="/public", file)
-> / ac.Routes
My index:scala.html file :
@(message: String)
@main("Welcome to Play") {
<p>@message</p>
}
My main.scala.html file :
@(title: String)(content: Html)
<!DOCTYPE html>
<html>
<head>
<title>@title</title>
<script src="http://localhost:1990/confluence/atlassian-connect/all.js" type="text/javascript"></script>
<link rel="stylesheet" href="//aui-cdn.atlassian.com/aui-adg/5.4.3/css/aui.css" media="all">
<link rel="stylesheet" media="screen" href="@routes.Assets.at("stylesheets/main.css")">
<link rel="shortcut icon" type="image/png" href="@routes.Assets.at("images/favicon.png")">
<script src="@routes.Assets.at("javascripts/jquery-1.9.0.min.js")" type="text/javascript"></script>
</head>
<body>
<div class="ac-content">
<p>@content</p>
</div>
</body>
</html>
My atlassian-connect.json file :
{
"key": "${addonKey}",
"name": "${addonName}",
"description": "Atlassian Connect add-on",
"baseUrl": "${localBaseUrl}",
"vendor": {
"name": "Atlassian",
"url": "http://www.atlassian.com"
},
"authentication": {
"type": "none"
},
"modules": {
"generalPages": [
{
"url": "/",
"key": "test-application",
"location": "system.user",
"name": {
"value": "Test"
}
}
]
},
"scopes": ["READ"]
}
When running my play application, it all works fine.
But when I install my plugin on a local instance of Confluence and launch it, the add-on's content never stops loading, I get the following message :
Add-on is not responding. wait or cancel ?
I tried to find the problem but I couldn't, can someone please help ?
All Atlassian Connect add-ons require the
all.jsJavascript resource to be loaded, so it can create the bridge between your add-on and the host environment. The loader sits there and waits for the bridge to be established. This means you aren't includingall.js.An example of doing: https://bitbucket.org/atlassian/whoslooking-connect/src/9066821fe168737b94d5b1e8ad520befb200ec99/app/views/poller.scala.html?at=master#cl-43
Double check the console of your browser for errors though if this doesn't fix your issues. It will likely give a hint as to what the problem is. Also check the network tab (maybe with a reload) to make sure all your resources load.
Some frameworks also emit a
X-Frame-Origin: SAMEORIGINheader by default causing the browser to never load the content of the iframe. This should not be the case with atlassian-connect-play.