VMware {code} Community
GeethaC
Contributor
Contributor
Jump to solution

vSphere HTML5 web client : Composite Exception on selecting specific object from left navigation panel

Hi all,

We are developing plugin using vSphere HTML5 web client sdk 6.5 with reference of Chassis-Rack sample provided. vCenter Server 6.0 is used to test plugin from local development set up.

Objects in left navigation panel listed properly [ Data Adapter flow ]. But on selecting any specific object from list of objects displayed in left navigation panel, an error pop up appears with CompositeException, invalid URI. Complete stack trace is attached.

On debug, it appears to be improper target URI being passed in constraint of QuerySpec from the framework to getData() of our Data Adapter class.

Expected URI : urn:mycompany:tspm:SCArray:192.168.1.193/SC3000+0x11882f40

Passed URI :  urn:mycompany:tspm:SCArray:192.168.1


Please let me know what might cause such scenario

0 Kudos
1 Solution

Accepted Solutions
laurentsd
VMware Employee
VMware Employee
Jump to solution

If you want to display some UI in your plugin Manage view to display a list of objects, you can make a data service call or a custom java service call.  Actions are usually reserved for menu items and they don't have call backs in our plugin because they are invoked from the Client's own menus.

View solution in original post

0 Kudos
6 Replies
laurentsd
VMware Employee
VMware Employee
Jump to solution

I see that your URI contains "/", the same way the chassisB sample does.  This is fine but this means you must follow the encoding/decoding logic very precisely, exactly the same way the chassisB-service code does.  Are you re-using the same code?  See in particular: samples/chassisB-service/src/main/java/com/vmware/samples/chassisb/mvc/ObjectIdUtil.java

0 Kudos
GeethaC
Contributor
Contributor
Jump to solution

Thanks for the reply Laurent.

Yes, I am using same code [ ObjectIdUtil ]. But have a doubt. From code flow I can make out that encoding/decoding logic present here is being triggered while performing some action [ ActionController.java ].

Where should I add this encode/decode logic in my code if characters like '/', '.' is present in ServerGuid?

Here for expected target URI : "urn:mycompany:tspm:SCArray:192.168.1.193/SC3000+0x11882f40", if I tweak my code to set ID to be some other string say "dummy", CompositeException mentioned earlier is not appearing!

So presence of "." in my ServerGuid is creating some problem?

Adding to the problem details, I am getting this error while processing ObjectIdentityConstraint when propertiesSpec [ name, primaryIconId ] is added in QuerySpec.

From Chassis example:

https://localhost:9443/ui/data/properties/urn:cr:samples:ChassisB:server1%252Fchassis-5?properties=n...

==> {"id":"urn:cr:samples:ChassisB:server1%252Fchassis-5","primaryIconId":"com_vmware_samples_chassisb-chassis","name":"Chassis 3"}

My plugin:

https://localhost:9443/ui/data/properties/urn:mycompany:tspm:SCArray:192.168.1.193%252FSC3000+0x3b8f...

==> Composite Exception

0 Kudos
laurentsd
VMware Employee
VMware Employee
Jump to solution

I can reproduce your problem when I change the chassisB-service code to use "1.2.3.4" as server id instead of "server1" (in ObjectStore.createChassis)

It's not obvious yet where this problem comes from and I can't think of a work around other than not using "." in your server name in the URI. For instance you could use "_" instead of "."

0 Kudos
GeethaC
Contributor
Contributor
Jump to solution

You are right Laurent. I did the same workaround and now am able to overcome all exceptions.

Also my object ID SC3000+0x11882f40 created a problem due to presence of "+" in it. This also needs encoding/decoding!

Thank you.

One more doubt. I have a manage view extension where I need to invoke Service layer methods to GET list of custom objects specific to selected object from left panel. Sample screenshot is attached.

What approach should I follow?

Should I define action for such scenario or directly some AJAX GET call can be done to perform other CRUD operations under manage views?

I tried defining action, but using ActionResult am not sure how to display data in UI.

0 Kudos
laurentsd
VMware Employee
VMware Employee
Jump to solution

If you want to display some UI in your plugin Manage view to display a list of objects, you can make a data service call or a custom java service call.  Actions are usually reserved for menu items and they don't have call backs in our plugin because they are invoked from the Client's own menus.

0 Kudos
GeethaC
Contributor
Contributor
Jump to solution

Thanks Laurent. It is working fine. I made java service call.

0 Kudos