VMware {code} Community
shishaozheng
Enthusiast
Enthusiast
Jump to solution

vwc plugin using sdk 5.1 is broken if running on the web client 6.0 with out port 9443 - Could not connect to vSphere Web Client. Contact your administrator to fix this issue.

We have made a vwc plugin with sdk 5.1, now we want to run it on the web client 6.0. before running, we modified the MANIFEST.MF and services-config.xml following the reminders as below:

2 Important reminders for your 5.5 plugin to be compatible with Web Client 6.0

After that, we deployed our plugin on web client 6.0.

If we access it using the URL with port: https://<ipaddress>:9443/vsphere-client/?csp, our plugin shows up, the function of our plugin is also ok.

If we access it using the URL without port: https://<ipaddress>/vsphere-client/?csp, our plugin shows up, the function is broken (error occurred when flex ui calling java service: " Could not connect to vSphere Web Client. Contact your administrator to fix this issue.").

Thank you very much

1 Solution

Accepted Solutions
Peter_Ivanov
VMware Employee
VMware Employee
Jump to solution

Please change the CHANNEL_URL in your proxy classes to use "amf" instead of "amfsecure".

private static const CHANNEL_URI:String = "/" + YOUR_MODULE.contextPath + "/messagebroker/amf"

This should fix your problem.

View solution in original post

Reply
0 Kudos
10 Replies
laurentsd
VMware Employee
VMware Employee
Jump to solution

Did you modify remote-config.xml as well as explained in 2 Important reminders for your 5.5 plugin to be compatible with Web Client 6.0

Reply
0 Kudos
shishaozheng
Enthusiast
Enthusiast
Jump to solution

yes, the remote-config.xml like this:

<?xml version="1.0" encoding="UTF-8"?>

<service id="remoting-service"

    class="flex.messaging.services.RemotingService">

    <adapters>

        <adapter-definition id="java-object"

            class="com.vmware.vise.messaging.remoting.JavaAdapterEx"

            default="true"/>

    </adapters>

    <default-channels>

        <channel ref="secure-amf"/>

        <channel ref="amf"/>

    </default-channels>

</service>

Reply
0 Kudos
shishaozheng
Enthusiast
Enthusiast
Jump to solution

I check the post request using chrome debug tool, the post request without port is failed,

6.0_without_port.jpg.

6.0_with_port.jpg

Reply
0 Kudos
shishaozheng
Enthusiast
Enthusiast
Jump to solution

I have read the Release Notes for vSphere Web Client SDK 6.0, There are three warnings to be followed to make sure the Plug-ins built with 5.1 and 5.5 should work as-is with VWC 6.0:

1. Flex plugins that define their own proxy class must use ServiceUtil.getDefaultChannelUri() as shown in the globalview sample below instead of hard-coding the channel URI. This ensures binary compatibility with version 6.0 which uses a reverse proxy (i.e. the internal proxy URL is http)


2. Starting with 6.0 you should use the environment variable VMWARE_DATA_DIR as the writable directory for keeping persistent data such as a properties file. See the sample code in flex-samples/globalview/globalview-service/src/main/java/com/vmware/samples/globalview/GlobalServiceImpl.java

In order to make your 5.5 plugin code compatible with 6.0 you can use the directory /storage on Linux and use System.getenv("PROGRAMDATA") on Windows.

3. All UI plugins Web-ContextPath must use the format vsphere-client/plugin-name, i.e. be prefixed with vsphere-client, in anticipation of a future release where this will be required. Samples have been updated to that effect, as well as the Eclipse wizard generating new plugin projects. UI plugins using proxies must have two default channels in war/src/main/webapp/WEB-INF/flex/remote-config.xml and war/src/main/webapp/WEB-INF/flex/services-config.xml, "amf" and "secure-amf" as shown below

Warning 1: The ServiceUtil.getDefaultChannelUri was added to SDK 5.5.2, we can't use this API in SDK 5.1, Is this related to our issue?

Warning 2: I think this is not related to our issue.

Warning 3: We have follow this warning and modified these files, but it still doesn't work.

Reply
0 Kudos
laurentsd
VMware Employee
VMware Employee
Jump to solution

Try to get more info on this 500 Server error to see what is causing it.  Browser console log,  Flex logs, Java debugging in your service code, etc.

Reply
0 Kudos
shishaozheng
Enthusiast
Enthusiast
Jump to solution

Thank you for reply, here is the various info:

Browser console log:

POST https://10.167.133.35/vsphere-client/evcp-ui/messagebroker/amfsecure 500 (Internal Server Error)

Flex log:

8/7/2015 13:41:58.670 [INFO] com.my.storagesystem.evcp.views.hostSystem.HostSystemMainFrameMediator Param[ipAddr] : 10.167.133.35:443

8/7/2015 13:41:58.672 [INFO] com.my.storagesystem.evcp.views.hostSystem.HostSystemMainFrameMediator Param[resourceType] : HostSystem

