Contributor
Contributor

REST api call to get object properties in html bridge gives resource not found (404) error.

Jump to solution

Hi,

I added an Html bridge Summary view to our existing plugin (which is in Flex). The html page is displayed in the Summary tab with the static data like images and headings. But the .gestJSON call to the REST api is failing with error "Failed to load resources: the server responded with a status of 404(Not Found)".

I followed the Html bridge sample chassisB (chassis-summary.js and html) to create the new page.

The UI plugin's web.xml is configured to map /rest/* . dataAccessController bean is defined in the bundle-context.

Java service bundle has the DataAccessController class same as the chassisB DataAccessController class.

This is the url that I can see in the javascript debugger and api call is failing for this url.  There are no errors seen in the virgo.log.

https://<vcenter ip>/vsphere-client/webui_ui_ns/rest/data/properties/323de5b9-4d2e-4dd7-ae32-98277dd44e90%252Fmf8k-h38?properties=name,model,version

vsphere-client/webui_ui_ns is the Web-ContextPath value in the plugin's MANIFEST.MF

I spent lot of time figuring out the issue, but no luck. What am I doing wrong here? Any help is appreciated.

  vCenter server appliance version 6.0.0

SDK - vSphere Web SDK 5.5.0

JDK 1.7.0_79 64 bit

Thanks

Deepa

0 Kudos
1 Solution

Accepted Solutions
Contributor
Contributor

It was a configuration problem. I missed the <mvc:annotation-driven /> tag in the spring bundle-context.

After adding the 2 lines, it worked.

Thanks for your time.

View solution in original post

0 Kudos
4 Replies
VMware Employee
VMware Employee

This problem may come from some missing configuration in your hybrid plugin, did you follow this FAQ?

html-bridge/docs/html-FAQ.html#hybrid

Another approach suggested in this FAQ is to have 2 separate UI plugins in your plugin package so that you can start your HTML plugin from a clean project generated by the wizard.

0 Kudos
Contributor
Contributor

We followed the 2nd approach in the FAQ. That is what we wanted. I can try the 1st option of having separate flex and HTML plugins, but our design needs the 2nd approach though.

0 Kudos
VMware Employee
VMware Employee

First it will be hard to know exactly what is wrong in your plugin without having a reproducible sample to look at.

The approach of 2 separate UI plugins one for Flex UI and one for HTML UI is pretty clean.  Why are you saying your design prevents it?

0 Kudos
Contributor
Contributor

It was a configuration problem. I missed the <mvc:annotation-driven /> tag in the spring bundle-context.

After adding the 2 lines, it worked.

Thanks for your time.

View solution in original post

0 Kudos