- Community Home
- >
- Software
- >
- HPE Morpheus Software
- >
- HPE Morpheus Enterprise
- >
- Calling a function exposed by HTTP route results i...
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-17-2022 05:58 AM
05-17-2022 05:58 AM
Calling a function exposed by HTTP route results in a 403 error
Hi,
I want to expose groovy methods to the javascript part of the plugin using HTTP routes.
when calling the exposed method from javascript with the following code I get a 403 error:
(function () {
$(document).on('shown.bs.tab', '[href="#morpheus-tab-plugin-lb"]', function (e) {
console.log("TEST");
$.ajax({
type: "GET",
url: "${createLink(controller: 'reverseTextController', action: '/reverseTask/json')}"
}).done(function(data) {
console.log("DONE")
});
});
}());
Any idea?
Thanks,
Nico
- Tags:
- groovy
- JavaScript

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-28-2022 11:08 AM
06-28-2022 11:08 AM
Re: Calling a function exposed by HTTP route results in a 403 error
Any chance you could share your plugin code and we can take a look?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-30-2022 01:28 AM
06-30-2022 01:28 AM
Re: Calling a function exposed by HTTP route results in a 403 error
Still the same result unfortunately

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-20-2022 11:36 AM
05-20-2022 11:36 AM
Re: Calling a function exposed by HTTP route results in a 403 error
ok the docs arent clear here you have to append /plugin/ to the route so in your case you will do
/plugin/reverseTask/example
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-08-2022 02:45 AM
06-08-2022 02:45 AM
Re: Calling a function exposed by HTTP route results in a 403 error
So, tried now with 5.5.0 release and plugin api version v0.13.1 and I get the same error.
Any idea?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-28-2022 01:36 PM
06-28-2022 01:36 PM
Re: Calling a function exposed by HTTP route results in a 403 error
I shared the code via teams with Chris Bunge last week.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-29-2022 01:13 PM
06-29-2022 01:13 PM
Re: Calling a function exposed by HTTP route results in a 403 error
I was able to take a look at your plugin code and run it locally. Give the following a try:
- In LBCustomTabPlugin.groovy you should define your own permissions… for example
@Override
public List<Permission> getPermissions() {
Permission permission = new Permission('LB Custom Tab Plugin', 'lbCustomTabPlugin', [Permission.AccessType.full])
return [permission];
}
- Change CustomTabController.groovy getRoutes() to:
List<Route> getRoutes() {
[
Route.build("/reverseTask/example", "example", Permission.build("lbCustomTabPlugin", "full")),
Route.build("/reverseTask/json", "json", Permission.build("lbCustomTabPlugin", "full"))
]
}
Notice the change on Permissions.build
to use the new Permission defined as lbCustomTabPlugin
Before you were using Permissions.build("admin","full")
. There is no admin
permission in the system so it would never route.
Also, after you upload the plugin, make sure you logout and login again to make sure your user’s permissions are recalculated.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-02-2022 08:02 AM
06-02-2022 08:02 AM
Re: Calling a function exposed by HTTP route results in a 403 error
Morpheus v5.5.0 will need to be used as this is the first version that uses morpheus-plugin-api v0.13.1 (the version where the bug was fixed)

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-23-2022 09:01 AM
05-23-2022 09:01 AM
Re: Calling a function exposed by HTTP route results in a 403 error
which version of the plugin api are you using, this is a bug that was fixed last February.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-05-2022 07:34 AM
07-05-2022 07:34 AM
Re: Calling a function exposed by HTTP route results in a 403 error
Issue is resolved.
Thanks everyone

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-20-2022 06:44 AM
05-20-2022 06:44 AM
Re: Calling a function exposed by HTTP route results in a 403 error
groovy code is not interpreted in JavaScript, you are going to need to use the path you specified in your plugin in directly in the JavaScript rather than expecting it to be interpreted.
if you have
List<Route> getRoutes() {
[
Route.build('reverseText/json', 'myFuncThatReturnsJSON', Permission.build("admin", "full"))
]
}
so instead of:
url: "${createLink(controller: 'reverseTextController', action: 'myFuncThatReturnsJSON')}"
you should just do
url: "/reverseText/json"
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-23-2022 01:53 AM
05-23-2022 01:53 AM
Re: Calling a function exposed by HTTP route results in a 403 error
That gets me further to this error:
[http-nio-127.0.0.1-8080-exec-4] MissingMethodException occurred when processing request: [GET] /plugin/reverseTask/json No signature of method: com.morpheusdata.core.PluginManager.handleRoute() is applicable for argument types: (org.codehaus.groovy.runtime.GStringImpl, com.morpheusdata.views.ViewModel...) values: [/reverseTask/json, com.morpheusdata.views.ViewModel@459e7a6c, ...] Possible solutions: handleRoute(java.lang.String, com.morpheusdata.views.ViewModel, java.util.List). Stacktrace follows: groovy.lang.MissingMethodException: No signature of method: com.morpheusdata.core.PluginManager.handleRoute() is applicable for argument types: (org.codehaus.groovy.runtime.GStringImpl, com.morpheusdata.views.ViewModel...) values: [/reverseTask/json, com.morpheusdata.views.ViewModel@459e7a6c, ...] Possible solutions: handleRoute(java.lang.String, com.morpheusdata.views.ViewModel, java.util.List) at com.morpheus.plugin.PluginManagerService.handleRoute(PluginManagerService.groovy:212) at com.morpheus.PluginManagerController.route(PluginManagerController.groovy:25) at com.morpheus.remote.HiddenHttpMethodFilter.doFilterInternal(HiddenHttpMethodFilter.java:20) [9 skipped] [36 skipped]
My Method to handle the route:
def json(ViewModel<Map> model){}

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-03-2022 06:59 AM
06-03-2022 06:59 AM
Re: Calling a function exposed by HTTP route results in a 403 error
You need to use Morpheus v5.5.0 if you are using plugin api version v0.13.1
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-20-2022 07:02 AM
05-20-2022 07:02 AM
Re: Calling a function exposed by HTTP route results in a 403 error
Thanks, still gives me a HTTP 403 but now with a json output: “{
“error”: “access denied”
}”

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-20-2022 07:15 AM
05-20-2022 07:15 AM
Re: Calling a function exposed by HTTP route results in a 403 error
do you have the required permissions you set in the route? (admin, full)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-20-2022 08:05 AM
05-20-2022 08:05 AM
Re: Calling a function exposed by HTTP route results in a 403 error
yes,
/**
* Defines two Routes with the builder method
* @return
*/
List getRoutes() {
[
Route.build("/reverseTask/example", “example”, Permission.build(“admin”, “full”)),
Route.build("/reverseTask/json", “json”, Permission.build(“admin”, “full”))
]
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-23-2022 02:03 PM
05-23-2022 02:03 PM
Re: Calling a function exposed by HTTP route results in a 403 error
I used com.morpheusdata:morpheus-plugin-api:0.12.0 previously.
Updated now to Version 0.13.1.
Similar error:
[http-nio-127.0.0.1-8080-exec-10] MissingMethodException occurred when processing request: [GET] /plugin/reverseTask/json No signature of method: com.morpheusdata.core.PluginManager.handleRoute() is applicable for argument types: (org.codehaus.groovy.runtime.GStringImpl, com.morpheusdata.views.ViewModel...) values: [/reverseTask/json, com.morpheusdata.views.ViewModel@1c628645, ...] Possible solutions: handleRoute(java.lang.String, com.morpheusdata.views.ViewModel, java.util.List). Stacktrace follows: groovy.lang.MissingMethodException: No signature of method: com.morpheusdata.core.PluginManager.handleRoute() is applicable for argument types: (org.codehaus.groovy.runtime.GStringImpl, com.morpheusdata.views.ViewModel...) values: [/reverseTask/json, com.morpheusdata.views.ViewModel@1c628645, ...] Possible solutions: handleRoute(java.lang.String, com.morpheusdata.views.ViewModel, java.util.List) at com.morpheus.plugin.PluginManagerService.handleRoute(PluginManagerService.groovy:212) at com.morpheus.PluginManagerController.route(PluginManagerController.groovy:25) at com.morpheus.remote.HiddenHttpMethodFilter.doFilterInternal(HiddenHttpMethodFilter.java:20) [9 skipped] [36 skipped]
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-03-2022 12:59 AM
06-03-2022 12:59 AM
Re: Calling a function exposed by HTTP route results in a 403 error
with Morpheus v5.4.6 and plugin api version v.0.13.1 the recent error is gone but I am now back to the 403 error I started the thread with.
What am I missing?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-03-2022 08:01 AM
06-03-2022 08:01 AM
Re: Calling a function exposed by HTTP route results in a 403 error
Ok, is there a solution for the LTS branch? As I need to use LTS releases.