8/7/2015 13:41:58.674 [INFO] com.my.storagesystem.evcp.views.hostSystem.HostSystemMainFrameMediator Param[resourceValue] : host-9

8/7/2015 13:41:58.676 [INFO] com.my.storagesystem.evcp.views.hostSystem.HostSystemMainFrameMediator Param[serverGuid] : 8fa4cd3b-622d-4ae1-b6f8-8a17fb23e9ef

8/7/2015 13:41:58.692 [INFO] com.vmware.flexutil.RemoteService Using destination: StorageViewService and channel: /vsphere-client/evcp-ui/messagebroker/amfsecure

8/7/2015 13:41:58.695 [INFO] com.vmware.flexutil.RemoteService Using destination: EvcpService and channel: /vsphere-client/evcp-ui/messagebroker/amfsecure

8/7/2015 13:41:58.699 [INFO] com.vmware.flexutil.RemoteService Using destination: EvcpService and channel: /vsphere-client/evcp-ui/messagebroker/amfsecure

8/7/2015 13:41:58.702 [INFO] com.vmware.flexutil.RemoteService Using destination: PrivilegeService and channel: /vsphere-client/evcp-ui/messagebroker/amfsecure

8/7/2015 13:41:59.231 [INFO] mx.messaging.Producer '6E1D3365-36C7-8322-BA9E-06AD9448F3D5' producer sending message 'DDE85E0D-5AB5-39AF-B032-06AE213FF671'

8/7/2015 13:41:59.297 [INFO] mx.messaging.Channel '/vsphere-client/evcp-ui/messagebroker/amfsecure' channel polling stopped.

8/7/2015 13:41:59.299 [ERROR] mx.messaging.Channel '/vsphere-client/evcp-ui/messagebroker/amfsecure' channel connect failed.

8/7/2015 13:41:59.300 [WARN] mx.messaging.Producer '6E1D3365-36C7-8322-BA9E-06AD9448F3D5' producer channel faulted with Channel.Connect.Failed NetConnection.Call.Failed: HTTP: Status 500: url: 'https://10.167.133.35/vsphere-client/evcp-ui/messagebroker/amfsecure'

8/7/2015 13:41:59.302 [ERROR] mx.messaging.Producer '6E1D3365-36C7-8322-BA9E-06AD9448F3D5' producer fault for 'DDE85E0D-5AB5-39AF-B032-06AE213FF671'.

8/7/2015 13:41:59.304 [ERROR] com.vmware.flexutil.proxies.OperationInvoker Noticed a channelFault with faultCode Channel.Connect.Failed with faultString error

8/7/2015 13:41:59.306 [FATAL] com.vmware.vsphere.client.util.AppErrorHandler Channel fault detected: [ChannelFaultEvent faultCode="Channel.Connect.Failed" faultString="error" faultDetail="NetConnection.Call.Failed: HTTP: Status 500: url: 'https://10.167.133.35/vsphere-client/evcp-ui/messagebroker/amfsecure'" channelId="/vsphere-client/evcp-ui/messagebroker/amfsecure" type="channelFault" bubbles=false cancelable=false eventPhase=2]

Java debugging:

Error occurred before our java code execution.

Reply
0 Kudos
Peter_Ivanov
VMware Employee
VMware Employee
Jump to solution

Please change the CHANNEL_URL in your proxy classes to use "amf" instead of "amfsecure".

private static const CHANNEL_URI:String = "/" + YOUR_MODULE.contextPath + "/messagebroker/amf"

This should fix your problem.

Reply
0 Kudos
shishaozheng
Enthusiast
Enthusiast
Jump to solution

Thank you for your answer, it indeed worked if use "amf" instead of "amfsecure".

But normally, A secure AMF channel is required because vSphere Web Client uses https.

vSphere Web Client uses https,  on the contrary, we use  AMF channel instead of secure AMF channel, that is confused. Could you explain the reason for me simply?


Is there any potential problems if use "amf" instead of "amfsecure"? for example: security problem.

Reply
0 Kudos
Peter_Ivanov
VMware Employee
VMware Employee
Jump to solution

Could you explain the reason for me simply?

When you access the Web Client using the port number, the request goes straight to the virgo web server.

When you access the Web Client without the port, the request goes through a proxy server. Between the browser and the proxy the communication is through HTTPS.

Then the proxy redirects the request to the web server. And this communication is through HTTP (note that you cannot access the virgo server through HTTP directly).


The internal server error that you see is because secure amf channel is accessed through HTTP:

flex.messaging.security.SecurityException: Secure endpoint '/messagebroker/amfsecure' must be contacted via a secure protocol


Is there any potential problems if use "amf" instead of "amfsecure"? for example: security problem.


There shouldn't be any. If you look at the requests being send, they are still though the HTTPS.

shishaozheng
Enthusiast
Enthusiast
Jump to solution

Thank you very much, your answer is really helpful

Reply
0 Kudos